Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Refinement of subdomain

More
4 years 3 months ago #2313 by rfirmeza
Hi,

I am new to the forum and usually run FEM simulation on pavement layered systems. I set up my mesh using CSG.

My question is this: Assume I apply a square load in the center on top of a layered system. How do I control mesh refinement through depth without having to create additional materials under my area of interest and using small (-maxh)? Normally I carry additional "orhtobricks" under the layer so they can be more refined, however I'd like to simply have another option without the need for these additional "orthobricks".

Any suggestions? Thanks

Attachments:
More
4 years 3 months ago #2314 by christopher
Replied by christopher on topic Refinement of subdomain
You could restrict the meshsize at a set of points:
Code:
mparam = meshsize.moderate for x,y,z in restrict_points: mparam.RestrictH(x,y,z,maxh) geo.GenerateMesh(mparam)
Best
Christopher
The following user(s) said Thank You: rfirmeza
More
4 years 2 months ago #2357 by rfirmeza
Replied by rfirmeza on topic Refinement of subdomain
Thanks Christopher. Maybe I haven't followed Netgen's evolution too close. But I have one comment regarding the Python version. Is all the previous syntax using direct CSG commands such as these:

solid sec_0 = plane(0, 5, 0; 0, 1, 0) and plane(0, 0, 0; 0, -1, 0) and plane(0, 0, 0; -1, 0, 0) and plane(1.5, 0, 0; 1, 0, 0) and plane(0, 0, 0; 0, 0, -1) and plane(0, 0, 50; 0, 0, 1)

solid lane_0_cut_0 = plane (0, 4.9, 0; 0, -1, 0);

tlo lane3layer1;

Have they been discontinued from development and now Python is the current version? I have been considering attending the user meeting but not sure what the focus would be and if it would be relevant to my application. Any thoughts?

Thanks again.

Roberto
More
4 years 2 months ago #2364 by christopher
Replied by christopher on topic Refinement of subdomain
Sry I didn't see the line "I set up my geometry using CSG".
You can do the same thing using a meshsize file as described in this documentation:
github.com/NGSolve/netgen/blob/master/doc/ng4.pdf
See 4.1 mesh size file.

I think all of the functionality of the CSG interface is now exported to Python as well. The syntax changed slightly, but internally the same C++ code is executed. It got more powerful, because you can use the full potential of Python.
The old geo files will be supported in the foreseeable future as well, but wont be further developed any more.
Basically your code in python would look like:
Code:
from netgen.csg import * geo = CSGeometry() sec_0 = Plane(Pnt(0, 5, 0), Vec(0, 1, 0)) * Plane(Pnt(0, 0, 0), Vec(0, -1, 0)) * Plane(Pnt(0, 0, 0), Vec(-1, 0, 0)) * Plane(Pnt(1.5, 0, 0), Vec(1, 0, 0)) * Plane(Pnt(0, 0, 0), Vec(0, 0, -1)) * Plane(Pnt(0, 0, 50), Vec(0, 0, 1)) geo.Add(sec_0)

The user meeting will mainly focus on NGSolve not Netgen. So if you are only interested in Netgen I would not recommend it. If you want to learn how to do FEM in NGSolve we will be happy to meet you in Portland ;)
If you have need for (professional) Netgen support you can contact me at clackner@cerbsim.com. We started a university spin off this summer to support companies in using Netgen/NGSolve.

Best
Christopher
More
4 years 2 months ago #2377 by rfirmeza
Replied by rfirmeza on topic Refinement of subdomain
That's great to hear. Thanks again for the reply.

Is the Python version faster than the previous one? I end up with lots of domains and it takes a while to generate mesh for all of them.

I will consider getting some support from you.

Thanks
More
4 years 2 months ago #2380 by christopher
Replied by christopher on topic Refinement of subdomain
Since all computationally expensive parts are done in C++ the speed from python and geo files should be the same if you use the same version. We have made some improvements in the meshing and have parallelized the mesh optimization recently, so a recent version of Netgen should be faster than old ones.

Best
Christopher
Time to create page: 0.159 seconds