MoCSI API Reference
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
GenericElement< T > Class Template Referenceabstract

Cell/Element abstract base class for the finite element method. All 1D/2D/3D elements should inherit from this class. More...

#include <GenericElement.h>

Inheritance diagram for GenericElement< T >:
Inheritance graph
Collaboration diagram for GenericElement< T >:
Collaboration graph

Public Member Functions

virtual void writeMatrixVectorBlock ()=0
 
virtual void writeBoundaryCondition ()=0
 
void setBoundaryConditions (std::map< std::string_view, std::unique_ptr< GenericBoundaryCondition< T > > > &boundary_cond)
 Sets the map of boundary condition objects.
 
std::map< std::string_view, std::unique_ptr< GenericBoundaryCondition< T > > > & getBoundaryCondition ()
 
void getReferenceToElements (GenericMatrix< T > &capacitance_matrix, GenericMatrix< T > &stiffness_matrix, std::valarray< T > &forcing_vector)
 Sets up a reference_wrapper vector to the elements within the matrix object. This adds a bit of pre-calculation overhead, but always allows const time element access even for matrix object that don't normally have const time random access. This of course assumes a static grid.
 
bool isBoundary ()
 
 GenericElement (bool is_boundary_point, std::map< std::string_view, std::vector< int > > all_boundary_points, std::vector< int > nodal_values, SimulationClassBase< T > *sim, int num_cell, ElementProperties< T > properties)
 Constructor for a GenericElement object. Sets all parameters that are known at creation.
 
virtual ~GenericElement ()=default
 

Protected Attributes

bool m_is_boundary
 
std::map< std::string_view, std::vector< int > > m_boundary_points
 
std::vector< intm_nodal_values
 
std::vector< std::reference_wrapper< T > > m_capacitance_matrix_elements {}
 
std::vector< std::reference_wrapper< T > > m_stiffness_matrix_elements {}
 
std::vector< std::reference_wrapper< T > > m_forcing_vector_elements {}
 
SimulationClassBase< T > * m_sim {}
 
int m_element_nr {-1}
 
std::map< std::string_view, std::unique_ptr< GenericBoundaryCondition< T > > > m_boundary_conditions {}
 
ElementProperties< Tm_properties {}
 

Detailed Description

template<typename T>
class GenericElement< T >

Cell/Element abstract base class for the finite element method. All 1D/2D/3D elements should inherit from this class.

Constructor & Destructor Documentation

◆ GenericElement()

template<typename T >
GenericElement< T >::GenericElement ( bool  is_boundary_point,
std::map< std::string_view, std::vector< int > >  all_boundary_points,
std::vector< int nodal_values,
SimulationClassBase< T > *  sim,
int  num_cell,
ElementProperties< T properties 
)

Constructor for a GenericElement object. Sets all parameters that are known at creation.

Parameters
is_boundary_pointFlag whether this element has boundary nodes or not.
all_boundary_pointsA map containg the types of boundary conditions and all the nodes belonging to that type (to allow for multiple boundary conditions in one element).
nodal_valuesThe node numbers of all nodes within the element. Needed to sort them into the correct position within the matrix.
simThe pointer to the sim class.
num_cellThe number of the cell.

◆ ~GenericElement()

template<typename T >
virtual GenericElement< T >::~GenericElement ( )
virtualdefault

Member Function Documentation

◆ getBoundaryCondition()

template<typename T >
std::map< std::string_view, std::unique_ptr< GenericBoundaryCondition< T > > > & GenericElement< T >::getBoundaryCondition ( )
inline

◆ getReferenceToElements()

template<typename T >
void GenericElement< T >::getReferenceToElements ( GenericMatrix< T > &  capacitance_matrix,
GenericMatrix< T > &  stiffness_matrix,
std::valarray< T > &  forcing_vector 
)

Sets up a reference_wrapper vector to the elements within the matrix object. This adds a bit of pre-calculation overhead, but always allows const time element access even for matrix object that don't normally have const time random access. This of course assumes a static grid.

◆ isBoundary()

template<typename T >
bool GenericElement< T >::isBoundary ( )
inline

◆ setBoundaryConditions()

template<typename T >
void GenericElement< T >::setBoundaryConditions ( std::map< std::string_view, std::unique_ptr< GenericBoundaryCondition< T > > > &  boundary_cond)

Sets the map of boundary condition objects.

Parameters
boundary_condMap of unique_ptrs to the boundary condition objects of this cell, if it is a boundary cell.

◆ writeBoundaryCondition()

template<typename T >
virtual void GenericElement< T >::writeBoundaryCondition ( )
pure virtual

Implemented in OneDimLinearElement< T >.

◆ writeMatrixVectorBlock()

template<typename T >
virtual void GenericElement< T >::writeMatrixVectorBlock ( )
pure virtual

Implemented in OneDimLinearElement< T >.

Member Data Documentation

◆ m_boundary_conditions

template<typename T >
std::map<std::string_view, std::unique_ptr<GenericBoundaryCondition<T> > > GenericElement< T >::m_boundary_conditions {}
protected

◆ m_boundary_points

template<typename T >
std::map<std::string_view, std::vector<int> > GenericElement< T >::m_boundary_points
protected

◆ m_capacitance_matrix_elements

template<typename T >
std::vector<std::reference_wrapper<T> > GenericElement< T >::m_capacitance_matrix_elements {}
protected

◆ m_element_nr

template<typename T >
int GenericElement< T >::m_element_nr {-1}
protected

◆ m_forcing_vector_elements

template<typename T >
std::vector<std::reference_wrapper<T> > GenericElement< T >::m_forcing_vector_elements {}
protected

◆ m_is_boundary

template<typename T >
bool GenericElement< T >::m_is_boundary
protected

◆ m_nodal_values

template<typename T >
std::vector<int> GenericElement< T >::m_nodal_values
protected

◆ m_properties

template<typename T >
ElementProperties<T> GenericElement< T >::m_properties {}
protected

◆ m_sim

template<typename T >
SimulationClassBase<T>* GenericElement< T >::m_sim {}
protected

◆ m_stiffness_matrix_elements

template<typename T >
std::vector<std::reference_wrapper<T> > GenericElement< T >::m_stiffness_matrix_elements {}
protected

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