- Thank you received: 0
Refinement of subdomain
4 years 10 months ago #2313
by rfirmeza
Refinement of subdomain was created 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
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:
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
4 years 10 months ago #2314
by christopher
Replied by christopher on topic Refinement of subdomain
You could restrict the meshsize at a set of points:
Best
Christopher
Code:
mparam = meshsize.moderate
for x,y,z in restrict_points:
mparam.RestrictH(x,y,z,maxh)
geo.GenerateMesh(mparam)
Christopher
The following user(s) said Thank You: rfirmeza
4 years 9 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
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
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
4 years 9 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:
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
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
4 years 9 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
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
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
4 years 9 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
Best
Christopher
Time to create page: 0.112 seconds