hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
hummingbird::Element Class Referenceabstract

Defines a subset of the domain (an "element"). More...

#include <element.h>

Inheritance diagram for hummingbird::Element:
[legend]

Public Member Functions

 Element (const int material_id, const int source_id)
 Construct a new Element object.
virtual ~Element ()=default
 Destroy the Element object. Virtual because Element is used polymorphically through std::unique_ptr<Element> (see Mesh::elements_).
virtual std::vector< Node > CreateInteriorNodes (const std::vector< Node > &existing_nodes, const GaussLobattoLegendre &gll_quadrature)=0
 Create nodes by mapping the Gauss-Lobatto-Legendre quadrature set from the reference to the real domain.
std::vector< size_t > node_ids () const
 Get node IDs.
int material_id () const
 Get Material ID.
int source_id () const
 Get Source ID.
void SetMaterialID (const int material_id)
 Set the Material ID, e.g. once it has been resolved from a raw gmsh tag to a MaterialBank-assigned ID (see Mesh::ResolveIDs).
void SetSourceID (const int source_id)
 Set the Source ID, e.g. once it has been resolved from a raw gmsh tag to a SourceBank-assigned ID (see Mesh::ResolveIDs).
void SetNewNodeID (const size_t prev_id, const size_t new_id)
 Set the new Node ID.
void SetNodeIDs (std::vector< size_t > node_ids)
 Replace all node IDs at once, e.g. when renumbering. Unlike SetNewNodeID, this does not search by value, so it is safe to use when remapped IDs could otherwise collide with not-yet-remapped IDs.
void SetNodeSourceFluxes (Mesh &mesh, const MaterialBank &material_bank, const SourceBank &source_bank, const QuadratureBase< Ordinate > &angular_quadrature)
 Compute and set the source flux values on this element's nodes using this element's material and source IDs.
virtual arma::Col< double > LocalForcingVector (const GaussLobattoLegendre &gll_quad, const Mesh &mesh, const MaterialBank &material_bank, const Ordinate &ordinate, const size_t ordinate_index)=0
 Construct the local forcing vector for this element at a given ordinate.
virtual arma::Mat< double > LocalStiffnessMatrix (const GaussLobattoLegendre &gll_quad, const MaterialBank &material_bank, const Ordinate &ordinate)=0
 Construct the local stiffness matrix for this element at a given ordinate.
virtual arma::SpMat< double > LocalMassMatrix (const GaussLobattoLegendre &gll_quad, const MaterialBank &material_bank)=0
 Construct the local mass matrix for this element.
virtual unsigned int dimension () const =0
 Get the spatial dimension of this element type (e.g. 1 for a line segment).

Protected Attributes

int material_id_ = -1
 Material ID to access Material Bank. Auto initialized to -1. Value must be set to a positive value (including 0) to map into the MaterialBank.
int source_id_ = 0
 Source ID to access Source Bank. ID of 0 is always NONE, meaning the element has no external source.
std::vector< size_t > node_ids_
 IDs of nodes defining the element.

Detailed Description

Defines a subset of the domain (an "element").

Definition at line 25 of file element.h.

Constructor & Destructor Documentation

◆ Element()

hummingbird::Element::Element ( const int material_id,
const int source_id )

Construct a new Element object.

Parameters
material_idMaterial ID
source_idSource ID

Definition at line 9 of file element.cc.

◆ ~Element()

virtual hummingbird::Element::~Element ( )
virtualdefault

Destroy the Element object. Virtual because Element is used polymorphically through std::unique_ptr<Element> (see Mesh::elements_).

Member Function Documentation

◆ CreateInteriorNodes()

virtual std::vector< Node > hummingbird::Element::CreateInteriorNodes ( const std::vector< Node > & existing_nodes,
const GaussLobattoLegendre & gll_quadrature )
pure virtual

Create nodes by mapping the Gauss-Lobatto-Legendre quadrature set from the reference to the real domain.

Parameters
existing_nodesVector of nodes that already exist in the mesh. Starting ID for new nodes will be equal to the number of nodes that already exist to ensure no duplicates
gll_quadratureGaussLobattoLegendre quadrature set

Implemented in hummingbird::Segment.

◆ dimension()

virtual unsigned int hummingbird::Element::dimension ( ) const
pure virtual

Get the spatial dimension of this element type (e.g. 1 for a line segment).

Returns
unsigned int

Implemented in hummingbird::Segment.

◆ LocalForcingVector()

virtual arma::Col< double > hummingbird::Element::LocalForcingVector ( const GaussLobattoLegendre & gll_quad,
const Mesh & mesh,
const MaterialBank & material_bank,
const Ordinate & ordinate,
const size_t ordinate_index )
pure virtual

Construct the local forcing vector for this element at a given ordinate.

Parameters
gll_quadGaussLobattoLegendre quadrature set
meshMesh
material_bankMaterial bank
ordinateOrdinate (direction)
ordinate_indexIndex of the ordinate in the angular quadrature
Returns
arma::Col<double>

Implemented in hummingbird::Segment.

◆ LocalMassMatrix()

virtual arma::SpMat< double > hummingbird::Element::LocalMassMatrix ( const GaussLobattoLegendre & gll_quad,
const MaterialBank & material_bank )
pure virtual

Construct the local mass matrix for this element.

Parameters
gll_quadGaussLobattoLegendre quadrature set
material_bankMaterial bank
Returns
arma::SpMat<double>

Implemented in hummingbird::Segment.

◆ LocalStiffnessMatrix()

virtual arma::Mat< double > hummingbird::Element::LocalStiffnessMatrix ( const GaussLobattoLegendre & gll_quad,
const MaterialBank & material_bank,
const Ordinate & ordinate )
pure virtual

Construct the local stiffness matrix for this element at a given ordinate.

Parameters
gll_quadGaussLobattoLegendre quadrature set
material_bankMaterial bank
ordinateOrdinate (direction)
Returns
arma::Mat<double>

Implemented in hummingbird::Segment.

◆ material_id()

int hummingbird::Element::material_id ( ) const
inline

Get Material ID.

Returns
int

Definition at line 68 of file element.h.

◆ node_ids()

std::vector< size_t > hummingbird::Element::node_ids ( ) const
inline

Get node IDs.

Returns
std::vector<size_t>

Definition at line 61 of file element.h.

◆ SetMaterialID()

void hummingbird::Element::SetMaterialID ( const int material_id)
inline

Set the Material ID, e.g. once it has been resolved from a raw gmsh tag to a MaterialBank-assigned ID (see Mesh::ResolveIDs).

Parameters
material_idMaterial ID

Definition at line 83 of file element.h.

◆ SetNewNodeID()

void hummingbird::Element::SetNewNodeID ( const size_t prev_id,
const size_t new_id )

Set the new Node ID.

Parameters
prev_idPrevious ID (currently stored in object)
new_idNew ID

Definition at line 12 of file element.cc.

◆ SetNodeIDs()

void hummingbird::Element::SetNodeIDs ( std::vector< size_t > node_ids)
inline

Replace all node IDs at once, e.g. when renumbering. Unlike SetNewNodeID, this does not search by value, so it is safe to use when remapped IDs could otherwise collide with not-yet-remapped IDs.

Parameters
node_idsNew node IDs, in the same order as the existing ones

Definition at line 108 of file element.h.

◆ SetNodeSourceFluxes()

void hummingbird::Element::SetNodeSourceFluxes ( Mesh & mesh,
const MaterialBank & material_bank,
const SourceBank & source_bank,
const QuadratureBase< Ordinate > & angular_quadrature )

Compute and set the source flux values on this element's nodes using this element's material and source IDs.

Parameters
meshMesh
material_bankMaterial bank
source_bankSource bank
angular_quadratureAngular quadrature set

Definition at line 23 of file element.cc.

◆ SetSourceID()

void hummingbird::Element::SetSourceID ( const int source_id)
inline

Set the Source ID, e.g. once it has been resolved from a raw gmsh tag to a SourceBank-assigned ID (see Mesh::ResolveIDs).

Parameters
source_idSource ID

Definition at line 91 of file element.h.

◆ source_id()

int hummingbird::Element::source_id ( ) const
inline

Get Source ID.

Returns
int

Definition at line 75 of file element.h.

Member Data Documentation

◆ material_id_

int hummingbird::Element::material_id_ = -1
protected

Material ID to access Material Bank. Auto initialized to -1. Value must be set to a positive value (including 0) to map into the MaterialBank.

Definition at line 176 of file element.h.

◆ node_ids_

std::vector<size_t> hummingbird::Element::node_ids_
protected

IDs of nodes defining the element.

Definition at line 183 of file element.h.

◆ source_id_

int hummingbird::Element::source_id_ = 0
protected

Source ID to access Source Bank. ID of 0 is always NONE, meaning the element has no external source.

Definition at line 180 of file element.h.


The documentation for this class was generated from the following files:
  • /home/runner/work/hummingbird/hummingbird/include/mesh/element.h
  • /home/runner/work/hummingbird/hummingbird/src/mesh/element.cc