Documentation for Concepts 2.0 (Boundary Conditions) | Tutorials | Class Documentation | Developer Tools

Boundary Conditions

Currently, only Dirichlet and Neumann boundary conditions are implemented. Other types such as Robin boundary conditions might follow. Typically (depends on the application), only homogeneous Dirichlet boundary conditions can be treated. A boundary is realised in Boundary, there a type and a formula can be given.

Boundary conditions are given by assigning an attribute (class Attribute) to a topological entity (this is done in the constructor of the mesh). The same attribute is then assigned to a specific boundary Boundary in BoundaryConditions:

concepts::BoundaryConditions bc;
bc.add(concepts::Attribute(1),
       concepts::Boundary(concepts::Boundary::DIRICHLET));

In the code itself, one can query the type of a certain boundary using

uint attribute = cntr0->attrib();
if ( (bc_ == NULL) || ((*bc_)(attribute).type() != Boundary::DIRICHLET) )) {
  /* do something for non-Dirichlet boundaries */
}
and if necessary get the formula behind the boundary condition evaluated:
if (bc_) {
  uint attribute = elm.support().edge(i)->attrib();
  real f = (*bc_)(attribute)(y);
}

Documentation for Concepts 2.0 (Boundary Conditions) | Tutorials | Class Documentation | Developer Tools