OOFEM 3.0
Loading...
Searching...
No Matches
oofem::FloatMatrixF< N, M > Class Template Reference

#include <floatmatrixf.h>

Public Member Functions

template<typename... V, class = typename std::enable_if_t<sizeof...(V) == N*M>>
 FloatMatrixF (V... x) noexcept
 FloatMatrixF () noexcept
 FloatMatrixF (const FloatMatrixF< N, M > &mat) noexcept
 Copy constructor.
 FloatMatrixF (const FloatMatrix &mat)
 FloatMatrix conversion constructor.
FloatMatrixFoperator= (const FloatMatrixF< N, M > &mat)
 Assignment operator.
void checkBounds (std::size_t i, std::size_t j) const
std::size_t rows () const
 Returns number of rows of receiver.
std::size_t cols () const
 Returns number of columns of receiver.
const double * data () const
double * data ()
double & operator[] (std::size_t i)
double operator[] (std::size_t i) const
double & operator() (std::size_t i, std::size_t j)
double operator() (std::size_t i, std::size_t j) const
template<std::size_t R, std::size_t C>
FloatMatrixF< R, C > operator() (std::size_t const (&r)[R], std::size_t const (&c)[C]) const
double at (std::size_t i, std::size_t j) const
double & at (std::size_t i, std::size_t j)
template<std::size_t R, std::size_t C>
void assemble (const FloatMatrixF< R, C > &x, int const (&r)[R], int const (&c)[C])
 Assemble x into self.
void setColumn (const FloatArrayF< N > &src, std::size_t c)
void setRow (const FloatArrayF< M > &src, int r)
FloatArrayF< Ncolumn (std::size_t j) const
template<std::size_t C>
 at (j, i)
void printYourself (const std::string &name="FloatMatrixF") const
 Prints matrix to stdout. Useful for debugging.
const double * givePointer () const
double * givePointer ()
contextIOResultType storeYourself (DataStream &stream) const
contextIOResultType restoreYourself (DataStream &stream)
int givePackSize (DataStream &buff) const

Static Public Member Functions

static FloatMatrixF< N, M > fromColumns (FloatArrayF< N > const (&x)[M]) noexcept

Protected Attributes

std::array< double, N *M > values
 Values of matrix stored column wise.

Detailed Description

template<std::size_t N, std::size_t M>
class oofem::FloatMatrixF< N, M >

Implementation of matrix containing floating point numbers.

Author
Mikael Öhman

Definition at line 62 of file floatmatrixf.h.

Constructor & Destructor Documentation

◆ FloatMatrixF() [1/4]

template<std::size_t N, std::size_t M>
template<typename... V, class = typename std::enable_if_t<sizeof...(V) == N*M>>
oofem::FloatMatrixF< N, M >::FloatMatrixF ( V... x)
inlinenoexcept

Constructor (values are specified column-wise)

Note
The syntax {{x,y,z},{...}} can be achieved by nested initializer_list, but

Definition at line 100 of file floatmatrixf.h.

References values.

Referenced by assemble(), FloatMatrixF(), fromColumns(), operator()(), and operator=().

◆ FloatMatrixF() [2/4]

template<std::size_t N, std::size_t M>
oofem::FloatMatrixF< N, M >::FloatMatrixF ( )
inlinenoexcept

Empty ctor, initializes to zero.

Definition at line 104 of file floatmatrixf.h.

References values.

◆ FloatMatrixF() [3/4]

template<std::size_t N, std::size_t M>
oofem::FloatMatrixF< N, M >::FloatMatrixF ( const FloatMatrixF< N, M > & mat)
inlinenoexcept

Copy constructor.

Definition at line 106 of file floatmatrixf.h.

References FloatMatrixF(), and values.

◆ FloatMatrixF() [4/4]

template<std::size_t N, std::size_t M>
oofem::FloatMatrixF< N, M >::FloatMatrixF ( const FloatMatrix & mat)
inline

FloatMatrix conversion constructor.

Definition at line 108 of file floatmatrixf.h.

References oofem::FloatMatrix::cols(), N, oofem::FloatMatrix::rows(), and values.

Member Function Documentation

◆ assemble()

template<std::size_t N, std::size_t M>
template<std::size_t R, std::size_t C>
void oofem::FloatMatrixF< N, M >::assemble ( const FloatMatrixF< R, C > & x,
int const (&) r[R],
int const (&) c[C] )
inline

Assemble x into self.

Definition at line 259 of file floatmatrixf.h.

References FloatMatrixF().

◆ at() [1/3]

template<std::size_t N, std::size_t M>
template<std::size_t C>
oofem::FloatMatrixF< N, M >::at ( j ,
i  )

Extract column from matrix

◆ at() [2/3]

template<std::size_t N, std::size_t M>
double & oofem::FloatMatrixF< N, M >::at ( std::size_t i,
std::size_t j )
inline

Coefficient access function. Returns value of coefficient at given position of the receiver. Implements 1-based indexing.

Parameters
iRow position of coefficient.
jColumn position of coefficient.

Definition at line 237 of file floatmatrixf.h.

References checkBounds().

◆ at() [3/3]

template<std::size_t N, std::size_t M>
double oofem::FloatMatrixF< N, M >::at ( std::size_t i,
std::size_t j ) const
inline

Coefficient access function. Returns value of coefficient at given position of the receiver. Implements 1-based indexing.

Parameters
iRow position of coefficient.
jColumn position of coefficient.

Definition at line 224 of file floatmatrixf.h.

References checkBounds().

Referenced by oofem::FEI2dQuadBiQuad::_evaldNdx(), oofem::Beam3d::B3SSMI_getUnknownsGtoLRotationMatrix(), oofem::ConcreteDPM2::compute3dTangentStiffness(), oofem::LatticeBondPlasticity::computeAMatrix(), oofem::ConcreteDPM2::computeDDCosThetaDDStress(), oofem::ConcreteDPM2::computeDDGDDInv(), oofem::ConcreteDPM2::computeDDGDDStress(), oofem::ConcreteDPM2::computeDDRhoDDStress(), oofem::LatticeBondPlasticity::computeDMMatrix(), oofem::LatticePlasticityDamage::computeDMMatrix(), oofem::ConcreteDPM2::computeFullJacobian(), oofem::ConcreteDPM2::computeJacobian(), oofem::LatticeBondPlasticity::computeJacobian(), oofem::LatticePlasticityDamage::computeJacobian(), oofem::Shell7Base::computeLambdaNMatrix(), oofem::Shell7BaseXFEM::computeLambdaNMatrixDis(), oofem::SimpleVitrificationMaterial::computeTangent(), oofem::BinghamFluidMaterial2::computeTangent3D(), oofem::TrabBone3D::constructAnisoComplTensor(), oofem::TrabBone3D::constructAnisoFabricTensor(), oofem::TrabBone3D::constructAnisoStiffnessTensor(), oofem::TrabBone3D::constructFabricTransformationMatrix(), oofem::TrabBoneEmbed::constructIsoComplTensor(), oofem::LargeStrainMasterMaterial::constructL1L2TransformationMatrices(), oofem::TrabBone3D::constructNormAdjustTensor(), oofem::TrabBone3D::constructStiffnessTransformationMatrix(), oofem::LargeStrainMasterMaterial::constructTransformationMatrix(), oofem::StructuralMaterial::convert_dSdE_2_dPdF_3D(), oofem::Tensor2_3d::eigs(), oofem::FEI2dQuadQuad::evaldNdx(), oofem::FEI2dTrQuad::evaldNdx(), oofem::FEI2dQuadLin::evaldNdxi(), oofem::RankineMat::evaluatePlaneStressStiffMtrx(), oofem::StructuralInterfaceMaterial::give1dStiffnessMatrix_dTdj_Num(), oofem::CebFipSlip90Material::give1dStiffnessMatrix_Eng(), oofem::LayeredCrossSection::give2dBeamStiffMtrx(), oofem::SimpleCrossSection::give2dBeamStiffMtrx(), oofem::LayeredCrossSection::give2dPlateStiffMtrx(), oofem::SimpleCrossSection::give2dPlateStiffMtrx(), oofem::WinklerMaterial::give2dPlateSubSoilStiffMtrx(), oofem::StructuralMaterial::give2DStrainVectorTranformationMtrx(), oofem::FiberedCrossSection::give3dBeamStiffMtrx(), oofem::SimpleCrossSection::give3dBeamStiffMtrx(), oofem::LayeredCrossSection::give3dDegeneratedShellStiffMtrx(), oofem::SimpleCrossSection::give3dDegeneratedShellStiffMtrx(), oofem::M1Material::give3dMaterialStiffnessMatrix(), oofem::MicroplaneMaterial::give3dMaterialStiffnessMatrix(), oofem::LayeredCrossSection::give3dShellStiffMtrx(), oofem::SimpleCrossSection::give3dShellStiffMtrx(), oofem::IntMatBilinearCZFagerstrom::give3dStiffnessMatrix_dTdj(), oofem::IntMatBilinearCZJansson::give3dStiffnessMatrix_dTdj(), oofem::IntMatPhaseField::give3dStiffnessMatrix_Eng(), oofem::SimpleInterfaceMaterial::give3dStiffnessMatrix_Eng(), oofem::Shell7Base::giveAxialMatrix(), oofem::LargeStrainMasterMaterial::giveFirstPKStressVector_3d(), oofem::IntMatBilinearCZFagerstrom::giveFirstPKTraction_3d(), oofem::IntMatBilinearCZFagerstromRate::giveFirstPKTraction_3d(), oofem::MITC4Shell::giveJacobian(), oofem::SimpleCrossSection::giveMembraneRotStiffMtrx(), oofem::AnisotropicDamageMaterial::givePlaneStressStiffMtrx(), oofem::MisesMat::givePlaneStressStiffMtrx(), oofem::StructuralMaterial::givePlaneStressVectorTranformationMtrx(), oofem::DruckerPragerPlasticitySM::giveRegAlgorithmicStiffMatrix(), oofem::StructuralMaterial::giveStrainVectorTranformationMtrx(), oofem::StructuralMaterial::giveStressVectorTranformationMtrx(), oofem::OrthotropicLinearElasticMaterial::giveTensorRotationMatrix(), oofem::CompoDamageMat::giveUnrotated3dMaterialStiffnessMatrix(), oofem::DruckerPragerPlasticitySM::giveVertexAlgorithmicStiffMatrix(), oofem::MITC4Shell::NodalAveragingRecoveryMI_computeNodalValue(), and oofem::Tensor4_3d::Tensor4_3d().

◆ checkBounds()

template<std::size_t N, std::size_t M>
void oofem::FloatMatrixF< N, M >::checkBounds ( std::size_t i,
std::size_t j ) const
inline

Checks size of receiver towards requested bounds.

Parameters
iRequired number of rows.
jRequired number of columns.

Definition at line 136 of file floatmatrixf.h.

References N.

Referenced by at(), at(), operator()(), and operator()().

◆ cols()

template<std::size_t N, std::size_t M>
std::size_t oofem::FloatMatrixF< N, M >::cols ( ) const
inline

Returns number of columns of receiver.

Definition at line 152 of file floatmatrixf.h.

Referenced by oofem::flatten(), and printYourself().

◆ column()

template<std::size_t N, std::size_t M>
FloatArrayF< N > oofem::FloatMatrixF< N, M >::column ( std::size_t j) const
inline

Sets the values of the matrix in specified column. If matrix size is zero, the size is adjusted.

Parameters
srcArray to set at column c.
cColumn to set.

Definition at line 298 of file floatmatrixf.h.

References N.

◆ data() [1/2]

template<std::size_t N, std::size_t M>
double * oofem::FloatMatrixF< N, M >::data ( )
inline

Definition at line 154 of file floatmatrixf.h.

References values.

◆ data() [2/2]

template<std::size_t N, std::size_t M>
const double * oofem::FloatMatrixF< N, M >::data ( ) const
inline

Definition at line 153 of file floatmatrixf.h.

References values.

Referenced by givePointer(), givePointer(), restoreYourself(), and storeYourself().

◆ fromColumns()

template<std::size_t N, std::size_t M>
FloatMatrixF< N, M > oofem::FloatMatrixF< N, M >::fromColumns ( FloatArrayF< N > const (&) x[M])
inlinestaticnoexcept

Definition at line 245 of file floatmatrixf.h.

References FloatMatrixF(), and N.

Referenced by oofem::Shell7BaseXFEM::edgeEvalEnrCovarBaseVectorsAt().

◆ givePackSize()

template<std::size_t N, std::size_t M>
int oofem::FloatMatrixF< N, M >::givePackSize ( DataStream & buff) const
inline

Definition at line 463 of file floatmatrixf.h.

References oofem::DataStream::givePackSizeOfDouble(), and N.

◆ givePointer() [1/2]

template<std::size_t N, std::size_t M>
double * oofem::FloatMatrixF< N, M >::givePointer ( )
inline

Definition at line 445 of file floatmatrixf.h.

References data().

◆ givePointer() [2/2]

template<std::size_t N, std::size_t M>
const double * oofem::FloatMatrixF< N, M >::givePointer ( ) const
inline

Exposes the internal values of the matrix. Should typically not be used outside of matrix classes.

Returns
Pointer to the values of the matrix.

Definition at line 444 of file floatmatrixf.h.

References data().

Referenced by oofem::AbaqusUserMaterial::giveFirstPKStressVector_3d(), and oofem::AbaqusUserMaterial::giveRealStressVector_3d().

◆ operator()() [1/3]

template<std::size_t N, std::size_t M>
template<std::size_t R, std::size_t C>
FloatMatrixF< R, C > oofem::FloatMatrixF< N, M >::operator() ( std::size_t const (&) r[R],
std::size_t const (&) c[C] ) const
inline

Extract sub matrix (can also reorder the matrix). Implements 0-based indexing.

Parameters
rRows to extract.
cColumns to extract.

Definition at line 207 of file floatmatrixf.h.

References FloatMatrixF().

◆ operator()() [2/3]

template<std::size_t N, std::size_t M>
double & oofem::FloatMatrixF< N, M >::operator() ( std::size_t i,
std::size_t j )
inline

Coefficient access function. Returns l-value of coefficient at given position of the receiver. Implements 0-based indexing.

Parameters
iRow position of coefficient.
jColumn position of coefficient.

Definition at line 181 of file floatmatrixf.h.

References checkBounds(), N, and values.

◆ operator()() [3/3]

template<std::size_t N, std::size_t M>
double oofem::FloatMatrixF< N, M >::operator() ( std::size_t i,
std::size_t j ) const
inline

Coefficient access function. Implements 0-based indexing.

Parameters
iRow position of coefficient.
jColumn position of coefficient.

Definition at line 193 of file floatmatrixf.h.

References checkBounds(), N, and values.

◆ operator=()

template<std::size_t N, std::size_t M>
FloatMatrixF & oofem::FloatMatrixF< N, M >::operator= ( const FloatMatrixF< N, M > & mat)
inline

Assignment operator.

Definition at line 125 of file floatmatrixf.h.

References FloatMatrixF(), and values.

◆ operator[]() [1/2]

template<std::size_t N, std::size_t M>
double & oofem::FloatMatrixF< N, M >::operator[] ( std::size_t i)
inline

Direct value access (column major). Implements 0-based indexing.

Parameters
iPosition in data.

Definition at line 162 of file floatmatrixf.h.

References values.

◆ operator[]() [2/2]

template<std::size_t N, std::size_t M>
double oofem::FloatMatrixF< N, M >::operator[] ( std::size_t i) const
inline

Direct value access (column major). Implements 0-based indexing.

Parameters
iPosition in data.

Definition at line 170 of file floatmatrixf.h.

References values.

◆ printYourself()

template<std::size_t N, std::size_t M>
void oofem::FloatMatrixF< N, M >::printYourself ( const std::string & name = "FloatMatrixF< N, M >") const
inline

Prints matrix to stdout. Useful for debugging.

Definition at line 418 of file floatmatrixf.h.

References cols(), N, and rows().

◆ restoreYourself()

template<std::size_t N, std::size_t M>
contextIOResultType oofem::FloatMatrixF< N, M >::restoreYourself ( DataStream & stream)
inline

Definition at line 455 of file floatmatrixf.h.

References oofem::CIO_IOERR, oofem::CIO_OK, data(), N, and oofem::DataStream::read().

◆ rows()

template<std::size_t N, std::size_t M>
std::size_t oofem::FloatMatrixF< N, M >::rows ( ) const
inline

Returns number of rows of receiver.

Definition at line 150 of file floatmatrixf.h.

References N.

Referenced by oofem::Bmatrix_3d(), oofem::flatten(), and printYourself().

◆ setColumn()

template<std::size_t N, std::size_t M>
void oofem::FloatMatrixF< N, M >::setColumn ( const FloatArrayF< N > & src,
std::size_t c )
inline

Sets the values of the matrix in specified column. If matrix size is zero, the size is adjusted.

Parameters
srcArray to set at column c.
cColumn to set.

Definition at line 274 of file floatmatrixf.h.

References N.

Referenced by oofem::XfemStructuralElementInterface::computeGlobalCohesiveTractionVector(), oofem::Shell7Base::computeLambdaNMatrix(), oofem::Shell7Base::edgeEvalCovarBaseVectorsAt(), oofem::PrescribedGenStrainShell7::evalCovarBaseVectorsAt(), oofem::Shell7Base::evalCovarBaseVectorsAt(), oofem::FEI3dHexaLin::evaldNdx(), oofem::FEI3dHexaQuad::evaldNdx(), oofem::FEI3dHexaTriQuad::evaldNdx(), oofem::FEI3dTetQuad::evaldNdx(), oofem::FEI3dWedgeLin::evaldNdx(), oofem::FEI3dWedgeQuad::evaldNdx(), oofem::PrescribedGenStrainShell7::evalInitialCovarBaseVectorsAt(), oofem::Shell7Base::evalInitialCovarBaseVectorsAt(), oofem::StructuralInterfaceMaterial::give2dStiffnessMatrix_dTdj_Num(), oofem::StructuralInterfaceMaterial::give2dStiffnessMatrix_Eng_Num(), oofem::StructuralFE2Material::give3dMaterialStiffnessMatrix(), oofem::AbaqusUserMaterial::give3dMaterialStiffnessMatrix_dPdF(), oofem::MFrontUserMaterial::give3dMaterialStiffnessMatrix_dPdF(), oofem::StructuralPythonMaterial::give3dMaterialStiffnessMatrix_dPdF(), oofem::StructuralInterfaceMaterial::give3dStiffnessMatrix_dTdj_Num(), oofem::StructuralInterfaceMaterial::give3dStiffnessMatrix_Eng_Num(), oofem::StructuralFE2Material::givePlaneStrainStiffMtrx(), oofem::StructuralFE2Material::givePlaneStressStiffMtrx(), and oofem::FEInterpolation3d::surfaceGiveJacobianMatrixAt().

◆ setRow()

template<std::size_t N, std::size_t M>
void oofem::FloatMatrixF< N, M >::setRow ( const FloatArrayF< M > & src,
int r )
inline

Sets the values of the matrix in specified row.

Parameters
srcArray to set at row c.
rColumn to set.

Definition at line 286 of file floatmatrixf.h.

Referenced by oofem::FEContactSurface::computeContactPointLocalCoordinates_3d().

◆ storeYourself()

template<std::size_t N, std::size_t M>
contextIOResultType oofem::FloatMatrixF< N, M >::storeYourself ( DataStream & stream) const
inline

Definition at line 447 of file floatmatrixf.h.

References oofem::CIO_IOERR, oofem::CIO_OK, data(), N, and oofem::DataStream::write().

Member Data Documentation

◆ values

template<std::size_t N, std::size_t M>
std::array< double, N*M > oofem::FloatMatrixF< N, M >::values
protected

Values of matrix stored column wise.

Definition at line 93 of file floatmatrixf.h.

Referenced by data(), data(), FloatMatrixF(), FloatMatrixF(), FloatMatrixF(), FloatMatrixF(), operator()(), operator()(), operator=(), operator[](), and operator[]().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011