1 #ifndef DUNE_PDELAB_LOCALOPERATOR_STOKESPARAMETER_HH
2 #define DUNE_PDELAB_LOCALOPERATOR_STOKESPARAMETER_HH
4 #include <dune/common/parametertree.hh>
44 template<
typename GV,
typename RF>
60 typedef Dune::FieldVector<DomainField,dimDomain>
Domain;
78 typedef typename GV::Traits::template Codim<0>::Entity
Element;
89 template<
typename GF,
typename Entity,
typename Domain>
90 typename GF::Traits::RangeType
91 evaluateVelocityGridFunction(
const GF& gf,
95 static_assert(
int(GF::Traits::dimRange) ==
int(Domain::dimension),
"dimension of function range does not match grid dimension");
96 typename GF::Traits::RangeType y;
105 template<
typename GF,
typename Entity,
typename Domain>
107 evaluateVelocityGridFunction(
const GF& gf,
113 typename GF::template Child<0>::Type::Traits::RangeType cy;
114 for (
int d = 0; d < Domain::dimension; ++d)
116 gf.child(d).evaluate(
e,x,cy);
142 template <
typename GV,
typename RF,
typename F,
typename B,
typename V,
typename J,
bool navier = false,
bool tensor = false>
159 : _rho(config.get<RF>(
"rho"))
160 , _mu(config.get<RF>(
"mu"))
183 template<
typename EG>
187 typename F::Traits::RangeType fvalue;
188 return evaluateVelocityGridFunction(_f,
e,x);
192 template<
typename IG>
197 typename B::Traits::BoundaryCondition::Type y;
203 template<
typename EG>
211 template<
typename IG>
219 template<
typename EG>
227 template<
typename IG>
235 template<
typename EG>
239 typename V::Traits::RangeType y;
245 template<
typename EG>
255 template<
typename IG>
264 template<
typename IG>
265 typename std::enable_if<
266 J::Traits::dimRange == 1 &&
267 (GV::dimension > 1) &&
275 typename J::Traits::RangeType r;
276 auto e =
ig.inside();
277 _j.evaluate(
e,
ig.geometryInInside().global(x),r);
283 template<
typename IG>
284 typename std::enable_if<
285 J::Traits::dimRange == GV::dimension &&
293 auto e =
ig.inside();
294 typename J::Traits::RangeType y;
295 _j.evaluate(
e,
ig.geometryInInside().global(x),y);
322 template<
typename PRM>
338 const Dune::FieldVector<typename I::ctype, I::mydimension> & coord)
const
349 template<
typename PRM>
365 const Dune::FieldVector<typename I::ctype, I::mydimension> & coord)
const
376 template<
typename PRM,
int rangeDim>
377 class NavierStokesFunctionAdapterBase
379 Dune::PDELab::GridFunctionTraits<
380 typename PRM::Traits::GridView,
381 typename PRM::Traits::RangeField,
383 Dune::FieldVector<typename PRM::Traits::RangeField,rangeDim>
385 NavierStokesFunctionAdapterBase<PRM,rangeDim>
391 typename PRM::Traits::GridView,
392 typename PRM::Traits::RangeField,
394 Dune::FieldVector<typename PRM::Traits::RangeField,rangeDim>
398 NavierStokesFunctionAdapterBase(PRM& prm)
402 void setTime(
const double time)
407 const PRM& parameters()
const
413 const typename Traits::GridViewType& getGridView ()
const
415 return _prm.gridView();
431 template<
typename PRM>
433 :
public NavierStokesFunctionAdapterBase<PRM,PRM::Traits::dimDomain>
437 typedef NavierStokesFunctionAdapterBase<PRM,PRM::Traits::dimDomain> Base;
439 using Base::parameters;
452 const typename Traits::DomainType& x,
453 typename Traits::RangeType& y)
const
455 y = parameters().g(
e,x);
464 template <
typename PRM >
465 class NavierStokesDirichletFunctionAdapterFactory
469 NavierStokesDirichletFunctionAdapter<PRM>,
470 NavierStokesPressureDirichletFunctionAdapter<PRM> >
471 BoundaryDirichletFunction;
473 NavierStokesDirichletFunctionAdapterFactory(PRM & prm)
474 : v(prm),
p(prm), df(v,
p)
477 BoundaryDirichletFunction & dirichletFunction()
483 NavierStokesVelocityDirichletFunctionAdapter<PRM> v;
484 NavierStokesPressureDirichletFunctionAdapter<PRM>
p;
485 BoundaryDirichletFunction df;
const P & p
Definition: constraints.hh:148
const IG & ig
Definition: constraints.hh:149
const Entity & e
Definition: localfunctionspace.hh:121
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
traits class holding the function signature, same as in local function
Definition: function.hh:183
leaf of a function tree
Definition: function.hh:302
composite functions
Definition: function.hh:539
Definition: constraintsparameters.hh:26
Definition: stokesparameter.hh:32
Type
Definition: stokesparameter.hh:33
@ SlipVelocity
Definition: stokesparameter.hh:37
@ StressNeumann
Definition: stokesparameter.hh:36
@ VelocityDirichlet
Definition: stokesparameter.hh:35
@ DoNothing
Definition: stokesparameter.hh:34
Definition: stokesparameter.hh:46
GV GridView
the grid view
Definition: stokesparameter.hh:48
GV::Grid::ctype DomainField
Export type for domain field.
Definition: stokesparameter.hh:57
Dune::FieldVector< DomainField, dimDomain > Domain
domain type
Definition: stokesparameter.hh:60
RF RangeField
Export type for range field.
Definition: stokesparameter.hh:66
@ dimDomain
dimension of the domain
Definition: stokesparameter.hh:53
GV::Traits::template Codim< 0 >::Entity Element
grid element type
Definition: stokesparameter.hh:78
Dune::FieldVector< RF, GV::dimensionworld > VelocityRange
deformation range type
Definition: stokesparameter.hh:69
StokesBoundaryCondition BoundaryCondition
boundary type value
Definition: stokesparameter.hh:75
Dune::FieldVector< RF, 1 > PressureRange
pressure range type
Definition: stokesparameter.hh:72
GV::Intersection Intersection
grid intersection type
Definition: stokesparameter.hh:80
Dune::FieldVector< DomainField, dimDomain-1 > IntersectionDomain
domain type
Definition: stokesparameter.hh:63
Definition: stokesparameter.hh:144
void setTime(RF time)
Definition: stokesparameter.hh:301
Traits::RangeField rho(const IG &ig, const typename Traits::IntersectionDomain &x) const
Density value from local intersection coordinate.
Definition: stokesparameter.hh:229
Traits::VelocityRange g(const EG &e, const typename Traits::Domain &x) const
Dirichlet boundary condition value from local cell coordinate.
Definition: stokesparameter.hh:237
Traits::RangeField rho(const EG &eg, const typename Traits::Domain &x) const
Density value from local cell coordinate.
Definition: stokesparameter.hh:221
NavierStokesDefaultParameters(const Dune::ParameterTree &config, F &f, B &b, V &v, J &j)
Constructor.
Definition: stokesparameter.hh:154
static const bool assemble_navier
Definition: stokesparameter.hh:147
Traits::VelocityRange j(const IG &ig, const typename Traits::IntersectionDomain &x, const typename Traits::Domain &normal) const
Neumann boundary condition (stress)
NavierStokesParameterTraits< GV, RF > Traits
Type traits.
Definition: stokesparameter.hh:151
static const bool assemble_full_tensor
Definition: stokesparameter.hh:148
Traits::VelocityRange f(const EG &e, const typename Traits::Domain &x) const
source term
Definition: stokesparameter.hh:185
NavierStokesDefaultParameters(const RF &mu, const RF &rho, F &f, B &b, V &v, J &j)
Definition: stokesparameter.hh:167
Traits::RangeField mu(const EG &e, const typename Traits::Domain &x) const
Dynamic viscosity value from local cell coordinate.
Definition: stokesparameter.hh:205
Traits::RangeField mu(const IG &ig, const typename Traits::IntersectionDomain &x) const
Dynamic viscosity value from local intersection coordinate.
Definition: stokesparameter.hh:213
Traits::RangeField g2(const EG &e, const typename Traits::Domain &x) const
pressure source term
Definition: stokesparameter.hh:247
Traits::BoundaryCondition::Type bctype(const IG &is, const typename Traits::IntersectionDomain &x) const
boundary condition type from local intersection coordinate
Definition: stokesparameter.hh:194
Definition: stokesparameter.hh:325
StokesVelocityDirichletConstraints(const PRM &_prm)
Constructor.
Definition: stokesparameter.hh:332
bool isDirichlet(const I &intersection, const Dune::FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: stokesparameter.hh:337
Definition: stokesparameter.hh:352
StokesPressureDirichletConstraints(const PRM &_prm)
Constructor.
Definition: stokesparameter.hh:359
bool isDirichlet(const I &intersection, const Dune::FieldVector< typename I::ctype, I::mydimension > &coord) const
Definition: stokesparameter.hh:364
Definition: stokesparameter.hh:434
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Evaluate dirichlet function.
Definition: stokesparameter.hh:451
NavierStokesVelocityFunctionAdapter(PRM &prm)
Constructor.
Definition: stokesparameter.hh:446
Base::Traits Traits
Definition: stokesparameter.hh:443
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139