https://mooseframework.inl.gov
Public Member Functions | Protected Attributes | List of all members
ElemInfo Class Reference

Class used for caching additional information for elements such as the volume and centroid. More...

#include <ElemInfo.h>

Public Member Functions

 ElemInfo (const Elem *const elem)
 Constructor using a real element from libmesh. More...
 
 ElemInfo ()
 Default constructor. More...
 
const Elem * elem () const
 
Real volume () const
 
const Point & centroid () const
 
Real coordFactor () const
 
RealcoordFactor ()
 
const std::vector< std::vector< dof_id_type > > & dofIndices () const
 
std::vector< std::vector< dof_id_type > > & dofIndices ()
 
SubdomainID subdomain_id () const
 We return the subdomain ID of the corresponding libmesh element. More...
 

Protected Attributes

const Elem *const _elem
 Reference to the element in libmesh. More...
 
Real _volume
 Volume of the element. More...
 
Point _centroid
 Centroid of the element. More...
 
Real _coord_transform_factor
 Cached coordinate transformation factor. More...
 
std::vector< std::vector< dof_id_type > > _dof_indices
 Cached dof indices mainly for segregated linear FV evaluations with the following structure: _dof_indices[system_number][variable_number] = dof_index Systems with no FV variables will store an empty vector and should not be accessed. More...
 

Detailed Description

Class used for caching additional information for elements such as the volume and centroid.

This also supports the ghost elements used in the finite volume setting (for the time being).

Definition at line 25 of file ElemInfo.h.

Constructor & Destructor Documentation

◆ ElemInfo() [1/2]

ElemInfo::ElemInfo ( const Elem *const  elem)

Constructor using a real element from libmesh.

Definition at line 14 of file ElemInfo.C.

15  : _elem(elem),
16  _volume(_elem->volume()),
17  _centroid(_elem->vertex_average()),
19  _dof_indices(std::vector<std::vector<dof_id_type>>())
20 {
21 }
std::vector< std::vector< dof_id_type > > _dof_indices
Cached dof indices mainly for segregated linear FV evaluations with the following structure: _dof_ind...
Definition: ElemInfo.h:60
const Elem * elem() const
Definition: ElemInfo.h:34
Point _centroid
Centroid of the element.
Definition: ElemInfo.h:51
Real _coord_transform_factor
Cached coordinate transformation factor.
Definition: ElemInfo.h:53
Real _volume
Volume of the element.
Definition: ElemInfo.h:49
const Elem *const _elem
Reference to the element in libmesh.
Definition: ElemInfo.h:47

◆ ElemInfo() [2/2]

ElemInfo::ElemInfo ( )
inline

Default constructor.

Definition at line 32 of file ElemInfo.h.

32 : _elem(nullptr) {}
const Elem *const _elem
Reference to the element in libmesh.
Definition: ElemInfo.h:47

Member Function Documentation

◆ centroid()

const Point& ElemInfo::centroid ( ) const
inline

◆ coordFactor() [1/2]

Real ElemInfo::coordFactor ( ) const
inline

Definition at line 37 of file ElemInfo.h.

37 { return _coord_transform_factor; }
Real _coord_transform_factor
Cached coordinate transformation factor.
Definition: ElemInfo.h:53

◆ coordFactor() [2/2]

Real& ElemInfo::coordFactor ( )
inline

Definition at line 38 of file ElemInfo.h.

38 { return _coord_transform_factor; }
Real _coord_transform_factor
Cached coordinate transformation factor.
Definition: ElemInfo.h:53

◆ dofIndices() [1/2]

const std::vector<std::vector<dof_id_type> >& ElemInfo::dofIndices ( ) const
inline

Definition at line 39 of file ElemInfo.h.

Referenced by LinearFVFluxKernel::addMatrixContribution(), LinearFVFluxKernel::addRightHandSideContribution(), MooseMesh::cacheFVElementalDoFs(), FVInitialConditionTempl< T >::computeElement(), MooseLinearVariableFV< Real >::getElemValue(), MooseLinearVariableFV< Real >::gradSln(), and LinearFVElementalKernel::setCurrentElemInfo().

39 { return _dof_indices; }
std::vector< std::vector< dof_id_type > > _dof_indices
Cached dof indices mainly for segregated linear FV evaluations with the following structure: _dof_ind...
Definition: ElemInfo.h:60

◆ dofIndices() [2/2]

std::vector<std::vector<dof_id_type> >& ElemInfo::dofIndices ( )
inline

Definition at line 40 of file ElemInfo.h.

40 { return _dof_indices; }
std::vector< std::vector< dof_id_type > > _dof_indices
Cached dof indices mainly for segregated linear FV evaluations with the following structure: _dof_ind...
Definition: ElemInfo.h:60

◆ elem()

const Elem* ElemInfo::elem ( ) const
inline

◆ subdomain_id()

SubdomainID ElemInfo::subdomain_id ( ) const
inline

We return the subdomain ID of the corresponding libmesh element.

Definition at line 43 of file ElemInfo.h.

Referenced by LinearFVFluxKernel::addMatrixContribution(), LinearFVFluxKernel::addRightHandSideContribution(), MooseMesh::cacheFVElementalDoFs(), FaceInfo::elemSubdomainID(), MooseLinearVariableFV< Real >::getElemValue(), and FaceInfo::neighborSubdomainID().

43 { return _elem->subdomain_id(); }
const Elem *const _elem
Reference to the element in libmesh.
Definition: ElemInfo.h:47

◆ volume()

Real ElemInfo::volume ( ) const
inline

Definition at line 35 of file ElemInfo.h.

Referenced by FaceInfo::elemVolume(), and FaceInfo::neighborVolume().

35 { return _volume; }
Real _volume
Volume of the element.
Definition: ElemInfo.h:49

Member Data Documentation

◆ _centroid

Point ElemInfo::_centroid
protected

Centroid of the element.

Definition at line 51 of file ElemInfo.h.

Referenced by centroid().

◆ _coord_transform_factor

Real ElemInfo::_coord_transform_factor
protected

Cached coordinate transformation factor.

Definition at line 53 of file ElemInfo.h.

Referenced by coordFactor().

◆ _dof_indices

std::vector<std::vector<dof_id_type> > ElemInfo::_dof_indices
protected

Cached dof indices mainly for segregated linear FV evaluations with the following structure: _dof_indices[system_number][variable_number] = dof_index Systems with no FV variables will store an empty vector and should not be accessed.

This will be checked through multiple asserts in the assembly routines. Furthermore, if the current variable is not active on the subdomain or if it is an FE variable of this element, we return an invalid_dof_index.

Definition at line 60 of file ElemInfo.h.

Referenced by dofIndices().

◆ _elem

const Elem* const ElemInfo::_elem
protected

Reference to the element in libmesh.

Definition at line 47 of file ElemInfo.h.

Referenced by elem(), and subdomain_id().

◆ _volume

Real ElemInfo::_volume
protected

Volume of the element.

Definition at line 49 of file ElemInfo.h.

Referenced by volume().


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