BEM++
2.0
|
Operator acting on functions defined on a surface. More...
#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/assembly/boundary_operator.hpp>
Public Member Functions | |
BoundaryOperator () | |
Construct an uninitialized BoundaryOperator. | |
BoundaryOperator (const shared_ptr< const Context< BasisFunctionType, ResultType > > &context, const shared_ptr< const AbstractBoundaryOperator< BasisFunctionType, ResultType > > &abstractOp) | |
Construct and initialize a BoundaryOperator. More... | |
void | initialize (const shared_ptr< const Context< BasisFunctionType, ResultType > > &context, const shared_ptr< const AbstractBoundaryOperator< BasisFunctionType, ResultType > > &abstractOp) |
Initialize or reinitialize a BoundaryOperator. More... | |
void | uninitialize () |
Uninitialize the BoundaryOperator. More... | |
bool | isInitialized () const |
Return true if the BoundaryOperator has been initialized, false otherwise. | |
shared_ptr< const AbstractBoundaryOperator < BasisFunctionType, ResultType > > | abstractOperator () const |
Return a shared pointer to the encapsulated abstract boundary operator. | |
shared_ptr< const Context < BasisFunctionType, ResultType > > | context () const |
Return a shared pointer to the stored Context object. | |
shared_ptr< const DiscreteBoundaryOperator < ResultType > > | weakForm () const |
Return a shared pointer to the weak form of the encapsulated abstract boundary operator. More... | |
shared_ptr< const Space < BasisFunctionType > > | domain () const |
Return a shared pointer to the domain of the encapsulated abstract boundary operator. More... | |
shared_ptr< const Space < BasisFunctionType > > | range () const |
Return a shared pointer to the range of the encapsulated abstract boundary operator. More... | |
shared_ptr< const Space < BasisFunctionType > > | dualToRange () const |
Return a shared pointer to the space dual to the range of the encapsulated abstract boundary operator. More... | |
std::string | label () const |
Return the label of this BoundaryOperator. | |
bool | isWeakFormHeld () const |
Return true if the BoundaryOperator should prevent its weak form from being destroyed. More... | |
void | holdWeakForm (bool value) |
Specify whether the BoundaryOperator should prevent its weak form from being destroyed. More... | |
void | apply (const TranspositionMode trans, const GridFunction< BasisFunctionType, ResultType > &x_in, GridFunction< BasisFunctionType, ResultType > &y_inout, ResultType alpha, ResultType beta) const |
Act on a GridFunction. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > | operator+ (const BoundaryOperator< BasisFunctionType, ResultType > &op) |
Return a BoundaryOperator identical to the operand. | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > | operator- (const BoundaryOperator< BasisFunctionType, ResultType > &op) |
Return a BoundaryOperator equal to the operand multiplied by -1. More... | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > | operator+ (const BoundaryOperator< BasisFunctionType, ResultType > &op1, const BoundaryOperator< BasisFunctionType, ResultType > &op2) |
Return a BoundaryOperator representing the sum of the operands. More... | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > | operator- (const BoundaryOperator< BasisFunctionType, ResultType > &op1, const BoundaryOperator< BasisFunctionType, ResultType > &op2) |
Return a BoundaryOperator representing the difference of the operands. More... | |
template<typename BasisFunctionType , typename ResultType , typename ScalarType > | |
boost::enable_if< typename boost::mpl::has_key < boost::mpl::set< float, double, std::complex< float > , std::complex< double > >, ScalarType > , BoundaryOperator < BasisFunctionType, ResultType > >::type | operator* (const BoundaryOperator< BasisFunctionType, ResultType > &op, const ScalarType &scalar) |
Return a BoundaryOperator representing the operator op multiplied by scalar . More... | |
template<typename BasisFunctionType , typename ResultType , typename ScalarType > | |
BoundaryOperator < BasisFunctionType, ResultType > | operator* (const ScalarType &scalar, const BoundaryOperator< BasisFunctionType, ResultType > &op) |
Return a BoundaryOperator representing the operator op multiplied by scalar . More... | |
template<typename BasisFunctionType , typename ResultType , typename ScalarType > | |
BoundaryOperator < BasisFunctionType, ResultType > | operator/ (const BoundaryOperator< BasisFunctionType, ResultType > &op, const ScalarType &scalar) |
Return a BoundaryOperator representing the operator op divided by scalar . More... | |
template<typename BasisFunctionType , typename ResultType > | |
GridFunction < BasisFunctionType, ResultType > | operator* (const BoundaryOperator< BasisFunctionType, ResultType > &op, const GridFunction< BasisFunctionType, ResultType > &fun) |
Act with a BoundaryOperator on a GridFunction. More... | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > | operator* (const BoundaryOperator< BasisFunctionType, ResultType > &op1, const BoundaryOperator< BasisFunctionType, ResultType > &op2) |
Return a BoundaryOperator representing the product of the operands (op1 * op2 ). More... | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > | adjoint (const BoundaryOperator< BasisFunctionType, ResultType > &op) |
Return the adjoint of a BoundaryOperator. More... | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > | adjoint (const BoundaryOperator< BasisFunctionType, ResultType > &op, const shared_ptr< const Space< BasisFunctionType > > &range) |
Return the adjoint of a BoundaryOperator. More... | |
template<typename BasisFunctionType , typename ResultType > | |
BoundaryOperator < BasisFunctionType, ResultType > & | throwIfUninitialized (BoundaryOperator< BasisFunctionType, ResultType > &op, std::string message="") |
Check whether a BoundaryOperator object is initialized. More... | |
template<typename BasisFunctionType , typename ResultType > | |
const BoundaryOperator < BasisFunctionType, ResultType > & | throwIfUninitialized (const BoundaryOperator< BasisFunctionType, ResultType > &op, std::string message="") |
Operator acting on functions defined on a surface.
A BoundaryOperator is a lightweight wrapper of a pair of shared pointers to an AbstractBoundaryOperator and a DiscreteBoundaryOperator representing the weak form of the former. The weak form is evaluated lazily, on the first call to weakForm(). The Context object passed to the constructor of the BoundaryOperator or to the initialize() function determines how this weak form is calculated.
See the documentation of AbstractBoundaryOperator for the decription of the template parameters BasisFunctionType
and ResultType
.
Bempp::BoundaryOperator< BasisFunctionType, ResultType >::BoundaryOperator | ( | const shared_ptr< const Context< BasisFunctionType, ResultType > > & | context, |
const shared_ptr< const AbstractBoundaryOperator< BasisFunctionType, ResultType > > & | abstractOp | ||
) |
Construct and initialize a BoundaryOperator.
Equivalent to calling the initialize() function on a BoundaryOperator object created with the default constructor. See the documentation of initialize() for a description of the constructor's parameters.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::context(), and Bempp::BoundaryOperator< BasisFunctionType, ResultType >::initialize().
void Bempp::BoundaryOperator< BasisFunctionType, ResultType >::apply | ( | const TranspositionMode | trans, |
const GridFunction< BasisFunctionType, ResultType > & | x_in, | ||
GridFunction< BasisFunctionType, ResultType > & | y_inout, | ||
ResultType | alpha, | ||
ResultType | beta | ||
) | const |
Act on a GridFunction.
This function sets y_inout
to alpha * A * x_in + beta * y_inout
, where A
is the operator represented by this object.
The space of x_in
must be identical with the domain of the encapsulated abstract boundary operator, whereas the space of y_inout
and its dual must be identical with the range of the encapsulated abstract boundary operator and its dual; otherwise an exception is thrown. An exception is also thrown if the BoundaryOperator is uninitialized.
References Bempp::GridFunction< BasisFunctionType, ResultType >::coefficients(), Bempp::GridFunction< BasisFunctionType, ResultType >::projections(), Bempp::GridFunction< BasisFunctionType, ResultType >::setProjections(), and Bempp::GridFunction< BasisFunctionType, ResultType >::space().
Referenced by Bempp::BoundaryOperator< BasisFunctionType, ResultType >::operator*().
shared_ptr< const Space< BasisFunctionType > > Bempp::BoundaryOperator< BasisFunctionType, ResultType >::domain | ( | ) | const |
Return a shared pointer to the domain of the encapsulated abstract boundary operator.
A null pointer is returned if this function is called on an uninitialized BoundaryOperator.
Referenced by Bempp::AbstractBoundaryOperatorPseudoinverse< BasisFunctionType_, ResultType_ >::AbstractBoundaryOperatorPseudoinverse(), and Bempp::AdjointAbstractBoundaryOperator< BasisFunctionType_, ResultType_ >::AdjointAbstractBoundaryOperator().
shared_ptr< const Space< BasisFunctionType > > Bempp::BoundaryOperator< BasisFunctionType, ResultType >::dualToRange | ( | ) | const |
Return a shared pointer to the space dual to the range of the encapsulated abstract boundary operator.
A null pointer is returned if this function is called on an uninitialized BoundaryOperator.
Referenced by Bempp::AbstractBoundaryOperatorPseudoinverse< BasisFunctionType_, ResultType_ >::AbstractBoundaryOperatorPseudoinverse(), Bempp::AdjointAbstractBoundaryOperator< BasisFunctionType_, ResultType_ >::AdjointAbstractBoundaryOperator(), and Bempp::BoundaryOperator< BasisFunctionType, ResultType >::operator*().
void Bempp::BoundaryOperator< BasisFunctionType, ResultType >::holdWeakForm | ( | bool | value | ) |
Specify whether the BoundaryOperator should prevent its weak form from being destroyed.
See isWeakFormHeld() for more information.
void Bempp::BoundaryOperator< BasisFunctionType, ResultType >::initialize | ( | const shared_ptr< const Context< BasisFunctionType, ResultType > > & | context, |
const shared_ptr< const AbstractBoundaryOperator< BasisFunctionType, ResultType > > & | abstractOp | ||
) |
Initialize or reinitialize a BoundaryOperator.
[in] | context | Shared pointer to a Context object that will be used to build the weak form of abstractOp when necessary. |
[in] | abstractOp | Shared pointer to an AbstractBoundaryOperator that will be encapsulated in this BoundaryOperator. |
An exception is thrown if either of these pointers is NULL.
The provided shared pointers are stored in internal variables. In addition, any stored pointer to the weak form of the abstract boundary operator is invalidated.
Referenced by Bempp::BoundaryOperator< BasisFunctionType, ResultType >::BoundaryOperator().
bool Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isWeakFormHeld | ( | ) | const |
Return true if the BoundaryOperator should prevent its weak form from being destroyed.
If isWeakFormHeld() returns true, the BoundaryOperator stores a "strong" shared pointer to its discrete weak form once it is assembled for the first time, so that the weak form is held in memory at least as long as the BoundaryOperator object is in scope and its uninitialize() member function is not called.
Otherwise only a weak pointer to the weak form is stored; thus, the weak form remains in memory only as long as a shared pointer to it is held somewhere else in the program.
By default, isWeakFormHeld() returns true; call holdWeakForm(false) to change it.
shared_ptr< const Space< BasisFunctionType > > Bempp::BoundaryOperator< BasisFunctionType, ResultType >::range | ( | ) | const |
Return a shared pointer to the range of the encapsulated abstract boundary operator.
A null pointer is returned if this function is called on an uninitialized BoundaryOperator.
Referenced by Bempp::AbstractBoundaryOperatorPseudoinverse< BasisFunctionType_, ResultType_ >::AbstractBoundaryOperatorPseudoinverse(), Bempp::AdjointAbstractBoundaryOperator< BasisFunctionType_, ResultType_ >::AdjointAbstractBoundaryOperator(), and Bempp::BoundaryOperator< BasisFunctionType, ResultType >::operator*().
void Bempp::BoundaryOperator< BasisFunctionType, ResultType >::uninitialize | ( | ) |
Uninitialize the BoundaryOperator.
This function resets the internal shared pointers to the abstract boundary operator and its weak form to NULL.
shared_ptr< const DiscreteBoundaryOperator< ResultType > > Bempp::BoundaryOperator< BasisFunctionType, ResultType >::weakForm | ( | ) | const |
Return a shared pointer to the weak form of the encapsulated abstract boundary operator.
An exception is thrown if this function is called on an uninitialized BoundaryOperator.
|
related |
Return the adjoint of a BoundaryOperator.
An exception is thrown if the operand is uninitialized. This method tries to figure out the range space using a simple heuristic.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::context().
|
related |
Return the adjoint of a BoundaryOperator.
An exception is thrown if the operand is uninitialized. The range space needs to be given explicitly.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::context().
|
related |
Return a BoundaryOperator representing the operator op
multiplied by scalar
.
An exception is thrown if op
is uninitialized.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::context(), and Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().
|
related |
Return a BoundaryOperator representing the operator op
multiplied by scalar
.
An exception is thrown if op
is uninitialized.
|
related |
Act with a BoundaryOperator on a GridFunction.
This function returns the GridFunction obtained by acting with the operator op
on the grid function fun
. It is equivalent to calling
on GridFunction result
with space and dual space compatible with the range and dual to range of op
.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::apply(), Bempp::BoundaryOperator< BasisFunctionType, ResultType >::context(), Bempp::BoundaryOperator< BasisFunctionType, ResultType >::dualToRange(), Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized(), Bempp::GridFunction< BasisFunctionType, ResultType >::isInitialized(), Bempp::NO_TRANSPOSE, and Bempp::BoundaryOperator< BasisFunctionType, ResultType >::range().
|
related |
Return a BoundaryOperator representing the product of the operands (op1 * op2
).
An exception is thrown if any of the operands is uninitialized.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::context(), and Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().
|
related |
Return a BoundaryOperator representing the sum of the operands.
An exception is thrown if either of the operands is uninitialized.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::context(), and Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().
|
related |
Return a BoundaryOperator equal to the operand multiplied by -1.
An exception is thrown if either of the operands is uninitialized.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().
|
related |
Return a BoundaryOperator representing the difference of the operands.
if either of the operands is uninitialized.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().
|
related |
Return a BoundaryOperator representing the operator op
divided by scalar
.
scalar
must not be zero. References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().
|
related |
Check whether a BoundaryOperator object is initialized.
This function checks whether the BoundaryOperator op
is initialized. If so, it returns a reference to op
, otherwise it throws a std::invalid_argument
exception with message message
(or a default message if message
is left empty).
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Bempp::BoundaryOperator< BasisFunctionType, ResultType >::isInitialized().