is it possible to create a mesh, where an inner subdomain contains a structured mesh (e.g. with meshes.MakeStructured2DMesh() ) which in turn is inside a larger domain with a coarser, unstructured mesh?

So something like this:

but with a structured mesh in domain 2.

Best wishes,

Henry]]>

I'm trying to understand how the imported STEP geometry dimensions are taken into account by Netgen.

To do so I calculate the volume of two geometry objects created one with CSGeometry and the other imported from a STEP file with OCCGeometry.

In principle they are identical. Two prisms with mm size length (where meter=1).

If I run the code:

I'm attaching the STEP file I used in the example (I had to change file extension to txt because the forum doesn't allow me to upload step files. You need to change the extension to test the code).

I verify the STEP file dimensions by looking at it's code. See for example the line:

and line:

As a result:

as it should be.

While:

Like if dimensions where in meter.

Why do I get such a difference? How can Ii take into account the right dimensions of a STEP file?

Thanks for your help,

Tommaso]]>

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?

Thank you,

Anand]]>

[ 53%] Performing build step for 'netgen_project'

make[3]: *** No targets specified and no makefile found. Stop.

make[2]: *** [CMakeFiles/netgen_project.dir/build.make:111: dependencies/Stamp/netgen_project/netgen_project-build] Error 2

make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/netgen_project.dir/all] Error 2

make: *** [Makefile:152: all] Error 2

Does anyone have any idea what may be going wrong?]]>

I am building a spacetime formulation of the heat equation, on a tensor product "prism"-like mesh (simplices in space, intervals in time). For now, I am focussing on 1+1 and 1+2 dimensions.

I found some (mostly undocumented) files regarding tensor product meshes and -FEspaces in the directory "ngsolve/py_tutorials/TensorProduct". However, whenever I try to use these objects, I get very unexpected behaviour.

First example, where the mesh on Y is just 1-dimensional (as opposed to 1+2-dimensional as I was hoping) and the matrix A contains far less nonzero entries than what I had expected:

Secondly, when I create a compound FESpace from these TensorProductFESpace's (or even just *one*), I get segfaults:

Lastly, when I use this compound FESpace "as intended", I get an error indicating "not implemented":

Is there any way I can get around this, maybe by *not* using a TensorProductFESpace, but rather specifying the FESpace (L2 in the time-direction, H1 in the space-direction) on the tensorproduct mesh directly?]]>

I've been working with NGSolve solving time harmonic elastic wave problem, with Robin boundary condition.

I am solving this problem using classical Galerkin and Hybrid Discontinuous Galerkin.

For the Galerkin method, it is working fine and the error in L2 norm is around 10^(-5).

For the HDG method, the solution seems correct (visually similar to the Galerkin method) but the L2 norm is not convergent.

For the HDG method, I choose the following spaces

To compute the L2 norm, I am using the following code

If I try to compute the norm using the following code, I get an error ("NgException: CompoundFESpace does not have an evaluator for VOL!")

How to compute the error in L^2 norm in fes = FESpace([V,F]) space?]]>

I am using adaptive refinement with the multigrid preconditioner and I have found that after each iteration, the program will stop without giving any indication of an error. I save the mesh after each iteration, so I can rerun the program and improve the mesh manually one iteration at a time, but I would like to know how to fix this issue. When running the program, I can see that the bilinear and linear forms are being assembled, but the program crashes when it gets to building the preconditioner. I have not had this problem with any other preconditioners. If could you help me figure this out, I would be appreciative.

Thanks]]>

[grad(u)*grad(v), 0;

0, p*q]

which take a lot of iterations to converge.]]>

Today i had to setup new installation of Netgen/NGSolve on macOS (10.12.6). When I try to open Netgen, it doesn't open or it is logged out directly ( I am not sure).

Attached is a terminal snapshot.

Thank you in advance!]]>

I am having an issue whilst using NGSolve version 6.2.1908 in parallel on a Linux machine. The same code works on a Linux machine running NGSolve version 6.2.1905-45-g73eb677a and works for mac using 6.2.1905.

part of the message received was

Loading a nullptr

Typeids are different: ngfem::CoefficientFunction vs ngfem::ConstantCoefficientFunction

Reading pointer of type std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >

Didn't find pointer, create new registry entry at 0Loading a nullptr

Store a possibly more complicated pointer

Reading pointer of type std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >

Writeout version needed = Loading a nullptr

Reading pointer of type std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >Pickling output for object of type ngfem::CoefficientFunction = (

As far as I can tell the results obtained are still the same but there is a significant decrease in performance.

Kind regards,

Ben

I'm trying to build a 1D mesh with two subdomains, somewhat like ngsolve.org/docu/nightly/i-tutorials/uni...mains-and-boundaries

I was unable to find helper methods for 1D meshes, so I tried something more manual, like

Now, this code segfaults:

I was unable to run it through valgrind (no support yet on newer MacOS systems, ) so I have little idea what is going wrong. In any case, I have two questions:

- how would I make this code work, or at least achieve the same goal?

- In setting the boundary conditions, there is a discrepancy between the indices (see comment) -- what am I doing wrong?

Thank you!!]]>

I am using NGSolve to solve Maxwell’s equations in time-harmonic form.

I am trying to use the adaptive refinement loop (Solve→Estimate→Mark→Refine→Solve→) to refine the mesh.

I used the approach in the example in section 1.6 (Error estimation & adaptive refinement) to do that, with the necessary changes; but this doesn't work. The step "mesh.SetRefinementFlag(el, elerr[el.nr] > 0.25*maxerr)" doesn't work even if I change the percentage of the max error.

Note: The example in section 1.6 works for 2D problem whereas my problem in 3D, so does this approach work for 3D meshes?

I am grateful for any explanation

Here are my python script.]]>