MoReFEM
|
Class in charge of Dirichlet boundary conditions. More...
#include <DirichletBoundaryCondition.hpp>
Public Types | |
using | shared_ptr = std::shared_ptr<DirichletBoundaryCondition> |
Shared smart pointer. | |
using | vector_shared_ptr = std::vector<shared_ptr> |
Vector of smart pointers. | |
using | underlying_type |
Type used for the unique id. | |
Public Member Functions | |
const Unknown & | GetUnknown () const noexcept |
Unknown considered in the boundary condition. | |
const Domain & | GetDomain () const noexcept |
Domain upon which the condition is applied. | |
const Dof::vector_shared_ptr & | GetDofList () const noexcept |
Access to the list of Dofs encompassed by the Dirichlet boundary condition. | |
bool | IsNumberingSubset (const NumberingSubset &numbering_subset) const |
Whether a given numbering subset is relevant for the boundary condition. | |
void | UpdateValues (const GlobalVector &new_values) |
Replace the values to apply on dofs by the ones given in new_values. | |
void | UpdateValues (const NumberingSubset &numbering_subset, std::vector< PetscScalar > &&new_values) |
Replace the values to apply on dofs by the ones given in new_values for numbering subset. | |
BoundaryConditionNS::unique_id | GetUniqueId () const |
Get the value of the internal unique ID. | |
Static Public Member Functions | |
static const std::string & | ClassName () |
Class name. | |
static BoundaryConditionNS::unique_id | GenerateNewEligibleId () |
Generate a unique id. | |
static void | ClearUniqueIdList () |
Clear all unique ids. | |
Data Fields | |
friend | GodOfDof |
Friendship to GodOfDof, which is the only allowed to call some of the private methods. | |
Private Types | |
using | unique_id_parent |
Alias to parent. | |
Private Member Functions | |
void | Reduce (const NodeBearer::vector_shared_ptr &processor_wise_node_bearer_list, const NodeBearer::vector_shared_ptr &ghost_node_bearer_list) |
Reduce: keep only NodeBearer that are either processor-wise or ghost. | |
const NodeBearer::vector_shared_ptr & | SetNodeBearerList (NodeBearer::vector_shared_ptr &&node_bearer_list) |
Set the list of NodeBearer. | |
const NodeBearer::vector_shared_ptr & | GetNodeBearerList () const noexcept |
Get the list of NodeBearer. | |
NodeBearer::vector_shared_ptr & | GetNonCstNodeBearerList () noexcept |
Get the list of NodeBearer. | |
Dof::vector_shared_ptr & | GetNonCstDofList () noexcept |
Non constant access to the list of Dofs encompassed by the Dirichlet boundary condition. | |
const std::vector< std::pair< NumberingSubsetNS::unique_id, Internal::BoundaryConditionNS::DofStorage > > & | GetDofStorage () const noexcept |
Constant accessor to Storage of dof for all numbering subsets . | |
std::vector< std::pair< NumberingSubsetNS::unique_id, Internal::BoundaryConditionNS::DofStorage > > & | GetNonCstDofStorage () noexcept |
Non constant accessor to Storage of dof for all numbering subsets . | |
const Internal::BoundaryConditionNS::DofStorage & | GetDofStorage (const NumberingSubset &numbering_subset) const noexcept |
Internal::BoundaryConditionNS::DofStorage & | GetNonCstDofStorage (const NumberingSubset &numbering_subset) noexcept |
const std::vector< std::pair< Dof::shared_ptr, double > > & | GetInitialDofValueList () const noexcept |
Accessor to the dof and their associated values. | |
std::vector< std::pair< Dof::shared_ptr, double > > & | GetNonCstInitialDofValueList () noexcept |
Non constant accessor to the dof and their associated values. | |
void | ClearInitialDofValueList () |
Clear the initial values storage. | |
Methods to be called by friend GodOfDof. | |
void | ShrinkToProcessorWise (const GodOfDof &god_of_dof) |
Keep only the dofs that are related to current processor (i.e. either processor-wise or ghost). | |
void | SetDofListForNumberingSubset (const NumberingSubset &numbering_subset, Dof::vector_shared_ptr &&dof_list) |
Fill properly the storage for a given numbering_subset. | |
void | ConsiderNumberingSubset (const NumberingSubset &numbering_subset) |
Tell a numbering subset is relevant for the boundary condition, even if not present processor-wisely. | |
void | ComputeDofList () |
Compute the list of dofs and their associated values. | |
const Internal::BoundaryConditionNS::ComponentManager & | GetComponentManager () const noexcept |
Access to component manager. | |
double | GetValueForComponent (Advanced::ComponentNS::index_type component) const |
Return the value of the requested boundary condition. | |
Static Private Member Functions | |
static BoundaryConditionNS::unique_id | AssignUniqueId () |
If AssignationMode is automatic, generates a new unique identifier. | |
static BoundaryConditionNS::unique_id | NewUniqueId (BoundaryConditionNS::unique_id new_unique_id) |
If AssignationMode is manual, checks the unique identifier provided is valid. | |
static std::set< BoundaryConditionNS::unique_id > & | StaticUniqueIdList () |
List of all identifiers existing for DerivedT. | |
Private Attributes | |
const Domain & | domain_ |
Domain upon which the condition is applied. | |
const Unknown & | unknown_ |
variable concerned by this DirichletBoundaryCondition | |
Internal::BoundaryConditionNS::ComponentManager::const_shared_ptr | component_manager_ = nullptr |
Object which can tell which components are encompassed by the boundary condition. | |
std::vector< std::pair< Dof::shared_ptr, double > > | initial_dof_value_list_ |
Initial values associated to each dof. | |
NodeBearer::vector_shared_ptr | node_bearer_list_ |
List of all NodeBearer encompassed by the boundary condition. | |
Dof::vector_shared_ptr | dof_list_ |
List of all dofs encompassed by the boundary condition. | |
std::vector< double > | penalization_array_ |
Helpful vector when penalization is to be used, which stores the penalization value for each dof. | |
std::vector< std::pair< NumberingSubsetNS::unique_id, Internal::BoundaryConditionNS::DofStorage > > | dof_storage_per_numbering_subset_ |
For each numbering subset, store the relevant information about the dofs involved in the boundary condition. | |
std::vector< double > | value_per_component_ |
Initial value per component (should not be stored past #619). | |
bool | is_dof_list_computed_ = false |
Whether the dof list has been properly computed or not (through a call to ComputeDofList(). | |
bool | is_cleared_ = false |
Whether ClearInitialDofValueList() has already been called or not. | |
bool | is_mutable_ = false |
Whether the values may vary over time. | |
const BoundaryConditionNS::unique_id | unique_id_ |
The value of the unique id for the current DerivedT object. | |
Friends | |
void | ClearAllBoundaryConditionInitialValueList () |
Friendship to the manager, that will erase some temporary data. | |
Special members. | |
DirichletBoundaryCondition (BoundaryConditionNS::unique_id unique_id, const Domain &domain, const Unknown &unknown, const std::vector< double > &value_per_component, const std::string &component, bool is_mutable) | |
Constructor. | |
~DirichletBoundaryCondition ()=default | |
Destructor. | |
DirichletBoundaryCondition (const DirichletBoundaryCondition &rhs)=delete | |
The copy constructor. | |
DirichletBoundaryCondition (DirichletBoundaryCondition &&rhs)=delete | |
The move constructor. | |
DirichletBoundaryCondition & | operator= (const DirichletBoundaryCondition &rhs)=delete |
The (copy) operator=. | |
DirichletBoundaryCondition & | operator= (DirichletBoundaryCondition &&rhs)=delete |
The (move) operator=. | |
Class in charge of Dirichlet boundary conditions.
This class is still relatively close to its counterpart in Felisce; a move heavy refactoring is not excluded at all.
|
private |
Alias to parent.
Friendship to Manager class.
|
explicitprivate |
Constructor.
[in] | unique_id | Unique identifier, used in the input data file to tag the condition. |
[in] | domain | Domain upon which the condition is applied. |
[in] | unknown | Unknown considered for the boundary condition. If you actually want a condition on a given domain that acts upon two unknowns, you must define another DirichletBoundaryCondition; both should be given in the dedicated VariationaFormulation. |
[in] | value_per_component | Initial value for each of the component. |
[in] | component | String that details on which component the condition should be applied. This string must be one recognized by the ComponentFactory; current choices are 'Comp1', 'Comp2', 'Comp3', 'Comp12', 'Comp23', 'Comp13' and 'Comp123'. |
[in] | is_mutable | False if the boundary condition is homogeneous, true otherwise. |
|
delete |
The copy constructor.
[in] | rhs | The object from which the construction occurs. |
|
delete |
The move constructor.
[in] | rhs | The object from which the construction occurs. |
|
delete |
The (copy) operator=.
[in] | rhs | The object from which the affectation occurs. |
|
delete |
The (move) operator=.
[in] | rhs | The object from which the affectation occurs. |
bool MoReFEM::DirichletBoundaryCondition::IsNumberingSubset | ( | const NumberingSubset & | numbering_subset | ) | const |
Whether a given numbering subset is relevant for the boundary condition.
The relevancy is here program-wise: it might return true even if no dofs are managed by the current processor.
[in] | numbering_subset | Numbering subset considered. |
void MoReFEM::DirichletBoundaryCondition::UpdateValues | ( | const GlobalVector & | new_values | ) |
Replace the values to apply on dofs by the ones given in new_values.
[in] | new_values | Global vector from which new boundaruy condition values should be extracted. |
void MoReFEM::DirichletBoundaryCondition::UpdateValues | ( | const NumberingSubset & | numbering_subset, |
std::vector< PetscScalar > && | new_values ) |
Replace the values to apply on dofs by the ones given in new_values for numbering subset.
[in] | new_values | Global vector from which new boundaruy condition values should be extracted. |
[in] | numbering_subset | Numbering subset considered. |
|
private |
Keep only the dofs that are related to current processor (i.e. either processor-wise or ghost).
Should be called only by GodOfDof.
[in] | god_of_dof | God of dof that possess the dofs considered in the boundary condition. |
|
private |
Fill properly the storage for a given numbering_subset.
Should be called only by GodOfDof.
[in] | numbering_subset | NumberingSubset considered. |
[in] | dof_list | Dof list to associate to numbering_subset. |
|
private |
Tell a numbering subset is relevant for the boundary condition, even if not present processor-wisely.
Should be called only by GodOfDof.
[in] | numbering_subset | NumberingSubset to consider. |
|
private |
Compute the list of dofs and their associated values.
Should be called only by GodOfDof.
|
privatenoexcept |
|
private |
Return the value of the requested boundary condition.
[in] | component | Index of the active component considered. If for instance Comp13, component = 0 will yield x and component = 1 will yield z. |
|
private |
Reduce: keep only NodeBearer that are either processor-wise or ghost.
[in] | processor_wise_node_bearer_list | List of processor-wise NodeBearer in the GodOfDof for which current method is called. |
[in] | ghost_node_bearer_list | List of ghost NodeBearer in the GodOfDof for which current method is called. |
|
private |
Set the list of NodeBearer.
[in] | node_bearer_list | The list of NodeBearer considered. |
The return value is the same content as the argument: it is a trick so that rvalue ay be used to initialise the list.
|
privatenoexcept |
Constant accessor to Storage of dof for all numbering subsets
.
|
privatenoexcept |
Non constant accessor to Storage of dof for all numbering subsets
.
|
privatenoexcept |
Access to the storage of dof for a given numbering subset.
[in] | numbering_subset | NumberingSubset used as filter. |
|
privatenoexcept |
Non constant access to the storage of dof for a given numbering subset.
[in] | numbering_subset | NumberingSubset used as filter. |
|
inherited |
Get the value of the internal unique ID.
|
staticinherited |
Generate a unique id.
No new objects is created, and the new identifier is not counted in the list - the purpose here is just to provide a value that don't collide with existing objects. This is really used in a very edge case; think twice before using this functionality as it really might not be what you really seek.
|
staticinherited |
Clear all unique ids.
|
staticprivateinherited |
If AssignationMode is automatic, generates a new unique identifier.
|
staticprivateinherited |
If AssignationMode is manual, checks the unique identifier provided is valid.
[in] | new_unique_id | The proposed new unique id. If it already exists an exception will be thrown. |
|
friend |
Friendship to the manager, that will erase some temporary data.
At the beginning of a model, boundary conditions are initialized with a value read in the input data file. This value is retained for homogeneous boundary condition, and modified for other cases; whichever the case the initial value is not needed anymore, as the storage is different in all cases. So it's possible to spare (very few) memory by dropping now unused values.
|
private |
Initial values associated to each dof.
[internal]
When this data is created, dofs aren't yet given their program-wise index, so both std::map and std::unordered_map would be very unreliable here.
All dofs are considered here, regardless of their numbering subset.
|
private |
Helpful vector when penalization is to be used, which stores the penalization value for each dof.
This vector may be given directly to Petsc::Matrix::SetValues().
|
private |
For each numbering subset, store the relevant information about the dofs involved in the boundary condition.
Key is unique id of the numbering subset; value is the object that stored the information about the dofs.