version 3.8
Dumux::PointSource< PositionType, ValueType > Class Template Reference

A point source base class. More...

#include <dumux/common/pointsource.hh>

Inheritance diagram for Dumux::PointSource< PositionType, ValueType >:

Description

template<class PositionType, class ValueType>
class Dumux::PointSource< PositionType, ValueType >
Template Parameters
PositionTypethe position type
ValueTypethe a vector type storing the source for all equations

Public Types

using Scalar = std::decay_t< decltype(std::declval< ValueType >()[0])>
 Export the scalar type. More...
 
using GlobalPosition = PositionType
 Export the position type. More...
 
using Values = ValueType
 Export the value type. More...
 

Public Member Functions

 PointSource (GlobalPosition pos, Values values)
 Constructor for constant point sources. More...
 
 PointSource (GlobalPosition pos)
 Constructor for sol dependent point sources, when there is no. More...
 
PointSourceoperator+= (Scalar s)
 Convenience += operator overload modifying only the values. More...
 
PointSourceoperator-= (Scalar s)
 Convenience -= operator overload modifying only the values. More...
 
PointSourceoperator*= (Scalar s)
 Convenience *= operator overload modifying only the values. More...
 
PointSourceoperator/= (Scalar s)
 Convenience /= operator overload modifying only the values. More...
 
PointSourceoperator= (const Values &values)
 Convenience = operator overload modifying only the values. More...
 
PointSourceoperator= (Scalar s)
 Convenience = operator overload modifying only the values. More...
 
Values values () const
 return the source values More...
 
const GlobalPositionposition () const
 return the source position More...
 
template<class Problem , class FVElementGeometry , class ElementVolumeVariables >
void update (const Problem &problem, const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolume &scv)
 an update function called before adding the value More...
 
void setEmbeddings (std::size_t embeddings)
 set the number of embeddings for this point source More...
 
std::size_t embeddings () const
 get the number of embeddings for this point source More...
 

Protected Attributes

Values values_
 value of the point source for each equation More...
 

Member Typedef Documentation

◆ GlobalPosition

template<class PositionType , class ValueType >
using Dumux::PointSource< PositionType, ValueType >::GlobalPosition = PositionType

◆ Scalar

template<class PositionType , class ValueType >
using Dumux::PointSource< PositionType, ValueType >::Scalar = std::decay_t<decltype(std::declval<ValueType>()[0])>

◆ Values

template<class PositionType , class ValueType >
using Dumux::PointSource< PositionType, ValueType >::Values = ValueType

Constructor & Destructor Documentation

◆ PointSource() [1/2]

template<class PositionType , class ValueType >
Dumux::PointSource< PositionType, ValueType >::PointSource ( GlobalPosition  pos,
Values  values 
)
inline

◆ PointSource() [2/2]

template<class PositionType , class ValueType >
Dumux::PointSource< PositionType, ValueType >::PointSource ( GlobalPosition  pos)
inline

Member Function Documentation

◆ embeddings()

template<class PositionType , class ValueType >
std::size_t Dumux::PointSource< PositionType, ValueType >::embeddings ( ) const
inline
Note
A point source might be located on the intersection between several scvs. If so, there are point sources for every neighboring scv with the same position. embeddings returns the number of neighboring scvs. Example: If I want to inject 1kg/s at a location that is on the inner face of an scv the point source exists in both scvs. Both have a value of 1kg/s. We then divide the value by the number of embeddings to not inject 2kg/s but 1kg/s.
This division is done in the problem.scvPointSources() if this behaviour is not explicitly changed by e.g. overloading this function in the problem implementation.

◆ operator*=()

template<class PositionType , class ValueType >
PointSource & Dumux::PointSource< PositionType, ValueType >::operator*= ( Scalar  s)
inline

◆ operator+=()

template<class PositionType , class ValueType >
PointSource & Dumux::PointSource< PositionType, ValueType >::operator+= ( Scalar  s)
inline

◆ operator-=()

template<class PositionType , class ValueType >
PointSource & Dumux::PointSource< PositionType, ValueType >::operator-= ( Scalar  s)
inline

◆ operator/=()

template<class PositionType , class ValueType >
PointSource & Dumux::PointSource< PositionType, ValueType >::operator/= ( Scalar  s)
inline

◆ operator=() [1/2]

template<class PositionType , class ValueType >
PointSource & Dumux::PointSource< PositionType, ValueType >::operator= ( const Values values)
inline

◆ operator=() [2/2]

template<class PositionType , class ValueType >
PointSource & Dumux::PointSource< PositionType, ValueType >::operator= ( Scalar  s)
inline

◆ position()

template<class PositionType , class ValueType >
const GlobalPosition & Dumux::PointSource< PositionType, ValueType >::position ( ) const
inline

◆ setEmbeddings()

template<class PositionType , class ValueType >
void Dumux::PointSource< PositionType, ValueType >::setEmbeddings ( std::size_t  embeddings)
inline

◆ update()

template<class PositionType , class ValueType >
template<class Problem , class FVElementGeometry , class ElementVolumeVariables >
void Dumux::PointSource< PositionType, ValueType >::update ( const Problem &  problem,
const typename FVElementGeometry::GridGeometry::GridView::template Codim< 0 >::Entity &  element,
const FVElementGeometry &  fvGeometry,
const ElementVolumeVariables &  elemVolVars,
const typename FVElementGeometry::SubControlVolume &  scv 
)
inline

◆ values()

template<class PositionType , class ValueType >
Values Dumux::PointSource< PositionType, ValueType >::values ( ) const
inline

Member Data Documentation

◆ values_

template<class PositionType , class ValueType >
Values Dumux::PointSource< PositionType, ValueType >::values_
protected

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