← Back to team overview

dolfin team mailing list archive

[Question #157661]: submesh for curved subdomain

 

New question #157661 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/157661

Hi @all

I'm a brand new user getting acquainted with FEniCS and at some point I would like to set up a FSI simulation of a deformable, ellipse-shaped particle in rectangular fluid domain. For this I would like to have a mesh with nodes on the bounding line of the ellipse. I was first trying to avoid using an external preprocessor for the mesh generation.

In a demo file from cbc.solve I saw that a rectangular submesh representing a structure was extracted from the main (rectangular) mesh. Is something like this possible with a curved subdomain? I saw that a Mesh method called "snap_boundary()" exists. What is that good for, could that be used for this purpose? Or is an external mesh the only solution here? My first test efforts look as follows:

from dolfin import *

# Circle sub domain
class Circle(SubDomain):
    def inside(self, x, on_boundary):
        return abs((x[0] - 0.5)*(x[0] - 0.5) + (x[1] - 0.5)*(x[1] - 0.5) - 0.09) \
            < DOLFIN_EPS

# Create mesh
mesh = UnitSquare(10, 10)
circle = Circle()
mesh.snap_boundary(circle)

The error is:
TypeError: in method 'SubDomain_snap', argument 2 of type 'dolfin::Array< double > &'


-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.