Call graph for preprocessed C code (*.i file) - doxygen

I have a preprocessed C code with gcc, as output i have .i files.
can i use preprocessed code (.i files) to generate call graph with doxygen?
if it is possible thanks for telling me how.

Related

Visual Studio Build Solution

I had Simulink model and have generated C code from MATLAB. Basically Simulink Model has many function and one S-Function with file Extension .mexw32 (hex code). The process of C-code generation is working without any error. Now that I have C-code and header files of my application, I wanted to build the solution file(.bat file) from these files with Visual Studio.
When I tried to build the files then I am getting error as shown in picture 1.
What I conclude is, there is a problem with the .mexw32 file to build. I dont have source code (c code) for these S-function .mexw32 file. I think that could be the problem while building the solution.
Do I need source code to build the solution or that doesnt matter if I have it or not? Because only the .mexw32 file is causing the problem during buiding the solution.
Yes, you'll need the source code (or an equivalent .tlc file). A .mexw32 file will only run inside MATLAB.

How to read Ansys data files in ParaView?

Anybody knows how to export an Ansys structural data file to ParaView?
It is read that ParaView has an Ansys reader, but it does not work. Errors always come up when loading the *.inp file.
Is there any script to convert .inp files to .vtk?
Thanks
Based on the video from Czech-based SVS FEM s.r.o., I wrote an input file for Ansys Mechanical APDL, that creates a VTK file, which can be opened in ParaView.
In the input file vtk.inp, the user has to specify the argument arg1, for which the nodal values are to be written to the vtk file via the command *get,my_results(j),NODE,n_j,..., p.e.
arg1='S,EQV' ! for equivalent stress or
arg1='TEMP' ! for temperature
For further nodal results, refer to the specifications of the *GET command in the Ansys Commands Reference.
The vtk.inp file should be placed in the current working directory. It is called with the APDL command /input,vtk,inp. In Ansys Mechanical, this command can directly be inserted in the command line. In Ansys Workbench, the command can be pasted in the feature Commands (APDL) under Solution.
The output file output.vtk is written in the same location as the input file.
The code was tested with a structural analysis in Ansys Mechanical APDL 17.2 and Ansys Workbench 17.2. The vtk file was tested with ParaView 5.4.1.
Explanation:
The array e_types_Ansys_to_VTK maps the Ansys element types (p. e. SOLID186) to VTK cell types (see also Ansys Element Types).
Limitations:
The input file is yet limited to write only one scalar parameter result in the vtk file, but it can easily be extended for vector or tensor results as well as for multiple results in one vtk file, following the VTK File Format Specification.
Since Ansys stores nodal results only in the corner nodes, only linear VTK elements are used. There could still be some minor mistakes in the e_types_Ansys_to_VTK map, since I could only test some element types. Please feel free to report any corrections or extensions to the code in the comments.
Here is the link to the source code. Use at your own risk.
In case you would like to export a vtk file directly from Ansys Workbench, a Python result converter was introduced in a Youtube video here. Unfortunately, the source code only appears in the video and is explained in Czech language.
Thus, I typewrote the code from screenshots and made some minor improvements.
You will need two files to install the macro as an Ansys ACT extension:
main.py and vtk.xml.
Place the file vtk.xml in the folder C:\Program Files\ANSYS Inc\v###\Addins\ACT\extensions, where ### is your Ansys version, p.e. 172
Create a new folder vtk in C:\Program Files\ANSYS Inc\v###\Addins\ACT\extensions.
Place the file main.py in the created folder.
Start Ansys Workbench.
Register the path C:\Program Files\ANSYS Inc\v###\Addins\ACT\extensions as additional extension path under Tools > Options > Extensions.
Restart Ansys Workbench, go to Extensions > ACT start page > Extension manager > VTK and load the extension.
In a structural analysis, go to Results, right-click and insert My results. Three inputs have to made by the user:
Under *get,my_results(j),NODE,N,..., , give the desired nodal result according to the Ansys Commands Reference, p.e. S,EQV for equivalent stress.
Under VTF file name, give the full path to the vtk output file to be created, p.e. C:\temp\output.vtk
Under Load step, give the load step number (p.e. 1 for last load step unless not stated otherwise).
For larger models, I experienced that the automatically generated file makeresult.mac is not instantly transferred from the project_pending folder to the actual working directory, thus, causing the macro to throw an error. Maybe, anyone can make a suggestion on how to fix this?
ParaView cannot read .inp structure files (I guess this is the Abaqus file format). You could try to export your files as Nastran (.nas) files, since ParaView has a Nastran reader.

Matlab Ode23 C++ file

I want to know can i use this code for my projects?
ftp://ftp.nodc.noaa.gov/nodc/archive/arc0032/0071189/1.1/data/0-data/AT003L11/RR_MOVED/FUNFUN/ODE23.C
it uses a include mex.h file in the beginning. what is that? what is that mex header doing there? can i just ignore that line and use the rest of the code in somewhere else?
I want to use the file in android NDK.
This file is meant to be compiled for Matlab to process. If you have Matlab installed you can compile it from the console. If not you will not be able to compile this by simply removing the include statement. Your best bet is to read through the code, understand what it is doing, and use it as an example for your own code.

How to create mex file in matlab having just object file, without source?

I have a precompiled static library propa64.a, which i want to use in Matlab in Linux.
No source code of it available, only header file (propa.h). As far as i understand, to use it in Matlab i need to create mex file. How can i do it, without source and with only compiled propa64.a?
mex propa64.a
doesn't work, matlab says "mex: no filename given" error.
Any suggestions?
Or , may be it's possible to use pre-compiled static library in Matlab somehow else?

How do I call a c function from inside a mex file in Matlab?

I have a mexFunction defined in a .c file, written in the regular mex wrapper format. I would like to be able to call another function, written in C, from inside that first function. How can I do this? Do I need to create a regular .c file and just include it at the beginning of the first file? I would like to be able to pass variables from within the mex function to this secondary C function.
The documentation for mex has two subsections that describe how to build a MATLAB extension when the source code is spread over multiple source files. Mostly, all you need to do is:
mex mexname.c helper1.c helper2.o
The result is automatically named according to the first file passed in.
For more information, read the documentation sections "Build MEX-File from Multiple Source Files" and "Create and Link to Separate Object Files". There are also sections discussing using libraries.