https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
 ElemInfo ()
 Default constructor.
 
const Elem * elem () const
 
Real volume () const
 
const Point & centroid () const
 
Real coordFactor () const
 
Real & coordFactor ()
 
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.
 

Protected Attributes

const Elem *const _elem
 Reference to the element in libmesh.
 
Real _volume
 Volume of the element.
 
Point _centroid
 Centroid of the element.
 
Real _coord_transform_factor
 Cached coordinate transformation factor.
 
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.
 

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
const Elem *const _elem
Reference to the element in libmesh.
Definition ElemInfo.h:47
Real _coord_transform_factor
Cached coordinate transformation factor.
Definition ElemInfo.h:53
Real _volume
Volume of the element.
Definition ElemInfo.h:49

◆ ElemInfo() [2/2]

ElemInfo::ElemInfo ( )
inline

Default constructor.

Definition at line 32 of file ElemInfo.h.

32: _elem(nullptr) {}

Member Function Documentation

◆ centroid()

const Point & ElemInfo::centroid ( ) const
inline

◆ coordFactor() [1/2]

Real & ElemInfo::coordFactor ( )
inline

Definition at line 38 of file ElemInfo.h.

◆ coordFactor() [2/2]

Real ElemInfo::coordFactor ( ) const
inline

Definition at line 37 of file ElemInfo.h.

◆ dofIndices() [1/2]

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

Definition at line 40 of file ElemInfo.h.

40{ return _dof_indices; }

◆ dofIndices() [2/2]

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

◆ elem()

const Elem * ElemInfo::elem ( ) const
inline

◆ subdomain_id()

SubdomainID ElemInfo::subdomain_id ( ) const
inline

◆ volume()

Real ElemInfo::volume ( ) const
inline

Definition at line 35 of file ElemInfo.h.

35{ return _volume; }

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

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(), and 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(), and 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: