[dune-pdelab] GridFunction with dim < dimworld
Nicolas Schwenck
nicolas.schwenck at iws.uni-stuttgart.de
Wed Sep 5 09:44:11 CEST 2012
I am sorry that I stated my problem incorrectly. The AnalyticGridFunctin
of course does work.
By using it I stumbled upon the problem that I can't use its traits to
derive the correct type for the position in the evaluateGlobal method.
That is, as correctly described by Jö, because the base class is
GridFunction which evaluates element-local.
Now I was wondering
1) if DomainType in general should be dim- or dimworld-sized
2) and in particular if it would make life easier when the
AnalyticGridFunctionTraits exports, maybe additionally, a DomainType in
dimworld?
Best,
Nicolas
P.S.:
template<typename GV, typename RF>
class ExampleAnalyticalGridFunction :
public
Dune::PDELab::AnalyticGridFunctionBase<Dune::PDELab::AnalyticGridFunctionTraits<GV,RF,1>,ExampleAnalyticalGridFunction<GV,RF>
>
{
public:
typedef Dune::PDELab::AnalyticGridFunctionTraits<GV,RF,1> Traits;
typedef
Dune::PDELab::AnalyticGridFunctionBase<Traits,ExampleAnalyticalGridFunction<GV,RF>
> B;
ExampleAnalyticalGridFunction (const GV& gv) : B(gv) {}
// xg is the global coordinate vector of the integration point.
inline void evaluateGlobal (const typename Traits::DomainType& xg,
typename Traits::RangeType& y) const
// inline void evaluateGlobal (const typename
Dune::FieldVector<double,dimworld> &xg, typename Traits::RangeType& y)
const
{
y= 1.0;//do something
}
};
--
_____________________________________________________________________
Dipl.-Ing. Nicolas Schwenck
University of Stuttgart
Department of Hydromechanics and Modelling of Hydrosystems
Pfaffenwaldring 61 phone: +49 711 685 64736
GER-70569 Stuttgart fax: +49 711 685 60430
email: nicolas.schwenck at iws.uni-stuttgart.de
url: www.hydrosys.uni-stuttgart.de
_____________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20120905/bbd9c738/attachment.htm>
More information about the dune-pdelab
mailing list