PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
pism::fem::Element Class Reference

The mapping from global to local degrees of freedom. More...

#include <Element.hh>

+ Inheritance diagram for pism::fem::Element:

Public Member Functions

 ~Element ()=default
 
int n_chi () const
 
const Germchi (unsigned int q, unsigned int k) const
 
int n_pts () const
 Number of quadrature points. More...
 
double weight (unsigned int q) const
 Weight of the quadrature point q More...
 
template<typename T >
void evaluate (const T *x, T *result) const
 Given nodal values, compute the values at quadrature points. More...
 

Protected Types

typedef Germ(* ShapeFunction) (unsigned int k, const QuadPoint &p)
 

Protected Member Functions

 Element (const Grid &grid, int Nq, int n_chi, int block_size)
 
 Element (const DMDALocalInfo &grid_info, int Nq, int n_chi, int block_size)
 
void add_contribution (const double *K, Mat J) const
 Add Jacobian contributions. More...
 
void mark_row_invalid (unsigned int k)
 Mark that the row corresponding to local degree of freedom k should not be updated when inserting into the global residual or Jacobian arrays. More...
 
void mark_col_invalid (unsigned int k)
 Mark that the column corresponding to local degree of freedom k should not be updated when inserting into the global Jacobian arrays. More...
 
void initialize (const double J[3][3], ShapeFunction f, unsigned int n_chi, const std::vector< QuadPoint > &points, const std::vector< double > &W)
 Initialize shape function values and quadrature weights of a 2D physical element. More...
 

Protected Attributes

DMDALocalInfo m_grid
 
std::vector< int > m_i_offset
 
std::vector< int > m_j_offset
 
const unsigned int m_n_chi
 
int m_i
 Indices of the current element. More...
 
int m_j
 
const unsigned int m_Nq
 Number of quadrature points. More...
 
const int m_block_size
 
std::vector< Germm_germs
 
std::vector< MatStencil > m_row
 Stencils for updating entries of the Jacobian matrix. More...
 
std::vector< MatStencil > m_col
 
std::vector< double > m_weights
 Quadrature weights for a particular physical element. More...
 

Static Protected Attributes

static const int m_invalid_dof = -1073741824
 

Private Member Functions

 Element ()
 

Detailed Description

The mapping from global to local degrees of freedom.

Computations of residual and Jacobian entries in the finite element method are done by iterating of the elements and adding the various contributions from each element. To do this, degrees of freedom from the global vector of unknowns must be remapped to element-local degrees of freedom for the purposes of local computation, (and the results added back again to the global residual and Jacobian arrays).

An Element mediates the transfer between element-local and global degrees of freedom and provides values of shape functions at quadrature points. In this implementation, the global degrees of freedom are either scalars (double's) or vectors (Vector2's), one per node in the Grid, and the local degrees of freedom on the element are q1::n_chi or p1::n_chi (i.e. four or three) scalars or vectors, one for each vertex of the element.

In addition to this, the Element transfers locally computed contributions to residual and Jacobian matrices to their global counterparts.

Definition at line 61 of file Element.hh.


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