I’d like to define a function with the MeshFem.eval method, but I’m not sure about the syntax I am expected to use in the ‘expression’ argument.
The GWLF language does not work, while, in some examples, it is shown how mathematical functions from numpy can be used. However, I don’t understand how spatial coordinates are named in this context. Up to 3 dimensions x, y, and z are often used, but I am interested in higher-dimensional problems, and I cannot find out how, for example, the fourth dimension is named in this context.
I would advice you against using the eval method. GWFL is the modern way. In GWFL the spatial coordinates are X(1), X(2), X(3), … You can define macros to rename those to x,y,z,… but I normally prefer to keep the standard GWFL notation.
GWFL has all common mathematical operators, if you need if conditions you can implement those using either the min/max() or the Heaviside function.
I’d be glad to help if you have some specific issue with GWFL in higher dimensions.
What I don’t understand is how I am supposed to set the initial conditions of a time evolution problem without using eval. In the examples I found, this is done via the set_variable method of the model class, but I don’t know how to evaluate the GWFL expression on the mesh and produce the array of initial data. I would need an equivalent of eval that accepts GWFL expressions, but I cannot find it in the documentation
where md is a model object, if you do not use a model object, you can create one on the fly just for this operation.
The model interpolation function is very general, it can evaluate on the nodes of a mesh_fem, or on the integration points of a mesh_im_data, or even on an arbitrary cloud of points.
Thank you for your help. I’m slowly getting into the logic.
I’ve written my code, but now the default solver called by evaluate does not converge.
As far as I understood, using MUMPS in these cases could help in 3D, would it also be useful in higher dimensions?
Unfortunately, I didn’t manage to complete the installation with MUMPS via mingw64 on Windows because of some incompatibility with the .configure file, but maybe it would be better to discuss that in another thread.