AMDiS  0.3
The Adaptive Multi-Dimensional Simulation Toolbox
LinearForm< GB, T, Traits > Class Template Reference

The basic container that stores a base vector and a corresponding basis. More...

#include <LinearForm.hpp>

Inherits VectorFacade< T, Traits::template VectorImpl >.

Public Types

using GlobalBasis = GB
 The type of the functionspace basis associated to this linearform.
 
using CoefficientType = T
 The type of the elements of the DOFVector.
 
using ElementVector = FlatVector< CoefficientType >
 The type of the vector filled on an element with local contributions.
 
- Public Types inherited from VectorFacade< T, Traits::template VectorImpl >
using size_type = typename Impl::size_type
 
using value_type = typename Impl::value_type
 
using HasLocalSize = decltype(std::declval< V >().localSize())
 
using HasGlobalSize = decltype(std::declval< V >().globalSize())
 

Public Member Functions

 LinearForm (std::shared_ptr< GB > const &basis)
 Constructor. Stores the shared_ptr of the basis and creates a new DataTransfer.
 
template<class GB_ , REQUIRES(Concepts::Similar< GB_, GB >) >
 LinearForm (GB_ &&basis)
 Wraps the passed global basis into a (non-destroying) shared_ptr.
 
GlobalBasis const & basis () const
 
template<class LocalView , REQUIRES(Concepts::LocalView< LocalView >) >
void assemble (LocalView const &localView)
 Assemble the vector operators on the bound element.
 
void assemble ()
 Assemble all vector operators added by addOperator().
 
template<class ContextTag , class Expr , class TreePath >
void addOperator (ContextTag contextTag, Expr const &expr, TreePath path)
 
template<class ContextTag , class Operator , class TreePath >
void addOperator (ContextTag contextTag, Operator const &op, TreePath path)
 Associate a local operator with this LinearForm. More...
 
template<class Operator , class TreePath = RootTreePath>
void addOperator (Operator const &op, TreePath path={})
 
template<class Operator , class TreePath = RootTreePath>
void addIntersectionOperator (Operator const &op, TreePath path={})
 
- Public Member Functions inherited from VectorFacade< T, Traits::template VectorImpl >
 VectorFacade (GlobalBasis const &basis)
 
Impl const & impl () const
 Return the underlying linear algebra backend.
 
Implimpl ()
 
std::size_t localSize () const
 Return the number of entries in the local part of the vector.
 
std::size_t globalSize () const
 Return the number of entries in the global vector.
 
void resize (SizeInfo const &sizeInfo)
 Resize the vector to the size of the basis.
 
void resizeZero (SizeInfo const &sizeInfo)
 Resize the vector to the size of the basis and set to zero.
 
void init (SizeInfo const &sizeInfo, bool clear)
 
void finish ()
 Finish the insertion of values, see init()
 
Impl::value_type at (Index const &idx) const
 Return the value of the vector at the local index idx.
 
void insert (Index const &idx, typename Impl::value_type const &value, Assign assign={})
 Insert a single value into the matrix (add or overwrite to existing value) More...
 
void set (Index const &idx, typename Impl::value_type const &value)
 See insert for assignment operation Assigner::assign.
 
void add (Index const &idx, typename Impl::value_type const &value)
 See insert for assignment operation Assigner::plus_assign.
 
void gather (LocalView const &localView, Node const &node, Buffer &buffer) const
 Extract values from the vector referring to the given local indices and store it into a buffer. More...
 
void gather (LocalView const &localView, Buffer &buffer) const
 
void scatter (LocalView const &localView, Node const &node, NodeVector const &localVector, MaskRange const &mask, Assign assign)
 Insert a block of values into the vector (add or overwrite to existing values) More...
 
void scatter (LocalView const &localView, Node const &node, NodeVector const &localVector, Assign assign)
 Call scatter with MaskRange set to FakeContainer.
 
void scatter (LocalView const &localView, LocalVector const &localVector, Assign assign)
 Call scatter with Node given by the tree of the localView.
 
void forEach (LocalInd const &localInd, Func &&func)
 Apply func to each value at given indices localInd. More...
 
void forEach (Func &&func)
 Call forEach for all entries in the vector.
 
void forEach (LocalInd const &localInd, Func &&func) const
 Apply func to each value at given indices localInd. More...
 
void forEach (Func &&func) const
 Call forEach for all entries in the vector.
 

Detailed Description

template<class GB, class T = double, class Traits = BackendTraits<GB>>
class AMDiS::LinearForm< GB, T, Traits >

The basic container that stores a base vector and a corresponding basis.

A vector storing all the assembled Operators indexed with DOF indices. The vector data is associated to a global basis.

Template Parameters
GBBasis of the vector
TCoefficient type to store in the vector
TraitsCollection of parameter for the linear-algebra backend

Member Function Documentation

◆ addOperator()

void addOperator ( ContextTag  contextTag,
Operator const &  op,
TreePath  path 
)

Associate a local operator with this LinearForm.

Stores an operator in a list that gets assembled during a call to assemble(). The operator may be assigned to a specific context, i.e. either an element operator, an intersection operator, or a boundary operator. The path tree paths specify the sub-basis for test functions the operator is applied to.

Template Parameters
ContextTagOne of tag::element_operator, tag::intersection_operator or tag::boundary_operator indicating where to assemble this operator.
OperatorAn (pre-)operator that can be bound to a gridView, or a valid GridOperator.
pathA tree-path for the Basis

[[expects: path is valid tree-path in Basis]]

Referenced by LinearForm< GB, T, Traits >::LinearForm().


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