The basic container that stores a base vector and a corresponding basis. More...
#include <LinearForm.hpp>
Inherits VectorFacade< T, VectorImpl >, and Observer< event::adapt >.
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, VectorImpl > | |
| using | size_type = typename Impl::size_type |
| using | value_type = typename Impl::value_type |
| template<class V > | |
| using | HasLocalSize = decltype(std::declval< V >().localSize()) |
| template<class V > | |
| 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(). | |
| auto & | assembler () |
| void | updateImpl (event::adapt e) override |
| Update all operators on the updated gridView. | |
| 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. | |
| 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, VectorImpl > | |
| template<class GlobalBasis , class = std::void_t<decltype(std::declval<GlobalBasis>().indexDistribution())>> | |
| VectorFacade (GlobalBasis const &basis) | |
| Impl const & | impl () const |
| Return the underlying linear algebra backend. | |
| Impl & | impl () |
| 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. | |
| template<class Basis > | |
| void | resize (Basis const &basis) |
| Resize the vector to the size of the basis. | |
| template<class Basis > | |
| void | resizeZero (Basis const &basis) |
| Resize the vector to the size of the basis and set to zero. | |
| template<class Basis > | |
| void | init (Basis const &basis, bool clear) |
| void | finish () |
| Finish the insertion of values, see init() | |
| template<class Index , class Assign = Assigner::plus_assign, REQUIRES(Concepts::MultiIndex< Index >) > | |
| 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) | |
| template<class Index , REQUIRES(Concepts::MultiIndex< Index >) > | |
| void | set (Index const &idx, typename Impl::value_type const &value) |
| See insert for assignment operation Assigner::assign. | |
| template<class Index , REQUIRES(Concepts::MultiIndex< Index >) > | |
| void | add (Index const &idx, typename Impl::value_type const &value) |
| See insert for assignment operation Assigner::plus_assign. | |
| template<class Index , REQUIRES(Concepts::MultiIndex< Index >) > | |
| Impl::value_type | get (Index const &idx) const |
| Return the value of the vector at the local index idx. | |
| template<class LocalView , class Node , class Buffer , REQUIRES(Concepts::LocalView< LocalView >) , REQUIRES(Concepts::BasisNode< Node >) > | |
| 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. | |
| template<class LocalView , class Buffer , REQUIRES(Concepts::LocalView< LocalView >) > | |
| void | gather (LocalView const &localView, Buffer &buffer) const |
| template<class Index , class Buffer , REQUIRES(Concepts::MultiIndex< Index >) > | |
| void | gather (std::vector< Index > const &indices, Buffer &buffer) |
Call gather the values associated to the indices into the buffer. | |
| template<class LocalView , class Node , class NodeVector , class MaskRange , class Assign , REQUIRES(Concepts::LocalView< LocalView >) , REQUIRES(Concepts::BasisNode< Node >) > | |
| 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) | |
| template<class LocalView , class Node , class NodeVector , class Assign , REQUIRES(Concepts::LocalView< LocalView >) , REQUIRES(Concepts::BasisNode< Node >) > | |
| void | scatter (LocalView const &localView, Node const &node, NodeVector const &localVector, Assign assign) |
Call scatter with MaskRange set to FakeContainer. | |
| template<class LocalView , class LocalVector , class Assign , REQUIRES(Concepts::LocalView< LocalView >) > | |
| void | scatter (LocalView const &localView, LocalVector const &localVector, Assign assign) |
Call scatter with Node given by the tree of the localView. | |
| template<class Index , class Buffer , REQUIRES(Concepts::MultiIndex< Index >) > | |
| void | scatter (std::vector< Index > const &indices, Buffer const &values) |
Call scatter the values associated to the indices into the vector. | |
| template<class LocalInd , class Func > | |
| void | forEach (LocalInd const &localInd, Func &&func) |
Apply func to each value at given indices localInd. | |
| template<class LocalInd , class Func > | |
| void | forEach (LocalInd const &localInd, Func &&func) const |
Apply func to each value at given indices localInd. | |
| VectorState | state () const |
| Return the internal state of the vector. | |
| template<class S , std::enable_if_t< Dune::IsNumber< S >::value, int > = 0> | |
| Self & | axpy (const S &alpha, const Self &x) |
| Implements *this = *this + alpha * x. | |
| template<class S , std::enable_if_t< Dune::IsNumber< S >::value, int > = 0> | |
| Self & | aypx (const S &alpha, const Self &x) |
| Implements *this = alpha * (*this) + x. | |
| template<class S , std::enable_if_t< Dune::IsNumber< S >::value, int > = 0> | |
| Self & | operator= (const S &alpha) |
| Set all entries to alpha. | |
| Self & | operator+= (const Self &x) |
| return *this += x | |
| Self & | operator-= (const Self &x) |
| return *this -= x | |
| template<class S , std::enable_if_t< Dune::IsNumber< S >::value, int > = 0> | |
| Self & | operator*= (const S &alpha) |
| scale all entries by the factor alpha | |
| template<class S , std::enable_if_t< Dune::IsNumber< S >::value, int > = 0> | |
| Self & | operator/= (const S &alpha) |
| scale all entries by the factor 1.0/alpha | |
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.
| GB | Basis of the vector |
| T | Coefficient type to store in the vector |
| Traits | Collection of parameter for the linear-algebra backend |
| 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.
| ContextTag | One of tag::element_operator, tag::intersection_operator or BoundarySubset indicating where to assemble this operator. |
| Operator | An (pre-)operator that can be bound to a gridView, or a valid GridOperator. |
| path | A tree-path for the Basis |
[[expects: path is valid tree-path in Basis]]