This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

move part of the boundary mesh

0 votes

Hi,

I am trying to move only one part of the whole boundary mesh as a submesh. I had a go defining a Mesh and a BoundaryMesh and then creating a submesh of the boundary mesh itself:

class Bottom(SubDomain):
    def inside(self, x, on_boundary):
        return x[1] == 0.0        
bottom = Bottom()

mesh = Mesh("./domain.xml")
boundary = BoundaryMesh(mesh, "exterior", True)

sub_domain_fluid = MeshFunction("size_t", mesh, mesh.topology().dim())
sub_domain_fluid.set_all(0)
fluid_mesh = SubMesh(mesh, sub_domain_fluid, 0)

sub_domain_bottom = MeshFunction("size_t", boundary, boundary.topology().dim())
sub_domain_bottom.set_all(0)
bottom.mark(sub_domain_bottom, 1)
bottom_mesh = SubMesh(boundary, sub_domain_bottom, 1)

After specifying the bottom_mesh.coordinates() with a simple sine function and moving the mesh:

for x in bottom_mesh.coordinates():     
        x[0] *= 1.0    
        x[1] += 0.1*.sin(3.0*x[0])

ALE.move(fluid_mesh, bottom_mesh)

The mesh looks very distorted and I wonder why?. All I can think is that defining the bottom submesh from the whole boundary mesh is like an incomplete domain.

The reason I want to do it this way is because later I want to resolve a PDE in the bottom submesh which will dictate how the that part of the boundary should move.

Thanks,
J

asked Jun 30, 2016 by jmn114 FEniCS Novice (140 points)
retagged Jul 2, 2016 by jmn114
...