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

Container for element-level DENSE matrices in transient nonlinear FEM. More...

#include <cl_TimestepMatrices.hpp>

Public Member Functions

 TimestepMatrices ()=default
 ~TimestepMatrices ()=default
void initialize (const index_t aNumDofs)
 Initialize all matrices to given size.
void reset ()
void reset_flags ()
 Clear all flags ( unused; the IWG sets its flags once in the constructor ).
void set_flag (const MatrixFlag aFlag)
 Set a flag after populating corresponding matrix.
bool has_flag (const MatrixFlag aFlag) const
 Check if a matrix has been populated.
const Bitset< 8 > & flags () const
 Direct access to flags bitset.
const Matrix< real > & M () const
const Matrix< real > & D () const
const Matrix< real > & K () const
const Vector< real > & f () const
const Matrix< real > & dMdx_times_x () const
const Matrix< real > & dMdx_times_h () const
const Matrix< real > & dKdx_times_x () const
const Matrix< real > & dfdx () const
const Matrix< real > & J () const
const Matrix< real > & dJdx () const
Matrix< real > & M ()
Matrix< real > & D ()
Matrix< real > & K ()
Vector< real > & f ()
Matrix< real > & dMdx_times_x ()
Matrix< real > & dMdx_times_h ()
Matrix< real > & dKdx_times_x ()
Matrix< real > & dfdx ()
void assemble_J (const real adt)
void assemble_dJdx (const real adt, const real aAlpha=1.0)
 Assemble the Newton correction dJ/dx.

Detailed Description

Container for element-level DENSE matrices in transient nonlinear FEM.

This class serves as interface between the physics-aware IWG and the time-stepping scheme (BDF). All matrices are DENSE and sized n_e × n_e where n_e is the number of element DOFs.

The global SPARSE Jacobian is assembled from these element contributions in a separate assembler class.

Workflow:

  1. IWG constructor sets the flags for the matrices it produces
  2. link_to_group() calls initialize( n_e ), which sizes the flagged matrices
  3. per element: reset(), then the IWG fills M, K, f and the derivative blocks
  4. assemble_dJdx() combines the flagged blocks with the BDF coefficients
  5. Global assembler accumulates element J^e into sparse global Jacobian

Key design decisions:

  • All matrices are DENSE (element-level, typically small: 4-27 DOFs)
  • Derivatives are stored as contracted n_e × n_e matrices (dX/dx · x), not as n_e × n_e × n_e tensors. The IWG computes this contraction directly.
  • Uses Bitset<8> to track which matrices are populated.
See also
IWG Module Usage Guide

Constructor & Destructor Documentation

◆ TimestepMatrices()

belfem::fem::TimestepMatrices::TimestepMatrices ( )
default

◆ ~TimestepMatrices()

belfem::fem::TimestepMatrices::~TimestepMatrices ( )
default

Member Function Documentation

◆ assemble_dJdx()

void belfem::fem::TimestepMatrices::assemble_dJdx ( const real adt,
const real aAlpha = 1.0 )

Assemble the Newton correction dJ/dx.

Parameters
adtlength of the current timestep
aAlphaBDF coefficient of the current time level; scales the (dM/dx)·x term (Hairer & Wanner 1996, II.4). One for all schemes that scale M by one (BDF1, Crank-Nicolson, ...)

◆ assemble_J()

void belfem::fem::TimestepMatrices::assemble_J ( const real adt)

◆ D() [1/2]

Matrix< real > & belfem::fem::TimestepMatrices::D ( )
inline

◆ D() [2/2]

const Matrix< real > & belfem::fem::TimestepMatrices::D ( ) const
inline

◆ dfdx() [1/2]

Matrix< real > & belfem::fem::TimestepMatrices::dfdx ( )
inline

◆ dfdx() [2/2]

const Matrix< real > & belfem::fem::TimestepMatrices::dfdx ( ) const
inline

◆ dJdx()

const Matrix< real > & belfem::fem::TimestepMatrices::dJdx ( ) const
inline

◆ dKdx_times_x() [1/2]

Matrix< real > & belfem::fem::TimestepMatrices::dKdx_times_x ( )
inline

◆ dKdx_times_x() [2/2]

const Matrix< real > & belfem::fem::TimestepMatrices::dKdx_times_x ( ) const
inline

◆ dMdx_times_h() [1/2]

Matrix< real > & belfem::fem::TimestepMatrices::dMdx_times_h ( )
inline

◆ dMdx_times_h() [2/2]

const Matrix< real > & belfem::fem::TimestepMatrices::dMdx_times_h ( ) const
inline

◆ dMdx_times_x() [1/2]

Matrix< real > & belfem::fem::TimestepMatrices::dMdx_times_x ( )
inline

◆ dMdx_times_x() [2/2]

const Matrix< real > & belfem::fem::TimestepMatrices::dMdx_times_x ( ) const
inline

◆ f() [1/2]

Vector< real > & belfem::fem::TimestepMatrices::f ( )
inline

◆ f() [2/2]

const Vector< real > & belfem::fem::TimestepMatrices::f ( ) const
inline

◆ flags()

const Bitset< 8 > & belfem::fem::TimestepMatrices::flags ( ) const
inline

Direct access to flags bitset.

◆ has_flag()

bool belfem::fem::TimestepMatrices::has_flag ( const MatrixFlag aFlag) const
inline

Check if a matrix has been populated.

◆ initialize()

void belfem::fem::TimestepMatrices::initialize ( const index_t aNumDofs)

Initialize all matrices to given size.

Parameters
aNumDofsNumber of element DOFs (typically 4-27 for common elements)

◆ J()

const Matrix< real > & belfem::fem::TimestepMatrices::J ( ) const
inline

◆ K() [1/2]

Matrix< real > & belfem::fem::TimestepMatrices::K ( )
inline

◆ K() [2/2]

const Matrix< real > & belfem::fem::TimestepMatrices::K ( ) const
inline

◆ M() [1/2]

Matrix< real > & belfem::fem::TimestepMatrices::M ( )
inline

◆ M() [2/2]

const Matrix< real > & belfem::fem::TimestepMatrices::M ( ) const
inline

◆ reset()

void belfem::fem::TimestepMatrices::reset ( )

◆ reset_flags()

void belfem::fem::TimestepMatrices::reset_flags ( )
inline

Clear all flags ( unused; the IWG sets its flags once in the constructor ).

◆ set_flag()

void belfem::fem::TimestepMatrices::set_flag ( const MatrixFlag aFlag)
inline

Set a flag after populating corresponding matrix.


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