CEPS  24.01
Cardiac ElectroPhysiology Simulator
Field< _Result, _SupportType > Class Template Reference

Detailed Description

template<class _Result, class _SupportType>
class Field< _Result, _SupportType >

A Field is an object wrapped around a SAFunc functor, defined on at least one domain.

A domain is a CepsVector of either GeomCell*, GeomNode* or DegreeOfFreedom*. Several vectors can be passed to the Field, on which to compute the values of the functor.

A compact support in these domains can be provided to the Field, by using a locator. For example:

Field f(mySAFunc, vecOfOnwedNodes); f.addDomain(vecOfHaloNodes); AttributesLocator l(); /// parametrize the locator... f.computeSupport(l); /// ... f.actualize(t); f.getValues(...),

  • If a support was computed, the functor will be called on each of its "points"
  • Otherwise, the whole domain(s) of definition will be parsed.

Optionally, data can be precomputed (bufferized). This can be useful for data that does not change with time. (e.g. reoriented conductivity tensors)

Definition at line 79 of file Field.hpp.

#include <Field.hpp>

Public Types

using FunctionType = SAFunc< _Result >
 The type returned by the functor. More...
 
using _Domain = CepsVector< _SupportType * >
 The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom) More...
 
using _Iterator = typename CepsVector< _SupportType * >::const_iterator
 The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom) More...
 

Public Member Functions

 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< _SupportType * > &points={})
 Get the values for given row indices. If no support was given, simply call the functor for all dofs. More...
 
_Result getValue (_SupportType *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< _SupportType * > & getSupport ()
 Get suppor. More...
 
const CepsVector< const CepsVector< _SupportType * > * > & getDomains ()
 Get the spans on which the field is defined. More...
 

Protected Member Functions

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...
 

Protected Attributes

FunctionTypem_functor
 doesn't belong to this object More...
 
CepsReal m_scaleFactor
 An optional scale factor. More...
 
CepsVector< _SupportType * > 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< _SupportType * > * > m_domains
 Ranges on which the field is defined. More...
 

Friends

class BoundaryConditionManager
 Friend classes. More...
 
class SourceTermManager
 

Member Typedef Documentation

◆ _Domain

template<class _Result , class _SupportType >
using Field< _Result, _SupportType >::_Domain = CepsVector<_SupportType*>

The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom)

Definition at line 87 of file Field.hpp.

◆ _Iterator

template<class _Result , class _SupportType >
using Field< _Result, _SupportType >::_Iterator = typename CepsVector<_SupportType*>::const_iterator

The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom)

Definition at line 89 of file Field.hpp.

◆ FunctionType

template<class _Result , class _SupportType >
using Field< _Result, _SupportType >::FunctionType = SAFunc<_Result>

The type returned by the functor.

Definition at line 85 of file Field.hpp.

Constructor & Destructor Documentation

◆ Field()

template<class _Result , class _SupportType >
Field< _Result, _SupportType >::Field ( FunctionType functor,
const _Domain domain,
CepsBool  bufferize = false 
)

Construct a new Field object, with a vector, functor cannot be null.

◆ ~Field()

template<class _Result , class _SupportType >
virtual Field< _Result, _SupportType >::~Field ( )
virtualdefault

Destructor.

Member Function Documentation

◆ actualize()

template<class _Result , class _SupportType >
virtual void Field< _Result, _SupportType >::actualize ( CepsReal  t)
virtual

Precompute field data.

◆ addDomain()

template<class _Result , class _SupportType >
void Field< _Result, _SupportType >::addDomain ( const _Domain domain)

Add another domain of definition.

◆ clearDomains()

template<class _Result , class _SupportType >
void Field< _Result, _SupportType >::clearDomains ( )

Removes domains and support.

◆ computeSupport()

template<class _Result , class _SupportType >
void Field< _Result, _SupportType >::computeSupport ( AbstractSelector< _Iterator > *  selector,
CepsBool  canStartEmpty = false 
)

Computes the support in the domains of definition, using the given selector.

Parameters
selectormust have been parametrized before calling this method
canStartEmptydo not consider empty support to be no support to compute

◆ evaluateAll()

template<class _Result , class _SupportType >
virtual void Field< _Result, _SupportType >::evaluateAll ( CepsReal  t,
CepsVector< _Result > &  results 
)
protectedvirtual

Evaluate on all domain or support, put results in given vector.

◆ evaluateOn()

template<class _Result , class _SupportType >
virtual void Field< _Result, _SupportType >::evaluateOn ( const _Domain domain,
CepsReal  t,
CepsUInt  offset,
CepsVector< _Result > &  results 
)
protectedvirtual

Precompute field data.

◆ getBufferedData()

template<class _Result , class _SupportType >
CepsVector<_Result>& Field< _Result, _SupportType >::getBufferedData ( )

Ref to buffered data.

◆ getDomains()

template<class _Result , class _SupportType >
const CepsVector<const CepsVector<_SupportType*>*>& Field< _Result, _SupportType >::getDomains ( )

Get the spans on which the field is defined.

◆ getFunctor()

template<class _Result , class _SupportType >
FunctionType* Field< _Result, _SupportType >::getFunctor ( ) const

Get the functor inside the object.

◆ getFunctorFlags()

template<class _Result , class _SupportType >
CepsEnum Field< _Result, _SupportType >::getFunctorFlags ( ) const

Get flags of the function.

◆ getScaleFactor()

template<class _Result , class _SupportType >
CepsReal Field< _Result, _SupportType >::getScaleFactor ( ) const

Get the scale factor used.

◆ getSupport()

template<class _Result , class _SupportType >
const CepsVector<_SupportType*>& Field< _Result, _SupportType >::getSupport ( )

Get suppor.

◆ getSupportIndices()

template<class _Result , class _SupportType >
CepsVector<CepsGlobalIndex>& Field< _Result, _SupportType >::getSupportIndices ( )

Get indices of support.

◆ getValue()

template<class _Result , class _SupportType >
_Result Field< _Result, _SupportType >::getValue ( _SupportType *  point,
CepsReal  t 
)

Get single value for given row index. /!\ If not nullptr, the solution vector should HAVE ALREADY CALLED getLocalData() !!

◆ getValues()

template<class _Result , class _SupportType >
void Field< _Result, _SupportType >::getValues ( CepsVector< _Result > &  values,
CepsReal  t,
const CepsVector< _SupportType * > &  points = {} 
)

Get the values for given row indices. If no support was given, simply call the functor for all dofs.

◆ hasBufferedData()

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::hasBufferedData ( ) const

Tells if field is bufferized and data has already been computed.

◆ hasFunctorOption()

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::hasFunctorOption ( CepsFunctionFlag  flag) const

Knowing the behavior relating to the time variable.

◆ isBuffered()

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::isBuffered ( ) const

Tells if field is bufferized.

◆ isSpaceVariable()

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::isSpaceVariable ( ) const

Knowing the behavior relating to the space variable.

◆ isTimeVariable()

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::isTimeVariable ( ) const

Knowing the behavior relating to the time variable.

◆ needsSolution()

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::needsSolution ( ) const

Knowing the behavior relating to the solution vector.

◆ setFunctor()

template<class _Result , class _SupportType >
void Field< _Result, _SupportType >::setFunctor ( ceps::Function< _Result(CepsStandardArgs)> *  functor)

Set the functor inside the object.

Parameters
functorchange the functor inside

◆ setScaleFactor()

template<class _Result , class _SupportType >
void Field< _Result, _SupportType >::setScaleFactor ( CepsReal  scaleFactor)

Scale the result.

Parameters
scaleFactorCepsReal

Friends And Related Function Documentation

◆ BoundaryConditionManager

template<class _Result , class _SupportType >
friend class BoundaryConditionManager
friend

Friend classes.

Definition at line 212 of file Field.hpp.

◆ SourceTermManager

template<class _Result , class _SupportType >
friend class SourceTermManager
friend

Definition at line 213 of file Field.hpp.

Field Documentation

◆ m_buffer

template<class _Result , class _SupportType >
CepsVector<_Result> Field< _Result, _SupportType >::m_buffer
protected

Get buffer with data evaluated.

Definition at line 230 of file Field.hpp.

◆ m_domains

template<class _Result , class _SupportType >
CepsVector<const CepsVector<_SupportType*>*> Field< _Result, _SupportType >::m_domains
protected

Ranges on which the field is defined.

Definition at line 234 of file Field.hpp.

◆ m_functor

template<class _Result , class _SupportType >
FunctionType* Field< _Result, _SupportType >::m_functor
protected

doesn't belong to this object

Definition at line 225 of file Field.hpp.

◆ m_isPrecomputed

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::m_isPrecomputed
protected

Check if values were already evaluated.

Definition at line 232 of file Field.hpp.

◆ m_precompute

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::m_precompute
protected

Do we bufferize data ?

Definition at line 231 of file Field.hpp.

◆ m_scaleFactor

template<class _Result , class _SupportType >
CepsReal Field< _Result, _SupportType >::m_scaleFactor
protected

An optional scale factor.

Definition at line 226 of file Field.hpp.

◆ m_support

template<class _Result , class _SupportType >
CepsVector<_SupportType*> Field< _Result, _SupportType >::m_support
protected

List of "points" where the field applies.

Definition at line 227 of file Field.hpp.

◆ m_supportComputed

template<class _Result , class _SupportType >
CepsBool Field< _Result, _SupportType >::m_supportComputed
protected

True if computeSupport has been called.

Definition at line 229 of file Field.hpp.

◆ m_supportIndices

template<class _Result , class _SupportType >
CepsVector<CepsGlobalIndex> Field< _Result, _SupportType >::m_supportIndices
protected

List of "points" indices.

Definition at line 228 of file Field.hpp.


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