Which b.c.s to reproduce 1-D solution with 2-D code

Asked by Joe Morris

I have a question about boundary conditions. My specific application is a little more complicated, but the problem arises rather simply in 2-D elasticity. Let’s say I have a domain x[0]:0-1, x[1]:0-1 with boundary conditions:

u=0 on x[1]=0

periodic on x[0]=0 (mapping y[0]=x[0]-1.0)

applied stress of -1 MPa on x[1]=1.0

What I am hoping for is a 1-D solution with sigma[1][1]=-1.0 MPa everywhere. Although I get that on the interior and near x[1]=0, I get stress concentrations at the corners where the periodic and applied stress b.c.s meet. I keep thinking it must be an issue with my choice of subdomains. At the moment I have the following subdomains defined for each of the b.c.s:

Periodic b.c.:

bool inside(const Array<double>& x, bool on_boundary) const

    {

      return (x[0] < DOLFIN_EPS)

          && (x[0] > -DOLFIN_EPS)

          && on_boundary;

    }

Fixed displacement b.c.:

bool inside(const Array<double>& x, bool on_boundary) const {

      return on_boundary && (x[1]<(0.0+DOLFIN_EPS));

  }

Applied stress b.c.:

if (x[1]>(1.0-DOLFIN_EPS)) {

        // Apply 1 MPa to the top

        values[1]=-1.0e6;

}

I’ve tried a number of permutations where the periodic b.c. is not applied at the corner, or the stress b.c. is not applied at the corner, but there is always some sort of perturbation in the stress field near those corners where the periodic and stress b.c.s meet.

I’m happy to share the code in its gory detail if that helps,

Best regards,

Joe.

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Garth Wells
Solved:
Last query:
Last reply:
Revision history for this message
Best Garth Wells (garth-wells) said :
#1

There is a subtly here related to the Neumann boundary condition. DOLFIN interpolates the BCs in finite element spaces, which can lead to some 'creep' around corners if the domain is not properly specified. What you need to do is mark the boundary on which you're applying the force bc, e.g

In the UFL file, do something like:

  L = f*vdx + h*v*ds(3)

This means the h*v should only be integrated over the boundary subdomain '3'.

In the C++ code:

  // Right boundary
  class RightBoundary : public SubDomain
  {
    bool inside(const Array<double>& x, bool on_boundary) const
    {
      if (1.0 - x[0] < DOLFIN_EPS && on_boundary)
        return true;
      else
        return false;
    }
  };

  // Create subdomain
  RightBoundary right_boundary;

  // Create mesh function over facets (FacetFunction is new in 0.9.9, otherwise use
  // MeshFunction<unsigned int> right_boundary_function(mesh, 1) for a 2D problem);
  FacetFunction<unsigned int> right_boundary_function(mesh);

  // Mark the boundary with '3'
  right_boundary.mark(right_boundary_function, 3);

If you're using the VariationalProblem class, then do

  // Create variational problem
  VariationalProblem pde(a_form, L, bc, 0, &right_boundary_function, 0);

This will pass the subdomains to the assembler. If you're calling the assembler directly, take a look in

  dolfin/fem/Assembler.h

for how to pass subdomains.

The elastodynamics demo also shows how to use boundary subdomains when applying force bcs (both in C++ and Python).

Revision history for this message
Garth Wells (garth-wells) said :
#2

I should add that the application of periodic bcs in DOLFIN needs some improvement. Test first without periodic BCs.

Revision history for this message
Joe Morris (x-launchpad-the-morris-net) said :
#3

Thanks Garth: My test problem now appears to work (even with periodic b.c.s...)

Revision history for this message
Joe Morris (x-launchpad-the-morris-net) said :
#4

Thanks Garth Wells, that solved my question.