BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
belfem::fem::DofManager Class Reference

this class creates the DOFs based on the passed equation object. More...

#include <cl_FEM_DofManager.hpp>

Inheritance diagram for belfem::fem::DofManager:
[legend]
Collaboration diagram for belfem::fem::DofManager:
[legend]

Public Member Functions

 DofManager (Kernel *aParent, const index_t aIndex)
 ~DofManager () override
void set_equation (IWG *aIWG)
 select the equation that is to be solved
void print (const proc_t aRank=0)
 a test routine for development
uint sideset_integration_order () const override
uint block_integration_order () const override
IntegrationScheme integration_scheme () const override
bool is_initialized () const override
 true once initialize() has frozen the free/fixed dof split and the matrix graphs; a first fix() of a free dof after that point changes a classification the solver containers are sized for ( see SideSet::impose_dirichlet )
Dofdof (const id_t aID) override
 return a specific dof
bool dof_exists (const id_t aID) const override
Cell< Dof * > & dofs ()
 return the non-hanging dofs ( free and fixed; hanging dofs live in DofData::hanging_dofs() )
Bearingbearing (const id_t aID)
 return a specific bearing
SideSetsideset (const id_t aID) override
 return a specific sideset
Blockblock (const id_t aID) override
 return a specific block
void extract_abstract_dofs_from_mesh ()
id_t calculate_dof_id (const mesh::Node *aNode, const uint aDofType) const override
id_t calculate_dof_id (const mesh::Edge *aEdge, const uint aDofType) const override
id_t calculate_dof_id (const mesh::Face *aFace, const uint aDofType) const
id_t calculate_dof_id (const mesh::Facet *aFacet, const uint aDofType) const override
void initialize () override
void initialize (const bool aSeedFreeDofsOnly)
void zero ()
void compute_jacobian (const bool aReset=true)
void compute_rhs (const bool aReset=true)
void compute_jacobian_and_rhs (const bool aReset=true)
void compute_full_matrices ()
void set_solver (const SolverParameters &aParams)
 set the solver type for this field
dofmgr::SolverDatasolver_data ()
Solversolver ()
 expose the solver
void solve ()
void compute_residual ()
void solve_from_residual ()
real residual (const uint aIteration)
real absolute_residual () const
 absolute residual norm of the last residual() call
real pre_update_residual () const
 pre-update residual of the entry state under the current assembly ( Newton iterates only, QUIET_NAN otherwise ) — the honest backtracking reference for the controller's line search
real fixed_point_residual () const
 fixed-point residual ||G(x)-x|| / ||x|| of the last Anderson update ( REAL_MAX while Anderson is off )
bool solve_failed ()
 true if the last solve failed softly ( soft-fail contract, see solver::Wrapper ); rank-uniform
void collect_fields (const Cell< string > &aFieldLabels) override
 collects node data from the others and send it to master
void collect_field (const string &aFieldLabel)
 collects node data from the others and send it to master
void distribute_fields (const Cell< string > &aFieldLabels) override
 sends field data from master to the others
void synchronize_fields (const Cell< string > &aFieldLabels) override
 perform a collect first, then a distribute
void compute_volume_loads (const Vector< id_t > &aBlockIDs)
SpMatrixsystem_matrix ()
 The JEDI Block Matrix System - May the Force be with you!
SpMatrixdirichlet ()
SpMatrixenforcement ()
SpMatriximposition ()
SpMatrixfull_mass ()
SpMatrixfull_stiffness ()
void full_lhs (Vector< real > &aLHS)
Vector< real > & rhs_vector ()
real rhs_norm ()
void load_system (const string &aPath)
void save_system (const string &aPath)
void init_dof_values ()
void seed_dof_values ()
void reset_convection ()
bool sideset_exists (const id_t &aID) const override
bool block_exists (const id_t &aID) const override
void create_fields (IWG *aIWG)
 check that the fields demanded by the IWG exist on the mesh and create them otherwise
Cell< Postprocessor * > & postprocessors ()
 expose the projector arrays
void initialize_postprocessors ()
 compute the matrices for the projections
void postprocess ()
 perform the L2 projections for the secondary fields
Cell< Block * > & blocks ()
 return the blocks on this dof manager
Cell< SideSet * > & sidesets ()
 return the sidesets on this dof manager
index_t number_of_wetted_nodes () const
 return the number of wetted nodes ( nodes on sidesets with a Neumann or Alpha BC )
void disconnect_dofs_from_mesh ()
dofmgr::EigenValueseigen_values ()
 expose the eigenvalue tool
Elementelement (const id_t aID)
 returns direct access to one element.
bool element_exists (const id_t aID) const
Cell< Dof * > & abstract_dofs ()
Public Member Functions inherited from belfem::fem::DofManagerBase
 DofManagerBase (const DofManagerType aType, Kernel *aParent)
virtual ~DofManagerBase ()=default
DofManagerType type () const
proc_t rank () const
 return the rank of this proc ( faster than comm_rank() )
Meshmesh ()
Kernelparent ()
IWGiwg ()
Vector< real > & field_data (const string &aLabel)
virtual uint number_of_dofs_per_node () const
virtual uint number_of_dofs_per_edge () const
bool is_master () const
virtual void print_worst_dof ()
virtual void write_residuals_to_mesh ()

Additional Inherited Members

Protected Attributes inherited from belfem::fem::DofManagerBase
KernelmParent
MeshmMesh
IWGmIWG = nullptr
const proc_t mCommRank

Detailed Description

this class creates the DOFs based on the passed equation object.

Main workhorse: DOF management, assembly coordination and the solver interface.

See also
DofManager and FEM Kernel Usage Guide

Constructor & Destructor Documentation

◆ DofManager()

belfem::fem::DofManager::DofManager ( Kernel * aParent,
const index_t aIndex )
Parameters
aParent
aIndex: corresponding index in kernel

◆ ~DofManager()

belfem::fem::DofManager::~DofManager ( )
override

Member Function Documentation

◆ absolute_residual()

real belfem::fem::DofManager::absolute_residual ( ) const

absolute residual norm of the last residual() call

◆ abstract_dofs()

Cell< Dof * > & belfem::fem::DofManager::abstract_dofs ( )
inline

◆ bearing()

Bearing * belfem::fem::DofManager::bearing ( const id_t aID)
inline

return a specific bearing

◆ block()

Block * belfem::fem::DofManager::block ( const id_t aID)
inlineoverridevirtual

return a specific block

Reimplemented from belfem::fem::DofManagerBase.

◆ block_exists()

bool belfem::fem::DofManager::block_exists ( const id_t & aID) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ block_integration_order()

uint belfem::fem::DofManager::block_integration_order ( ) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ blocks()

Cell< Block * > & belfem::fem::DofManager::blocks ( )
inline

return the blocks on this dof manager

Returns

◆ calculate_dof_id() [1/4]

id_t belfem::fem::DofManager::calculate_dof_id ( const mesh::Edge * aEdge,
const uint aDofType ) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ calculate_dof_id() [2/4]

id_t belfem::fem::DofManager::calculate_dof_id ( const mesh::Face * aFace,
const uint aDofType ) const
inline

◆ calculate_dof_id() [3/4]

id_t belfem::fem::DofManager::calculate_dof_id ( const mesh::Facet * aFacet,
const uint aDofType ) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ calculate_dof_id() [4/4]

id_t belfem::fem::DofManager::calculate_dof_id ( const mesh::Node * aNode,
const uint aDofType ) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ collect_field()

void belfem::fem::DofManager::collect_field ( const string & aFieldLabel)

collects node data from the others and send it to master

◆ collect_fields()

void belfem::fem::DofManager::collect_fields ( const Cell< string > & aFieldLabels)
overridevirtual

collects node data from the others and send it to master

Reimplemented from belfem::fem::DofManagerBase.

◆ compute_full_matrices()

void belfem::fem::DofManager::compute_full_matrices ( )

◆ compute_jacobian()

void belfem::fem::DofManager::compute_jacobian ( const bool aReset = true)

◆ compute_jacobian_and_rhs()

void belfem::fem::DofManager::compute_jacobian_and_rhs ( const bool aReset = true)

◆ compute_residual()

void belfem::fem::DofManager::compute_residual ( )

phase 1 of the two-phase iterative solve: residual of the committed state under the current assembly, no update

◆ compute_rhs()

void belfem::fem::DofManager::compute_rhs ( const bool aReset = true)

◆ compute_volume_loads()

void belfem::fem::DofManager::compute_volume_loads ( const Vector< id_t > & aBlockIDs)

◆ create_fields()

void belfem::fem::DofManager::create_fields ( IWG * aIWG)

check that the fields demanded by the IWG exist on the mesh and create them otherwise

◆ dirichlet()

SpMatrix * belfem::fem::DofManager::dirichlet ( )
inline

◆ disconnect_dofs_from_mesh()

void belfem::fem::DofManager::disconnect_dofs_from_mesh ( )

◆ distribute_fields()

void belfem::fem::DofManager::distribute_fields ( const Cell< string > & aFieldLabels)
overridevirtual

sends field data from master to the others

Reimplemented from belfem::fem::DofManagerBase.

◆ dof()

Dof * belfem::fem::DofManager::dof ( const id_t aID)
inlineoverridevirtual

return a specific dof

Reimplemented from belfem::fem::DofManagerBase.

◆ dof_exists()

bool belfem::fem::DofManager::dof_exists ( const id_t aID) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ dofs()

Cell< Dof * > & belfem::fem::DofManager::dofs ( )
inline

return the non-hanging dofs ( free and fixed; hanging dofs live in DofData::hanging_dofs() )

◆ eigen_values()

dofmgr::EigenValues * belfem::fem::DofManager::eigen_values ( )
inline

expose the eigenvalue tool

◆ element()

Element * belfem::fem::DofManager::element ( const id_t aID)
inline

returns direct access to one element.

Needed for postprocessing

◆ element_exists()

bool belfem::fem::DofManager::element_exists ( const id_t aID) const
inline

◆ enforcement()

SpMatrix * belfem::fem::DofManager::enforcement ( )
inline

◆ extract_abstract_dofs_from_mesh()

void belfem::fem::DofManager::extract_abstract_dofs_from_mesh ( )

◆ fixed_point_residual()

real belfem::fem::DofManager::fixed_point_residual ( ) const

fixed-point residual ||G(x)-x|| / ||x|| of the last Anderson update ( REAL_MAX while Anderson is off )

◆ full_lhs()

void belfem::fem::DofManager::full_lhs ( Vector< real > & aLHS)

◆ full_mass()

SpMatrix * belfem::fem::DofManager::full_mass ( )
inline

◆ full_stiffness()

SpMatrix * belfem::fem::DofManager::full_stiffness ( )
inline

◆ imposition()

SpMatrix * belfem::fem::DofManager::imposition ( )
inline

◆ init_dof_values()

void belfem::fem::DofManager::init_dof_values ( )

◆ initialize() [1/2]

void belfem::fem::DofManager::initialize ( )
overridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ initialize() [2/2]

void belfem::fem::DofManager::initialize ( const bool aSeedFreeDofsOnly)

seed-mode overload: aSeedFreeDofsOnly = true skips the fixed-dof dof -> field write during init_dof_values(), so fields restored before this call ( load_memdump ) survive at Dirichlet nodes. The zero-arg override above must stay: it keeps base-pointer callers on full-mode virtual dispatch

◆ initialize_postprocessors()

void belfem::fem::DofManager::initialize_postprocessors ( )

compute the matrices for the projections

◆ integration_scheme()

IntegrationScheme belfem::fem::DofManager::integration_scheme ( ) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ is_initialized()

bool belfem::fem::DofManager::is_initialized ( ) const
inlineoverridevirtual

true once initialize() has frozen the free/fixed dof split and the matrix graphs; a first fix() of a free dof after that point changes a classification the solver containers are sized for ( see SideSet::impose_dirichlet )

Reimplemented from belfem::fem::DofManagerBase.

◆ load_system()

void belfem::fem::DofManager::load_system ( const string & aPath)

◆ number_of_wetted_nodes()

index_t belfem::fem::DofManager::number_of_wetted_nodes ( ) const
inline

return the number of wetted nodes ( nodes on sidesets with a Neumann or Alpha BC )

Returns

◆ postprocess()

void belfem::fem::DofManager::postprocess ( )

perform the L2 projections for the secondary fields

◆ postprocessors()

Cell< Postprocessor * > & belfem::fem::DofManager::postprocessors ( )
inline

expose the projector arrays

◆ pre_update_residual()

real belfem::fem::DofManager::pre_update_residual ( ) const

pre-update residual of the entry state under the current assembly ( Newton iterates only, QUIET_NAN otherwise ) — the honest backtracking reference for the controller's line search

◆ print()

void belfem::fem::DofManager::print ( const proc_t aRank = 0)

a test routine for development

◆ reset_convection()

void belfem::fem::DofManager::reset_convection ( )

◆ residual()

real belfem::fem::DofManager::residual ( const uint aIteration)

◆ rhs_norm()

real belfem::fem::DofManager::rhs_norm ( )
inline

◆ rhs_vector()

Vector< real > & belfem::fem::DofManager::rhs_vector ( )
inline

◆ save_system()

void belfem::fem::DofManager::save_system ( const string & aPath)

◆ seed_dof_values()

void belfem::fem::DofManager::seed_dof_values ( )

copy field values into the FREE dofs only ( fixed dofs keep their imposed values and do not write back into the field ). Call after the fields have been populated or restored — the initialize() pass seeds the dofs from whatever the fields held at that moment, and does not run again on this path ( only reset() via set_equation() clears the flag )

◆ set_equation()

void belfem::fem::DofManager::set_equation ( IWG * aIWG)

select the equation that is to be solved

◆ set_solver()

void belfem::fem::DofManager::set_solver ( const SolverParameters & aParams)

set the solver type for this field

◆ sideset()

SideSet * belfem::fem::DofManager::sideset ( const id_t aID)
inlineoverridevirtual

return a specific sideset

Reimplemented from belfem::fem::DofManagerBase.

◆ sideset_exists()

bool belfem::fem::DofManager::sideset_exists ( const id_t & aID) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ sideset_integration_order()

uint belfem::fem::DofManager::sideset_integration_order ( ) const
inlineoverridevirtual

Reimplemented from belfem::fem::DofManagerBase.

◆ sidesets()

Cell< SideSet * > & belfem::fem::DofManager::sidesets ( )
inline

return the sidesets on this dof manager

Returns

◆ solve()

void belfem::fem::DofManager::solve ( )

◆ solve_failed()

bool belfem::fem::DofManager::solve_failed ( )

true if the last solve failed softly ( soft-fail contract, see solver::Wrapper ); rank-uniform

◆ solve_from_residual()

void belfem::fem::DofManager::solve_from_residual ( )

phase 2: linear solve + update consuming compute_residual()'s result; must be entered on every rank

◆ solver()

Solver * belfem::fem::DofManager::solver ( )
inline

expose the solver

◆ solver_data()

dofmgr::SolverData * belfem::fem::DofManager::solver_data ( )
inline

◆ synchronize_fields()

void belfem::fem::DofManager::synchronize_fields ( const Cell< string > & aFieldLabels)
overridevirtual

perform a collect first, then a distribute

Reimplemented from belfem::fem::DofManagerBase.

◆ system_matrix()

SpMatrix * belfem::fem::DofManager::system_matrix ( )
inline

The JEDI Block Matrix System - May the Force be with you!

Block form: [ J D ] [ x ] [ f ] [ E I ] [ y ] = [ g ]

where x = free DOFs, y = fixed DOFs (imposed values)

Reduced system: J*x = f - D*y (solves for unknowns) Reaction forces: E*x + I*y = g (computes constraint forces!)

In structural mechanics, the JEDI system literally computes "the Force" at supports and constraints.

◆ zero()

void belfem::fem::DofManager::zero ( )

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