MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
MAST::FEMOperatorMatrix Class Reference

Detailed Description

Definition at line 35 of file fem_operator_matrix.h.

#include <fem_operator_matrix.h>

Public Member Functions

 FEMOperatorMatrix ()
 
virtual ~FEMOperatorMatrix ()
 
void clear ()
 clears the data structures More...
 
template<typename T >
void left_multiply (T &r, const T &m) const
 [R] = [M] * [this] More...
 
template<typename T >
void left_multiply_transpose (T &r, const T &m) const
 [R] = [M] * [this]^T More...
 
unsigned int m () const
 
unsigned int n () const
 
void print (std::ostream &o)
 
void reinit (unsigned int n_interpolated_vars, unsigned int n_discrete_vars, unsigned int n_discrete_dofs_per_var)
 this initializes the operator for number of rows and variables, assuming that all variables has the same number of dofs. More...
 
void reinit (unsigned int n_interpolated_vars, const RealVectorX &shape_func)
 this initializes all variables to use the same interpolation function. More...
 
template<typename T >
void right_multiply (T &r, const T &m) const
 [R] = [this] * [M] More...
 
template<typename T >
void right_multiply_transpose (T &r, const T &m) const
 [R] = [this]^T * [M] More...
 
template<typename T >
void right_multiply_transpose (T &r, const MAST::FEMOperatorMatrix &m) const
 [R] = [this]^T * [M] More...
 
void set_shape_function (unsigned int interpolated_var, unsigned int discrete_var, const RealVectorX &shape_func)
 sets the shape function values for the block corresponding to interpolated_var and discrete_var. More...
 
template<typename T >
void vector_mult (T &res, const T &v) const
 res = [this] * v More...
 
template<typename T >
void vector_mult_transpose (T &res, const T &v) const
 res = v^T * [this] More...
 

Protected Attributes

unsigned int _n_discrete_vars
 number of discrete variables in the system More...
 
unsigned int _n_dofs_per_var
 number of dofs for each variable More...
 
unsigned int _n_interpolated_vars
 number of rows of the operator More...
 
std::vector< RealVectorX * > _var_shape_functions
 stores the shape function values that defines the coupling of i_th interpolated var and j_th discrete var. More...
 

Constructor & Destructor Documentation

◆ FEMOperatorMatrix()

MAST::FEMOperatorMatrix::FEMOperatorMatrix ( )

Definition at line 24 of file fem_operator_matrix.cpp.

◆ ~FEMOperatorMatrix()

MAST::FEMOperatorMatrix::~FEMOperatorMatrix ( )
virtual

Definition at line 33 of file fem_operator_matrix.cpp.

Member Function Documentation

◆ clear()

void MAST::FEMOperatorMatrix::clear ( )
inline

clears the data structures

Definition at line 187 of file fem_operator_matrix.h.

◆ left_multiply()

template<typename T >
void MAST::FEMOperatorMatrix::left_multiply ( T &  r,
const T &  m 
) const
inline

[R] = [M] * [this]

Definition at line 415 of file fem_operator_matrix.h.

◆ left_multiply_transpose()

template<typename T >
void MAST::FEMOperatorMatrix::left_multiply_transpose ( T &  r,
const T &  m 
) const
inline

[R] = [M] * [this]^T

Definition at line 442 of file fem_operator_matrix.h.

◆ m()

unsigned int MAST::FEMOperatorMatrix::m ( ) const
inline

Definition at line 50 of file fem_operator_matrix.h.

◆ n()

unsigned int MAST::FEMOperatorMatrix::n ( ) const
inline

Definition at line 52 of file fem_operator_matrix.h.

◆ print()

void MAST::FEMOperatorMatrix::print ( std::ostream &  o)
inline

Definition at line 166 of file fem_operator_matrix.h.

◆ reinit() [1/2]

void MAST::FEMOperatorMatrix::reinit ( unsigned int  n_interpolated_vars,
unsigned int  n_discrete_vars,
unsigned int  n_discrete_dofs_per_var 
)
inline

this initializes the operator for number of rows and variables, assuming that all variables has the same number of dofs.

This is typically the case for structural strain operator matrices. Note that when this method is used the user must set the matrix entries by calling set_shape_functions

Definition at line 210 of file fem_operator_matrix.h.

◆ reinit() [2/2]

void MAST::FEMOperatorMatrix::reinit ( unsigned int  n_interpolated_vars,
const RealVectorX shape_func 
)
inline

this initializes all variables to use the same interpolation function.

It is assumed that the number of discrete vars is same as the number of interpolated vars. This is typically the case for fluid elements and for structural element inertial matrix calculations

Definition at line 256 of file fem_operator_matrix.h.

◆ right_multiply()

template<typename T >
void MAST::FEMOperatorMatrix::right_multiply ( T &  r,
const T &  m 
) const
inline

[R] = [this] * [M]

Definition at line 327 of file fem_operator_matrix.h.

◆ right_multiply_transpose() [1/2]

template<typename T >
void MAST::FEMOperatorMatrix::right_multiply_transpose ( T &  r,
const T &  m 
) const
inline

[R] = [this]^T * [M]

Definition at line 355 of file fem_operator_matrix.h.

◆ right_multiply_transpose() [2/2]

template<typename T >
void MAST::FEMOperatorMatrix::right_multiply_transpose ( T &  r,
const MAST::FEMOperatorMatrix m 
) const
inline

[R] = [this]^T * [M]

Definition at line 382 of file fem_operator_matrix.h.

◆ set_shape_function()

void MAST::FEMOperatorMatrix::set_shape_function ( unsigned int  interpolated_var,
unsigned int  discrete_var,
const RealVectorX shape_func 
)
inline

sets the shape function values for the block corresponding to interpolated_var and discrete_var.

This means that the row interpolated_var, the value in columns discrete_vars*n_discrete_dofs_per_var - (discrete_vars+1)*n_discrete_dofs_per_var-1) will be set equal to shape_func .

Definition at line 228 of file fem_operator_matrix.h.

◆ vector_mult()

template<typename T >
void MAST::FEMOperatorMatrix::vector_mult ( T &  res,
const T &  v 
) const
inline

res = [this] * v

Definition at line 280 of file fem_operator_matrix.h.

◆ vector_mult_transpose()

template<typename T >
void MAST::FEMOperatorMatrix::vector_mult_transpose ( T &  res,
const T &  v 
) const
inline

res = v^T * [this]

Definition at line 303 of file fem_operator_matrix.h.

Member Data Documentation

◆ _n_discrete_vars

unsigned int MAST::FEMOperatorMatrix::_n_discrete_vars
protected

number of discrete variables in the system

Definition at line 145 of file fem_operator_matrix.h.

◆ _n_dofs_per_var

unsigned int MAST::FEMOperatorMatrix::_n_dofs_per_var
protected

number of dofs for each variable

Definition at line 150 of file fem_operator_matrix.h.

◆ _n_interpolated_vars

unsigned int MAST::FEMOperatorMatrix::_n_interpolated_vars
protected

number of rows of the operator

Definition at line 140 of file fem_operator_matrix.h.

◆ _var_shape_functions

std::vector<RealVectorX*> MAST::FEMOperatorMatrix::_var_shape_functions
protected

stores the shape function values that defines the coupling of i_th interpolated var and j_th discrete var.

Stored in column major format. nullptr, if values are zero, otherwise the value is set in the vector.

Definition at line 158 of file fem_operator_matrix.h.


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