svZeroDSolver
Loading...
Searching...
No Matches
DOFHandler Class Reference

Degree-of-freedom handler. More...

#include <DOFHandler.h>

Public Member Functions

int size () const
 Get the size of the system.
 
int get_num_equations () const
 Get the number of equations.
 
int get_num_variables () const
 Get the number of variables.
 
int register_variable (const std::string &name)
 Register a new variable at the DOFHandler.
 
int get_variable_index (const std::string &name) const
 Get the index of a variable by its name.
 
int register_equation (const std::string &name)
 Register a new equation at the DOFHandler.
 
int get_index (const std::string_view &name) const
 Get the index of a variable.
 

Public Attributes

std::vector< std::string > variables
 Variable names corresponding to the variable indices.
 
std::map< std::string, int > variable_name_map
 Map between variable name and index.
 
std::vector< std::string > equations
 Equation names corresponding to the equation indices.
 

Detailed Description

Degree-of-freedom handler.

This class handles degrees-of-freedom for model variables and equations. It assigns each element with row and column indices which it can use to assemble it's local contributions into the global system.

Member Function Documentation

◆ get_index()

int DOFHandler::get_index ( const std::string_view & name) const

Get the index of a variable.

Parameters
nameName of the variable
Returns
Index of variable with given name

◆ get_num_equations()

int DOFHandler::get_num_equations ( ) const

Get the number of equations.

Returns
int Number of equations

◆ get_num_variables()

int DOFHandler::get_num_variables ( ) const

Get the number of variables.

Returns
int Number of variables

◆ get_variable_index()

int DOFHandler::get_variable_index ( const std::string & name) const

Get the index of a variable by its name.

Parameters
nameName of the variable
Returns
int Name of the variable

◆ register_equation()

int DOFHandler::register_equation ( const std::string & name)

Register a new equation at the DOFHandler.

Parameters
nameName of the equation
Returns
Global index of the equation

◆ register_variable()

int DOFHandler::register_variable ( const std::string & name)

Register a new variable at the DOFHandler.

Parameters
nameName of the variable
Returns
Global index of the variable

◆ size()

int DOFHandler::size ( ) const

Get the size of the system.

Returns
Size of the system

Member Data Documentation

◆ equations

std::vector<std::string> DOFHandler::equations

Equation names corresponding to the equation indices.

◆ variable_name_map

std::map<std::string, int> DOFHandler::variable_name_map

Map between variable name and index.

◆ variables

std::vector<std::string> DOFHandler::variables

Variable names corresponding to the variable indices.


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