Loading [MathJax]/extensions/tex2jax.js

dune-composites (unstable)

dirichletBC.hh
1#ifndef DIRICHLET_BC_HH
2#define DIRICHLET_BC_HH
3
4namespace Dune{
5 namespace Composites{
6
8 template<typename GV, typename MODEL, typename RF>
9 class Scalar_BC :
10 public Dune::PDELab::AnalyticGridFunctionBase<
11 Dune::PDELab::AnalyticGridFunctionTraits<GV,RF,1>,
12 Scalar_BC<GV,MODEL,RF> >,
13 public Dune::PDELab::InstationaryFunctionDefaults
14 {
15 public:
16
17 typedef Dune::PDELab::AnalyticGridFunctionTraits<GV,RF,1> Traits;
18 typedef Dune::PDELab::AnalyticGridFunctionBase<Traits, Scalar_BC<GV,MODEL,RF>> BaseT;
19
20 typedef typename Traits::DomainType DomainType;
21 typedef typename Traits::RangeType RangeType;
22
23 // Constructor
24 Scalar_BC(const GV & gv, MODEL& model_, int i_dim_) :
25 BaseT(gv), model(model_), i_dim(i_dim_){ }
26
27 template<typename I>
28 bool isDirichlet(const I & ig, const Dune::FieldVector<typename I::ctype, I::mydimension> & x) const
29 {
30 Dune::FieldVector<double,3> xg = ig.geometry().global( x );
31 return model.isDirichlet(xg, i_dim);
32 }
33
34 inline void evaluateGlobal(const DomainType & x, RangeType & u) const
35 {
36 u = model.evaluateDirichlet(x,i_dim);
37 } // end inline function evaluateGlobal
38
39 void setDof(int degree_of_freedom){
40 dof = degree_of_freedom;
41 }
42
43 private:
44 int dof;
45 MODEL& model;
46 int i_dim;
47 };
48
49
50 }
51}
52
53#endif
Define Scalar Dirichlet Boundary Conditions.
Definition: dirichletBC.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 15, 23:04, 2025)