ug4
Loading...
Searching...
No Matches
metric_spaces.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014-2017: G-CSC, Goethe University Frankfurt
3 * Author: Arne Naegel
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#ifndef __H__UG__LIB_DISC__FUNCTION_SPACE__METRIC_SPACES_H_
34#define __H__UG__LIB_DISC__FUNCTION_SPACE__METRIC_SPACES_H_
35
36// C++ includes
37#include <vector>
38#include <cmath>
39
40// UG includes
41#include "common/common.h"
43
46
51
52#include "lib_disc/spatial_disc/user_data/linker/darcy_velocity_linker.h" // required for Darcy velocity linker
53
54namespace ug {
56template<typename TVector>
58{
59
60public:
61 virtual ~IBanachSpace() {}
62
64 virtual double norm(TVector &x)
65 { return x.norm(); }
66
67 virtual double distance(TVector& x, TVector& y)
68 {
69 SmartPtr<TVector> delta = x.clone();
70 *delta -= y;
71 return norm(*delta);
72 }
73
74};
75
76
77
79template<typename TGridFunction>
81 public IBanachSpace<typename TGridFunction::vector_type>
82{
83
84public:
85 typedef typename TGridFunction::vector_type vector_type;
86 typedef TGridFunction grid_function_type;
87
90
92 virtual double norm(TGridFunction& x) = 0;
93 virtual double norm2(TGridFunction& x) = 0;
94
95 // { return x.norm(); }
96
98 virtual double distance(TGridFunction& x, TGridFunction& y) = 0;
99 virtual double distance2(TGridFunction& x, TGridFunction& y) = 0;
100 /*{
101 SmartPtr<TGridFunction> delta = x.clone();
102 *delta -= y;
103 return norm(*delta);
104 }*/
105
107 virtual double norm(vector_type &x)
108 {
109 TGridFunction* gfX=dynamic_cast< TGridFunction*>(&x);
110 UG_ASSERT(gfX!=NULL, "Huhh: GridFunction required!");
111 return norm(*gfX);
112 }
113
115 virtual double distance(vector_type &x, vector_type &y)
116 { return distance(static_cast<TGridFunction &>(x), static_cast<TGridFunction &>(y)); }
117
118 virtual double scaling() const
119 { return 1.0; }
120
121 virtual std::string config_string() const
122 { return std::string("IGridFunctionSpace"); }
123};
124
125template<typename TGridFunction>
126class AlgebraicSpace : public IGridFunctionSpace<TGridFunction>
127{
128 typedef typename TGridFunction::vector_type vector_type;
129 virtual ~AlgebraicSpace() {}
130
131 virtual double norm(TGridFunction& x)
132 {return x.norm();}
133
134 virtual double norm2(TGridFunction& x)
135 { double n = this->norm(x); return n*n; }
136
137 virtual double distance(TGridFunction& x, TGridFunction& y)
138 { SmartPtr<TGridFunction> delta = x.clone(); *delta -= y; return delta->norm(); }
139
140 virtual double distance2(TGridFunction& x, TGridFunction& y)
141 { double d = this->distance(x,y);; return d*d;}
142};
143
144
145
147template <typename W>
169
170
172/*
173class ITimeData {
174
175public:
176 virtual ~ITimeData() {};
177
179 virtual void update_time_data(number dt) = 0;
180
181 virtual bool is_time_dependent() const
182 { return false; }
183
184};
185
186*/
187
189template <typename TGridFunction>
191 public IGridFunctionSpace<TGridFunction>
192{
193protected:
194 std::string m_fctNames;
195 const char* m_ssNames;
197 //bool m_opposite;
198 //number m_thickness;
199 //std::string m_type;
200
201public:
203 static const int dim=TGridFunction::dim;
204
205 IComponentSpace(const char *fctNames)
206 : m_fctNames(fctNames), m_ssNames(NULL), m_quadorder(3){}
207
208 IComponentSpace(const char *fctNames, int order)
209 : m_fctNames(fctNames), m_ssNames(NULL), m_quadorder(order) {}
210
211 IComponentSpace(const char *fctNames, const char* ssNames, int order)
212 : m_fctNames(fctNames), m_ssNames(ssNames), m_quadorder(order){}
213
214 virtual ~IComponentSpace() {};
215
216 // per convention, norm must return sqrt of norm2
217 virtual double norm(TGridFunction& uFine)
218 { return sqrt(norm2(uFine)); }
219
220 // per convention, distance must return sqrt of distance2
221 virtual double distance(TGridFunction& uFine, TGridFunction& uCoarse)
222 { return sqrt(distance2(uFine, uCoarse)); }
223
224 virtual double norm2(TGridFunction& uFine) = 0;
225 virtual double distance2(TGridFunction& uFine, TGridFunction& uCoarse) = 0;
226
227 std::string function_name(){return m_fctNames;}
228
229 //void set_opposite(bool opposite){m_opposite=opposite;}
230
231public:
233 virtual std::string config_string() const
234 {
235 std::stringstream ss;
236
237 if (this->m_ssNames)
238 ss << this->m_fctNames << ", " << this->m_ssNames << ", " << this->m_quadorder
239 << ", type=" << std::endl;
240
241 else
242 ss << this->m_fctNames << ", (no name), " << this->m_quadorder
243 << ", type=" << std::endl;
244 return ss.str();
245 }
246
247};
248
249
252template <typename TGridFunction>
254: public IComponentSpace<TGridFunction>
255{
256 public:
257 GridFunctionComponentSpace(const char* fctNames)
258 : IComponentSpace<TGridFunction>(fctNames) {}
259
260 GridFunctionComponentSpace(const char* fctNames, const char* ssNames)
261 : IComponentSpace<TGridFunction>(fctNames, ssNames, 1) {}
262
264
265 virtual double norm2(TGridFunction& uFine)
266 {
267 ConstSmartPtr<DoFDistribution> dd = uFine.dof_distribution();
268
269 // find function indices
270 FunctionGroup fg(dd->function_pattern());
271 try {fg.add(TokenizeTrimString(this->m_fctNames));}
272 UG_CATCH_THROW("Could not convert function names to function indices.");
273
274 // find subset indices
275 SubsetGroup sg(dd->subset_handler());
276 if (this->m_ssNames)
277 {
278 try {sg.add(TokenizeTrimString(this->m_ssNames));}
279 UG_CATCH_THROW("Could not convert subset names to subset indices.");
280 }
281 else
282 sg.add_all();
283
284
285 // loop subsets
286 number sum = 0.0;
287 const size_t sgSz = sg.size();
288 for (size_t i = 0; i < sgSz; ++i)
289 {
290 int si = sg[i];
291 if (dd->max_dofs(VERTEX, si)) add_norm_values<Vertex>(sum, uFine, dd, sg[i], fg);
292 if (dd->max_dofs(EDGE, si)) add_norm_values<Edge>(sum, uFine, dd, sg[i], fg);
293 if (dd->max_dofs(FACE, si)) add_norm_values<Face>(sum, uFine, dd, sg[i], fg);
294 if (dd->max_dofs(VOLUME, si)) add_norm_values<Volume>(sum, uFine, dd, sg[i], fg);
295 }
296
297#ifdef UG_PARALLEL
298 if (pcl::NumProcs() > 1)
299 {
301 sum = pc.allreduce(sum, PCL_RO_SUM);
302 }
303#endif
304
305 return sum;
306 }
307
308 virtual double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
309 {
310 ConstSmartPtr<DoFDistribution> dd = uFine.dof_distribution();
311 UG_COND_THROW(dd != uCoarse.dof_distribution(),
312 "GridFunctionComponentSpace::distance2: GF1 DoF distro is not the same as for GF2.\n"
313 "This case is not implemented.");
314
315 // find function indices
316 FunctionGroup fg(dd->function_pattern());
317 try {fg.add(TokenizeTrimString(this->m_fctNames));}
318 UG_CATCH_THROW("Could not convert function names to function indices.");
319
320 // find subset indices
321 SubsetGroup sg(dd->subset_handler());
322 if (this->m_ssNames)
323 {
324 try {sg.add(TokenizeTrimString(this->m_ssNames));}
325 UG_CATCH_THROW("Could not convert subset names to subset indices.");
326 }
327 else
328 sg.add_all();
329
330
331 // loop subsets
332 number sum = 0.0;
333 const size_t sgSz = sg.size();
334 for (size_t i = 0; i < sgSz; ++i)
335 {
336 int si = sg[i];
337 if (dd->max_dofs(VERTEX, si)) add_distance_values<Vertex>(sum, uFine, uCoarse, dd, sg[i], fg);
338 if (dd->max_dofs(EDGE, si)) add_distance_values<Edge>(sum, uFine, uCoarse, dd, sg[i], fg);
339 if (dd->max_dofs(FACE, si)) add_distance_values<Face>(sum, uFine, uCoarse, dd, sg[i], fg);
340 if (dd->max_dofs(VOLUME, si)) add_distance_values<Volume>(sum, uFine, uCoarse, dd, sg[i], fg);
341 }
342
343#ifdef UG_PARALLEL
344 if (pcl::NumProcs() > 1)
345 {
347 sum = pc.allreduce(sum, PCL_RO_SUM);
348 }
349#endif
350
351 return sum;
352 }
353
354 private:
355 template <typename TBaseElem>
357 (
358 number& sum,
359 const TGridFunction& uFine,
360 const TGridFunction& uCoarse,
362 int si,
363 const FunctionGroup& fg
364 ) const
365 {
366 const SurfaceView& sv = *dd->surface_view();
367 const MultiGrid& mg = *dd->multi_grid();
368
369 const number nFct = fg.size();
370
371 // iterate all elements (including SHADOW_RIM_COPY!)
373 iter = dd->template begin<TBaseElem>(si, SurfaceView::ALL);
374 iterEnd = dd->template end<TBaseElem>(si, SurfaceView::ALL);
375 std::vector<DoFIndex> vInd;
376 for (; iter != iterEnd; ++iter)
377 {
378 TBaseElem* elem = *iter;
379 if (sv.is_contained(elem, dd->grid_level(), SurfaceView::SHADOW_RIM_COPY))
380 {
381 if (mg.num_children<TBaseElem>(elem) > 0)
382 {
383 TBaseElem* child = mg.get_child<TBaseElem>(elem, 0);
384 if (sv.is_contained(child, dd->grid_level(), SurfaceView::SURFACE_RIM))
385 continue;
386 }
387 }
388
389 for (size_t fi = 0; fi < nFct; ++fi)
390 {
391 dd->inner_dof_indices(elem, fg[fi], vInd);
392
393 const size_t nDof = vInd.size();
394 for (size_t dof = 0; dof < nDof; ++dof)
395 {
396 const number tmp = DoFRef(uFine, vInd[dof]) - DoFRef(uCoarse, vInd[dof]);
397 sum += tmp*tmp;
398 }
399 }
400 }
401 // note: no duplicate additions possible
402 }
403
404 template <typename TBaseElem>
406 (
407 number& sum,
408 const TGridFunction& uFine,
410 int si,
411 const FunctionGroup& fg
412 ) const
413 {
414 const SurfaceView& sv = *dd->surface_view();
415 const MultiGrid& mg = *dd->multi_grid();
416
417 const number nFct = fg.size();
418
419 // iterate all elements (including SHADOW_RIM_COPY!)
421 iter = dd->template begin<TBaseElem>(si, SurfaceView::ALL);
422 iterEnd = dd->template end<TBaseElem>(si, SurfaceView::ALL);
423 std::vector<DoFIndex> vInd;
424 for (; iter != iterEnd; ++iter)
425 {
426 TBaseElem* elem = *iter;
427 if (sv.is_contained(elem, dd->grid_level(), SurfaceView::SHADOW_RIM_COPY))
428 {
429 if (mg.num_children<TBaseElem>(elem) > 0)
430 {
431 TBaseElem* child = mg.get_child<TBaseElem>(elem, 0);
432 if (sv.is_contained(child, dd->grid_level(), SurfaceView::SURFACE_RIM))
433 continue;
434 }
435 }
436
437 for (size_t fi = 0; fi < nFct; ++fi)
438 {
439 dd->inner_dof_indices(elem, fg[fi], vInd);
440
441 const size_t nDof = vInd.size();
442 for (size_t dof = 0; dof < nDof; ++dof)
443 {
444 const number tmp = DoFRef(uFine, vInd[dof]);
445 sum += tmp*tmp;
446 }
447 }
448 }
449 // note: no duplicate additions possible
450 }
451};
452
453
454
456template <typename TGridFunction>
458 public IGridFunctionSpace<TGridFunction>
459{
460public:
463
467
470
471 using base_type::norm;
473 using base_type::scaling;
474
476 double scaling() const
477 { return (m_spSpatialSpace->scaling()*m_tScale); }
478
481 { m_tScale = tScale; }
482
484 std::string config_string() const
485 {
486 std::stringstream ss;
487 ss << "TimeDependentSpace for " << std::endl;
488 ss << m_spSpatialSpace->config_string() << std::endl;
489 return ss.str();
490 }
491
492protected:
495};
496
497
499template <typename TGridFunction>
501 public IComponentSpace<TGridFunction>,
502 public IObjectWithWeights<typename L2DistIntegrand<TGridFunction>::weight_type >
503{
504public:
508
510 L2ComponentSpace(const char *fctNames)
511 : base_type(fctNames), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(1.0))) {};
512
513 L2ComponentSpace(const char *fctNames, int order)
514 : base_type(fctNames, order), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(1.0))) {};
515
516 L2ComponentSpace(const char *fctNames, int order, double weight, const char* ssNames=0)
517 : base_type(fctNames, ssNames, order), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(weight))) {};
518
519 L2ComponentSpace(const char *fctNames, int order, ConstSmartPtr<weight_type> spWeight, const char* ssNames=0)
520 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight) {};
521
524
525 using IComponentSpace<TGridFunction>::norm;
526 using IComponentSpace<TGridFunction>::distance;
527
532
534 double norm2(TGridFunction& uFine)
535 { return L2Norm2(uFine, base_type::m_fctNames.c_str(), base_type::m_quadorder, base_type::m_ssNames, weighted_obj_type::m_spWeight); }
536
538 double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
539 { return L2Distance2(uFine, base_type::m_fctNames.c_str(), uCoarse, base_type::m_fctNames.c_str(),
540 base_type::m_quadorder, base_type::m_ssNames, weighted_obj_type::m_spWeight);}
541
542
543
544};
545
547template <typename TGridFunction>
549 public IComponentSpace<TGridFunction>,
550 public IObjectWithWeights<typename L2DistIntegrand<TGridFunction>::weight_type >
551{
552public:
556
558 L2QuotientSpace(const char *fctNames)
559 : base_type(fctNames), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(1.0))) {};
560
561 L2QuotientSpace(const char *fctNames, int order)
562 : base_type(fctNames, order), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(1.0))) {};
563
564 L2QuotientSpace(const char *fctNames, int order, double weight, const char* ssNames=0)
565 : base_type(fctNames, ssNames, order), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(weight))) {};
566
567 L2QuotientSpace(const char *fctNames, int order, ConstSmartPtr<weight_type> spWeight, const char* ssNames=0)
568 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight) {};
569
572
573 using IComponentSpace<TGridFunction>::norm;
574 using IComponentSpace<TGridFunction>::distance;
575
580
582 double norm2(TGridFunction& u)
583 {
584 typedef ConstUserNumber<TGridFunction::dim> MyConstUserData;
586
587 SPUserData spConst= make_sp(new MyConstUserData(1.0));
588 number Meas = Integral(spConst, u, base_type::m_ssNames, 0.0, 1, "best");
589 number uAvg = Integral(u, base_type::m_fctNames.c_str(), base_type::m_ssNames, base_type::m_quadorder);
590
591 std::cerr << "Average:=" << uAvg <<"/" << Meas << " = " << uAvg/Meas << std::endl;
592 SPUserData spAvg = make_sp(new MyConstUserData(uAvg/Meas));
593 double qnorm = L2Error(spAvg, u, base_type::m_fctNames.c_str(), 0.0, base_type::m_quadorder, base_type::m_ssNames);
594
595 return qnorm*qnorm;
596 }
597
599 double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
600 {
601 typedef ConstUserNumber<TGridFunction::dim> MyConstUserData;
603
604 SPUserData spConst= make_sp(new MyConstUserData(1.0));
605 number Meas = Integral(spConst, uFine, base_type::m_ssNames, 0.0, 1, "best");
606 number avgFine = Integral(uFine, base_type::m_fctNames.c_str(), base_type::m_ssNames, base_type::m_quadorder);
607 number avgCoarse = Integral(uCoarse, base_type::m_fctNames.c_str(), base_type::m_ssNames, base_type::m_quadorder);
608
609 std::cerr << "Average:=(" << avgFine << "-" << avgCoarse<<")/" << Meas << " = " << (avgFine-avgCoarse)/Meas << std::endl;
610 return L2Distance2(uFine, base_type::m_fctNames.c_str(),
611 uCoarse, base_type::m_fctNames.c_str(),
612 base_type::m_quadorder, base_type::m_ssNames, weighted_obj_type::m_spWeight,
613 (avgFine-avgCoarse)/Meas);
614 }
615
616
617
618};
619
620
622template <typename TGridFunction>
624: public IComponentSpace<TGridFunction>,
625 public IObjectWithWeights<typename H1SemiDistIntegrand<TGridFunction>::weight_type >
626{
627public:
631
632
633 H1SemiComponentSpace(const char *fctNames)
634 : base_type(fctNames), weighted_obj_type(make_sp(new ConstUserMatrix<TGridFunction::dim>(1.0))) {};
635
636 H1SemiComponentSpace(const char *fctNames, int order)
637 : base_type(fctNames, order), weighted_obj_type(make_sp(new ConstUserMatrix<TGridFunction::dim>(1.0))) {};
638
639 H1SemiComponentSpace(const char *fctNames, int order, number weight, const char* ssNames=0)
640 : base_type(fctNames, ssNames, order), weighted_obj_type(make_sp(new ConstUserMatrix<TGridFunction::dim>(weight))) {};
641
642 H1SemiComponentSpace(const char *fctNames, int order, ConstSmartPtr<weight_type> spWeight, const char* ssNames=0)
643 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight) {};
644
645 H1SemiComponentSpace(const char *fctNames, int order, const char* ssNames, ConstSmartPtr<weight_type> spWeight)
646 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight) {};
647
650
651
654 using IComponentSpace<TGridFunction>::norm;
655 using IComponentSpace<TGridFunction>::distance;
656
658 double norm2(TGridFunction& uFine)
659 { return H1SemiNorm2<TGridFunction>(uFine, base_type::m_fctNames.c_str(), base_type::m_quadorder, NULL, weighted_obj_type::m_spWeight); }
660
662 double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
663 { return H1SemiDistance2<TGridFunction>(uFine, base_type::m_fctNames.c_str(), uCoarse, base_type::m_fctNames.c_str(), base_type::m_quadorder, m_spWeight); }
664
669
670};
671
672
673
674/*
676template <typename TGridFunction>
677class KineticEnergyComponentSpace
678: public IComponentSpace<TGridFunction>,
679 public IObjectWithWeights<typename L2Integrand<TGridFunction>::weight_type >
680{
681public:
682 typedef IComponentSpace<TGridFunction> base_type;
683 typedef typename L2Integrand<TGridFunction>::weight_type weight_type;
684 typedef IObjectWithWeights<weight_type> weighted_obj_type;
685 typedef DarcyVelocityLinker<TGridFunction::dim> velocity_type;
686
687
688 KineticEnergyComponentSpace(SmartPtr<velocity_type> spVelocity, const char *fctNames)
689 : base_type(fctNames), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(1.0))), m_spVelocity(spVelocity) {};
690
691 KineticEnergyComponentSpace(SmartPtr<velocity_type> spVelocity, const char *fctNames, int order)
692 : base_type(fctNames, order), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(1.0))), m_spVelocity(spVelocity) {};
693
694 KineticEnergyComponentSpace(SmartPtr<velocity_type> spVelocity, const char *fctNames, int order, number weight, const char* ssNames=0)
695 : base_type(fctNames, ssNames, order), weighted_obj_type(make_sp(new ConstUserNumber<TGridFunction::dim>(weight))), m_spVelocity(spVelocity) {};
696
697 KineticEnergyComponentSpace(SmartPtr<velocity_type> spVelocity, const char *fctNames, int order, ConstSmartPtr<weight_type> spWeight, const char* ssNames=0)
698 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight), m_spVelocity(spVelocity) {};
699
700 KineticEnergyComponentSpace(SmartPtr<velocity_type> spVelocity, const char *fctNames, int order, const char* ssNames, ConstSmartPtr<weight_type> spWeight)
701 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight), m_spVelocity(spVelocity) {};
702
704 ~KineticEnergyComponentSpace() {};
705
706
707 using IComponentSpace<TGridFunction>::m_quadorder;
708 using IComponentSpace<TGridFunction>::norm;
709 using IComponentSpace<TGridFunction>::distance;
710
712 double norm2(TGridFunction& u)
713 {
714 const char* subsets = NULL;
715 UserDataIntegrandSq<MathVector<TGridFunction::dim>, TGridFunction> integrand2(m_spVelocity, &u, 0.0);
716 return IntegrateSubsets(integrand2, u, subsets, m_quadorder);
717 }
718
720 double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
721 {
722 // UG_THROW("Not implemented!");
723 const char* subsets = NULL;
724 UserDataDistIntegrandSq<MathVector<TGridFunction::dim>, TGridFunction> integrand2(m_spVelocity, uFine, 0, uCoarse, 0);
725 return IntegrateSubsets(integrand2, uFine, subsets, m_quadorder);
726 }
727
729 using weighted_obj_type::set_weight;
730 using weighted_obj_type::get_weight;
731 using weighted_obj_type::m_spWeight;
732
733 void set_velocity(SmartPtr<velocity_type> spVelocity)
734 { m_spVelocity = spVelocity;}
735
736protected:
737 SmartPtr<velocity_type> m_spVelocity;
738
739};
740*/
741
743
744template <typename TGridFunction>
746: public IComponentSpace<TGridFunction>,
747 public IObjectWithWeights<typename H1EnergyDistIntegrand<TGridFunction>::weight_type >
748{
749public:
753 // typedef DarcyVelocityLinker<TGridFunction::dim> velocity_type;
754 static const int dim = TGridFunction::dim;
756
757 H1EnergyComponentSpace(const char *fctNames)
758 : base_type(fctNames), weighted_obj_type(make_sp(new ConstUserMatrix<TGridFunction::dim>(1.0))), m_spVelocity(SPNULL) {};
759
760 H1EnergyComponentSpace(const char *fctNames, int order)
761 : base_type(fctNames, order), weighted_obj_type(make_sp(new ConstUserMatrix<TGridFunction::dim>(1.0))), m_spVelocity(SPNULL) {};
762
763 H1EnergyComponentSpace(const char *fctNames, int order, number weight, const char* ssNames=0)
764 : base_type(fctNames, ssNames, order), weighted_obj_type(make_sp(new ConstUserMatrix<TGridFunction::dim>(weight))), m_spVelocity(SPNULL) {};
765
766 H1EnergyComponentSpace(const char *fctNames, int order, ConstSmartPtr<weight_type> spWeight, const char* ssNames=0)
767 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight), m_spVelocity(SPNULL) {};
768
769 /*H1EnergyComponentSpace(const char *fctNames, int order, const char* ssNames, ConstSmartPtr<weight_type> spWeight)
770 : base_type(fctNames, ssNames, order), weighted_obj_type(spWeight), m_spVelocity(SPNULL) {};*/
771
774
775
778 using IComponentSpace<TGridFunction>::norm;
779 using IComponentSpace<TGridFunction>::distance;
780
782 double norm2(TGridFunction& uFine)
783 {
784 if (m_spVelocity.valid()) {
785 //const char* subsets = NULL; // [q^2]
786 UserDataIntegrandSq<MathVector<TGridFunction::dim>, TGridFunction> integrand2(m_spVelocity, &uFine, 0.0);
787 return IntegrateSubsets(integrand2, uFine, base_type::m_ssNames, base_type::m_quadorder);
788 } else {
789 return H1EnergyNorm2<TGridFunction>(uFine, base_type::m_fctNames.c_str(), base_type::m_quadorder, base_type::m_ssNames, weighted_obj_type::m_spWeight);
790 }
791 }
792
794 double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
795 { return H1EnergyDistance2<TGridFunction>(uFine, base_type::m_fctNames.c_str(), uCoarse, base_type::m_fctNames.c_str(), base_type::m_quadorder,base_type::m_ssNames, weighted_obj_type::m_spWeight); }
796
800
802 { m_spVelocity = spVelocity;}
803
804protected:
806
807};
808
810template <typename TGridFunction>
812 public IComponentSpace<TGridFunction>
813{
814public:
816
817 H1ComponentSpace(const char *fctNames) : base_type(fctNames) {};
818 H1ComponentSpace(const char *fctNames, int order) : base_type(fctNames, order) {};
819 H1ComponentSpace(const char *fctNames, const char* ssNames, int order) : base_type(fctNames, ssNames, order) {};
821
822 using IComponentSpace<TGridFunction>::norm;
823 using IComponentSpace<TGridFunction>::distance;
824
826 double norm2(TGridFunction& uFine)
827 { return H1Norm2<TGridFunction>(uFine, base_type::m_fctNames.c_str(), base_type::m_quadorder, base_type::m_ssNames); }
828
830 double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
831 { return H1Distance2<TGridFunction>(uFine, base_type::m_fctNames.c_str(), uCoarse, base_type::m_fctNames.c_str(), base_type::m_quadorder, base_type::m_ssNames); }
832
833};
834
835
836
838
841template <typename TGridFunction>
842class CompositeSpace : public IGridFunctionSpace<TGridFunction>
843{
844public:
848 typedef std::pair<SmartPtr<obj_type>, number> weighted_obj_type;
849
851 // virtual ~CompositeSpace() {};
852
853 using base_type::norm;
855
857 double norm(TGridFunction& uFine)
858 { return(sqrt(norm2(uFine))); }
859
861 double norm2(TGridFunction& uFine)
862 {
863 number unorm2 = 0.0;
864 for (typename std::vector<weighted_obj_type>::iterator it = m_spWeightedSubspaces.begin();
865 it!= m_spWeightedSubspaces.end(); ++it)
866 {
867 double snorm2 = it->first->norm2(uFine);
868 unorm2 += it->second * snorm2; // scaling
869 UG_LOG("composite-norm2:\t" << snorm2 << "\t*\t" << it->second
870 << "\t=\t" << it->second * snorm2 << std::endl);
871 }
872 UG_LOG("composite-norm2-final:\t" << unorm2 << std::endl);
873 return unorm2;
874 }
875
877 double distance2(TGridFunction& uFine, TGridFunction& uCoarse)
878 {
879 number unorm2 = 0.0;
880 for (typename std::vector<weighted_obj_type>::iterator it = m_spWeightedSubspaces.begin();
881 it!= m_spWeightedSubspaces.end(); ++it)
882 {
883 double sdist2 = it->first->distance2(uFine, uCoarse);
884 unorm2 += it->second * sdist2; // scaling
885 UG_LOG("composite-dist2:\t" << sdist2 << "\t*\t" << it->second
886 << "\t=\t" << it->second * sdist2 << std::endl);
887 }
888 UG_LOG("composite-dist2-final:\t" << unorm2 << std::endl);
889 return unorm2;
890 }
891
893 double distance(TGridFunction& uFine, TGridFunction& uCoarse)
894 { return sqrt(distance2(uFine, uCoarse)); }
895
897 void add(SmartPtr<obj_type> spSubSpace)
898 { m_spWeightedSubspaces.push_back(std::make_pair(spSubSpace, 1.0)); }
899
901 void add(SmartPtr<obj_type> spSubSpace, number sigma)
902 { m_spWeightedSubspaces.push_back(std::make_pair(spSubSpace, sigma)); }
903
905 std::string config_string() const
906 {
907 std::stringstream ss;
908 ss << "CompositeSpace:" << std::endl;
909
910 for (typename std::vector<weighted_obj_type>::const_iterator it = m_spWeightedSubspaces.begin();
911 it!= m_spWeightedSubspaces.end(); ++it)
912 { ss << it->first->config_string(); }
913
914 return ss.str();
915 }
916
917
920 {
921 for (typename std::vector<weighted_obj_type>::iterator it = m_spWeightedSubspaces.begin();
922 it!= m_spWeightedSubspaces.end(); ++it)
923 {
924 SmartPtr<time_dependent_obj_type> spSpaceT = it->first.template cast_dynamic<time_dependent_obj_type> ();
925 if (spSpaceT.valid()) spSpaceT->update_time_data(t);
926 }
927 }
928
930 bool is_time_dependent() const
931 {
932 for (typename std::vector<weighted_obj_type>::const_iterator it = m_spWeightedSubspaces.begin();
933 it!= m_spWeightedSubspaces.end(); ++it)
934 {
935 SmartPtr<time_dependent_obj_type> spSpaceT = it->first.template cast_dynamic<time_dependent_obj_type>();
936 if (spSpaceT.valid()) return true;
937 }
938 return false;
939 }
940
941 const std::vector<weighted_obj_type> &get_subspaces() const
942 { return m_spWeightedSubspaces; }
943
944protected:
945 std::vector<weighted_obj_type> m_spWeightedSubspaces;
946
947};
948
949/*
950template <typename TGridFunction>
951class TimeDependentCompositeSpace
952 : public CompositeSpace<TGridFunction>, public ITimeDependentSpace<TGridFunction>
953{
954protected:
955 using CompositeSpace<TGridFunction>::m_spSubspaces;
956
957public:
958 typedef typename IComponentSpace<TGridFunction> obj_type;
959
960
962 void add(SmartPtr<obj_type> spSubSpace)
963 { m_spSubspaces.push_back(make_sp(new ITimeDependentSpace(spSubSpace))); }
964
966 void update_time_data(number t)
967 {
968 for (typename std::vector<SmartPtr<obj_type> >::iterator it = m_spSubspaces.begin();
969 it!= m_spSubspaces.end(); ++it)
970 { if ((*it)->is_time_dependent()) (*it)->update_time_data(t); }
971 }
972
974 bool is_time_dependent() const
975 {
976 for (typename std::vector<SmartPtr<obj_type> >::const_iterator it = m_spSubspaces.begin();
977 it!= m_spSubspaces.end(); ++it)
978 { if ((*it)->is_time_dependent()) return true; }
979 return false;
980 }
981};
982
983 */
984
985} // namespace ug
986#endif
Definition smart_pointer.h:296
Definition smart_pointer.h:108
bool valid() const
returns true if the pointer is valid, false if not.
Definition smart_pointer.h:206
Definition pcl_process_communicator.h:70
void allreduce(const void *sendBuf, void *recBuf, int count, DataType type, ReduceOperation op) const
performs MPI_Allreduce on the processes of the communicator.
Definition pcl_process_communicator.cpp:318
Definition metric_spaces.h:127
virtual double distance(TGridFunction &x, TGridFunction &y)
distance (for grid functions)
Definition metric_spaces.h:137
TGridFunction::vector_type vector_type
Definition metric_spaces.h:128
virtual ~AlgebraicSpace()
Definition metric_spaces.h:129
virtual double distance2(TGridFunction &x, TGridFunction &y)
Definition metric_spaces.h:140
virtual double norm2(TGridFunction &x)
Definition metric_spaces.h:134
virtual double norm(TGridFunction &x)
norm (for grid functions)
Definition metric_spaces.h:131
Defines a composite space, (i.e., additive composition from other spaces)
Definition metric_spaces.h:843
const std::vector< weighted_obj_type > & get_subspaces() const
Definition metric_spaces.h:941
IGridFunctionSpace< TGridFunction > base_type
Definition metric_spaces.h:845
TimeDependentSpace< TGridFunction > time_dependent_obj_type
Definition metric_spaces.h:847
std::string config_string() const
print config string
Definition metric_spaces.h:905
double norm(TGridFunction &uFine)
norm (for grid functions)
Definition metric_spaces.h:857
double norm2(TGridFunction &uFine)
Definition metric_spaces.h:861
bool is_time_dependent() const
Check, if any object is time-dependent.
Definition metric_spaces.h:930
double distance2(TGridFunction &uFine, TGridFunction &uCoarse)
Definition metric_spaces.h:877
std::vector< weighted_obj_type > m_spWeightedSubspaces
Definition metric_spaces.h:945
void add(SmartPtr< obj_type > spSubSpace)
add space to composite (with weight 1.0)
Definition metric_spaces.h:897
std::pair< SmartPtr< obj_type >, number > weighted_obj_type
Definition metric_spaces.h:848
void update_time_data(number t)
Forward update to all members.
Definition metric_spaces.h:919
void add(SmartPtr< obj_type > spSubSpace, number sigma)
add space to composite (with variable weight)
Definition metric_spaces.h:901
double distance(TGridFunction &uFine, TGridFunction &uCoarse)
Definition metric_spaces.h:893
CompositeSpace()
Definition metric_spaces.h:850
IComponentSpace< TGridFunction > obj_type
Definition metric_spaces.h:846
constant matrix user data
Definition const_user_data.h:232
constant scalar user data
Definition const_user_data.h:153
Definition function_group.h:52
void add(size_t fct)
adds a function by id to this group
Definition function_group.cpp:79
size_t size() const
number of functions in this group
Definition function_group.h:116
Definition metric_spaces.h:255
virtual double distance2(TGridFunction &uFine, TGridFunction &uCoarse)
Definition metric_spaces.h:308
GridFunctionComponentSpace(const char *fctNames, const char *ssNames)
Definition metric_spaces.h:260
void add_distance_values(number &sum, const TGridFunction &uFine, const TGridFunction &uCoarse, ConstSmartPtr< DoFDistribution > dd, int si, const FunctionGroup &fg) const
Definition metric_spaces.h:357
virtual double norm2(TGridFunction &uFine)
Definition metric_spaces.h:265
void add_norm_values(number &sum, const TGridFunction &uFine, ConstSmartPtr< DoFDistribution > dd, int si, const FunctionGroup &fg) const
Definition metric_spaces.h:406
GridFunctionComponentSpace(const char *fctNames)
Definition metric_spaces.h:257
virtual ~GridFunctionComponentSpace()
Definition metric_spaces.h:263
Definition metric_spaces.h:813
~H1ComponentSpace()
Definition metric_spaces.h:820
H1ComponentSpace(const char *fctNames, const char *ssNames, int order)
Definition metric_spaces.h:819
H1ComponentSpace(const char *fctNames)
Definition metric_spaces.h:817
double norm2(TGridFunction &uFine)
norm (for grid functions)
Definition metric_spaces.h:826
H1ComponentSpace(const char *fctNames, int order)
Definition metric_spaces.h:818
IComponentSpace< TGridFunction > base_type
Definition metric_spaces.h:815
double distance2(TGridFunction &uFine, TGridFunction &uCoarse)
norm (for grid functions)
Definition metric_spaces.h:830
Definition metric_spaces.h:748
IObjectWithWeights< weight_type > weighted_obj_type
Definition metric_spaces.h:752
H1SemiDistIntegrand< TGridFunction >::weight_type weight_type
Definition metric_spaces.h:751
H1EnergyComponentSpace(const char *fctNames, int order, ConstSmartPtr< weight_type > spWeight, const char *ssNames=0)
Definition metric_spaces.h:766
double norm2(TGridFunction &uFine)
Definition metric_spaces.h:782
SmartPtr< velocity_type > m_spVelocity
Definition metric_spaces.h:805
double distance2(TGridFunction &uFine, TGridFunction &uCoarse)
Definition metric_spaces.h:794
IComponentSpace< TGridFunction > base_type
Definition metric_spaces.h:750
UserData< MathVector< dim >, dim > velocity_type
Definition metric_spaces.h:755
static const int dim
Definition metric_spaces.h:754
~H1EnergyComponentSpace()
DTOR.
Definition metric_spaces.h:773
H1EnergyComponentSpace(const char *fctNames)
Definition metric_spaces.h:757
H1EnergyComponentSpace(const char *fctNames, int order)
Definition metric_spaces.h:760
H1EnergyComponentSpace(const char *fctNames, int order, number weight, const char *ssNames=0)
Definition metric_spaces.h:763
void set_velocity(SmartPtr< velocity_type > spVelocity)
Definition metric_spaces.h:801
Definition metric_spaces.h:626
H1SemiDistIntegrand< TGridFunction >::weight_type weight_type
Definition metric_spaces.h:629
IComponentSpace< TGridFunction > base_type
Definition metric_spaces.h:628
ConstSmartPtr< weight_type > m_spWeight
Definition metric_spaces.h:167
H1SemiComponentSpace(const char *fctNames, int order, ConstSmartPtr< weight_type > spWeight, const char *ssNames=0)
Definition metric_spaces.h:642
IObjectWithWeights< weight_type > weighted_obj_type
Definition metric_spaces.h:630
H1SemiComponentSpace(const char *fctNames, int order, const char *ssNames, ConstSmartPtr< weight_type > spWeight)
Definition metric_spaces.h:645
H1SemiComponentSpace(const char *fctNames, int order)
Definition metric_spaces.h:636
~H1SemiComponentSpace()
DTOR.
Definition metric_spaces.h:649
H1SemiComponentSpace(const char *fctNames, int order, number weight, const char *ssNames=0)
Definition metric_spaces.h:639
H1SemiComponentSpace(const char *fctNames)
Definition metric_spaces.h:633
double norm2(TGridFunction &uFine)
Definition metric_spaces.h:658
double distance2(TGridFunction &uFine, TGridFunction &uCoarse)
Definition metric_spaces.h:662
Abstract base class for (algebraic) vectors.
Definition metric_spaces.h:58
virtual double norm(TVector &x)
euclidean norm (default)
Definition metric_spaces.h:64
virtual double distance(TVector &x, TVector &y)
Definition metric_spaces.h:67
virtual ~IBanachSpace()
Definition metric_spaces.h:61
Estimate the error (based on the difference between two grid functions)
Definition metric_spaces.h:192
virtual std::string config_string() const
print config string
Definition metric_spaces.h:233
int m_quadorder
Definition metric_spaces.h:196
std::string function_name()
Definition metric_spaces.h:227
IGridFunctionSpace< TGridFunction > base_type
Definition metric_spaces.h:202
virtual double distance2(TGridFunction &uFine, TGridFunction &uCoarse)=0
IComponentSpace(const char *fctNames, int order)
Definition metric_spaces.h:208
IComponentSpace(const char *fctNames, const char *ssNames, int order)
Definition metric_spaces.h:211
IComponentSpace(const char *fctNames)
Definition metric_spaces.h:205
virtual double norm(TGridFunction &uFine)
norm (for grid functions)
Definition metric_spaces.h:217
virtual double norm2(TGridFunction &uFine)=0
virtual ~IComponentSpace()
Definition metric_spaces.h:214
std::string m_fctNames
Definition metric_spaces.h:194
virtual double distance(TGridFunction &uFine, TGridFunction &uCoarse)
distance (for grid functions)
Definition metric_spaces.h:221
const char * m_ssNames
Definition metric_spaces.h:195
static const int dim
Definition metric_spaces.h:203
Abstract base class for grid functions.
Definition metric_spaces.h:82
virtual double distance(vector_type &x, vector_type &y)
OVERRIDE distance (for vectors)
Definition metric_spaces.h:115
virtual ~IGridFunctionSpace()
DTOR.
Definition metric_spaces.h:89
virtual std::string config_string() const
Definition metric_spaces.h:121
virtual double distance2(TGridFunction &x, TGridFunction &y)=0
virtual double norm(vector_type &x)
OVERRIDE norm (for vectors)
Definition metric_spaces.h:107
TGridFunction grid_function_type
Definition metric_spaces.h:86
virtual double norm(TGridFunction &x)=0
norm (for grid functions)
TGridFunction::vector_type vector_type
Definition metric_spaces.h:85
virtual double distance(TGridFunction &x, TGridFunction &y)=0
distance (for grid functions)
virtual double scaling() const
Definition metric_spaces.h:118
virtual double norm2(TGridFunction &x)=0
Definition metric_spaces.h:149
W weight_type
Definition metric_spaces.h:151
ConstSmartPtr< weight_type > m_spWeight
Definition metric_spaces.h:167
void set_weight(ConstSmartPtr< weight_type > spWeight)
for weighted norms
Definition metric_spaces.h:160
IObjectWithWeights()
Definition metric_spaces.h:153
ConstSmartPtr< weight_type > get_weight()
Definition metric_spaces.h:163
IObjectWithWeights(ConstSmartPtr< weight_type > spW)
Definition metric_spaces.h:156
Definition metric_spaces.h:503
L2DistIntegrand< TGridFunction >::weight_type weight_type
Definition metric_spaces.h:506
IComponentSpace< TGridFunction > base_type
Definition metric_spaces.h:505
L2ComponentSpace(const char *fctNames, int order, double weight, const char *ssNames=0)
Definition metric_spaces.h:516
L2ComponentSpace(const char *fctNames, int order, ConstSmartPtr< weight_type > spWeight, const char *ssNames=0)
Definition metric_spaces.h:519
L2ComponentSpace(const char *fctNames, int order)
Definition metric_spaces.h:513
~L2ComponentSpace()
DTOR.
Definition metric_spaces.h:523
double distance2(TGridFunction &uFine, TGridFunction &uCoarse)
distance (for grid functions)
Definition metric_spaces.h:538
IObjectWithWeights< weight_type > weighted_obj_type
Definition metric_spaces.h:507
L2ComponentSpace(const char *fctNames)
CTOR.
Definition metric_spaces.h:510
double norm2(TGridFunction &uFine)
norm (for grid functions)
Definition metric_spaces.h:534
Definition metric_spaces.h:551
L2QuotientSpace(const char *fctNames, int order)
Definition metric_spaces.h:561
~L2QuotientSpace()
DTOR.
Definition metric_spaces.h:571
IComponentSpace< TGridFunction > base_type
Definition metric_spaces.h:553
L2QuotientSpace(const char *fctNames)
CTOR.
Definition metric_spaces.h:558
L2QuotientSpace(const char *fctNames, int order, ConstSmartPtr< weight_type > spWeight, const char *ssNames=0)
Definition metric_spaces.h:567
double distance2(TGridFunction &uFine, TGridFunction &uCoarse)
distance (for grid functions)
Definition metric_spaces.h:599
double norm2(TGridFunction &u)
norm (for grid functions)
Definition metric_spaces.h:582
IObjectWithWeights< weight_type > weighted_obj_type
Definition metric_spaces.h:555
L2DistIntegrand< TGridFunction >::weight_type weight_type
Definition metric_spaces.h:554
L2QuotientSpace(const char *fctNames, int order, double weight, const char *ssNames=0)
Definition metric_spaces.h:564
Definition multi_grid.h:72
TChild * get_child(TElem *elem, size_t ind) const
returns the i-th child of the given child-type
Definition multi_grid.h:268
size_t num_children(TElem *elem) const
returns the number of children of the given child-type
Definition multi_grid.h:225
Group of subsets.
Definition subset_group.h:51
size_t size() const
number of subsets in this group
Definition subset_group.h:122
void add_all()
select all subsets of underlying subset handler
Definition subset_group.cpp:133
void add(int si)
adds a subset by number to this group
Definition subset_group.cpp:64
Represents the surface view of a multi-grid hierarchy.
Definition surface_view.h:61
bool is_contained(TGeomObj *obj, const GridLevel &gl, SurfaceState validStates=ALL) const
returns if the element is contained in the surface view
Definition surface_view_impl.hpp:442
@ SURFACE_RIM
Definition surface_view.h:94
@ ALL
Definition surface_view.h:102
@ SHADOW_RIM_COPY
Definition surface_view.h:95
Wrapper class for time dependence.
Definition metric_spaces.h:459
void update_time_data(number tScale)
characteristic time
Definition metric_spaces.h:480
virtual ~TimeDependentSpace()
DTOR.
Definition metric_spaces.h:469
double scaling() const
scaling (OVERRIDE)
Definition metric_spaces.h:476
IGridFunctionSpace< TGridFunction > base_type
Definition metric_spaces.h:461
SmartPtr< comp_space_type > m_spSpatialSpace
Definition metric_spaces.h:493
TimeDependentSpace(SmartPtr< comp_space_type > spSpace, number tScale)
time dependent CTOR
Definition metric_spaces.h:465
IComponentSpace< TGridFunction > comp_space_type
Definition metric_spaces.h:462
number m_tScale
Definition metric_spaces.h:494
std::string config_string() const
print config string
Definition metric_spaces.h:484
For arbitrary UserData (of type TData), this class defines the integrand .
Definition integrate.h:557
#define PCL_RO_SUM
Definition pcl_methods.h:63
int NumProcs()
returns the number of processes
Definition pcl_base.cpp:91
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition smart_pointer.h:90
#define UG_ASSERT(expr, msg)
Definition assert.h:70
#define UG_CATCH_THROW(msg)
Definition error.h:64
#define UG_LOG(msg)
Definition log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition error.h:61
double number
Definition types.h:124
the ug namespace
number L2Distance2(TGridFunction &spGridFct1, const char *cmp1, TGridFunction &spGridFct2, const char *cmp2, int quadOrder, const char *subsets, ConstSmartPtr< typename L2Integrand< TGridFunction >::weight_type > spWeight, number avgDist12=0.0)
computes the squared l2 distance between two functions
Definition integrate.h:1911
number L2Norm2(TGridFunction &u, const char *cmp, int quadOrder, const char *subsets, ConstSmartPtr< typename L2Integrand< TGridFunction >::weight_type > spWeight)
Definition integrate.h:1680
number IntegrateSubsets(IIntegrand< number, TGridFunction::dim > &spIntegrand, TGridFunction &spGridFct, const char *subsets, int quadOrder, std::string quadType=std::string())
Definition integrate.h:393
void TokenizeTrimString(const string &str, vector< string > &vToken, const char delimiter)
Definition string_util.cpp:83
@ VOLUME
Definition grid_base_objects.h:63
@ VERTEX
Definition grid_base_objects.h:60
@ EDGE
Definition grid_base_objects.h:61
@ FACE
Definition grid_base_objects.h:62
number L2Error(SmartPtr< UserData< number, TGridFunction::dim > > spExactSol, TGridFunction &gridFct, const char *cmp, number time, int quadOrder, const char *subsets)
computes the l2 error function on the whole domain or on some subsets
Definition integrate.h:1185
number Integral(SmartPtr< UserData< number, TGridFunction::dim > > spData, TGridFunction &spGridFct, const char *subsets, number time, int quadOrder, std::string quadType)
Definition integrate.h:856
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition multi_index.h:276
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition smart_pointer.h:836
SurfaceView::traits< TElem >::const_iterator const_iterator
Definition dof_distribution.h:82