NuTo
Numerics Tool
Public Member Functions | List of all members
NuTo::MatrixAssembler Class Reference

Assembles an internal NuTo::DofMatrixSparse<double> from arbitrary contributions and provides access to it. More...

#include <Assembler.h>

Public Member Functions

 MatrixAssembler (DofContainer< int > sizes={})
 ctor More...
 
void Resize (DofContainer< int > sizes)
 resizes the internal DofMatrixSparse More...
 
void Add (const DofMatrix< double > &m, const DofVector< int > &numbering, std::vector< DofType > dofTypes={})
 adds an arbitrary contribution m to the internal DofMatrixSparse More...
 
void SetZero ()
 sets the entries of the internal DofMatrixSparse to zero but keeps the nonzeros More...
 
void Finish ()
 transforms the internal triplet lists into an DofMatrixSparse and drops the triplet lists More...
 
const DofMatrixSparse< double > & Get () const
 

Detailed Description

Assembles an internal NuTo::DofMatrixSparse<double> from arbitrary contributions and provides access to it.

Remarks
an interal flag distinguishes from the first assembly (into triplet lists) and any other assemblies (directly into the existsing nonzero entries)

Constructor & Destructor Documentation

NuTo::MatrixAssembler::MatrixAssembler ( DofContainer< int >  sizes = {})

ctor

Parameters
sizesnumber of global dofs for each dof type

Member Function Documentation

void NuTo::MatrixAssembler::Add ( const DofMatrix< double > &  m,
const DofVector< int > &  numbering,
std::vector< DofType dofTypes = {} 
)

adds an arbitrary contribution m to the internal DofMatrixSparse

Parameters
mcontribution, e.g. a local element/cell matrix
numberingmapping from local (0...numbering.size()) to global (0...sizes)
dofTypesspecific dof types to assemble - an empty value will assemble all available dof types from the numbering
void NuTo::MatrixAssembler::Finish ( )

transforms the internal triplet lists into an DofMatrixSparse and drops the triplet lists

Remarks
calling this method indicates that the position of the nonzeros are now fixed
const NuTo::DofMatrixSparse< double > & NuTo::MatrixAssembler::Get ( ) const
Returns
current state of the internal DofMatrixSparse
void NuTo::MatrixAssembler::Resize ( DofContainer< int >  sizes)

resizes the internal DofMatrixSparse

Parameters
sizesnumber of global dofs for each dof type
void NuTo::MatrixAssembler::SetZero ( )

sets the entries of the internal DofMatrixSparse to zero but keeps the nonzeros


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