Prototype for Integrator of Weak Form Governing Equation. More...
#include <cl_IWG.hpp>
Public Member Functions | |
| IWG (const IWG &)=delete | |
| IWG & | operator= (const IWG &)=delete |
| IWG (IWG &&)=delete | |
| IWG & | operator= (IWG &&)=delete |
| IWG (const IwgType aType, const ModelDimensionality aDimensionality, const IwgMode aMode=IwgMode::Iterative, const SymmetryMode aSymmetryMode=SymmetryMode::Unsymmetric, const DofMode aDofMode=DofMode::AllBlocksEqual, const SideSetDofLinkMode aSideSetDofLinkMode=SideSetDofLinkMode::FacetOnly) | |
| virtual | ~IWG () |
| void | select_blocks (const Vector< id_t > &aBlockIDs) |
| the blocks are selected over the IWG object. | |
| void | select_block (const id_t aBlockID) |
| void | select_sidesets (const Vector< id_t > &aSidesetIDs) |
| the sidesets are selected over the IWG object. | |
| const Vector< id_t > & | selected_blocks () const |
| returns the list of selected blocks | |
| const Vector< id_t > & | selected_sidesets () const |
| returns the list of selected sidesets | |
| virtual void | compute_jacobian (Element *aElement, Matrix< real > &aJacobian) |
| The caller provides aJacobian, sized number_of_dofs_per_element() squared, in the element's local dof order and in column-major order. | |
| virtual void | compute_jacobian_and_rhs (Element *aElement, Matrix< real > &aJacobian, Vector< real > &aRHS) |
| virtual void | compute_convection (Element *aElement, Vector< real > &aConvection) |
| virtual void | compute_alpha_boundary_condition (Element *aElement, Matrix< real > &aJacobian, Vector< real > &aRHS) |
| virtual void | compute_rhs (Element *aElement, Vector< real > &aRHS) |
| virtual void | compute_rhs (Element *aElement, Matrix< real > &aRHS) |
| virtual void | link_to_group (Group *aGroup) |
| The IWG borrows the group, its calculator and the pointers reachable from them. | |
| const Cell< string > & | dof_fields () const |
| const Cell< string > & | flux_fields () const |
| const Cell< string > & | tensor_fields () const |
| special purpose if RHS is a matrix | |
| const Cell< string > & | other_fields () const |
| const Cell< string > & | all_fields () const |
| const string & | field (const index_t aIndex) const |
| index_t | number_of_fields () const |
| uint | number_of_dofs_per_node () const |
| TODO(cm): retire number_of_dofs_per_node() for the block-scoped overload below. | |
| uint | number_of_dofs_per_node (const id_t aBlockID) const |
| uint | number_of_dofs_per_node_on_sideset (const id_t aSideSetID) const |
| uint | number_of_dofs_per_edge (const id_t aBlockID) const |
| uint | number_of_dofs_per_face (const id_t aBlockID) const |
| uint | number_of_dofs_per_cell (const id_t aBlockID) const |
| virtual uint | number_of_dofs_per_element (Block *aBlock) const |
| uint | number_of_nodes_per_element (SideSet *aSideSet) const |
| uint | number_of_edges_per_element (SideSet *aSideSet) const |
| uint | number_of_faces_per_element (SideSet *aSideSet) const |
| virtual uint | number_of_dofs_per_element (SideSet *aSideSet) const |
| uint | number_of_lambda_dofs (const id_t aSideSetID) const |
| const Vector< index_t > & | dofs_per_node (const id_t aBlockID) const |
| const Vector< index_t > & | dofs_per_edge (const id_t aBlockID) const |
| const Vector< index_t > & | dofs_per_face (const id_t aBlockID) const |
| const Vector< index_t > & | dofs_per_cell (const id_t aBlockID) const |
| const Vector< index_t > & | lambda_dofs (const id_t aSideSetID) const |
| const Vector< index_t > & | dofs_per_node_on_sideset (const id_t aSideSetID, const bool aSideSetOnly=false) const |
| const Vector< index_t > & | dofs_per_edge_on_sideset (const id_t aSideSetID, const bool aSideSetOnly=false) const |
| const Vector< index_t > & | dofs_per_face_on_sideset (const id_t aSideSetID, const bool aSideSetOnly=false) const |
| const Vector< index_t > & | dofs_per_cell_on_sideset (const id_t, const bool aSideSetOnly=false) const |
| const Vector< index_t > & | dof_entity_types () const |
| const Vector< index_t > & | default_dof_types () const |
| index_t | edge_multiplicity () const |
| tells how many dofs sit on one edge | |
| index_t | face_multiplicity () const |
| tells how many dofs sit on one face | |
| index_t | cell_multiplicity () const |
| tells how many dofs sit on one cell | |
| index_t | edge_field_index (const index_t aDofType) const |
| index_t | face_field_index (const index_t aDofType) const |
| const Vector< index_t > & | dofs_per_sideset (const id_t aSidesetID) const |
| intended to be used for interface dof creation | |
| uint | num_rhs_cols () const |
| virtual void | set_field (DofManagerBase *aField) |
| void | detach_field (const DofManagerBase *aField) |
| forgets aField if it is the linked one. | |
| IwgType | type () const |
| ModelDimensionality | model_dimensionality () const |
| void | set_interpolation_type (const InterpolationType aType) |
| InterpolationType | interpolation_type () const |
| IwgMode | mode () const |
| real | omega () const |
| The Newton relaxation factor, dimensionless; 1 is an undamped step. | |
| void | set_omega (const real &aOmega) |
| All ranks must call it. | |
| void | set_penalty (const real aPsi, const uint aIndex=0) |
| All ranks must call it. | |
| real | penalty (const uint aIndex) const |
| SymmetryMode | symmetry_mode () const |
| flag telling if matrices are symmetric | |
| void | set_num_rhs_cols (const uint &aNumRhsCols) |
| special function, must be called before init->jacobian() is called | |
| virtual void | set_wetted_sidesets (const Vector< id_t > &aSideSets) |
| const Vector< id_t > & | wetted_sidesets () const |
| real & | delta_time () |
| uint & | time_loop () |
| void | add_fields (const Cell< string > &aFieldLabels) |
| add additional non-dof fields to mOtherFields and mAllFields; a label "alpha" also sets mHasConvection | |
| bool | has_convection () const |
| tells if this field has an alpha boundary condition | |
| virtual void | compute_boundary_flux_matrix (Element *aElement, const uint aDirection, Matrix< real > &aJacobian) |
| special function to compute the boundary flux in magnetics impose zero as weak BC | |
| void | set_blocks (const Vector< id_t > &aBlockIDs, const Cell< DomainType > &aBlockTypes) |
| void | set_sidesets (const Vector< id_t > &aSideSetIDs, const Cell< DomainType > &aSideSetTypes) |
| DomainType | block_type (const id_t aID) const |
| DomainType | sideset_type (const id_t aID) const |
| GroupActivationMode | block_activation_mode (const DomainType aType) const |
| returns the activation mode for a block based on its domain type | |
| GroupActivationMode | sideset_activation_mode (const DomainType aType) const |
| returns the activation mode for a sideset based on its domain type | |
| virtual void | initialize () |
| virtual void | initialize (const IwgType aType) |
| bool | is_initialized () const |
| bool | enrich_sidesets () const |
| virtual int | check_mesh (Mesh *aMesh, const proc_t aMasterRank=0) |
| This routine makes sure that the mesh fulfills the requirements. | |
| void | hide_fields_from_exodus (Mesh *aMesh) |
| hides fields that are not to be saved to exodus | |
| virtual bool | has_edge_dofs () const |
| flag telling if the IWG has edge dofs | |
| uint | lambda_multiplicity () const |
| if this number is > 0, we have langrande dofs such as contact | |
| SideSetDofLinkMode | sideset_dof_link_mode () const |
| return the dof linking mode for sideset | |
| void | set_algorithm (const SolverAlgorithm aAlgorithm) |
| sets the mode for the solver algorithm | |
| SolverAlgorithm | algorithm () const |
| returns the solver algorithm | |
| virtual void | shift_fields () |
| called by main file to copy fields into last timestep eg. | |
| virtual void | reset_fields () |
| called by main file to copy fields from last timestep eg. | |
| void | collect_node_data (Element *aElement, Cell< string > &aFieldLabels, Matrix< real > &aData) |
| The caller pre-sizes aData. | |
| void | collect_node_data (Element *aElement, const string &aFieldLabel) |
| void | collect_node_data (Element *aElement, const Cell< string > &aFieldLabels) |
| void | collect_node_data (Element *aElement, const string &aFieldLabel, Vector< real > &aData) |
| void | collect_node_data (Element *aElement, const string &aFieldLabel, Vector< real > &aData, uint &aOffset) |
| void | collect_edge_data (Element *aElement, const string &aEdgeFieldLabel, Vector< real > &aData) |
| void | collect_edge_data (Element *aElement, const string &aEdgeFieldLabel, const string &aFaceFieldLabel, Vector< real > &aData) |
| void | collect_lambda_data (Element *aElement, const string &aFieldLabel, real &aData) |
| uint | doftype (const string &aDofLabel) const |
| return the type id of a dof | |
| void | unique_and_rearrange (Cell< string > &aDofs, const bool aMakeMap=false) |
| makes sure that dof list is unique and also creares dofmap must be accessible by Mawell_FieldList as well | |
| bool | compute_jacobian_on_sideset () const |
| bool | compute_jacobian_on_block () const |
| virtual void | compute_mkf (Element *aElement) |
| virtual TimestepMatrices * | matrices () |
| A timestep IWG returns the work matrices it owns. | |
| void | print_dofs (Element *aElement, const bool aLocal=false) |
| for debugging | |
| const string & | dof_label (const index_t aDofIndex) |
| for debugging | |
| Calculator * | calc () |
| The group's calculator, borrowed and re-pointed by every link_to_group(). | |
| void | set_abstract_nodes (Cell< mesh::Node * > &aNodes) |
| void | set_orphaned_nodes (Cell< mesh::Node * > &aNodes) |
| Cell< mesh::Node * > & | abstract_nodes () |
| Cell< mesh::Node * > & | orphaned_nodes () |
| index_t | abstract_dof_type () const |
| virtual void | collect_abstract_node_dofs () |
| virtual void | create_custom_vectors_and_matrices (Calculator *aCalc) |
| uint | get_field_index (const uint aDofType) const |
| virtual void | custom_postprocess () |
| void | set_abstract_dof_type (const uint aDofType) |
| virtual void | set_timestepping_method (const EulerMethod aMethod, const bool aHaveStiffness=true) |
| virtual EulerMethod | method () const |
| virtual uint | timestepping_order () const |
Protected Member Functions | |
| void | delete_boundary_conditions () |
| Reserved; not defined and not called by the destructor. | |
| void | delete_block_dof_tables () |
| void | delete_sideset_dof_tables () |
| virtual void | assign_dofs_per_block (const Vector< id_t > &aBlockIDs) |
| this function assumes that all blocks are treated equally. | |
| virtual void | assign_dofs_per_sideset (const Vector< id_t > &aSideSetIDs) |
| this function assumes that all sidesets are treated equally. | |
| virtual void | init_activation_maps () |
| populates the activation mode maps for blocks and sidesets based on domain types. | |
| virtual void | allocate_work_matrices (Group *aGroup) |
| Sizes the group's node-coordinate work matrix before its element loop. | |
| void | collect_nodes_on_wetted_sitdesets (Mesh *aMesh, const Vector< id_t > &aSideSets) |
| populate the node indices for the nodes that sit on wetted sidesets | |
| void | count_dofs_per_block () |
| void | count_dofs_per_sideset () |
| void | collect_node_coords (Element *aElement, Matrix< real > &aX) |
| Sizes aX to number_of_nodes x mNumberOfSpatialDimensions, the problem dimension the derived IWG's constructor sets ( 2 or 3; link_to_group() does not set it, and an IWG that leaves the sentinel trips the assert ), and fills row k with node k's coordinates. | |
Prototype for Integrator of Weak Form Governing Equation.
|
delete |
|
delete |
| belfem::fem::IWG::IWG | ( | const IwgType | aType, |
| const ModelDimensionality | aDimensionality, | ||
| const IwgMode | aMode = IwgMode::Iterative, | ||
| const SymmetryMode | aSymmetryMode = SymmetryMode::Unsymmetric, | ||
| const DofMode | aDofMode = DofMode::AllBlocksEqual, | ||
| const SideSetDofLinkMode | aSideSetDofLinkMode = SideSetDofLinkMode::FacetOnly ) |
|
virtual |
|
inline |
|
inline |
add additional non-dof fields to mOtherFields and mAllFields; a label "alpha" also sets mHasConvection
| aFieldLabels |
|
inline |
returns the solver algorithm
|
protectedvirtual |
Sizes the group's node-coordinate work matrix before its element loop.
The loop then allocates nothing. It also records the element geometry counts. An override must size every buffer its kernel writes into.
this function assumes that all blocks are treated equally.
special purpose IWGs might overload this function
|
protectedvirtual |
this function assumes that all sidesets are treated equally.
special purpose IWGs might overload this function
| GroupActivationMode belfem::fem::IWG::block_activation_mode | ( | const DomainType | aType | ) | const |
returns the activation mode for a block based on its domain type
| DomainType belfem::fem::IWG::block_type | ( | const id_t | aID | ) | const |
|
inline |
The group's calculator, borrowed and re-pointed by every link_to_group().
A reference into one of its scratch vectors stays valid, but the next collect into the same slot overwrites the contents.
|
inline |
tells how many dofs sit on one cell
This routine makes sure that the mesh fulfills the requirements.
Unless those are not explicitly specified by the IWG, this routine only checks if the mesh is not a nullpointer.
|
virtual |
Reimplemented in belfem::fem::IWG_Maxwell.
| void belfem::fem::IWG::collect_edge_data | ( | Element * | aElement, |
| const string & | aEdgeFieldLabel, | ||
| const string & | aFaceFieldLabel, | ||
| Vector< real > & | aData ) |
| void belfem::fem::IWG::collect_edge_data | ( | Element * | aElement, |
| const string & | aEdgeFieldLabel, | ||
| Vector< real > & | aData ) |
| void belfem::fem::IWG::collect_lambda_data | ( | Element * | aElement, |
| const string & | aFieldLabel, | ||
| real & | aData ) |
Sizes aX to number_of_nodes x mNumberOfSpatialDimensions, the problem dimension the derived IWG's constructor sets ( 2 or 3; link_to_group() does not set it, and an IWG that leaves the sentinel trips the assert ), and fills row k with node k's coordinates.
| void belfem::fem::IWG::collect_node_data | ( | Element * | aElement, |
| Cell< string > & | aFieldLabels, | ||
| Matrix< real > & | aData ) |
The caller pre-sizes aData.
Row i holds element node i. Column j holds aFieldLabels( j ). BELFEM_ASSERT checks this in debug builds only.
| void belfem::fem::IWG::collect_node_data | ( | Element * | aElement, |
| const Cell< string > & | aFieldLabels ) |
| void belfem::fem::IWG::collect_node_data | ( | Element * | aElement, |
| const string & | aFieldLabel, | ||
| Vector< real > & | aData ) |
| void belfem::fem::IWG::collect_node_data | ( | Element * | aElement, |
| const string & | aFieldLabel, | ||
| Vector< real > & | aData, | ||
| uint & | aOffset ) |
|
protected |
populate the node indices for the nodes that sit on wetted sidesets
|
virtual |
|
virtual |
special function to compute the boundary flux in magnetics impose zero as weak BC
|
virtual |
The caller provides aJacobian, sized number_of_dofs_per_element() squared, in the element's local dof order and in column-major order.
The implementation fills it. The compute_* overloads below share this contract for their matrix and vector arguments.
Reimplemented in belfem::fem::IWG_Poisson.
|
virtual |
Reimplemented in belfem::fem::IWG_MaxwellPostproc, belfem::fem::IWG_StaticHeatConduction, and belfem::fem::IWG_Timestep.
|
inline |
|
inline |
|
virtual |
|
protected |
|
protected |
|
virtual |
Reimplemented in belfem::fem::IWG_Maxwell, belfem::fem::IWG_MaxwellPostproc, and belfem::fem::IWG_MaxwellThermal.
|
virtual |
Reimplemented in belfem::fem::IWG_Maxwell.
|
protected |
|
protected |
Reserved; not defined and not called by the destructor.
|
protected |
| real & belfem::fem::IWG::delta_time | ( | ) |
| void belfem::fem::IWG::detach_field | ( | const DofManagerBase * | aField | ) |
forgets aField if it is the linked one.
The kernel calls this when a field refused to link and is about to be freed, so the equation does not keep pointing at that dof manager
|
inline |
|
inline |
|
inline |
|
inline |
intended to be used for interface dof creation
| aSidesetID |
|
inline |
tells how many dofs sit on one edge
|
inline |
|
inline |
tells how many dofs sit on one face
|
inline |
tells if this field has an alpha boundary condition
|
inlinevirtual |
flag telling if the IWG has edge dofs
Reimplemented in belfem::fem::IWG_Maxwell.
| void belfem::fem::IWG::hide_fields_from_exodus | ( | Mesh * | aMesh | ) |
hides fields that are not to be saved to exodus
|
protectedvirtual |
populates the activation mode maps for blocks and sidesets based on domain types.
Called during initialization. Default implementation maps DomainType::Inactive to GroupActivationMode::Inactive and DomainType::GeometryOnly to GroupActivationMode::GeometryOnly; every other domain type falls back to GeometryAndDofs in block_activation_mode() / sideset_activation_mode(). Override in derived classes to add entries.
Reimplemented in belfem::fem::IWG_Maxwell.
|
virtual |
Reimplemented in belfem::fem::IWG_Maxwell.
|
virtual |
|
inline |
|
inline |
|
inline |
if this number is > 0, we have langrande dofs such as contact
|
virtual |
The IWG borrows the group, its calculator and the pointers reachable from them.
It owns and deletes nothing linked here.
Reimplemented in belfem::fem::IWG_Maxwell, belfem::fem::IWG_MaxwellThermal, and belfem::fem::IWG_StaticHeatConduction.
|
virtual |
A timestep IWG returns the work matrices it owns.
The base implementation aborts with BELFEM_ERROR.
Reimplemented in belfem::fem::IWG_Timestep.
|
virtual |
Reimplemented in belfem::fem::IWG_Timestep.
| IwgMode belfem::fem::IWG::mode | ( | ) | const |
| ModelDimensionality belfem::fem::IWG::model_dimensionality | ( | ) | const |
| uint belfem::fem::IWG::num_rhs_cols | ( | ) | const |
| uint belfem::fem::IWG::number_of_dofs_per_node | ( | ) | const |
TODO(cm): retire number_of_dofs_per_node() for the block-scoped overload below.
Exit criterion: the call in cl_FEM_DofMgr_SolverData.cpp has moved to that overload.
|
inline |
|
inline |
The Newton relaxation factor, dimensionless; 1 is an undamped step.
The setter does not clamp it.
|
inline |
| void belfem::fem::IWG::print_dofs | ( | Element * | aElement, |
| const bool | aLocal = false ) |
for debugging
|
virtual |
called by main file to copy fields from last timestep eg.
T = T0
Reimplemented in belfem::fem::IWG_Timestep.
| void belfem::fem::IWG::select_block | ( | const id_t | aBlockID | ) |
the blocks are selected over the IWG object.
the equation object knows how many DOFs sit on each entity per block
the sidesets are selected over the IWG object.
the equation object knows how many DOFs sit on each entity per sideset
returns the list of selected blocks
returns the list of selected sidesets
| void belfem::fem::IWG::set_abstract_dof_type | ( | const uint | aDofType | ) |
| void belfem::fem::IWG::set_abstract_nodes | ( | Cell< mesh::Node * > & | aNodes | ) |
| void belfem::fem::IWG::set_algorithm | ( | const SolverAlgorithm | aAlgorithm | ) |
sets the mode for the solver algorithm
| void belfem::fem::IWG::set_blocks | ( | const Vector< id_t > & | aBlockIDs, |
| const Cell< DomainType > & | aBlockTypes ) |
|
virtual |
Reimplemented in belfem::fem::IWG_Timestep.
|
inline |
| void belfem::fem::IWG::set_num_rhs_cols | ( | const uint & | aNumRhsCols | ) |
special function, must be called before init->jacobian() is called
| void belfem::fem::IWG::set_omega | ( | const real & | aOmega | ) |
All ranks must call it.
The value from rank 0 is broadcast to all ranks.
| void belfem::fem::IWG::set_orphaned_nodes | ( | Cell< mesh::Node * > & | aNodes | ) |
All ranks must call it.
The penalty factor of the weak boundary condition at slot aIndex is taken from rank 0 and broadcast.
| void belfem::fem::IWG::set_sidesets | ( | const Vector< id_t > & | aSideSetIDs, |
| const Cell< DomainType > & | aSideSetTypes ) |
|
virtual |
Reimplemented in belfem::fem::IWG_Timestep.
|
virtual |
called by main file to copy fields into last timestep eg.
T0 = T
Reimplemented in belfem::fem::IWG_Timestep.
| GroupActivationMode belfem::fem::IWG::sideset_activation_mode | ( | const DomainType | aType | ) | const |
returns the activation mode for a sideset based on its domain type
|
inline |
return the dof linking mode for sideset
| DomainType belfem::fem::IWG::sideset_type | ( | const id_t | aID | ) | const |
| SymmetryMode belfem::fem::IWG::symmetry_mode | ( | ) | const |
flag telling if matrices are symmetric
special purpose if RHS is a matrix
|
inline |
|
virtual |
| IwgType belfem::fem::IWG::type | ( | ) | const |
makes sure that dof list is unique and also creares dofmap must be accessible by Mawell_FieldList as well
list with special dofs that sit on abstract nodes
|
protected |
abstract nodes needed for cut BCs in MAXWELL
|
protected |
|
protected |
maps domain types to activation modes for blocks
|
protected |
this list contains the sidesets that are shells. needed by dof manager. Must be populated by set_sidesets of child class
links block IDs with the designated types must be populated by child class
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
no writer anywhere in the tree, by design: the sideset branch of DofManager::compute_jacobian is dormant capability for a future problem where surface matrices matter — not needed for the maxwell-thermal problem. Any future writer must also give that loop the is_active() guard it alone lacks
|
protected |
|
protected |
this enum tells which dimensionality we have
|
protected |
except maxwell, most IWGs are AllBlocksEqual
|
protected |
|
protected |
flag telling if we want to use bubbles on sidesets this works only if air elements are master
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
flag telling if we have been initialized
|
protected |
|
protected |
|
protected |
|
protected |
this enum tells if we have to perform a Newton-Raphson
TODO(cm): mNormal2D and mNormal3D have no reader; delete both.
|
protected |
|
protected |
|
protected |
set by link_to_group(), not by the constructor – the sentinel makes a premature read deterministic instead of undefined
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
nodes that belong to no active element but still carry a phi dof ( see Mesh::orphaned_nodes() )
|
protected |
maps domain types to activation modes for sidesets
|
protected |
mode how sidesets are linked
contains the sideset dofs that sit only on the sideset, but not on master or slave
|
protected |
links sideset IDs with the designated types
|
protected |
links sideset IDs with the designated types
|
protected |
tells which solver algorithm is to be used per default, the IWG sets Newton Raphson
|
protected |
needed for the solver
|
protected |
value for timeloop, needed if we don't want to write every timestep
|
protected |
this enum tells which equation object is used