Corbin, deal.II has some limited support for python mainly for mesh manipulation. We have some python notebooks here <https://github.com/dealii/dealii/blob/master/contrib/python-bindings/notebooks/index.ipynb>. I think what you want to do is similar to the step-62 notebook. Right now, the only way to interact with numpy is to print the data to a file and then load it (see here <https://dealii.org/current/doxygen/deal.II/classLinearAlgebra_1_1Vector.html#a2fadcc595d3e7e9ba44de8c85fd7595c> and here <https://dealii.org/current/doxygen/deal.II/classSparseMatrix.html#a3141075e3ad6362fce005d2f1c8da699>). If you want to manipulate the mesh directly in python, you need boost.python and you need to configure deal.II with -DDEAL_II_COMPONENT_PYTHON_BINDING=ON. It's sometimes a little bit tricky to enable the python binding so don't hesitate to ask any question on the mailing list if you need help.
Best, Bruno On Tuesday, November 24, 2020 at 12:16:18 AM UTC-5 [email protected] wrote: > Hi everyone, > > I am new to deal.ii but after reading through the documentation and the > tutorials I'm very excited about all the functionality that the software > offers! I'm aiming to link a finite element solver with a machine learning > code that I have in python. To that end: > > - what is the best practice for exporting deal.ii solution data in a > way that Python / numpy can interact with it? > - Is there a good way for external software to 'hook' into the deal.ii > pipeline? Something like: > - initialize a triangulation / grid > - run the solver > - make a call like: new_data = external_software(deal_ii_output, > grid) > - reinitialize the grid based on new_data > - loop > > Apologies if this is explained elsewhere! > > Corbin > > > -- 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/2f6de409-374c-43bd-8afa-f86beb3ab205n%40googlegroups.com.
