end
My issue is *how to pass the vector 'p' to the dealii program*.
There are MEX files which provide an interface between Matlab and C++ programs. A standard MEX file looks like this:
//file mymex.cpp
#include "mex.h"
//include some more header files from c++ or dealii
//write here the whole class definition and implemenation
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
//this is the interface function to Matlab where also 'p' is passed
//in here, I will also create the instance of my dealii program to run the typical member //functions ike make_grid(), system_setup(),...
}
The above mex file is compiled within the Matlab gui using a c++ compiler (mex mymex.cpp).
If I do not include any dealii headers in
mymex.cpp
, the compilation works.
However, including dealii headers results in a bunch of error messages when I compile the program in Matlab (mex mymex.cpp), because environment variables are not known to Matlab,...
Usually, I just call 'spack load dealii' followed by 'make run' to run my dealii programs, but I do not know how to 'forward' all this information to the Matlab compilation process.
All that said, has someone already worked with Mex files together with dealii?
I also appreciate other approaches to manage the data transfer between Matlab and dealii.
Best
Simon