Unstructured mesh with mshr


204
views
0
5 months ago by
noname  
Hello everyone,

I would like to create a  simple unstructured mesh with mshr and I am using
mshr::Rectangle rectangle(dolfin::Point(-1.0,-1.0),dolfin::Point(1.0,1.0));
mshr::CSGCGALMeshGenerator2D generator;       
dolfin::Mesh mesh;         
generator.generate(rectangle, mesh);

which works fine, but I would like to add a parameter to control the mesh size, and do refinement, how can I do that?

Thanks in advance.
Community: FEniCS Project

1 Answer


2
5 months ago by
noname  
Answering my own question:

mshr::Rectangle rectangle(dolfin::Point(-1.0,-1.0),dolfin::Point(1.0,1.0));
dolfin::Mesh mesh;        
mshr::generate(mesh, rectangle,N);
How can I do this in Python?
written 11 weeks ago by 翰乔 余  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »