CEPS  24.01
Cardiac ElectroPhysiology Simulator
BoundaryCondition< _Result > Class Template Reference

Detailed Description

template<class _Result>
class BoundaryCondition< _Result >

Boundary condition.

See also
Field<_Result,_SupportType>

Definition at line 49 of file BoundaryCondition.hpp.

#include <BoundaryCondition.hpp>

Inheritance diagram for BoundaryCondition< _Result >:
[legend]

Public Types

using CoeffFunc = ScalarSAFunc *
 Typedef for the functor used to define the coeffs alpha,beta in the BC. More...
 
- Public Types inherited from Field< _Result, DegreeOfFreedom >
using FunctionType = SAFunc< _Result >
 The type returned by the functor. More...
 
using _Domain = CepsVector< DegreeOfFreedom * >
 The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom) More...
 
using _Iterator = typename CepsVector< DegreeOfFreedom * >::const_iterator
 The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom) More...
 
- Public Types inherited from SAFunc< _Result >
using BaseFunction = ceps::Function< _Result(CepsStandardArgs)>
 Typedef for the function type. More...
 

Public Member Functions

 BoundaryCondition (CoeffFunc functor, const CepsVector< DegreeOfFreedom * > *domain, CepsUnknownIndex unknown)
 Construct a new BoundaryCondition object. More...
 
 ~BoundaryCondition () override
 Delete data. More...
 
void setBoundaryConditionType (CepsBoundaryConditionFlag type)
 Set boundary condition type. More...
 
CepsBoundaryConditionFlag getBoundaryConditionType () const
 Get boundary condition type. More...
 
CepsUnknownIndex getUnknownId () const
 Get the id of the unknown that this BC is for. More...
 
void setAlpha (CoeffFunc alpha)
 Set alpha in $\alpha\partial_n u + \beta u = g$. More...
 
CoeffFunc getAlpha () const
 Get alpha in $\alpha\partial_n u + \beta u = g$. More...
 
std::remove_pointer_t< CoeffFunc >::ReturnType getAlpha (CepsStandardArgs args) const
 Evaluate alpha in $\alpha\partial_n u + \beta u = g$. More...
 
void setBeta (CoeffFunc beta)
 Set beta in $\alpha\partial_n u + \beta u = g$. More...
 
CoeffFunc getBeta () const
 Get beta in $\alpha\partial_n u + \beta u = g$. More...
 
std::remove_pointer_t< CoeffFunc >::ReturnType getBeta (CepsStandardArgs args) const
 Evaluate beta in $\alpha\partial_n u + \beta u = g$. More...
 
void applyAsDirichlet (DMatPtr mat, DVecPtr sec, CepsReal t=0., CepsReal scalingFactor=1.0)
 Apply this boundary condition as Dirichlet bc (zeroed row and col of mat and u in sec) The scaling factor is applied only to matrix term FIXME. More...
 
_Result eval (CepsStandardArgs args) override
 Evaluate a boundary condition, essentially call the functor inside. More...
 
CepsEnum getFlags () const override
 The final flag is a combination of Attribute and of the flags of the stored object type (if it has any) More...
 
- Public Member Functions inherited from Field< _Result, DegreeOfFreedom >
 Field (FunctionType *functor, const _Domain *domain, CepsBool bufferize=false)
 Construct a new Field object, with a vector, functor cannot be null. More...
 
virtual ~Field ()=default
 Destructor. More...
 
void addDomain (const _Domain *domain)
 Add another domain of definition. More...
 
void clearDomains ()
 Removes domains and support. More...
 
FunctionTypegetFunctor () const
 Get the functor inside the object. More...
 
void setFunctor (ceps::Function< _Result(CepsStandardArgs)> *functor)
 Set the functor inside the object. More...
 
void setScaleFactor (CepsReal scaleFactor)
 Scale the result. More...
 
CepsReal getScaleFactor () const
 Get the scale factor used. More...
 
CepsBool isBuffered () const
 Tells if field is bufferized. More...
 
CepsBool hasBufferedData () const
 Tells if field is bufferized and data has already been computed. More...
 
CepsEnum getFunctorFlags () const
 Get flags of the function. More...
 
CepsBool hasFunctorOption (CepsFunctionFlag flag) const
 Knowing the behavior relating to the time variable. More...
 
CepsBool isSpaceVariable () const
 Knowing the behavior relating to the space variable. More...
 
CepsBool isTimeVariable () const
 Knowing the behavior relating to the time variable. More...
 
CepsBool needsSolution () const
 Knowing the behavior relating to the solution vector. More...
 
void getValues (CepsVector< _Result > &values, CepsReal t, const CepsVector< DegreeOfFreedom * > &points={})
 Get the values for given row indices. If no support was given, simply call the functor for all dofs. More...
 
_Result getValue (DegreeOfFreedom *point, CepsReal t)
 Get single value for given row index. /!\ If not nullptr, the solution vector should HAVE ALREADY CALLED getLocalData() !! More...
 
void computeSupport (AbstractSelector< _Iterator > *selector, CepsBool canStartEmpty=false)
 Computes the support in the domains of definition, using the given selector. More...
 
virtual void actualize (CepsReal t)
 Precompute field data. More...
 
CepsVector< _Result > & getBufferedData ()
 Ref to buffered data. More...
 
CepsVector< CepsGlobalIndex > & getSupportIndices ()
 Get indices of support. More...
 
const CepsVector< DegreeOfFreedom * > & getSupport ()
 Get suppor. More...
 
const CepsVector< const CepsVector< DegreeOfFreedom * > * > & getDomains ()
 Get the spans on which the field is defined. More...
 
- Public Member Functions inherited from SAFunc< _Result >
 SAFunc (const SAFunc &)=default
 We allow the copy from a functor to another. More...
 
SAFuncoperator= (const SAFunc &)=default
 We allow the assignement from a functor to another. More...
 
virtual void getLocalData ()
 Authorize access to data for solvecSAFunc, other derived classes : nothing. More...
 
virtual void releaseLocalData ()
 Authorize access to data for solvecSAFunc, other derived classes : nothing. More...
 
CepsBool hasOption (CepsFunctionFlag flag)
 Tells if option is activated. More...
 
- Public Member Functions inherited from ceps::HoldsDimension
 HoldsDimension (const CepsUInt &dim)
 Constructor with dimension. More...
 
 HoldsDimension ()=default
 Default constructor. More...
 
 HoldsDimension (const HoldsDimension &)=default
 Constructor by copy. More...
 
 HoldsDimension (HoldsDimension &&) noexcept=default
 Constructor by copy. More...
 
virtual ~HoldsDimension ()=default
 Destructor. More...
 
HoldsDimensionoperator= (const HoldsDimension &)=default
 Assignment operator. More...
 
HoldsDimensionoperator= (HoldsDimension &&) noexcept=default
 Assignment operator. More...
 
const CepsUIntgetDimension () const
 Get the dimension of the object. More...
 
void setDimension (const CepsUInt &dim)
 Set the dimension of the object. More...
 
void reset ()
 Set the dimension of the object to 0. More...
 
- Public Member Functions inherited from ceps::HoldsAttributes
 HoldsAttributes (const CepsSet< CepsAttribute > &attributes)
 Constructor with any number of attributes. More...
 
 HoldsAttributes (const CepsVector< CepsAttribute > &attributes)
 Constructor with any number of attributes. More...
 
 HoldsAttributes (CepsAttribute *attributes, const CepsUInt &n)
 Constructor with any number of attributes. More...
 
 HoldsAttributes ()=default
 Default constructor. More...
 
 HoldsAttributes (const HoldsAttributes &)=default
 Assignement operator. More...
 
 HoldsAttributes (HoldsAttributes &&) noexcept=default
 Copy constructor. More...
 
virtual ~HoldsAttributes ()=default
 Destructor. More...
 
HoldsAttributesoperator= (const HoldsAttributes &)=default
 Assignment operator. More...
 
HoldsAttributesoperator= (HoldsAttributes &&) noexcept=default
 Assignment operator. More...
 
CepsUInt getNumberOfAttributes () const
 Returns number of attributes of the entity. More...
 
CepsSet< CepsAttribute > & getAttributes ()
 Returns the attributes of the entity. More...
 
const CepsSet< CepsAttribute > & getAttributes () const
 Returns the attributes of the entity, const version. More...
 
void setAttributes (const CepsVector< CepsAttribute > &attributes)
 Sets the attributes of the entity. More...
 
void setAttributes (const CepsSet< CepsAttribute > &attributes)
 Sets the attributes of the entity. More...
 
void setAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Sets the attributes of the entity. More...
 
template<class _It >
void setAttributes (_It first, _It last)
 Sets the attributes of the entity. More...
 
void addAttribute (const CepsAttribute &name)
 Adds an attribute to the entity. More...
 
void addAttributes (const CepsVector< CepsAttribute > &attributes)
 Adds several attributes to the entity. More...
 
void addAttributes (const CepsSet< CepsAttribute > &attributes)
 Adds several attributes to the entity. More...
 
void addAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Adds several attributes to the entity. More...
 
template<class _It >
void addAttributes (_It first, _It last)
 Adds several attributes to the entity. More...
 
void removeAttribute (const CepsAttribute &name)
 Removes an attribute from the entity. More...
 
void removeAttributes (const CepsSet< CepsAttribute > &attributes)
 Removes several attributes from the entity. More...
 
void removeAttributes (const CepsVector< CepsAttribute > &attributes)
 Removes several attributes from the entity. More...
 
void removeAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Removes several attributes from the entity. More...
 
template<class _It >
void removeAttributes (_It first, _It last)
 Removes several attributes from the entity. More...
 
void clearAttributes ()
 Removes all attributes from the entity. More...
 
CepsBool hasAttribute (const CepsAttribute &name) const
 Tells if the entity has the attribute in argument. More...
 
CepsBool hasAllAttributes (const CepsVector< CepsAttribute > &attributes) const
 Tells if the entity has all the attributes in argument. More...
 
CepsBool hasAllAttributes (const CepsAttribute *attributes, const CepsUInt &n) const
 Tells if the entity has all the attributes in argument. More...
 
template<class _It >
CepsBool hasAllAttributes (_It first, _It last) const
 Tells if the entity has all the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsSet< CepsAttribute > &attributes) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsVector< CepsAttribute > &attributes) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsAttribute *attributes, const CepsUInt &n) const
 Tells if the entity has one of the attributes in argument. More...
 
template<class _It >
CepsBool hasOneOfAttributes (_It first, _It last) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasUniversalAttribute () const
 Detect if the current entity has the attribute universal. More...
 
void reset ()
 Equivalent to HoldsAttributes::clear() More...
 

Protected Attributes

CepsBoundaryConditionFlag m_type
 friend display operator
More...
 
CoeffFunc m_alpha
 alpha in $\alpha\partial_n u + \beta u = g$ More...
 
CoeffFunc m_beta
 beta in $\alpha\partial_n u + \beta u = g$ More...
 
CepsUnknownIndex m_unknown
 The unknown for which the BC applies. More...
 
- Protected Attributes inherited from Field< _Result, DegreeOfFreedom >
FunctionTypem_functor
 doesn't belong to this object More...
 
CepsReal m_scaleFactor
 An optional scale factor. More...
 
CepsVector< DegreeOfFreedom * > m_support
 List of "points" where the field applies. More...
 
CepsVector< CepsGlobalIndexm_supportIndices
 List of "points" indices. More...
 
CepsBool m_supportComputed
 True if computeSupport has been called. More...
 
CepsVector< _Result > m_buffer
 Get buffer with data evaluated. More...
 
CepsBool m_precompute
 Do we bufferize data ? More...
 
CepsBool m_isPrecomputed
 Check if values were already evaluated. More...
 
CepsVector< const CepsVector< DegreeOfFreedom * > * > m_domains
 Ranges on which the field is defined. More...
 
- Protected Attributes inherited from ceps::HoldsAttributes
CepsSet< CepsAttributem_attributes
 The attributes held by the entity. More...
 

Friends

class BoundaryConditionManager
 Friend class. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Field< _Result, DegreeOfFreedom >
virtual void evaluateAll (CepsReal t, CepsVector< _Result > &results)
 Evaluate on all domain or support, put results in given vector. More...
 
virtual void evaluateOn (const _Domain *domain, CepsReal t, CepsUInt offset, CepsVector< _Result > &results)
 Precompute field data. More...
 

Member Typedef Documentation

◆ CoeffFunc

template<class _Result >
using BoundaryCondition< _Result >::CoeffFunc = ScalarSAFunc*

Typedef for the functor used to define the coeffs alpha,beta in the BC.

Definition at line 58 of file BoundaryCondition.hpp.

Constructor & Destructor Documentation

◆ BoundaryCondition()

template<class _Result >
BoundaryCondition< _Result >::BoundaryCondition ( CoeffFunc  functor,
const CepsVector< DegreeOfFreedom * > *  domain,
CepsUnknownIndex  unknown 
)

Construct a new BoundaryCondition object.

Parameters
functorfunctor wrapped
domainvector of dofs on which the bc is defined. Others can be added, and then restricted to support
unknownname of unknown to which the BC applies, will have to match the id in the pb

◆ ~BoundaryCondition()

template<class _Result >
BoundaryCondition< _Result >::~BoundaryCondition ( )
override

Delete data.

Member Function Documentation

◆ applyAsDirichlet()

template<class _Result >
void BoundaryCondition< _Result >::applyAsDirichlet ( DMatPtr  mat,
DVecPtr  sec,
CepsReal  t = 0.,
CepsReal  scalingFactor = 1.0 
)

Apply this boundary condition as Dirichlet bc (zeroed row and col of mat and u in sec) The scaling factor is applied only to matrix term FIXME.

◆ eval()

template<class _Result >
_Result BoundaryCondition< _Result >::eval ( CepsStandardArgs  args)
override

Evaluate a boundary condition, essentially call the functor inside.

◆ getAlpha() [1/2]

template<class _Result >
CoeffFunc BoundaryCondition< _Result >::getAlpha ( ) const

Get alpha in $\alpha\partial_n u + \beta u = g$.

◆ getAlpha() [2/2]

template<class _Result >
std::remove_pointer_t<CoeffFunc>::ReturnType BoundaryCondition< _Result >::getAlpha ( CepsStandardArgs  args) const

Evaluate alpha in $\alpha\partial_n u + \beta u = g$.

◆ getBeta() [1/2]

template<class _Result >
CoeffFunc BoundaryCondition< _Result >::getBeta ( ) const

Get beta in $\alpha\partial_n u + \beta u = g$.

◆ getBeta() [2/2]

template<class _Result >
std::remove_pointer_t<CoeffFunc>::ReturnType BoundaryCondition< _Result >::getBeta ( CepsStandardArgs  args) const

Evaluate beta in $\alpha\partial_n u + \beta u = g$.

◆ getBoundaryConditionType()

template<class _Result >
CepsBoundaryConditionFlag BoundaryCondition< _Result >::getBoundaryConditionType ( ) const

Get boundary condition type.

◆ getFlags()

template<class _Result >
CepsEnum BoundaryCondition< _Result >::getFlags ( ) const
overridevirtual

The final flag is a combination of Attribute and of the flags of the stored object type (if it has any)

Implements SAFunc< _Result >.

◆ getUnknownId()

template<class _Result >
CepsUnknownIndex BoundaryCondition< _Result >::getUnknownId ( ) const

Get the id of the unknown that this BC is for.

◆ setAlpha()

template<class _Result >
void BoundaryCondition< _Result >::setAlpha ( CoeffFunc  alpha)

Set alpha in $\alpha\partial_n u + \beta u = g$.

◆ setBeta()

template<class _Result >
void BoundaryCondition< _Result >::setBeta ( CoeffFunc  beta)

Set beta in $\alpha\partial_n u + \beta u = g$.

◆ setBoundaryConditionType()

template<class _Result >
void BoundaryCondition< _Result >::setBoundaryConditionType ( CepsBoundaryConditionFlag  type)

Set boundary condition type.

Friends And Related Function Documentation

◆ BoundaryConditionManager

template<class _Result >
friend class BoundaryConditionManager
friend

Friend class.

Definition at line 128 of file BoundaryCondition.hpp.

Field Documentation

◆ m_alpha

template<class _Result >
CoeffFunc BoundaryCondition< _Result >::m_alpha
protected

alpha in $\alpha\partial_n u + \beta u = g$

Definition at line 136 of file BoundaryCondition.hpp.

◆ m_beta

template<class _Result >
CoeffFunc BoundaryCondition< _Result >::m_beta
protected

beta in $\alpha\partial_n u + \beta u = g$

Definition at line 137 of file BoundaryCondition.hpp.

◆ m_type

template<class _Result >
CepsBoundaryConditionFlag BoundaryCondition< _Result >::m_type
protected

friend display operator

Type of bc

Definition at line 135 of file BoundaryCondition.hpp.

◆ m_unknown

template<class _Result >
CepsUnknownIndex BoundaryCondition< _Result >::m_unknown
protected

The unknown for which the BC applies.

Definition at line 138 of file BoundaryCondition.hpp.


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