controlling mesh density with netgen

More
5 years 9 months ago #1420 by masi2019
Hi Everybody,

I am using netgen quite extensively for my work.

I am using the similar following script for generation of my model.

algebraic3d
#
# Example with two sub-domains:
# cube dimension
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (10, 10, 10; 0, 0, 1)
and plane (10, 10, 10; 0, 1, 0)
and plane (10, 10, 10; 1, 0, 0);
# sphere arrangement
solid sph = sphere (5.0, 5.0, 5.0; 2.0);


solid rest = cube and not sph;

tlo rest -transparent -col=[1,0,0] -maxh=0.52;
tlo sph -col=[0,0,1] -maxh=0.52;


#tlo cube -transparent -col=[1,0,0];
#tlo sph -col=[1,1,1];

Here, I can control mesh density globally by setting maxh value..
Now my question is that how can we control the mesh density at different region say at interface?
Any help would be appreciated. Thank you
More
5 years 9 months ago #1421 by hvwahl
Hi,

if you look at the documentation Netgen Tutorial: Mesh size , csg primitives can be given a local mesh size, e.g.,
Code:
# Set the mesh size on the sphere surface to 0.1 sphere = Sphere(Pnt(0,0,0),1).maxh(0.1)

Best wishes,
Henry
The following user(s) said Thank You: masi2019
More
5 years 9 months ago #1425 by joachim
The following user(s) said Thank You: masi2019
More
5 years 9 months ago #1435 by masi2019
problem is I am only using netgen for generating mesh, not ngsolve. Can you suggest me some *-msz file example which I can use for sphereincube.geo file example (which I put for the main question), please?

Thanks
More
5 years 9 months ago #1436 by masi2019
thank you but any idea of how I can do the same without ngsolve but simply netgen. What the syntax there for controlling local mesh density
More
5 years 9 months ago #1437 by joachim
its not a question of Netgen or NGSolve, but how to do it in pre-Python times:

have a look into Section 4.1:
netgen-mesher.sourceforge.net/docs/ng4.pdf

Joachim
Time to create page: 0.117 seconds