geodynamics / pylith

PyLith is a finite element code for the solution of dynamic and quasi-static tectonic deformation problems.
Other
152 stars 96 forks source link

Dirichlet BC only works on a boundary with a submesh #220

Open baagaard-usgs opened 3 years ago

baagaard-usgs commented 3 years ago

The Dirichlet BC (DirichletTimeDependent) assumes that it is being applied to a boundary and creates a submesh. In v2 we have different implementations for with and without a submesh.

There are a few cases in which it is useful to be able to apply a Dirichlet BC to a point or the whole domain (1D shear bar).

  1. We need to add a check to the Dirichlet BC to make sure it is only applied to boundaries.
  2. @knepley How would we set up a Dirichlet BC for a single point or some portion of the domain that is not a boundary?
knepley commented 3 years ago

At the lowest level, you specify a constraint on the Section, by saying how many dofs are affected and what the local dofs numbers are.

I usually go up one layer and use DMAddBoundary(). This just takes a DMLabel, field, and components. If it is essential, it also takes a function used to generate boundary values.

baagaard-usgs commented 3 years ago

Yes, but we use an auxiliary field instead of a function. I think where things are breaking down now is the creation and discretization of the auxiliary field when it is not for a boundary. For such cases, do we just create a field over the domain for the auxiliary field instead?

knepley commented 3 years ago

You are allowed to give an FE field instead of a function, using DM_BOUNDARY_ESSENTIAL_FIELD.

baagaard-usgs commented 3 years ago

Right, but isn't the real problem what PETSc DM is associated with the auxiliary field (submesh or domain mesh)? If we don't have a boundary, we want the domain DM not a submesh DM, right?