Hi, I have done the mex-coupling with dealii before. As Bruno said, it is easiest to mex with cmake. Example in attached zip. Hope it helps.
Best, Simon Sticko On 15/08/2022 15:05, Bruno Turcksin wrote:
Simon Le lun. 15 août 2022 à 08:52, Simon Wiesheier <[email protected] <mailto:[email protected]>> a écrit : I also thought about transferring the data by reading from/writing to a file. But I was looking for a more general approach without having to create files. Writing files is no less general than coupling directly Matlab and deal.II The main advantage of coupling the two codes directly is that it is faster but it should only matter if you have to transfer a very large amount of data or if you do it very often. I was also pondering if it is possible to compile the mex file like a normal dealii program (by adding a few Matlab macros to the files generated by cmake). But I can not say how much is involved to do this due to my modest knowledge about cmake. If it were possible and someone wanted to guide me through that process, I would be willed to try that out; otherwise I go with the easier approach and work with files. The way you probably want to do that is to start from a CMakeLists.txt similar to the one that you are using to compile your deal.II code and use https://cmake.org/cmake/help/latest/module/FindMatlab.html <https://cmake.org/cmake/help/latest/module/FindMatlab.html> to compile the mex file. I have never done it so I don't know if it "just works" or if it is more involved. Best, Bruno -- The deal.II project is located at http://www.dealii.org/ <http://www.dealii.org/> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en <https://groups.google.com/d/forum/dealii?hl=en> --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAGVt9eMM_kwCXbSHZONL2p8icdeiwDF%3DQrvQ-qbyQFYxqEPL4g%40mail.gmail.com <https://groups.google.com/d/msgid/dealii/CAGVt9eMM_kwCXbSHZONL2p8icdeiwDF%3DQrvQ-qbyQFYxqEPL4g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
-- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/ad0f6fad-39f8-db0d-d5f2-bd849504dcbb%40gmail.com.
<<attachment: mex_example.zip>>
