If I have a BVP defined on a 2D or 3D domain (ex.: a cube) is it possible in NGSolve to compute integrals on a given slice that cuts through the domain?
For example: in the attached toy problem, I have a function u(x,y) defined on a unit cube. How do I compute the integral of u(x,y) on a plane with z-normal, say at z=0.5?
Thanks for directing me to the relevant topic. I am currently unable to get ngsxfem working with my NGSolve installation on Ubuntu. But the other method seems to work. I have a couple of follow-up questions in this regard.
1. The boolean operation within the AddSurface functionality seems to work only on solid primitives. It throws an error if I use it on solids constructed from primitives (example: cube constructed from plane primitives; please see attached file). Is this expected?
2. Is there similar functionality for a mesh which is not associated with a geometry, for example, if I just have a mesh from another source such as Gmsh?
it works also for solids constructed from primitives. But you have to use it before adding it to the CSGeometry, see attached file.
To handle meshes without geometry I really would recommend xfem.
It is somehow possible to use your own integration rule, where you specify the according integration points, but the first option is easier, more robust and more flexible.
What error occurs when you try to get ngsxfem running?
I tried to install ngsxfem but it doesn’t seem to work. My laptop runs Ubuntu 18.04.3 LTS. The Netgen/NGSolve executables are in /usr/bin/. I go through the following steps (as described on this webpage).
From my home directory:
> git clone https://github.com/ngsxfem/ngsxfem.git
> cd ngsxfem
> mkdir build
> cd build
> cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/bin/ -DBUILD_NGSOLVE=OFF -DCMAKE_CXX_COMPILER=ngscxx -DCMAKE_LINKER=ngsld
> make
> make install
Other than some warnings on deprecated declarations, the install goes fine. But when I try to run an examples as follows:
> cd $HOME/ngsxfem/py_tutorials/
> netgen cutfem.py
I get this error: No module named ‘xfem’
So ngsxfem does not seem to be installed. Please let me know where things could be going wrong.