Skip to content

Commit

Permalink
Replace the mesh in the cashocs as solver (for shape optimization) wi…
Browse files Browse the repository at this point in the history
…th a custom mesh.
  • Loading branch information
sblauth committed Apr 21, 2022
1 parent 145e1be commit 3e5a43d
Show file tree
Hide file tree
Showing 10 changed files with 2,885 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@

config = cashocs.load_config("./config.ini")

meshlevel = 15
degree = 1
dim = 2
mesh = UnitDiscMesh.create(MPI.comm_world, meshlevel, degree, dim)
dx = Measure("dx", mesh)
boundary = CompiledSubDomain("on_boundary")
boundaries = MeshFunction("size_t", mesh, dim=1)
boundary.mark(boundaries, 1)
ds = Measure("ds", mesh, subdomain_data=boundaries)
mesh, subdomains, boundaries, dx, ds, dS = cashocs.import_mesh("./mesh/mesh.xdmf")

V = FunctionSpace(mesh, "CG", 1)
u = Function(V)
Expand Down
10 changes: 10 additions & 0 deletions demos/documented/cashocs_as_solver/shape_solver/mesh/mesh.geo
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
lc = 7.5e-2;

SetFactory("OpenCASCADE");
Disk(1) = {0, 0, 0, 1, 1};

Mesh.MeshSizeMax = lc;
Mesh.MeshSizeMin = 0.0;

Physical Curve(1) = {1};
Physical Surface(1) = {1};
Binary file not shown.
Loading

0 comments on commit 3e5a43d

Please sign in to comment.