PRISMS-PF Manual
Loading...
Searching...
No Matches
ConstraintManager< dim, degree, number > Class Template Reference

The class handles the generation and application of boundary conditions based on the user-inputs. More...

#include <constraint_manager.h>

Public Member Functions

 ConstraintManager (const std::vector< FieldAttributes > &field_attributes, const BoundaryParameters< dim > &_boundary_parameters, const SpatialDiscretization< dim > &_spatial_discretization, const DoFManager< dim, degree > &_dof_manager, const PDEOperatorBase< dim, degree, number > &_pde_operator)
 Constructor.
 
std::vector< const dealii::AffineConstraints< number > * > get_constraints (const std::set< unsigned int > &field_indices, unsigned int relative_level=0) const
 Getter function for the constraints.
 
const dealii::AffineConstraints< number > & get_constraint (Types::Index index, unsigned int relative_level=0) const
 Getter function for the constraint of an index (constant reference).
 
const std::vector< std::array< dealii::AffineConstraints< number >, 2 > > & get_generic_constraints () const
 Getter function for the constraints.
 
const dealii::AffineConstraints< number > & get_generic_constraint (unsigned int rank, unsigned int relative_level=0) const
 Getter function for the constraint of an index (constant reference).
 
void reinit (const std::vector< FieldAttributes > &field_attributes)
 Make constraints based on the inputs of the constructor.
 
void update_time_dependent_constraints (const std::vector< FieldAttributes > &field_attributes)
 Update time-dependent constraints. For now this only updates the non-uniform dirichlet constraints.
 

Private Member Functions

void make_constraints_for_single_field (dealii::AffineConstraints< number > &constraint, const dealii::DoFHandler< dim > &dof_handler, const FieldConstraints< dim > &field_constraints, TensorRank tensor_rank, Types::Index field_index)
 Construct constraints for a single field based on the boundary conditions.
 
void make_bc_constraints (dealii::AffineConstraints< number > &constraint, const dealii::DoFHandler< dim > &dof_handler, const FieldConstraints< dim > &boundary_condition, TensorRank tensor_rank, Types::Index field_index)
 Add boundary conditions to a single constraint.
 
void make_one_boundary_constraint (dealii::AffineConstraints< number > &_constraints, unsigned int boundary_id, unsigned int component, Condition boundary_type, const dealii::DoFHandler< dim > &dof_handler, TensorRank tensor_rank, Types::Index field_index) const
 Apply constraints for common boundary conditions.
 
void make_natural_constraints () const
 Apply natural constraints.
 
void make_dirichlet_constraints (dealii::AffineConstraints< number > &_constraints, const dealii::DoFHandler< dim > &dof_handler, const unsigned int &boundary_id, const unsigned int &field_index, const bool &is_vector_field, const dealii::ComponentMask &mask) const
 Make dirichlet constraints.
 
void make_periodic_constraints (dealii::AffineConstraints< number > &_constraints, const dealii::DoFHandler< dim > &dof_handler, const unsigned int &boundary_id, const dealii::ComponentMask &mask) const
 make periodic constraints.
 
void set_pinned_point (dealii::AffineConstraints< number > &constraint, const dealii::Point< dim > &target_point, const std::array< number, dim > &value, const dealii::DoFHandler< dim > &dof_handler, TensorRank tensor_rank) const
 Set the dirichlet constraint for the pinned point.
 

Private Attributes

const BoundaryParameters< dim > * boundary_parameters
 User-inputs constraint parameters.
 
const SpatialDiscretization< dim > * spatial_discretization
 User-inputs discretization.
 
const DoFManager< dim, degree > * dof_manager
 Dof manager pointer.
 
const PDEOperatorBase< dim, degree, number > * pde_operator
 PDE operator.
 
std::vector< std::vector< dealii::AffineConstraints< number > > > constraints
 Constraints. Outer vector is indexed by field index. Inner vector is indexed by relative mg level.
 
std::vector< std::array< dealii::AffineConstraints< number >, 2 > > generic_constraints
 Constraints not specific to any field. We need this for invm.
 

Static Private Attributes

static const std::array< dealii::ComponentMask, dimvector_component_mask
 Create a component mask.
 
static const dealii::ComponentMask scalar_empty_mask {}
 

Detailed Description

template<unsigned int dim, unsigned int degree, typename number>
class ConstraintManager< dim, degree, number >

The class handles the generation and application of boundary conditions based on the user-inputs.

Constructor & Destructor Documentation

◆ ConstraintManager()

template<unsigned int dim, unsigned int degree, typename number >
PRISMS_PF_BEGIN_NAMESPACE ConstraintManager< dim, degree, number >::ConstraintManager ( const std::vector< FieldAttributes > &  field_attributes,
const BoundaryParameters< dim > &  _boundary_parameters,
const SpatialDiscretization< dim > &  _spatial_discretization,
const DoFManager< dim, degree > &  _dof_manager,
const PDEOperatorBase< dim, degree, number > &  _pde_operator 
)

Constructor.

Member Function Documentation

◆ get_constraint()

template<unsigned int dim, unsigned int degree, typename number >
const dealii::AffineConstraints< number > & ConstraintManager< dim, degree, number >::get_constraint ( Types::Index  index,
unsigned int  relative_level = 0 
) const

Getter function for the constraint of an index (constant reference).

◆ get_constraints()

template<unsigned int dim, unsigned int degree, typename number >
std::vector< const dealii::AffineConstraints< number > * > ConstraintManager< dim, degree, number >::get_constraints ( const std::set< unsigned int > &  field_indices,
unsigned int  relative_level = 0 
) const

Getter function for the constraints.

◆ get_generic_constraint()

template<unsigned int dim, unsigned int degree, typename number >
const dealii::AffineConstraints< number > & ConstraintManager< dim, degree, number >::get_generic_constraint ( unsigned int  rank,
unsigned int  relative_level = 0 
) const

Getter function for the constraint of an index (constant reference).

◆ get_generic_constraints()

template<unsigned int dim, unsigned int degree, typename number >
const std::vector< std::array< dealii::AffineConstraints< number >, 2 > > & ConstraintManager< dim, degree, number >::get_generic_constraints ( ) const

Getter function for the constraints.

◆ make_bc_constraints()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::make_bc_constraints ( dealii::AffineConstraints< number > &  constraint,
const dealii::DoFHandler< dim > &  dof_handler,
const FieldConstraints< dim > &  boundary_condition,
TensorRank  tensor_rank,
Types::Index  field_index 
)
private

Add boundary conditions to a single constraint.

◆ make_constraints_for_single_field()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::make_constraints_for_single_field ( dealii::AffineConstraints< number > &  constraint,
const dealii::DoFHandler< dim > &  dof_handler,
const FieldConstraints< dim > &  field_constraints,
TensorRank  tensor_rank,
Types::Index  field_index 
)
private

Construct constraints for a single field based on the boundary conditions.

◆ make_dirichlet_constraints()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::make_dirichlet_constraints ( dealii::AffineConstraints< number > &  _constraints,
const dealii::DoFHandler< dim > &  dof_handler,
const unsigned int boundary_id,
const unsigned int field_index,
const bool is_vector_field,
const dealii::ComponentMask &  mask 
) const
private

Make dirichlet constraints.

◆ make_natural_constraints()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::make_natural_constraints ( ) const
private

Apply natural constraints.

◆ make_one_boundary_constraint()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::make_one_boundary_constraint ( dealii::AffineConstraints< number > &  _constraints,
unsigned int  boundary_id,
unsigned int  component,
Condition  boundary_type,
const dealii::DoFHandler< dim > &  dof_handler,
TensorRank  tensor_rank,
Types::Index  field_index 
) const
private

Apply constraints for common boundary conditions.

◆ make_periodic_constraints()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::make_periodic_constraints ( dealii::AffineConstraints< number > &  _constraints,
const dealii::DoFHandler< dim > &  dof_handler,
const unsigned int boundary_id,
const dealii::ComponentMask &  mask 
) const
private

make periodic constraints.

Deprecated:
We apply periodic conditions to the mesh itself

◆ reinit()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::reinit ( const std::vector< FieldAttributes > &  field_attributes)

Make constraints based on the inputs of the constructor.

◆ set_pinned_point()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::set_pinned_point ( dealii::AffineConstraints< number > &  constraint,
const dealii::Point< dim > &  target_point,
const std::array< number, dim > &  value,
const dealii::DoFHandler< dim > &  dof_handler,
TensorRank  tensor_rank 
) const
private

Set the dirichlet constraint for the pinned point.

◆ update_time_dependent_constraints()

template<unsigned int dim, unsigned int degree, typename number >
void ConstraintManager< dim, degree, number >::update_time_dependent_constraints ( const std::vector< FieldAttributes > &  field_attributes)

Update time-dependent constraints. For now this only updates the non-uniform dirichlet constraints.

Member Data Documentation

◆ boundary_parameters

template<unsigned int dim, unsigned int degree, typename number >
const BoundaryParameters<dim>* ConstraintManager< dim, degree, number >::boundary_parameters
private

User-inputs constraint parameters.

◆ constraints

template<unsigned int dim, unsigned int degree, typename number >
std::vector<std::vector<dealii::AffineConstraints<number> > > ConstraintManager< dim, degree, number >::constraints
private

Constraints. Outer vector is indexed by field index. Inner vector is indexed by relative mg level.

◆ dof_manager

template<unsigned int dim, unsigned int degree, typename number >
const DoFManager<dim, degree>* ConstraintManager< dim, degree, number >::dof_manager
private

Dof manager pointer.

◆ generic_constraints

template<unsigned int dim, unsigned int degree, typename number >
std::vector<std::array<dealii::AffineConstraints<number>, 2> > ConstraintManager< dim, degree, number >::generic_constraints
private

Constraints not specific to any field. We need this for invm.

◆ pde_operator

template<unsigned int dim, unsigned int degree, typename number >
const PDEOperatorBase<dim, degree, number>* ConstraintManager< dim, degree, number >::pde_operator
private

PDE operator.

◆ scalar_empty_mask

template<unsigned int dim, unsigned int degree, typename number >
const dealii::ComponentMask ConstraintManager< dim, degree, number >::scalar_empty_mask {}
staticprivate

◆ spatial_discretization

template<unsigned int dim, unsigned int degree, typename number >
const SpatialDiscretization<dim>* ConstraintManager< dim, degree, number >::spatial_discretization
private

User-inputs discretization.

◆ vector_component_mask

template<unsigned int dim, unsigned int degree, typename number >
const std::array< dealii::ComponentMask, dim > ConstraintManager< dim, degree, number >::vector_component_mask
staticprivate
Initial value:
= []()
{
std::array<dealii::ComponentMask, dim> masks {};
for (unsigned int i = 0; i < dim; ++i)
{
dealii::ComponentMask temp_mask(dim, false);
temp_mask.set(i, true);
masks.at(i) = temp_mask;
}
return masks;
}()
@ Value
Use value of the variable as a criterion for refinement.
Definition grid_refiner_criterion.h:31

Create a component mask.


The documentation for this class was generated from the following files: