Plugins
Loading...
Searching...
No Matches
grid_func_ls_user_data.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015: G-CSC, Goethe University Frankfurt
3 * Author: Dmitry Logashenko
4 *
5 * This file is part of UG4.
6 *
7 * UG4 is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License version 3 (as published by the
9 * Free Software Foundation) with the following additional attribution
10 * requirements (according to LGPL/GPL v3 §7):
11 *
12 * (1) The following notice must be displayed in the Appropriate Legal Notices
13 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 *
15 * (2) The following notice must be displayed at a prominent place in the
16 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 *
18 * (3) The following bibliography is recommended for citation and must be
19 * preserved in all covered files:
20 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 * parallel geometric multigrid solver on hierarchically distributed grids.
22 * Computing and visualization in science 16, 4 (2013), 151-164"
23 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 * flexible software system for simulating pde based models on high performance
25 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU Lesser General Public License for more details.
31 */
32
33/*
34 * grid_func_ls_user_data.h
35 */
36
37#ifndef __H__UG__PLUGINS__GRID_FUNC_LS_USER_DATA__
38#define __H__UG__PLUGINS__GRID_FUNC_LS_USER_DATA__
39
40#include "common/common.h"
41
50
51namespace ug{
52namespace LevelSet {
53
60template <typename TGridFunction>
62: public StdDependentUserData<GridFuncLSNumberData<TGridFunction>,
63 number, TGridFunction::dim>
64{
65 public:
66 // world dimension of grid function
67 static const int dim = TGridFunction::dim;
68
69 // domain type
70 typedef typename TGridFunction::domain_type domain_type;
71
72 // algebra type
73 typedef typename TGridFunction::algebra_type algebra_type;
74
75 // extrapolation type
77
78 private:
79 // grid function
81
82 // extrapolation by the level-set function
84
85 // component of function
86 size_t m_fct;
87
88 // local finite element id
90
91 public:
94 : m_spGridFct(spGridFct), m_spExtrapolation(spExtrapol)
95 {
96 this->set_functions(cmp);
97
98 // get function id of name
99 m_fct = spGridFct->fct_id_by_name(cmp);
100
101 // check that function exists
102 if(m_fct >= spGridFct->num_fct())
103 UG_THROW("GridFuncLSNumberData: Function space does not contain"
104 " a function with name " << cmp << ".");
105
106 // local finite element id
107 m_lfeID = spGridFct->local_finite_element_id(m_fct);
108
109 if (m_lfeID != LFEID (LFEID::LAGRANGE, dim, 1))
110 UG_THROW ("GridFuncLSNumberData: Only Lagrange spaces are currently supported.");
111 };
112
113 virtual bool continuous() const
114 {
115 return LocalFiniteElementProvider::continuous(m_lfeID);
116 }
117
118 template <int refDim>
119 void eval_and_deriv(number vValue[],
120 const MathVector<dim> vGlobIP[],
121 number time, int si,
122 GridObject* elem,
123 const MathVector<dim> vCornerCoords[],
124 const MathVector<refDim> vLocIP[],
125 const size_t nip,
126 LocalVector* u,
127 bool bDeriv,
128 int s,
129 std::vector<std::vector<number> > vvvDeriv[],
130 const MathMatrix<refDim, dim>* vJT = NULL) const
131 {
132 // reference object id
133 const ReferenceObjectID roid = elem->reference_object_id();
134 const DimReferenceElement<refDim>& rRefElem = ReferenceElementProvider::get<refDim>(roid);
135
136 // check if the element is inside/cut/outside
137 int inside = 1;
138 if(m_spExtrapolation.valid())
139 {
140 int g_level = m_spGridFct->grid_level().level();
141 if(g_level == GridLevel::TOP)
142 g_level = m_spGridFct->approx_space()->num_levels() - 1;
143 if((inside = ((extrapol_type *) m_spExtrapolation.get())->check_elem_lsf
144 (rRefElem.num(0), elem, si, g_level, false, vCornerCoords, time)) < 0)
145 {
146 for(size_t ip = 0; ip < nip; ++ip) // element outside
147 vValue[ip] = 0; //TODO: set the interface value
148 return;
149 }
150 }
151
152 // get trial space
153 try{
154 const LocalShapeFunctionSet<refDim>& rTrialSpace =
155 LocalFiniteElementProvider::get<refDim>(roid, m_lfeID);
156
157 // memory for shapes
158 std::vector<number> vShape;
159 std::vector<number> vVal;
160
161 // get multiindices of element
162 std::vector<DoFIndex> ind;
163 m_spGridFct->dof_indices(elem, m_fct, ind);
164
165 // loop ips
166 for(size_t ip = 0; ip < nip; ++ip)
167 {
168 // evaluate at shapes at ip
169 rTrialSpace.shapes(vShape, vLocIP[ip]);
170
171 // get the values at the corners and extrapolate them
172 vVal.resize(vShape.size());
173 for(size_t sh = 0; sh < vVal.size(); ++sh)
174 vVal[sh] = DoFRef(*m_spGridFct, ind[sh]);
175 if(inside == 0) // the element is cut
176 m_spExtrapolation->extrapolate_by_lsf (rRefElem.num(0), &(vVal[0]), m_fct);
177
178 // compute solution at integration point
179 vValue[ip] = 0.0;
180 for(size_t sh = 0; sh < vShape.size(); ++sh)
181 vValue[ip] += vVal[sh] * vShape[sh];
182 }
183
184 if(bDeriv){
185 for(size_t ip = 0; ip < nip; ++ip){
186 // evaluate at shapes at ip
187 rTrialSpace.shapes(vShape, vLocIP[ip]);
188
189 for(size_t sh = 0; sh < vShape.size(); ++sh)
190 vvvDeriv[ip][0][sh] = vShape[sh];
191 }
192 }
193 }
194 UG_CATCH_THROW("GridFuncLSNumberData: Shape Function Set missing for"
195 " Reference Object: "<<roid<<", Trial Space: "
196 <<m_lfeID<<", refDim="<<refDim);
197
198 }
199};
200
207template <typename TGridFunction>
209: public StdDependentUserData<GridFuncLSGradientData<TGridFunction> ,
210 MathVector<TGridFunction::dim>, TGridFunction::dim>
211{
212 public:
213 // world dimension of grid function
214 static const int dim = TGridFunction::dim;
215
216 // domain type
217 typedef typename TGridFunction::domain_type domain_type;
218
219 // algebra type
220 typedef typename TGridFunction::algebra_type algebra_type;
221
222 // extrapolation type
224
225 private:
226 // grid function
228
229 // extrapolation by the level-set function
231
232 // component of function
233 size_t m_fct;
234
235 // local finite element id
237
238 public:
241 : m_spGridFct(spGridFct), m_spExtrapolation(spExtrapol)
242 {
243 this->set_functions(cmp);
244
245 // get function id of name
246 m_fct = spGridFct->fct_id_by_name(cmp);
247
248 // check that function exists
249 if(m_fct >= spGridFct->num_fct())
250 UG_THROW("GridFuncLSGradientData: Function space does not contain"
251 " a function with name " << cmp << ".");
252
253 // local finite element id
254 m_lfeID = spGridFct->local_finite_element_id(m_fct);
255
256 if (m_lfeID != LFEID (LFEID::LAGRANGE, dim, 1))
257 UG_THROW ("GridFuncLSGradientData: Only Lagrange spaces are currently supported.");
258 };
259
260 virtual bool continuous() const
261 {
262 return false;
263 }
264
265 template <int refDim>
267 const MathVector<dim> vGlobIP[],
268 number time, int si,
269 GridObject* elem,
270 const MathVector<dim> vCornerCoords[],
271 const MathVector<refDim> vLocIP[],
272 const size_t nip,
273 LocalVector* u,
274 bool bDeriv,
275 int s,
276 std::vector<std::vector<MathVector<dim> > > vvvDeriv[],
277 const MathMatrix<refDim, dim>* vJT = NULL) const
278 {
279 const ReferenceObjectID roid = elem->reference_object_id();
280 const DimReferenceElement<dim>& rRefElem = ReferenceElementProvider::get<dim>(roid);
281
282 // check if the element is inside/cut/outside
283 int inside = 1;
284 if(m_spExtrapolation.valid())
285 {
286 int g_level = m_spGridFct->grid_level().level();
287 if(g_level == GridLevel::TOP)
288 g_level = m_spGridFct->approx_space()->num_levels() - 1;
289 if((inside = ((extrapol_type *) m_spExtrapolation.get())->check_elem_lsf
290 (rRefElem.num(0), elem, si, g_level, false, vCornerCoords, time)) < 0)
291 {
292 for(size_t ip = 0; ip < nip; ++ip) // element outside
293 VecSet(vValue[ip], 0);
294 return;
295 }
296 }
297
298 // get trial space
299 try{
300 const LocalShapeFunctionSet<refDim>& rTrialSpace =
301 LocalFiniteElementProvider::get<refDim>(roid, m_lfeID);
302
303 // storage for shape function at ip
304 std::vector<MathVector<refDim> > vLocGrad;
305 MathVector<refDim> locGrad;
306
307 // storage for corner values
308 std::vector<number> vVal;
309
310 // Reference Mapping
312
313 // get multiindices of element
314 std::vector<DoFIndex > ind;
315 m_spGridFct->dof_indices(elem, m_fct, ind);
316
317 // treat the cut elements separately
318 if(inside != 0) // the element is NOT cut
319 {
320 // get reference element mapping by reference object id
321 std::vector<MathMatrix<refDim, dim> > vJTTmp(nip);
322 if(vJT == NULL)
323 {
325 = ReferenceMappingProvider::get<refDim, dim>(roid, vCornerCoords);
326
327 // compute transformation matrices
328 mapping.jacobian_transposed(&(vJTTmp[0]), vLocIP, nip);
329
330 // store tmp Gradient
331 vJT = &(vJTTmp[0]);
332 }
333
334 // loop ips
335 for(size_t ip = 0; ip < nip; ++ip)
336 {
337 // evaluate at shapes at ip
338 rTrialSpace.grads(vLocGrad, vLocIP[ip]);
339
340 // get the values at the corners
341 vVal.resize(vLocGrad.size());
342 for(size_t sh = 0; sh < vVal.size(); ++sh)
343 vVal[sh] = DoFRef(*m_spGridFct, ind[sh]);
344
345 // compute grad at ip
346 VecSet(locGrad, 0.0);
347 for(size_t sh = 0; sh < vLocGrad.size(); ++sh)
348 VecScaleAppend(locGrad, vVal[sh], vLocGrad[sh]);
349
350 Inverse(JTInv, vJT[ip]);
351 MatVecMult(vValue[ip], JTInv, locGrad);
352 }
353 }
354 else // REMARK: All the ip's get the same gradient!
355 {
356 const DimReferenceElement<refDim>& rRefElem
357 = ReferenceElementProvider::get<refDim> (roid);
358 MathVector<dim> baseGrad, elemGrad;
360
362 = ReferenceMappingProvider::get<refDim, dim>(roid, vCornerCoords);
363
364 VecSet(elemGrad, 0.0);
365
366 // loop base corners
367 size_t n_base_co = 0;
368 for(size_t base_co = 0; base_co < rRefElem.num(0); ++base_co)
369 if(m_spExtrapolation->corner_inside (base_co))
370 {
371 // evaluate at shapes at ip
372 rTrialSpace.grads(vLocGrad, rRefElem.corner(base_co));
373
374 // get the values at the corners and extrapolate them
375 vVal.resize(vLocGrad.size());
376 for(size_t sh = 0; sh < vVal.size(); ++sh)
377 vVal[sh] = DoFRef(*m_spGridFct, ind[sh]);
378 m_spExtrapolation->extrapolate_by_lsf (rRefElem.num(0), base_co, &(vVal[0]), m_fct);
379
380 // compute the local gradient at ip
381 VecSet(locGrad, 0.0);
382 for(size_t sh = 0; sh < vLocGrad.size(); ++sh)
383 VecScaleAppend(locGrad, vVal[sh], vLocGrad[sh]);
384
385 // compute the gradient
386 mapping.jacobian_transposed(JT, rRefElem.corner(base_co));
387 Inverse(JTInv, JT);
388 MatVecMult(baseGrad, JTInv, locGrad);
389
390 // add the contribution to the element gradient
391 elemGrad += baseGrad;
392
393 ++n_base_co;
394 }
395 if(n_base_co == 0)
396 UG_THROW("GridFunctionNumberData: Failed in a cut element.");
397
398 // average the gradient and copy it to all the ip's
399 elemGrad /= (number) n_base_co;
400 for(size_t ip = 0; ip < nip; ++ip)
401 vValue[ip] = elemGrad;
402
403 }
404 }
405 UG_CATCH_THROW("GridFunctionNumberData: Failed for"
406 " Reference Object: "<<roid<<", Trial Space: "
407 <<m_lfeID<<", refDim="<<refDim);
408
409 if(bDeriv)
410 UG_THROW("Not implemented.");
411 }
412};
413
419template <typename TDomain, typename TAlgebra>
421 : public StdDataLinker< LSBearScheidegger<TDomain, TAlgebra>, MathMatrix<TDomain::dim,TDomain::dim>, TDomain::dim>
422{
424
425public:
426
427 // world dimension of grid function
428 static const int dim = TDomain::dim;
429
430 // domain type
431 typedef TDomain domain_type;
432
433 // algebra type
434 typedef TAlgebra algebra_type;
435
436 // extrapolation type
438
439 // constructor
441 (
443 SmartPtr<extrapol_type> spExtrapol
444 )
445 : m_spExtrapolation (spExtrapol)
446 {
447 if (spDispersion.invalid ())
448 UG_THROW ("LSBearScheidegger: No valid disperion specified.");
449 this->set_num_input(1);
450 m_spDispersion = spDispersion;
451 m_spDDispersion = spDispersion.template cast_dynamic<DependentUserData<MathMatrix<dim,dim>, dim> > ();
452 this->set_input (0, spDispersion, spDispersion);
453 }
454
456 const MathVector<dim>& globIP,
457 number time, int si) const
458 {
459 UG_THROW ("LSBearScheidegger needs the grid element.");
460 }
461
462 template <int refDim>
463 inline void evaluate
464 (
465 MathMatrix<dim,dim> vValue[],
466 const MathVector<dim> vGlobIP[],
467 number time,
468 int si,
469 GridObject* elem,
470 const MathVector<dim> vCornerCoords[],
471 const MathVector<refDim> vLocIP[],
472 const size_t nip,
473 LocalVector* u,
474 const MathMatrix<refDim, dim>* vJT = NULL
475 ) const
476 {
477 // check if the element is inside/cut/outside
478 if (m_spExtrapolation.valid ())
479 {
480 const ReferenceObjectID roid = elem->reference_object_id ();
481 const DimReferenceElement<dim>& rRefElem = ReferenceElementProvider::get<dim> (roid);
482
483 if (((extrapol_type *) m_spExtrapolation.get())->check_elem_lsf
484 (rRefElem.num(0), elem, si, false, vCornerCoords, time) <= 0)
485 {
486 for (size_t ip = 0; ip < nip; ++ip) // element is cut or outside
487 MatSet(vValue[ip], 0);
488 return;
489 }
490 }
491
492 // compute the dispersion by the usual formula
493 (* m_spDispersion) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
494 }
495
496 template <int refDim>
498 (
499 MathMatrix<dim,dim> vValue[],
500 const MathVector<dim> vGlobIP[],
501 number time,
502 int si,
503 GridObject* elem,
504 const MathVector<dim> vCornerCoords[],
505 const MathVector<refDim> vLocIP[],
506 const size_t nip,
507 LocalVector* u,
508 bool bDeriv,
509 int s,
510 std::vector<std::vector<MathMatrix<dim,dim> > > vvvDeriv[],
511 const MathMatrix<refDim, dim>* vJT = NULL
512 ) const
513 {
514 // check if the element is inside/cut/outside
515 if (m_spExtrapolation.valid ())
516 {
517 const ReferenceObjectID roid = elem->reference_object_id ();
518 const DimReferenceElement<dim>& rRefElem = ReferenceElementProvider::get<dim> (roid);
519
520 if (((extrapol_type *) m_spExtrapolation.get())->check_elem_lsf
521 (rRefElem.num(0), elem, si, false, vCornerCoords, time) <= 0)
522 {
523 for (size_t ip = 0; ip < nip; ++ip) // element is cut or outside
524 MatSet(vValue[ip], 0);
525 if (bDeriv && ! this->zero_derivative ())
526 this->set_zero (vvvDeriv, nip);
527 return;
528 }
529 }
530
531 // compute the dispersion and its derivatives by the usual formulas
532 const MathMatrix<dim,dim>* vVector = m_spDispersion->values (s);
533 for (size_t i = 0; i < nip; i++)
534 {
535 vValue[i] = vVector[i];
536
537 if (! bDeriv) continue;
538 for (size_t fct = 0; fct < m_spDDispersion->num_fct(); fct++)
539 {
540 const MathMatrix<dim,dim>* vDDispersion = m_spDDispersion->deriv (s, i, fct);
541 const size_t c_fct = this->input_common_fct (0, fct);
542 for (size_t sh = 0; sh < this->num_sh (c_fct); sh++)
543 vvvDeriv[i][c_fct][sh] = vDDispersion [sh];
544 }
545 }
546 }
547
548private:
549
550 // extrapolation by the level-set function
552
553 // the original dispersion
556};
557
564template <typename TDomain, typename TAlgebra>
566 : public StdDataLinker< LSBearScheidegger2<TDomain, TAlgebra>, MathMatrix<TDomain::dim,TDomain::dim>, TDomain::dim>
567{
569
570public:
571
572 // world dimension of grid function
573 static const int dim = TDomain::dim;
574
575 // domain type
576 typedef TDomain domain_type;
577
578 // algebra type
579 typedef TAlgebra algebra_type;
580
581 // extrapolation type
583
584 // constructor
586 (
587 SmartPtr<CplUserData<MathMatrix<dim,dim>, dim> > spDispersion_under,
588 SmartPtr<CplUserData<MathMatrix<dim,dim>, dim> > spDispersion_at,
589 SmartPtr<extrapol_type> spExtrapol
590 )
591 : m_spExtrapolation (spExtrapol)
592 {
593 if (spDispersion_under.invalid ())
594 UG_THROW ("LSBearScheidegger2: No valid disperion under the interface specified.");
595 if (spDispersion_at.invalid ())
596 UG_THROW ("LSBearScheidegger2: No valid disperion at the interface specified.");
597 this->set_num_input(2);
598 m_spDispersion_under = spDispersion_under;
599 m_spDDispersion_under = spDispersion_under.template cast_dynamic<DependentUserData<MathMatrix<dim,dim>, dim> > ();
600 this->set_input (0, spDispersion_under, spDispersion_under);
601 m_spDispersion_at = spDispersion_at;
602 m_spDDispersion_at = spDispersion_at.template cast_dynamic<DependentUserData<MathMatrix<dim,dim>, dim> > ();
603 this->set_input (1, spDispersion_at, spDispersion_at);
604 }
605
607 const MathVector<dim>& globIP,
608 number time, int si) const
609 {
610 UG_THROW ("LSBearScheidegger2 needs the grid element.");
611 }
612
613 template <int refDim>
614 inline void evaluate
615 (
616 MathMatrix<dim,dim> vValue[],
617 const MathVector<dim> vGlobIP[],
618 number time,
619 int si,
620 GridObject* elem,
621 const MathVector<dim> vCornerCoords[],
622 const MathVector<refDim> vLocIP[],
623 const size_t nip,
624 LocalVector* u,
625 const MathMatrix<refDim, dim>* vJT = NULL
626 ) const
627 {
628 // check if the element is inside/cut/outside
629 if (m_spExtrapolation.valid ())
630 {
631 const ReferenceObjectID roid = elem->reference_object_id ();
632 const DimReferenceElement<dim>& rRefElem = ReferenceElementProvider::get<dim> (roid);
633 int lsf;
634
635 if ((lsf = ((extrapol_type *) m_spExtrapolation.get())->check_elem_lsf
636 (rRefElem.num(0), elem, si, false, vCornerCoords, time)) < 0)
637 {
638 for (size_t ip = 0; ip < nip; ++ip) // element is cut outside
639 MatSet(vValue[ip], 0);
640 return;
641 }
642 else if (lsf == 0)
643 {
644 (* m_spDispersion_at) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
645 return;
646 }
647 }
648
649 // compute the dispersion by the usual formula
650 (* m_spDispersion_under) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
651 }
652
653 template <int refDim>
655 (
656 MathMatrix<dim,dim> vValue[],
657 const MathVector<dim> vGlobIP[],
658 number time,
659 int si,
660 GridObject* elem,
661 const MathVector<dim> vCornerCoords[],
662 const MathVector<refDim> vLocIP[],
663 const size_t nip,
664 LocalVector* u,
665 bool bDeriv,
666 int s,
667 std::vector<std::vector<MathMatrix<dim,dim> > > vvvDeriv[],
668 const MathMatrix<refDim, dim>* vJT = NULL
669 ) const
670 {
671 // check if the element is inside/cut/outside
672 if (m_spExtrapolation.valid ())
673 {
674 const ReferenceObjectID roid = elem->reference_object_id ();
675 const DimReferenceElement<dim>& rRefElem = ReferenceElementProvider::get<dim> (roid);
676 int lsf;
677
678 if ((lsf = ((extrapol_type *) m_spExtrapolation.get())->check_elem_lsf
679 (rRefElem.num(0), elem, si, false, vCornerCoords, time)) < 0)
680 {
681 for (size_t ip = 0; ip < nip; ++ip) // element is cut outside
682 MatSet(vValue[ip], 0);
683 if (bDeriv && ! this->zero_derivative ())
684 this->set_zero (vvvDeriv, nip);
685 return;
686 }
687 else if (lsf == 0)
688 {
689 // compute the dispersion and its derivatives by the usual formulas at the interface
690 const MathMatrix<dim,dim>* vVector = m_spDispersion_at->values (s);
691 for (size_t i = 0; i < nip; i++)
692 {
693 vValue[i] = vVector[i];
694
695 if (! bDeriv) continue;
696 for (size_t fct = 0; fct < m_spDDispersion_at->num_fct(); fct++)
697 {
698 const MathMatrix<dim,dim>* vDDispersion_at = m_spDDispersion_at->deriv (s, i, fct);
699 const size_t c_fct = this->input_common_fct (0, fct);
700 for (size_t sh = 0; sh < this->num_sh (c_fct); sh++)
701 vvvDeriv[i][c_fct][sh] = vDDispersion_at [sh];
702 }
703 }
704 return;
705 }
706 }
707
708 // compute the dispersion and its derivatives by the usual formulas under the interface
709 const MathMatrix<dim,dim>* vVector = m_spDispersion_under->values (s);
710 for (size_t i = 0; i < nip; i++)
711 {
712 vValue[i] = vVector[i];
713
714 if (! bDeriv) continue;
715 for (size_t fct = 0; fct < m_spDDispersion_under->num_fct(); fct++)
716 {
717 const MathMatrix<dim,dim>* vDDispersion_under = m_spDDispersion_under->deriv (s, i, fct);
718 const size_t c_fct = this->input_common_fct (0, fct);
719 for (size_t sh = 0; sh < this->num_sh (c_fct); sh++)
720 vvvDeriv[i][c_fct][sh] = vDDispersion_under [sh];
721 }
722 }
723 }
724
725private:
726
727 // extrapolation by the level-set function
729
730 // the original dispersion (under the interface)
733
734 // the effective dispersion at the interface
737};
738
739} // namespace LevelSet
740} // end namespace ug
741
742#endif /* __H__UG__PLUGINS__GRID_FUNC_LS_USER_DATA__ */
parameterString s
Definition Biogas.lua:2
const MathVector< dim, int > * corner() const
virtual void jacobian_transposed(MathMatrix< dim, worldDim > &JT, const MathVector< dim > &locPos) const=0
virtual ReferenceObjectID reference_object_id() const=0
number time() const
const MathVector< dim > & ip(size_t s, size_t ip) const
Definition grid_func_ls_user_data.h:211
virtual bool continuous() const
Definition grid_func_ls_user_data.h:260
static const int dim
Definition grid_func_ls_user_data.h:214
IInterfaceExtrapolation< domain_type, algebra_type > extrapol_type
Definition grid_func_ls_user_data.h:223
size_t m_fct
Definition grid_func_ls_user_data.h:233
GridFuncLSGradientData(SmartPtr< TGridFunction > spGridFct, const char *cmp, SmartPtr< extrapol_type > spExtrapol)
constructor
Definition grid_func_ls_user_data.h:240
TGridFunction::domain_type domain_type
Definition grid_func_ls_user_data.h:217
SmartPtr< TGridFunction > m_spGridFct
Definition grid_func_ls_user_data.h:227
LFEID m_lfeID
Definition grid_func_ls_user_data.h:236
TGridFunction::algebra_type algebra_type
Definition grid_func_ls_user_data.h:220
void eval_and_deriv(MathVector< dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< MathVector< dim > > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Definition grid_func_ls_user_data.h:266
SmartPtr< extrapol_type > m_spExtrapolation
Definition grid_func_ls_user_data.h:230
Definition grid_func_ls_user_data.h:64
TGridFunction::domain_type domain_type
Definition grid_func_ls_user_data.h:70
SmartPtr< extrapol_type > m_spExtrapolation
Definition grid_func_ls_user_data.h:83
GridFuncLSNumberData(SmartPtr< TGridFunction > spGridFct, const char *cmp, SmartPtr< extrapol_type > spExtrapol)
constructor
Definition grid_func_ls_user_data.h:93
void eval_and_deriv(number vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< number > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Definition grid_func_ls_user_data.h:119
virtual bool continuous() const
Definition grid_func_ls_user_data.h:113
size_t m_fct
Definition grid_func_ls_user_data.h:86
IInterfaceExtrapolation< domain_type, algebra_type > extrapol_type
Definition grid_func_ls_user_data.h:76
TGridFunction::algebra_type algebra_type
Definition grid_func_ls_user_data.h:73
LFEID m_lfeID
Definition grid_func_ls_user_data.h:89
SmartPtr< TGridFunction > m_spGridFct
Definition grid_func_ls_user_data.h:80
static const int dim
Definition grid_func_ls_user_data.h:67
Definition grid_func_ls_user_data.h:567
StdDataLinker< LSBearScheidegger2< TDomain, TAlgebra >, MathMatrix< TDomain::dim, TDomain::dim >, TDomain::dim > base_type
Definition grid_func_ls_user_data.h:568
SmartPtr< DependentUserData< MathMatrix< dim, dim >, dim > > m_spDDispersion_at
Definition grid_func_ls_user_data.h:736
TAlgebra algebra_type
Definition grid_func_ls_user_data.h:579
SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > m_spDispersion_at
Definition grid_func_ls_user_data.h:735
IInterfaceExtrapolation< domain_type, algebra_type > extrapol_type
Definition grid_func_ls_user_data.h:582
void evaluate(MathMatrix< dim, dim > &D, const MathVector< dim > &globIP, number time, int si) const
Definition grid_func_ls_user_data.h:606
LSBearScheidegger2(SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > spDispersion_under, SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > spDispersion_at, SmartPtr< extrapol_type > spExtrapol)
Definition grid_func_ls_user_data.h:586
SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > m_spDispersion_under
Definition grid_func_ls_user_data.h:731
void evaluate(MathMatrix< dim, dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< refDim, dim > *vJT=NULL) const
Definition grid_func_ls_user_data.h:615
static const int dim
Definition grid_func_ls_user_data.h:573
void eval_and_deriv(MathMatrix< dim, dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< MathMatrix< dim, dim > > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Definition grid_func_ls_user_data.h:655
SmartPtr< DependentUserData< MathMatrix< dim, dim >, dim > > m_spDDispersion_under
Definition grid_func_ls_user_data.h:732
SmartPtr< extrapol_type > m_spExtrapolation
Definition grid_func_ls_user_data.h:728
TDomain domain_type
Definition grid_func_ls_user_data.h:576
Definition grid_func_ls_user_data.h:422
SmartPtr< extrapol_type > m_spExtrapolation
Definition grid_func_ls_user_data.h:551
LSBearScheidegger(SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > spDispersion, SmartPtr< extrapol_type > spExtrapol)
Definition grid_func_ls_user_data.h:441
TAlgebra algebra_type
Definition grid_func_ls_user_data.h:434
TDomain domain_type
Definition grid_func_ls_user_data.h:431
void eval_and_deriv(MathMatrix< dim, dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< MathMatrix< dim, dim > > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Definition grid_func_ls_user_data.h:498
StdDataLinker< LSBearScheidegger< TDomain, TAlgebra >, MathMatrix< TDomain::dim, TDomain::dim >, TDomain::dim > base_type
Definition grid_func_ls_user_data.h:423
SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > m_spDispersion
Definition grid_func_ls_user_data.h:554
static const int dim
Definition grid_func_ls_user_data.h:428
SmartPtr< DependentUserData< MathMatrix< dim, dim >, dim > > m_spDDispersion
Definition grid_func_ls_user_data.h:555
void evaluate(MathMatrix< dim, dim > &D, const MathVector< dim > &globIP, number time, int si) const
Definition grid_func_ls_user_data.h:455
IInterfaceExtrapolation< domain_type, algebra_type > extrapol_type
Definition grid_func_ls_user_data.h:437
void evaluate(MathMatrix< dim, dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< refDim, dim > *vJT=NULL) const
Definition grid_func_ls_user_data.h:464
virtual void grads(std::vector< std::vector< grad_type > > &vvGrad, const std::vector< MathVector< dim > > &vLocPos) const=0
virtual void shapes(std::vector< std::vector< shape_type > > &vvShape, const std::vector< MathVector< dim > > &vLocPos) const=0
size_t num(int dim) const
virtual void set_input(size_t i, SmartPtr< ICplUserData< dim > > input, SmartPtr< UserDataInfo > info)
void MatSet(matrix_t &mInOut, typename matrix_t::value_type s)
MathMatrix< N, M, T >::value_type Inverse(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
#define UG_CATCH_THROW(msg)
#define UG_THROW(msg)
double number
void MatVecMult(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
void VecScaleAppend(vector_t &vOut, typename vector_t::value_type s1, const vector_t &v1)
ReferenceObjectID
const number & DoFRef(const TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
void VecSet(vector_t &dest, number alpha, const std::vector< size_t > vIndex)