dune-pdelab  2.6.0-rc1
convectiondiffusiondg.hh
Go to the documentation of this file.
1 // -*- tab-width: 2; indent-tabs-mode: nil -*-
2 #ifndef DUNE_PDELAB_LOCALOPERATOR_CONVECTIONDIFFUSIONDG_HH
3 #define DUNE_PDELAB_LOCALOPERATOR_CONVECTIONDIFFUSIONDG_HH
4 
5 #include<dune/common/exceptions.hh>
6 #include<dune/common/fvector.hh>
7 
8 #include<dune/geometry/referenceelements.hh>
9 
17 
19 
26 namespace Dune {
27  namespace PDELab {
28 
30  {
31  enum Type { NIPG, SIPG, IIPG };
32  };
33 
35  {
37  };
38 
53  template<typename T, typename FiniteElementMap>
55  public Dune::PDELab::NumericalJacobianApplyBoundary<ConvectionDiffusionDG<T,FiniteElementMap> >,
59  public Dune::PDELab::InstationaryLocalOperatorDefaultMethods<typename T::Traits::RangeFieldType>
60  {
61  enum { dim = T::Traits::GridViewType::dimension };
62 
63  using Real = typename T::Traits::RangeFieldType;
64  using BCType = typename ConvectionDiffusionBoundaryConditions::Type;
65 
66  public:
67  // pattern assembly flags
68  enum { doPatternVolume = true };
69  enum { doPatternSkeleton = true };
70 
71  // residual assembly flags
72  enum { doAlphaVolume = true };
73  enum { doAlphaSkeleton = true };
74  enum { doAlphaBoundary = true };
75  enum { doLambdaVolume = true };
76 
88  Real alpha_=0.0,
89  int intorderadd_=0
90  )
91  : Dune::PDELab::NumericalJacobianApplyBoundary<ConvectionDiffusionDG<T,FiniteElementMap> >(1.0e-7),
92  param(param_), method(method_), weights(weights_),
93  alpha(alpha_), intorderadd(intorderadd_), quadrature_factor(2),
94  cache(20)
95  {
96  theta = 1.0;
97  if (method==ConvectionDiffusionDGMethod::SIPG) theta = -1.0;
98  if (method==ConvectionDiffusionDGMethod::IIPG) theta = 0.0;
99  }
100 
101  // volume integral depending on test and ansatz functions
102  template<typename EG, typename LFSU, typename X, typename LFSV, typename R>
103  void alpha_volume (const EG& eg, const LFSU& lfsu, const X& x, const LFSV& lfsv, R& r) const
104  {
105  // define types
106  using RF = typename LFSU::Traits::FiniteElementType::
107  Traits::LocalBasisType::Traits::RangeFieldType;
108  using size_type = typename LFSU::Traits::SizeType;
109 
110  // dimensions
111  const int dim = EG::Entity::dimension;
112  const int order = std::max(lfsu.finiteElement().localBasis().order(),
113  lfsv.finiteElement().localBasis().order());
114 
115  // Get cell
116  const auto& cell = eg.entity();
117 
118  // Get geometry
119  auto geo = eg.geometry();
120 
121  // evaluate diffusion tensor at cell center, assume it is constant over elements
122  auto ref_el = referenceElement(geo);
123  auto localcenter = ref_el.position(0,0);
124  auto A = param.A(cell,localcenter);
125 
126  // Initialize vectors outside for loop
127  std::vector<Dune::FieldVector<RF,dim> > gradphi(lfsu.size());
128  std::vector<Dune::FieldVector<RF,dim> > gradpsi(lfsv.size());
129  Dune::FieldVector<RF,dim> gradu(0.0);
130  Dune::FieldVector<RF,dim> Agradu(0.0);
131 
132  // Transformation matrix
133  typename EG::Geometry::JacobianInverseTransposed jac;
134 
135  // loop over quadrature points
136  auto intorder = intorderadd + quadrature_factor * order;
137  for (const auto& ip : quadratureRule(geo,intorder))
138  {
139  // update all variables dependent on A if A is not cell-wise constant
140  if (!Impl::permeabilityIsConstantPerCell<T>(param))
141  {
142  A = param.A(cell, ip.position());
143  }
144 
145  // evaluate basis functions
146  auto& phi = cache[order].evaluateFunction(ip.position(),lfsu.finiteElement().localBasis());
147  auto& psi = cache[order].evaluateFunction(ip.position(),lfsv.finiteElement().localBasis());
148 
149  // evaluate u
150  RF u=0.0;
151  for (size_type i=0; i<lfsu.size(); i++)
152  u += x(lfsu,i)*phi[i];
153 
154  // evaluate gradient of basis functions
155  auto& js = cache[order].evaluateJacobian(ip.position(),lfsu.finiteElement().localBasis());
156  auto& js_v = cache[order].evaluateJacobian(ip.position(),lfsv.finiteElement().localBasis());
157 
158  // transform gradients of shape functions to real element
159  jac = geo.jacobianInverseTransposed(ip.position());
160  for (size_type i=0; i<lfsu.size(); i++)
161  jac.mv(js[i][0],gradphi[i]);
162 
163  for (size_type i=0; i<lfsv.size(); i++)
164  jac.mv(js_v[i][0],gradpsi[i]);
165 
166  // compute gradient of u
167  gradu = 0.0;
168  for (size_type i=0; i<lfsu.size(); i++)
169  gradu.axpy(x(lfsu,i),gradphi[i]);
170 
171  // compute A * gradient of u
172  A.mv(gradu,Agradu);
173 
174  // evaluate velocity field
175  auto b = param.b(cell,ip.position());
176 
177  // evaluate reaction term
178  auto c = param.c(cell,ip.position());
179 
180  // integrate (A grad u - bu)*grad phi_i + a*u*phi_i
181  RF factor = ip.weight() * geo.integrationElement(ip.position());
182  for (size_type i=0; i<lfsv.size(); i++)
183  r.accumulate(lfsv,i,( Agradu*gradpsi[i] - u*(b*gradpsi[i]) + c*u*psi[i] )*factor);
184  }
185  }
186 
187  // apply jacobian of volume term
188  template<typename EG, typename LFSU, typename X, typename LFSV, typename Y>
189  void jacobian_apply_volume (const EG& eg, const LFSU& lfsu, const X& x, const LFSV& lfsv, Y& y) const
190  {
191  alpha_volume(eg,lfsu,x,lfsv,y);
192  }
193 
194  // jacobian of volume term
195  template<typename EG, typename LFSU, typename X, typename LFSV, typename M>
196  void jacobian_volume (const EG& eg, const LFSU& lfsu, const X& x, const LFSV& lfsv,
197  M& mat) const
198  {
199  // define types
200  using RF = typename LFSU::Traits::FiniteElementType::
201  Traits::LocalBasisType::Traits::RangeFieldType;
202  using size_type = typename LFSU::Traits::SizeType;
203 
204  // dimensions
205  const int dim = EG::Entity::dimension;
206  const int order = std::max(lfsu.finiteElement().localBasis().order(),
207  lfsv.finiteElement().localBasis().order());
208 
209  // Get cell
210  const auto& cell = eg.entity();
211 
212  // Get geometry
213  auto geo = eg.geometry();
214 
215  // evaluate diffusion tensor at cell center, assume it is constant over elements
216  auto ref_el = referenceElement(geo);
217  auto localcenter = ref_el.position(0,0);
218  auto A = param.A(cell,localcenter);
219 
220  // Initialize vectors outside for loop
221  std::vector<Dune::FieldVector<RF,dim> > gradphi(lfsu.size());
222  std::vector<Dune::FieldVector<RF,dim> > Agradphi(lfsu.size());
223 
224  // Transformation matrix
225  typename EG::Geometry::JacobianInverseTransposed jac;
226 
227  // loop over quadrature points
228  auto intorder = intorderadd + quadrature_factor * order;
229  for (const auto& ip : quadratureRule(geo,intorder))
230  {
231  // update all variables dependent on A if A is not cell-wise constant
232  if (!Impl::permeabilityIsConstantPerCell<T>(param))
233  {
234  A = param.A(cell, ip.position());
235  }
236 
237  // evaluate basis functions
238  auto& phi = cache[order].evaluateFunction(ip.position(),lfsu.finiteElement().localBasis());
239 
240  // evaluate gradient of basis functions
241  auto& js = cache[order].evaluateJacobian(ip.position(),lfsu.finiteElement().localBasis());
242 
243  // transform gradients of shape functions to real element
244  jac = geo.jacobianInverseTransposed(ip.position());
245  for (size_type i=0; i<lfsu.size(); i++)
246  {
247  jac.mv(js[i][0],gradphi[i]);
248  A.mv(gradphi[i],Agradphi[i]);
249  }
250 
251  // evaluate velocity field
252  auto b = param.b(cell,ip.position());
253 
254  // evaluate reaction term
255  auto c = param.c(cell,ip.position());
256 
257  // integrate (A grad u - bu)*grad phi_i + a*u*phi_i
258  auto factor = ip.weight() * geo.integrationElement(ip.position());
259  for (size_type j=0; j<lfsu.size(); j++)
260  for (size_type i=0; i<lfsu.size(); i++)
261  mat.accumulate(lfsu,i,lfsu,j,( Agradphi[j]*gradphi[i] - phi[j]*(b*gradphi[i]) + c*phi[j]*phi[i] )*factor);
262  }
263  }
264 
265  // skeleton integral depending on test and ansatz functions
266  // each face is only visited ONCE!
267  template<typename IG, typename LFSU, typename X, typename LFSV, typename R>
268  void alpha_skeleton (const IG& ig,
269  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
270  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
271  R& r_s, R& r_n) const
272  {
273  // define types
274  using RF = typename LFSV::Traits::FiniteElementType::
275  Traits::LocalBasisType::Traits::RangeFieldType;
276  using size_type = typename LFSV::Traits::SizeType;
277 
278  // dimensions
279  const int dim = IG::Entity::dimension;
280  const int order = std::max(
281  std::max(lfsu_s.finiteElement().localBasis().order(),
282  lfsu_n.finiteElement().localBasis().order()),
283  std::max(lfsv_s.finiteElement().localBasis().order(),
284  lfsv_n.finiteElement().localBasis().order())
285  );
286 
287  // References to inside and outside cells
288  const auto& cell_inside = ig.inside();
289  const auto& cell_outside = ig.outside();
290 
291  // Get geometries
292  auto geo = ig.geometry();
293  auto geo_inside = cell_inside.geometry();
294  auto geo_outside = cell_outside.geometry();
295 
296  // Get geometry of intersection in local coordinates of cell_inside and cell_outside
297  auto geo_in_inside = ig.geometryInInside();
298  auto geo_in_outside = ig.geometryInOutside();
299 
300  // evaluate permeability tensors
301  auto ref_el_inside = referenceElement(geo_inside);
302  auto ref_el_outside = referenceElement(geo_outside);
303  auto local_inside = ref_el_inside.position(0,0);
304  auto local_outside = ref_el_outside.position(0,0);
305  auto A_s = param.A(cell_inside,local_inside);
306  auto A_n = param.A(cell_outside,local_outside);
307 
308  // face diameter for anisotropic meshes taken from Paul Houston et al.
309  // this formula ensures coercivity of the bilinear form
310  auto h_F = std::min(geo_inside.volume(),geo_outside.volume())/geo.volume();
311 
312  // tensor times normal
313  auto n_F = ig.centerUnitOuterNormal();
314  Dune::FieldVector<RF,dim> An_F_s;
315  A_s.mv(n_F,An_F_s);
316  Dune::FieldVector<RF,dim> An_F_n;
317  A_n.mv(n_F,An_F_n);
318 
319  // compute weights
320  RF omega_s;
321  RF omega_n;
322  RF harmonic_average(0.0);
324  {
325  RF delta_s = (An_F_s*n_F);
326  RF delta_n = (An_F_n*n_F);
327  omega_s = delta_n/(delta_s+delta_n+1e-20);
328  omega_n = delta_s/(delta_s+delta_n+1e-20);
329  harmonic_average = 2.0*delta_s*delta_n/(delta_s+delta_n+1e-20);
330  }
331  else
332  {
333  omega_s = omega_n = 0.5;
334  harmonic_average = 1.0;
335  }
336 
337  // get polynomial degree
338  auto order_s = lfsu_s.finiteElement().localBasis().order();
339  auto order_n = lfsu_n.finiteElement().localBasis().order();
340  auto degree = std::max( order_s, order_n );
341 
342  // penalty factor
343  auto penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
344 
345  // Initialize vectors outside for loop
346  std::vector<Dune::FieldVector<RF,dim> > tgradphi_s(lfsu_s.size());
347  std::vector<Dune::FieldVector<RF,dim> > tgradpsi_s(lfsv_s.size());
348  std::vector<Dune::FieldVector<RF,dim> > tgradphi_n(lfsu_n.size());
349  std::vector<Dune::FieldVector<RF,dim> > tgradpsi_n(lfsv_n.size());
350  Dune::FieldVector<RF,dim> gradu_s(0.0);
351  Dune::FieldVector<RF,dim> gradu_n(0.0);
352 
353  // Transformation matrix
354  typename IG::Entity::Geometry::JacobianInverseTransposed jac;
355 
356  // loop over quadrature points
357  auto intorder = intorderadd+quadrature_factor*order;
358  for (const auto& ip : quadratureRule(geo,intorder))
359  {
360  // update all variables dependent on A if A is not cell-wise constant
361  if (!Impl::permeabilityIsConstantPerCell<T>(param))
362  {
363  A_s = param.A(cell_inside,geo_in_inside.global(ip.position()));
364  A_n = param.A(cell_outside,geo_in_outside.global(ip.position()));
365  A_s.mv(n_F,An_F_s);
366  A_n.mv(n_F,An_F_n);
368  {
369  RF delta_s = (An_F_s*n_F);
370  RF delta_n = (An_F_n*n_F);
371  omega_s = delta_n/(delta_s+delta_n+1e-20);
372  omega_n = delta_s/(delta_s+delta_n+1e-20);
373  harmonic_average = 2.0*delta_s*delta_n/(delta_s+delta_n+1e-20);
374  penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
375  }
376  }
377 
378  // exact normal
379  auto n_F_local = ig.unitOuterNormal(ip.position());
380 
381  // position of quadrature point in local coordinates of elements
382  auto iplocal_s = geo_in_inside.global(ip.position());
383  auto iplocal_n = geo_in_outside.global(ip.position());
384 
385  // evaluate basis functions
386  auto& phi_s = cache[order_s].evaluateFunction(iplocal_s,lfsu_s.finiteElement().localBasis());
387  auto& phi_n = cache[order_n].evaluateFunction(iplocal_n,lfsu_n.finiteElement().localBasis());
388  auto& psi_s = cache[order_s].evaluateFunction(iplocal_s,lfsv_s.finiteElement().localBasis());
389  auto& psi_n = cache[order_n].evaluateFunction(iplocal_n,lfsv_n.finiteElement().localBasis());
390 
391  // evaluate u
392  RF u_s=0.0;
393  for (size_type i=0; i<lfsu_s.size(); i++)
394  u_s += x_s(lfsu_s,i)*phi_s[i];
395  RF u_n=0.0;
396  for (size_type i=0; i<lfsu_n.size(); i++)
397  u_n += x_n(lfsu_n,i)*phi_n[i];
398 
399  // evaluate gradient of basis functions
400  auto& gradphi_s = cache[order_s].evaluateJacobian(iplocal_s,lfsu_s.finiteElement().localBasis());
401  auto& gradphi_n = cache[order_n].evaluateJacobian(iplocal_n,lfsu_n.finiteElement().localBasis());
402  auto& gradpsi_s = cache[order_s].evaluateJacobian(iplocal_s,lfsv_s.finiteElement().localBasis());
403  auto& gradpsi_n = cache[order_n].evaluateJacobian(iplocal_n,lfsv_n.finiteElement().localBasis());
404 
405  // transform gradients of shape functions to real element
406  jac = geo_inside.jacobianInverseTransposed(iplocal_s);
407  for (size_type i=0; i<lfsu_s.size(); i++) jac.mv(gradphi_s[i][0],tgradphi_s[i]);
408  for (size_type i=0; i<lfsv_s.size(); i++) jac.mv(gradpsi_s[i][0],tgradpsi_s[i]);
409  jac = geo_outside.jacobianInverseTransposed(iplocal_n);
410  for (size_type i=0; i<lfsu_n.size(); i++) jac.mv(gradphi_n[i][0],tgradphi_n[i]);
411  for (size_type i=0; i<lfsv_n.size(); i++) jac.mv(gradpsi_n[i][0],tgradpsi_n[i]);
412 
413  // compute gradient of u
414  gradu_s = 0.0;
415  for (size_type i=0; i<lfsu_s.size(); i++)
416  gradu_s.axpy(x_s(lfsu_s,i),tgradphi_s[i]);
417  gradu_n = 0.0;
418  for (size_type i=0; i<lfsu_n.size(); i++)
419  gradu_n.axpy(x_n(lfsu_n,i),tgradphi_n[i]);
420 
421  // evaluate velocity field and upwinding, assume H(div) velocity field => may choose any side
422  auto b = param.b(cell_inside,iplocal_s);
423  auto normalflux = b*n_F_local;
424  RF omegaup_s, omegaup_n;
425  if (normalflux>=0.0)
426  {
427  omegaup_s = 1.0;
428  omegaup_n = 0.0;
429  }
430  else
431  {
432  omegaup_s = 0.0;
433  omegaup_n = 1.0;
434  }
435 
436  // integration factor
437  auto factor = ip.weight()*geo.integrationElement(ip.position());
438 
439  // convection term
440  auto term1 = (omegaup_s*u_s + omegaup_n*u_n) * normalflux *factor;
441  for (size_type i=0; i<lfsv_s.size(); i++)
442  r_s.accumulate(lfsv_s,i,term1 * psi_s[i]);
443  for (size_type i=0; i<lfsv_n.size(); i++)
444  r_n.accumulate(lfsv_n,i,-term1 * psi_n[i]);
445 
446  // diffusion term
447  auto term2 = -(omega_s*(An_F_s*gradu_s) + omega_n*(An_F_n*gradu_n)) * factor;
448  for (size_type i=0; i<lfsv_s.size(); i++)
449  r_s.accumulate(lfsv_s,i,term2 * psi_s[i]);
450  for (size_type i=0; i<lfsv_n.size(); i++)
451  r_n.accumulate(lfsv_n,i,-term2 * psi_n[i]);
452 
453  // (non-)symmetric IP term
454  auto term3 = (u_s-u_n) * factor;
455  for (size_type i=0; i<lfsv_s.size(); i++)
456  r_s.accumulate(lfsv_s,i,term3 * theta * omega_s * (An_F_s*tgradpsi_s[i]));
457  for (size_type i=0; i<lfsv_n.size(); i++)
458  r_n.accumulate(lfsv_n,i,term3 * theta * omega_n * (An_F_n*tgradpsi_n[i]));
459 
460  // standard IP term integral
461  auto term4 = penalty_factor * (u_s-u_n) * factor;
462  for (size_type i=0; i<lfsv_s.size(); i++)
463  r_s.accumulate(lfsv_s,i,term4 * psi_s[i]);
464  for (size_type i=0; i<lfsv_n.size(); i++)
465  r_n.accumulate(lfsv_n,i,-term4 * psi_n[i]);
466  }
467  }
468 
469  // apply jacobian of skeleton term
470  template<typename IG, typename LFSU, typename X, typename LFSV, typename Y>
471  void jacobian_apply_skeleton (const IG& ig,
472  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
473  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
474  Y& y_s, Y& y_n) const
475  {
476  alpha_skeleton(ig,lfsu_s,x_s,lfsv_s,lfsu_n,x_n,lfsv_n,y_s,y_n);
477  }
478 
479  template<typename IG, typename LFSU, typename X, typename LFSV, typename M>
480  void jacobian_skeleton (const IG& ig,
481  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
482  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
483  M& mat_ss, M& mat_sn,
484  M& mat_ns, M& mat_nn) const
485  {
486  // define types
487  using RF = typename LFSV::Traits::FiniteElementType::
488  Traits::LocalBasisType::Traits::RangeFieldType;
489  using size_type = typename LFSV::Traits::SizeType;
490 
491  // dimensions
492  const int dim = IG::Entity::dimension;
493  const int order = std::max(
494  std::max(lfsu_s.finiteElement().localBasis().order(),
495  lfsu_n.finiteElement().localBasis().order()),
496  std::max(lfsv_s.finiteElement().localBasis().order(),
497  lfsv_n.finiteElement().localBasis().order())
498  );
499 
500  // References to inside and outside cells
501  const auto& cell_inside = ig.inside();
502  const auto& cell_outside = ig.outside();
503 
504  // Get geometries
505  auto geo = ig.geometry();
506  auto geo_inside = cell_inside.geometry();
507  auto geo_outside = cell_outside.geometry();
508 
509  // Get geometry of intersection in local coordinates of cell_inside and cell_outside
510  auto geo_in_inside = ig.geometryInInside();
511  auto geo_in_outside = ig.geometryInOutside();
512 
513  // evaluate permeability tensors
514  auto ref_el_inside = referenceElement(geo_inside);
515  auto ref_el_outside = referenceElement(geo_outside);
516  auto local_inside = ref_el_inside.position(0,0);
517  auto local_outside = ref_el_outside.position(0,0);
518  auto A_s = param.A(cell_inside,local_inside);
519  auto A_n = param.A(cell_outside,local_outside);
520 
521  // face diameter for anisotropic meshes taken from Paul Houston et al.
522  // this formula ensures coercivity of the bilinear form
523  auto h_F = std::min(geo_inside.volume(),geo_outside.volume())/geo.volume();
524 
525  // tensor times normal
526  auto n_F = ig.centerUnitOuterNormal();
527  Dune::FieldVector<RF,dim> An_F_s;
528  A_s.mv(n_F,An_F_s);
529  Dune::FieldVector<RF,dim> An_F_n;
530  A_n.mv(n_F,An_F_n);
531 
532  // compute weights
533  RF omega_s;
534  RF omega_n;
535  RF harmonic_average(0.0);
537  {
538  RF delta_s = (An_F_s*n_F);
539  RF delta_n = (An_F_n*n_F);
540  omega_s = delta_n/(delta_s+delta_n+1e-20);
541  omega_n = delta_s/(delta_s+delta_n+1e-20);
542  harmonic_average = 2.0*delta_s*delta_n/(delta_s+delta_n+1e-20);
543  }
544  else
545  {
546  omega_s = omega_n = 0.5;
547  harmonic_average = 1.0;
548  }
549 
550  // get polynomial degree
551  auto order_s = lfsu_s.finiteElement().localBasis().order();
552  auto order_n = lfsu_n.finiteElement().localBasis().order();
553  auto degree = std::max( order_s, order_n );
554 
555  // penalty factor
556  auto penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
557 
558  // Initialize vectors outside for loop
559  std::vector<Dune::FieldVector<RF,dim> > tgradphi_s(lfsu_s.size());
560  std::vector<Dune::FieldVector<RF,dim> > tgradphi_n(lfsu_n.size());
561 
562  // Transformation matrix
563  typename IG::Entity::Geometry::JacobianInverseTransposed jac;
564 
565  // loop over quadrature points
566  const int intorder = intorderadd+quadrature_factor*order;
567  for (const auto& ip : quadratureRule(geo,intorder))
568  {
569  // update all variables dependent on A if A is not cell-wise constant
570  if (!Impl::permeabilityIsConstantPerCell<T>(param))
571  {
572  A_s = param.A(cell_inside,geo_in_inside.global(ip.position()));
573  A_n = param.A(cell_outside,geo_in_outside.global(ip.position()));
574  A_s.mv(n_F,An_F_s);
575  A_n.mv(n_F,An_F_n);
577  {
578  RF delta_s = (An_F_s*n_F);
579  RF delta_n = (An_F_n*n_F);
580  omega_s = delta_n/(delta_s+delta_n+1e-20);
581  omega_n = delta_s/(delta_s+delta_n+1e-20);
582  harmonic_average = 2.0*delta_s*delta_n/(delta_s+delta_n+1e-20);
583  penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
584  }
585  }
586 
587  // exact normal
588  auto n_F_local = ig.unitOuterNormal(ip.position());
589 
590  // position of quadrature point in local coordinates of elements
591  auto iplocal_s = geo_in_inside.global(ip.position());
592  auto iplocal_n = geo_in_outside.global(ip.position());
593 
594  // evaluate basis functions
595  auto& phi_s = cache[order_s].evaluateFunction(iplocal_s,lfsu_s.finiteElement().localBasis());
596  auto& phi_n = cache[order_n].evaluateFunction(iplocal_n,lfsu_n.finiteElement().localBasis());
597 
598  // evaluate gradient of basis functions
599  auto& gradphi_s = cache[order_s].evaluateJacobian(iplocal_s,lfsu_s.finiteElement().localBasis());
600  auto& gradphi_n = cache[order_n].evaluateJacobian(iplocal_n,lfsu_n.finiteElement().localBasis());
601 
602  // transform gradients of shape functions to real element
603  jac = geo_inside.jacobianInverseTransposed(iplocal_s);
604  for (size_type i=0; i<lfsu_s.size(); i++) jac.mv(gradphi_s[i][0],tgradphi_s[i]);
605  jac = geo_outside.jacobianInverseTransposed(iplocal_n);
606  for (size_type i=0; i<lfsu_n.size(); i++) jac.mv(gradphi_n[i][0],tgradphi_n[i]);
607 
608  // evaluate velocity field and upwinding, assume H(div) velocity field => may choose any side
609  auto b = param.b(cell_inside,iplocal_s);
610  auto normalflux = b*n_F_local;
611  RF omegaup_s, omegaup_n;
612  if (normalflux>=0.0)
613  {
614  omegaup_s = 1.0;
615  omegaup_n = 0.0;
616  }
617  else
618  {
619  omegaup_s = 0.0;
620  omegaup_n = 1.0;
621  }
622 
623  // integration factor
624  auto factor = ip.weight() * geo.integrationElement(ip.position());
625  auto ipfactor = penalty_factor * factor;
626 
627  // do all terms in the order: I convection, II diffusion, III consistency, IV ip
628  for (size_type j=0; j<lfsu_s.size(); j++) {
629  auto temp1 = -(An_F_s*tgradphi_s[j])*omega_s*factor;
630  for (size_type i=0; i<lfsu_s.size(); i++) {
631  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,omegaup_s * phi_s[j] * normalflux *factor * phi_s[i]);
632  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,temp1 * phi_s[i]);
633  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,phi_s[j] * factor * theta * omega_s * (An_F_s*tgradphi_s[i]));
634  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,phi_s[j] * ipfactor * phi_s[i]);
635  }
636  }
637  for (size_type j=0; j<lfsu_n.size(); j++) {
638  auto temp1 = -(An_F_n*tgradphi_n[j])*omega_n*factor;
639  for (size_type i=0; i<lfsu_s.size(); i++) {
640  mat_sn.accumulate(lfsu_s,i,lfsu_n,j,omegaup_n * phi_n[j] * normalflux *factor * phi_s[i]);
641  mat_sn.accumulate(lfsu_s,i,lfsu_n,j,temp1 * phi_s[i]);
642  mat_sn.accumulate(lfsu_s,i,lfsu_n,j,-phi_n[j] * factor * theta * omega_s * (An_F_s*tgradphi_s[i]));
643  mat_sn.accumulate(lfsu_s,i,lfsu_n,j,-phi_n[j] * ipfactor * phi_s[i]);
644  }
645  }
646  for (size_type j=0; j<lfsu_s.size(); j++) {
647  auto temp1 = -(An_F_s*tgradphi_s[j])*omega_s*factor;
648  for (size_type i=0; i<lfsu_n.size(); i++) {
649  mat_ns.accumulate(lfsu_n,i,lfsu_s,j,-omegaup_s * phi_s[j] * normalflux *factor * phi_n[i]);
650  mat_ns.accumulate(lfsu_n,i,lfsu_s,j,-temp1 * phi_n[i]);
651  mat_ns.accumulate(lfsu_n,i,lfsu_s,j,phi_s[j] * factor * theta * omega_n * (An_F_n*tgradphi_n[i]));
652  mat_ns.accumulate(lfsu_n,i,lfsu_s,j,-phi_s[j] * ipfactor * phi_n[i]);
653  }
654  }
655  for (size_type j=0; j<lfsu_n.size(); j++) {
656  auto temp1 = -(An_F_n*tgradphi_n[j])*omega_n*factor;
657  for (size_type i=0; i<lfsu_n.size(); i++) {
658  mat_nn.accumulate(lfsu_n,i,lfsu_n,j,-omegaup_n * phi_n[j] * normalflux *factor * phi_n[i]);
659  mat_nn.accumulate(lfsu_n,i,lfsu_n,j,-temp1 * phi_n[i]);
660  mat_nn.accumulate(lfsu_n,i,lfsu_n,j,-phi_n[j] * factor * theta * omega_n * (An_F_n*tgradphi_n[i]));
661  mat_nn.accumulate(lfsu_n,i,lfsu_n,j,phi_n[j] * ipfactor * phi_n[i]);
662  }
663  }
664  }
665  }
666 
667  // boundary integral depending on test and ansatz functions
668  // We put the Dirchlet evaluation also in the alpha term to save some geometry evaluations
669  template<typename IG, typename LFSU, typename X, typename LFSV, typename R>
670  void alpha_boundary (const IG& ig,
671  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
672  R& r_s) const
673  {
674  // define types
675  using RF = typename LFSV::Traits::FiniteElementType::
676  Traits::LocalBasisType::Traits::RangeFieldType;
677  using size_type = typename LFSV::Traits::SizeType;
678 
679  // dimensions
680  const int dim = IG::Entity::dimension;
681  const int order = std::max(
682  lfsu_s.finiteElement().localBasis().order(),
683  lfsv_s.finiteElement().localBasis().order()
684  );
685 
686  // References to the inside cell
687  const auto& cell_inside = ig.inside();
688 
689  // Get geometries
690  auto geo = ig.geometry();
691  auto geo_inside = cell_inside.geometry();
692 
693  // Get geometry of intersection in local coordinates of cell_inside
694  auto geo_in_inside = ig.geometryInInside();
695 
696  // evaluate permeability tensors
697  auto ref_el_inside = referenceElement(geo_inside);
698  auto local_inside = ref_el_inside.position(0,0);
699  auto A_s = param.A(cell_inside,local_inside);
700 
701  // face diameter for anisotropic meshes taken from Paul Houston et al.
702  // this formula ensures coercivity of the bilinear form
703  auto h_F = geo_inside.volume()/geo.volume();
704 
705  // compute weights
706  auto n_F = ig.centerUnitOuterNormal();
707  Dune::FieldVector<RF,dim> An_F_s;
708  A_s.mv(n_F,An_F_s);
709  RF harmonic_average;
711  harmonic_average = An_F_s*n_F;
712  else
713  harmonic_average = 1.0;
714 
715  // get polynomial degree
716  auto order_s = lfsu_s.finiteElement().localBasis().order();
717  auto degree = order_s;
718 
719  // penalty factor
720  auto penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
721 
722  // Initialize vectors outside for loop
723  std::vector<Dune::FieldVector<RF,dim> > tgradphi_s(lfsu_s.size());
724  std::vector<Dune::FieldVector<RF,dim> > tgradpsi_s(lfsv_s.size());
725  Dune::FieldVector<RF,dim> gradu_s(0.0);
726 
727  // Transformation matrix
728  typename IG::Entity::Geometry::JacobianInverseTransposed jac;
729 
730  // loop over quadrature points
731  auto intorder = intorderadd+quadrature_factor*order;
732  for (const auto& ip : quadratureRule(geo,intorder))
733  {
734  // update all variables dependent on A if A is not cell-wise constant
735  if (!Impl::permeabilityIsConstantPerCell<T>(param))
736  {
737  A_s = param.A(cell_inside,geo_in_inside.global(ip.position()));
738  A_s.mv(n_F,An_F_s);
740  {
741  harmonic_average = An_F_s*n_F;
742  penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
743  }
744  }
745 
746  auto bctype = param.bctype(ig.intersection(),ip.position());
747 
749  continue;
750 
751  // position of quadrature point in local coordinates of elements
752  auto iplocal_s = geo_in_inside.global(ip.position());
753 
754  // local normal
755  auto n_F_local = ig.unitOuterNormal(ip.position());
756 
757  // evaluate basis functions
758  auto& phi_s = cache[order_s].evaluateFunction(iplocal_s,lfsu_s.finiteElement().localBasis());
759  auto& psi_s = cache[order_s].evaluateFunction(iplocal_s,lfsv_s.finiteElement().localBasis());
760 
761  // integration factor
762  RF factor = ip.weight() * geo.integrationElement(ip.position());
763 
765  {
766  // evaluate flux boundary condition
767  auto j = param.j(ig.intersection(),ip.position());
768 
769  // integrate
770  for (size_type i=0; i<lfsv_s.size(); i++)
771  r_s.accumulate(lfsv_s,i,j * psi_s[i] * factor);
772 
773  continue;
774  }
775 
776  // evaluate u
777  RF u_s=0.0;
778  for (size_type i=0; i<lfsu_s.size(); i++)
779  u_s += x_s(lfsu_s,i)*phi_s[i];
780 
781  // evaluate velocity field and upwinding, assume H(div) velocity field => choose any side
782  auto b = param.b(cell_inside,iplocal_s);
783  auto normalflux = b*n_F_local;
784 
786  {
787  if (normalflux<-1e-30)
788  DUNE_THROW(Dune::Exception,
789  "Outflow boundary condition on inflow! [b("
790  << geo.global(ip.position()) << ") = "
791  << b << ")");
792 
793  // convection term
794  auto term1 = u_s * normalflux *factor;
795  for (size_type i=0; i<lfsv_s.size(); i++)
796  r_s.accumulate(lfsv_s,i,term1 * psi_s[i]);
797 
798  // evaluate flux boundary condition
799  auto o = param.o(ig.intersection(),ip.position());
800 
801  // integrate
802  for (size_type i=0; i<lfsv_s.size(); i++)
803  r_s.accumulate(lfsv_s,i,o * psi_s[i] * factor);
804 
805  continue;
806  }
807 
808  // evaluate gradient of basis functions
810  auto& gradphi_s = cache[order_s].evaluateJacobian(iplocal_s,lfsu_s.finiteElement().localBasis());
811  auto& gradpsi_s = cache[order_s].evaluateJacobian(iplocal_s,lfsv_s.finiteElement().localBasis());
812 
813  // transform gradients of shape functions to real element
814  jac = geo_inside.jacobianInverseTransposed(iplocal_s);
815  for (size_type i=0; i<lfsu_s.size(); i++) jac.mv(gradphi_s[i][0],tgradphi_s[i]);
816  for (size_type i=0; i<lfsv_s.size(); i++) jac.mv(gradpsi_s[i][0],tgradpsi_s[i]);
817 
818  // compute gradient of u
819  gradu_s = 0.0;
820  for (size_type i=0; i<lfsu_s.size(); i++)
821  gradu_s.axpy(x_s(lfsu_s,i),tgradphi_s[i]);
822 
823  // evaluate Dirichlet boundary condition
824  auto g = param.g(cell_inside,iplocal_s);
825 
826  // upwind
827  RF omegaup_s, omegaup_n;
828  if (normalflux>=0.0)
829  {
830  omegaup_s = 1.0;
831  omegaup_n = 0.0;
832  }
833  else
834  {
835  omegaup_s = 0.0;
836  omegaup_n = 1.0;
837  }
838 
839  // convection term
840  auto term1 = (omegaup_s*u_s + omegaup_n*g) * normalflux *factor;
841  for (size_type i=0; i<lfsv_s.size(); i++)
842  r_s.accumulate(lfsv_s,i,term1 * psi_s[i]);
843 
844  // diffusion term
845  auto term2 = (An_F_s*gradu_s) * factor;
846  for (size_type i=0; i<lfsv_s.size(); i++)
847  r_s.accumulate(lfsv_s,i,-term2 * psi_s[i]);
848 
849  // (non-)symmetric IP term
850  auto term3 = (u_s-g) * factor;
851  for (size_type i=0; i<lfsv_s.size(); i++)
852  r_s.accumulate(lfsv_s,i,term3 * theta * (An_F_s*tgradpsi_s[i]));
853 
854  // standard IP term
855  auto term4 = penalty_factor * (u_s-g) * factor;
856  for (size_type i=0; i<lfsv_s.size(); i++)
857  r_s.accumulate(lfsv_s,i,term4 * psi_s[i]);
858  }
859  }
860 
861  template<typename IG, typename LFSU, typename X, typename LFSV, typename M>
862  void jacobian_boundary (const IG& ig,
863  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
864  M& mat_ss) const
865  {
866  // define types
867  using RF = typename LFSV::Traits::FiniteElementType::
868  Traits::LocalBasisType::Traits::RangeFieldType;
869  using size_type = typename LFSV::Traits::SizeType;
870 
871  // dimensions
872  const int dim = IG::Entity::dimension;
873  const int order = std::max(
874  lfsu_s.finiteElement().localBasis().order(),
875  lfsv_s.finiteElement().localBasis().order()
876  );
877 
878  // References to the inside cell
879  const auto& cell_inside = ig.inside();
880 
881  // Get geometries
882  auto geo = ig.geometry();
883  auto geo_inside = cell_inside.geometry();
884 
885  // Get geometry of intersection in local coordinates of cell_inside
886  auto geo_in_inside = ig.geometryInInside();
887 
888  // evaluate permeability tensors
889  auto ref_el_inside = referenceElement(geo_inside);
890  auto local_inside = ref_el_inside.position(0,0);
891  auto A_s = param.A(cell_inside,local_inside);
892 
893  // face diameter for anisotropic meshes taken from Paul Houston et al.
894  // this formula ensures coercivity of the bilinear form
895  auto h_F = geo_inside.volume()/geo.volume();
896 
897  // compute weights
898  auto n_F = ig.centerUnitOuterNormal();
899  Dune::FieldVector<RF,dim> An_F_s;
900  A_s.mv(n_F,An_F_s);
901  RF harmonic_average;
903  harmonic_average = An_F_s*n_F;
904  else
905  harmonic_average = 1.0;
906 
907  // get polynomial degree
908  auto order_s = lfsu_s.finiteElement().localBasis().order();
909  auto degree = order_s;
910 
911  // penalty factor
912  auto penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
913 
914  // Initialize vectors outside for loop
915  std::vector<Dune::FieldVector<RF,dim> > tgradphi_s(lfsu_s.size());
916 
917  // Transformation matrix
918  typename IG::Entity::Geometry::JacobianInverseTransposed jac;
919 
920  // loop over quadrature points
921  auto intorder = intorderadd+quadrature_factor*order;
922  for (const auto& ip : quadratureRule(geo,intorder))
923  {
924  // update all variables dependent on A if A is not cell-wise constant
925  if (!Impl::permeabilityIsConstantPerCell<T>(param))
926  {
927  A_s = param.A(cell_inside,geo_in_inside.global(ip.position()));
928  A_s.mv(n_F,An_F_s);
930  {
931  harmonic_average = An_F_s*n_F;
932  penalty_factor = (alpha/h_F) * harmonic_average * degree*(degree+dim-1);
933  }
934  }
935 
936  auto bctype = param.bctype(ig.intersection(),ip.position());
937 
940  continue;
941 
942  // position of quadrature point in local coordinates of elements
943  auto iplocal_s = geo_in_inside.global(ip.position());
944 
945  // local normal
946  auto n_F_local = ig.unitOuterNormal(ip.position());
947 
948  // evaluate basis functions
949  auto& phi_s = cache[order_s].evaluateFunction(iplocal_s,lfsu_s.finiteElement().localBasis());
950 
951  // integration factor
952  auto factor = ip.weight() * geo.integrationElement(ip.position());
953 
954  // evaluate velocity field and upwinding, assume H(div) velocity field => choose any side
955  auto b = param.b(cell_inside,iplocal_s);
956  auto normalflux = b*n_F_local;
957 
959  {
960  if (normalflux<-1e-30)
961  DUNE_THROW(Dune::Exception,
962  "Outflow boundary condition on inflow! [b("
963  << geo.global(ip.position()) << ") = "
964  << b << ")" << n_F_local << " " << normalflux);
965 
966  // convection term
967  for (size_type j=0; j<lfsu_s.size(); j++)
968  for (size_type i=0; i<lfsu_s.size(); i++)
969  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,phi_s[j] * normalflux * factor * phi_s[i]);
970 
971  continue;
972  }
973 
974  // evaluate gradient of basis functions
975  auto& gradphi_s = cache[order_s].evaluateJacobian(iplocal_s,lfsu_s.finiteElement().localBasis());
976 
977  // transform gradients of shape functions to real element
978  jac = geo_inside.jacobianInverseTransposed(iplocal_s);
979  for (size_type i=0; i<lfsu_s.size(); i++) jac.mv(gradphi_s[i][0],tgradphi_s[i]);
980 
981  // upwind
982  RF omegaup_s = normalflux>=0.0 ? 1.0 : 0.0;
983 
984  // convection term
985  for (size_type j=0; j<lfsu_s.size(); j++)
986  for (size_type i=0; i<lfsu_s.size(); i++)
987  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,omegaup_s * phi_s[j] * normalflux * factor * phi_s[i]);
988 
989  // diffusion term
990  for (size_type j=0; j<lfsu_s.size(); j++)
991  for (size_type i=0; i<lfsu_s.size(); i++)
992  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,-(An_F_s*tgradphi_s[j]) * factor * phi_s[i]);
993 
994  // (non-)symmetric IP term
995  for (size_type j=0; j<lfsu_s.size(); j++)
996  for (size_type i=0; i<lfsu_s.size(); i++)
997  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,phi_s[j] * factor * theta * (An_F_s*tgradphi_s[i]));
998 
999  // standard IP term
1000  for (size_type j=0; j<lfsu_s.size(); j++)
1001  for (size_type i=0; i<lfsu_s.size(); i++)
1002  mat_ss.accumulate(lfsu_s,i,lfsu_s,j,penalty_factor * phi_s[j] * phi_s[i] * factor);
1003  }
1004  }
1005 
1006  // volume integral depending only on test functions
1007  template<typename EG, typename LFSV, typename R>
1008  void lambda_volume (const EG& eg, const LFSV& lfsv, R& r) const
1009  {
1010  // define types
1011  using size_type = typename LFSV::Traits::SizeType;
1012 
1013  // Get cell
1014  const auto& cell = eg.entity();
1015 
1016  // get geometries
1017  auto geo = eg.geometry();
1018 
1019  // loop over quadrature points
1020  auto order = lfsv.finiteElement().localBasis().order();
1021  auto intorder = intorderadd + 2 * order;
1022  for (const auto& ip : quadratureRule(geo,intorder))
1023  {
1024  // evaluate shape functions
1025  auto& phi = cache[order].evaluateFunction(ip.position(),lfsv.finiteElement().localBasis());
1026 
1027  // evaluate right hand side parameter function
1028  auto f = param.f(cell,ip.position());
1029 
1030  // integrate f
1031  auto factor = ip.weight() * geo.integrationElement(ip.position());
1032  for (size_type i=0; i<lfsv.size(); i++)
1033  r.accumulate(lfsv,i,-f*phi[i]*factor);
1034  }
1035  }
1036 
1038  void setTime (Real t)
1039  {
1041  param.setTime(t);
1042  }
1043 
1044  private:
1045  T& param; // two phase parameter class
1048  Real alpha, beta;
1049  int intorderadd;
1050  int quadrature_factor;
1051  Real theta;
1052 
1053  using LocalBasisType = typename FiniteElementMap::Traits::FiniteElementType::Traits::LocalBasisType;
1055 
1056  // In theory it is possible that one and the same local operator is
1057  // called first with a finite element of one type and later with a
1058  // finite element of another type. Since finite elements of different
1059  // type will usually produce different results for the same local
1060  // coordinate they cannot share a cache. Here we use a vector of caches
1061  // to allow for different orders of the shape functions, which should be
1062  // enough to support p-adaptivity. (Another likely candidate would be
1063  // differing geometry types, i.e. hybrid meshes.)
1064 
1065  std::vector<Cache> cache;
1066 
1067  template<class GEO>
1068  void element_size (const GEO& geo, typename GEO::ctype& hmin, typename GEO::ctype hmax) const
1069  {
1070  using DF = typename GEO::ctype;
1071  hmin = 1.0E100;
1072  hmax = -1.0E00;
1073  const int dim = GEO::coorddimension;
1074  if (dim==1)
1075  {
1076  Dune::FieldVector<DF,dim> x = geo.corner(0);
1077  x -= geo.corner(1);
1078  hmin = hmax = x.two_norm();
1079  return;
1080  }
1081  else
1082  {
1083  Dune::GeometryType gt = geo.type();
1084  for (int i=0; i<Dune::ReferenceElements<DF,dim>::general(gt).size(dim-1); i++)
1085  {
1086  Dune::FieldVector<DF,dim> x = geo.corner(Dune::ReferenceElements<DF,dim>::general(gt).subEntity(i,dim-1,0,dim));
1087  x -= geo.corner(Dune::ReferenceElements<DF,dim>::general(gt).subEntity(i,dim-1,1,dim));
1088  hmin = std::min(hmin,x.two_norm());
1089  hmax = std::max(hmax,x.two_norm());
1090  }
1091  return;
1092  }
1093  }
1094  };
1095  }
1096 }
1097 #endif // DUNE_PDELAB_LOCALOPERATOR_CONVECTIONDIFFUSIONDG_HH
Definition: convectiondiffusiondg.hh:75
QuadratureRuleWrapper< QuadratureRule< typename Geometry::ctype, Geometry::mydimension > > quadratureRule(const Geometry &geo, std::size_t order, QuadratureType::Enum quadrature_type=QuadratureType::GaussLegendre)
Returns a quadrature rule for the given geometry.
Definition: quadraturerules.hh:117
void setTime(Real t)
set time in parameter class
Definition: convectiondiffusiondg.hh:1038
Definition: convectiondiffusiondg.hh:29
Implements linear and nonlinear versions of jacobian_apply_boundary() based on alpha_boundary()
Definition: numericaljacobianapply.hh:285
Definition: convectiondiffusiondg.hh:73
Definition: convectiondiffusionparameter.hh:113
Definition: convectiondiffusiondg.hh:54
Definition: convectiondiffusionparameter.hh:113
Definition: convectiondiffusiondg.hh:68
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
const Entity & e
Definition: localfunctionspace.hh:120
Definition: convectiondiffusiondg.hh:31
Definition: convectiondiffusionparameter.hh:113
void alpha_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, R &r_s) const
Definition: convectiondiffusiondg.hh:670
void jacobian_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, M &mat_ss) const
Definition: convectiondiffusiondg.hh:862
Type
Definition: convectiondiffusiondg.hh:36
Definition: convectiondiffusiondg.hh:72
Definition: convectiondiffusiondg.hh:36
sparsity pattern generator
Definition: pattern.hh:29
Default flags for all local operators.
Definition: flags.hh:18
Type
Definition: convectiondiffusiondg.hh:31
Definition: convectiondiffusiondg.hh:31
Definition: convectiondiffusiondg.hh:74
Definition: convectiondiffusionparameter.hh:113
Default class for additional methods in instationary local operators.
Definition: idefault.hh:89
Definition: convectiondiffusiondg.hh:69
sparsity pattern generator
Definition: pattern.hh:13
void jacobian_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat) const
Definition: convectiondiffusiondg.hh:196
void lambda_volume(const EG &eg, const LFSV &lfsv, R &r) const
Definition: convectiondiffusiondg.hh:1008
void jacobian_apply_skeleton(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, Y &y_s, Y &y_n) const
Definition: convectiondiffusiondg.hh:471
void jacobian_skeleton(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, M &mat_ss, M &mat_sn, M &mat_ns, M &mat_nn) const
Definition: convectiondiffusiondg.hh:480
ConvectionDiffusionDG(T &param_, ConvectionDiffusionDGMethod::Type method_=ConvectionDiffusionDGMethod::NIPG, ConvectionDiffusionDGWeights::Type weights_=ConvectionDiffusionDGWeights::weightsOff, Real alpha_=0.0, int intorderadd_=0)
constructor: pass parameter object and define DG-method
Definition: convectiondiffusiondg.hh:85
const IG & ig
Definition: constraints.hh:148
Type
Definition: convectiondiffusionparameter.hh:113
Definition: convectiondiffusiondg.hh:36
void setTime(R t_)
set time for subsequent evaluation
Definition: idefault.hh:104
void alpha_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r) const
Definition: convectiondiffusiondg.hh:103
void jacobian_apply_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y) const
Definition: convectiondiffusiondg.hh:189
Definition: convectiondiffusiondg.hh:34
store values of basis functions and gradients in a cache
Definition: localbasiscache.hh:17
void alpha_skeleton(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, R &r_s, R &r_n) const
Definition: convectiondiffusiondg.hh:268
Definition: convectiondiffusiondg.hh:31