Skip to content
Snippets Groups Projects
Commit 22ac479e authored by Timo Koch's avatar Timo Koch
Browse files

[pointsource] Implement a point source with identifier

Thus, data can be easily attached to a specified point source
and can be retrieved later. Useful especially for solution
dependent point sources.
parent 35d954de
No related branches found
No related tags found
1 merge request!36Feature/pointsources rebased
...@@ -75,6 +75,33 @@ private: ...@@ -75,6 +75,33 @@ private:
GlobalPosition pos_; GlobalPosition pos_;
}; };
/*!
* \ingroup Common
* \brief A point source class with an identifier to attach data
*/
template<class TypeTag, typename IdType>
class IdPointSource : public Dumux::PointSource<TypeTag>
{
typedef typename Dumux::PointSource<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
static const int dimworld = GridView::dimensionworld;
typedef typename Dune::FieldVector<Scalar, dimworld> GlobalPosition;
public:
// Constructor
IdPointSource(GlobalPosition pos, PrimaryVariables values, IdType id)
: ParentType(pos, values), id_(id) {}
//! return the sources identifier
IdType id() const
{ return id_; }
private:
IdType id_;
};
/*! /*!
* \ingroup Common * \ingroup Common
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment