GooseFEM 1.4.1.dev2+g78f16df
Loading...
Searching...
No Matches
GooseFEM::Vector Class Reference

Class to switch between storage types. More...

#include <GooseFEM/Vector.h>

Inheritance diagram for GooseFEM::Vector:
GooseFEM::VectorPartitioned GooseFEM::VectorPartitionedTyings

Public Member Functions

template<class S , class T >
 Vector (const S &conn, const T &dofs)
 Constructor.
 
size_t nelem () const
 
size_t nne () const
 
size_t nnode () const
 
size_t ndim () const
 
size_t ndof () const
 
const array_type::tensor< size_t, 2 > & conn () const
 
const array_type::tensor< size_t, 2 > & dofs () const
 
template<class T >
T Copy (const T &nodevec_src, const T &nodevec_dest) const
 Copy "nodevec" to another "nodevec".
 
template<class T >
void copy (const T &nodevec_src, T &nodevec_dest) const
 Copy "nodevec" to another "nodevec".
 
template<class T >
array_type::tensor< double, 1 > AsDofs (const T &arg) const
 Convert "nodevec" or "elemvec" to "dofval" (overwrite entries that occur more than once).
 
template<class T , class R >
void asDofs (const T &arg, R &ret) const
 Convert "nodevec" or "elemvec" to "dofval" (overwrite entries that occur more than once).
 
template<class T >
array_type::tensor< double, 2 > AsNode (const T &arg) const
 Convert "dofval" or "elemvec" to "nodevec" (overwrite entries that occur more than once).
 
template<class T , class R >
void asNode (const T &arg, R &ret) const
 Convert "dofval" or "elemvec" to "nodevec" (overwrite entries that occur more than once).
 
template<class T >
array_type::tensor< double, 3 > AsElement (const T &arg) const
 Convert "dofval" or "nodevec" to "elemvec" (overwrite entries that occur more than once).
 
template<class T , class R >
void asElement (const T &arg, R &ret) const
 Convert "dofval" or "nodevec" to "elemvec" (overwrite entries that occur more than once).
 
template<class T >
array_type::tensor< double, 1 > AssembleDofs (const T &arg) const
 Assemble "nodevec" or "elemvec" to "dofval" (adds entries that occur more that once).
 
template<class T , class R >
void assembleDofs (const T &arg, R &ret) const
 Assemble "nodevec" or "elemvec" to "dofval" (adds entries that occur more that once).
 
template<class T >
array_type::tensor< double, 2 > AssembleNode (const T &arg) const
 Assemble "elemvec" to "nodevec" (adds entries that occur more that once.
 
template<class T , class R >
void assembleNode (const T &arg, R &ret) const
 Assemble "elemvec" to "nodevec" (adds entries that occur more that once.
 
std::array< size_t, 1 > shape_dofval () const
 Shape of "dofval".
 
std::array< size_t, 2 > shape_nodevec () const
 Shape of "nodevec".
 
std::array< size_t, 3 > shape_elemvec () const
 Shape of "elemvec".
 
std::array< size_t, 3 > shape_elemmat () const
 Shape of "elemmat".
 
array_type::tensor< double, 1 > allocate_dofval () const
 Allocated "dofval".
 
array_type::tensor< double, 1 > allocate_dofval (double val) const
 Allocated and initialised "dofval".
 
array_type::tensor< double, 2 > allocate_nodevec () const
 Allocated "nodevec".
 
array_type::tensor< double, 2 > allocate_nodevec (double val) const
 Allocated and initialised "nodevec".
 
array_type::tensor< double, 3 > allocate_elemvec () const
 Allocated "elemvec".
 
array_type::tensor< double, 3 > allocate_elemvec (double val) const
 Allocated and initialised "elemvec".
 
array_type::tensor< double, 3 > allocate_elemmat () const
 Allocated "elemmat".
 
array_type::tensor< double, 3 > allocate_elemmat (double val) const
 Allocated and initialised "elemmat".
 

Protected Attributes

array_type::tensor< size_t, 2 > m_conn
 See conn()
 
array_type::tensor< size_t, 2 > m_dofs
 See dofs()
 
size_t m_nelem
 See nelem.
 
size_t m_nne
 See nne.
 
size_t m_nnode
 See nnode.
 
size_t m_ndim
 See ndim.
 
size_t m_ndof
 See ndof.
 

Detailed Description

Class to switch between storage types.

In particular:

  • "dofval": DOF values [ndof].
  • "nodevec": nodal vectors [nnode, ndim].
  • "elemvec": nodal vectors stored per element [nelem, nne, ndim].

Definition at line 23 of file Vector.h.

Constructor & Destructor Documentation

◆ Vector()

template<class S , class T >
GooseFEM::Vector::Vector ( const S & conn,
const T & dofs )
inline

Constructor.

Parameters
connconnectivity [nelem, nne].
dofsDOFs per node [nnode, ndim].

Definition at line 34 of file Vector.h.

Member Function Documentation

◆ allocate_dofval() [1/2]

array_type::tensor< double, 1 > GooseFEM::Vector::allocate_dofval ( ) const
inline

Allocated "dofval".

Returns
[ndof]

Definition at line 310 of file Vector.h.

◆ allocate_dofval() [2/2]

array_type::tensor< double, 1 > GooseFEM::Vector::allocate_dofval ( double val) const
inline

Allocated and initialised "dofval".

Parameters
valvalue to which to initialise.
Returns
[ndof]

Definition at line 322 of file Vector.h.

◆ allocate_elemmat() [1/2]

array_type::tensor< double, 3 > GooseFEM::Vector::allocate_elemmat ( ) const
inline

Allocated "elemmat".

Returns
[nelem, nne * ndim, nne * ndim]

Definition at line 382 of file Vector.h.

◆ allocate_elemmat() [2/2]

array_type::tensor< double, 3 > GooseFEM::Vector::allocate_elemmat ( double val) const
inline

Allocated and initialised "elemmat".

Parameters
valvalue to which to initialise.
Returns
[nelem, nne * ndim, nne * ndim]

Definition at line 394 of file Vector.h.

◆ allocate_elemvec() [1/2]

array_type::tensor< double, 3 > GooseFEM::Vector::allocate_elemvec ( ) const
inline

Allocated "elemvec".

Returns
[nelem, nne, ndim]

Definition at line 358 of file Vector.h.

◆ allocate_elemvec() [2/2]

array_type::tensor< double, 3 > GooseFEM::Vector::allocate_elemvec ( double val) const
inline

Allocated and initialised "elemvec".

Parameters
valvalue to which to initialise.
Returns
[nelem, nne, ndim]

Definition at line 370 of file Vector.h.

◆ allocate_nodevec() [1/2]

array_type::tensor< double, 2 > GooseFEM::Vector::allocate_nodevec ( ) const
inline

Allocated "nodevec".

Returns
[nnode, ndim]

Definition at line 334 of file Vector.h.

◆ allocate_nodevec() [2/2]

array_type::tensor< double, 2 > GooseFEM::Vector::allocate_nodevec ( double val) const
inline

Allocated and initialised "nodevec".

Parameters
valvalue to which to initialise.
Returns
[nnode, ndim]

Definition at line 346 of file Vector.h.

◆ AsDofs()

template<class T >
array_type::tensor< double, 1 > GooseFEM::Vector::AsDofs ( const T & arg) const
inline

Convert "nodevec" or "elemvec" to "dofval" (overwrite entries that occur more than once).

Parameters
argnodevec [nnode, ndim] or elemvec [nelem, nne, ndim]
Returns
dofval [ndof]

Definition at line 142 of file Vector.h.

◆ asDofs()

template<class T , class R >
void GooseFEM::Vector::asDofs ( const T & arg,
R & ret ) const
inline

Convert "nodevec" or "elemvec" to "dofval" (overwrite entries that occur more than once).

Parameters
argnodevec [nnode, ndim] or elemvec [nelem, nne, ndim]
retdofval (output) [ndof]

Definition at line 156 of file Vector.h.

◆ AsElement()

template<class T >
array_type::tensor< double, 3 > GooseFEM::Vector::AsElement ( const T & arg) const
inline

Convert "dofval" or "nodevec" to "elemvec" (overwrite entries that occur more than once).

Parameters
argdofval [ndof] or nodevec [nnode, ndim].
Returns
elemvec output [nelem, nne, ndim].

Definition at line 194 of file Vector.h.

◆ asElement()

template<class T , class R >
void GooseFEM::Vector::asElement ( const T & arg,
R & ret ) const
inline

Convert "dofval" or "nodevec" to "elemvec" (overwrite entries that occur more than once).

Parameters
argdofval [ndof] or nodevec [nnode, ndim].
retelemvec, output [nelem, nne, ndim].

Definition at line 208 of file Vector.h.

◆ AsNode()

template<class T >
array_type::tensor< double, 2 > GooseFEM::Vector::AsNode ( const T & arg) const
inline

Convert "dofval" or "elemvec" to "nodevec" (overwrite entries that occur more than once).

Parameters
argdofval [ndof] or elemvec [nelem, nne, ndim]
Returns
nodevec output [nnode, ndim]

Definition at line 168 of file Vector.h.

◆ asNode()

template<class T , class R >
void GooseFEM::Vector::asNode ( const T & arg,
R & ret ) const
inline

Convert "dofval" or "elemvec" to "nodevec" (overwrite entries that occur more than once).

Parameters
argdofval [ndof] or elemvec [nelem, nne, ndim]
retnodevec, output [nnode, ndim]

Definition at line 182 of file Vector.h.

◆ AssembleDofs()

template<class T >
array_type::tensor< double, 1 > GooseFEM::Vector::AssembleDofs ( const T & arg) const
inline

Assemble "nodevec" or "elemvec" to "dofval" (adds entries that occur more that once).

Parameters
argnodevec [nnode, ndim] or elemvec [nelem, nne, ndim]
Returns
dofval output [ndof]

Definition at line 220 of file Vector.h.

◆ assembleDofs()

template<class T , class R >
void GooseFEM::Vector::assembleDofs ( const T & arg,
R & ret ) const
inline

Assemble "nodevec" or "elemvec" to "dofval" (adds entries that occur more that once).

Parameters
argnodevec [nnode, ndim] or elemvec [nelem, nne, ndim]
retdofval, output [ndof]

Definition at line 234 of file Vector.h.

◆ AssembleNode()

template<class T >
array_type::tensor< double, 2 > GooseFEM::Vector::AssembleNode ( const T & arg) const
inline

Assemble "elemvec" to "nodevec" (adds entries that occur more that once.

Parameters
argelemvec [nelem, nne, ndim]
Returns
nodevec output [nnode, ndim]

Definition at line 246 of file Vector.h.

◆ assembleNode()

template<class T , class R >
void GooseFEM::Vector::assembleNode ( const T & arg,
R & ret ) const
inline

Assemble "elemvec" to "nodevec" (adds entries that occur more that once.

Parameters
argelemvec [nelem, nne, ndim]
retnodevec, output [nnode, ndim]

Definition at line 260 of file Vector.h.

◆ conn()

const array_type::tensor< size_t, 2 > & GooseFEM::Vector::conn ( ) const
inline
Returns
Connectivity (nodes per element) [nelem, nne].

Definition at line 92 of file Vector.h.

◆ Copy()

template<class T >
T GooseFEM::Vector::Copy ( const T & nodevec_src,
const T & nodevec_dest ) const
inline

Copy "nodevec" to another "nodevec".

Parameters
nodevec_srcinput [nnode, ndim]
nodevec_destinput [nnode, ndim]
Returns
nodevec output [nnode, ndim]

Definition at line 113 of file Vector.h.

◆ copy()

template<class T >
void GooseFEM::Vector::copy ( const T & nodevec_src,
T & nodevec_dest ) const
inline

Copy "nodevec" to another "nodevec".

Parameters
nodevec_srcinput [nnode, ndim]
nodevec_destoutput [nnode, ndim]

Definition at line 127 of file Vector.h.

◆ dofs()

const array_type::tensor< size_t, 2 > & GooseFEM::Vector::dofs ( ) const
inline
Returns
DOFs per node [nnode, ndim]

Definition at line 100 of file Vector.h.

◆ ndim()

size_t GooseFEM::Vector::ndim ( ) const
inline
Returns
Number of dimensions.

Definition at line 76 of file Vector.h.

◆ ndof()

size_t GooseFEM::Vector::ndof ( ) const
inline
Returns
Number of DOFs.

Definition at line 84 of file Vector.h.

◆ nelem()

size_t GooseFEM::Vector::nelem ( ) const
inline
Returns
Number of elements.

Definition at line 52 of file Vector.h.

◆ nne()

size_t GooseFEM::Vector::nne ( ) const
inline
Returns
Number of nodes per element.

Definition at line 60 of file Vector.h.

◆ nnode()

size_t GooseFEM::Vector::nnode ( ) const
inline
Returns
Number of nodes.

Definition at line 68 of file Vector.h.

◆ shape_dofval()

std::array< size_t, 1 > GooseFEM::Vector::shape_dofval ( ) const
inline

Shape of "dofval".

Returns
[ndof]

Definition at line 270 of file Vector.h.

◆ shape_elemmat()

std::array< size_t, 3 > GooseFEM::Vector::shape_elemmat ( ) const
inline

Shape of "elemmat".

Returns
[nelem, nne * ndim, nne * ndim]

Definition at line 300 of file Vector.h.

◆ shape_elemvec()

std::array< size_t, 3 > GooseFEM::Vector::shape_elemvec ( ) const
inline

Shape of "elemvec".

Returns
[nelem, nne, ndim]

Definition at line 290 of file Vector.h.

◆ shape_nodevec()

std::array< size_t, 2 > GooseFEM::Vector::shape_nodevec ( ) const
inline

Shape of "nodevec".

Returns
[nnode, ndim]

Definition at line 280 of file Vector.h.

Member Data Documentation

◆ m_conn

array_type::tensor<size_t, 2> GooseFEM::Vector::m_conn
protected

See conn()

Definition at line 760 of file Vector.h.

◆ m_dofs

array_type::tensor<size_t, 2> GooseFEM::Vector::m_dofs
protected

See dofs()

Definition at line 761 of file Vector.h.

◆ m_ndim

size_t GooseFEM::Vector::m_ndim
protected

See ndim.

Definition at line 765 of file Vector.h.

◆ m_ndof

size_t GooseFEM::Vector::m_ndof
protected

See ndof.

Definition at line 766 of file Vector.h.

◆ m_nelem

size_t GooseFEM::Vector::m_nelem
protected

See nelem.

Definition at line 762 of file Vector.h.

◆ m_nne

size_t GooseFEM::Vector::m_nne
protected

See nne.

Definition at line 763 of file Vector.h.

◆ m_nnode

size_t GooseFEM::Vector::m_nnode
protected

See nnode.

Definition at line 764 of file Vector.h.


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