ug4
Loading...
Searching...
No Matches
dim_dim_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 * Classes for user data that compute normals or project vectors to low-dimensional
35 * subsets. Note that these classes are mainly implemented for visualization purposes
36 * and cannot be used for coupling.
37 */
38#ifndef __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__ONC_USER_DATA__
39#define __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__ONC_USER_DATA__
40
41#include <vector>
42
43// ug4 headers
44#include "common/common.h"
45#include "common/math/ugmath.h"
52
53namespace ug {
54
56
65template <typename TDomain>
67 : public StdUserData<OutNormCmp<TDomain>, MathVector<TDomain::dim>, TDomain::dim, void, UserData<MathVector<TDomain::dim>, TDomain::dim, void> >
68{
70 static const int dim = TDomain::dim;
71
73 typedef TDomain domain_type;
74
76 typedef typename TDomain::grid_type grid_type;
77
80
83
86
89
90public:
91
94 (
95 SmartPtr<domain_type> spDomain,
97 const char * ss_names
98 )
99 : m_spData (spData), m_spDomain (spDomain), m_ssGrp (spDomain->subset_handler ())
100 {
101 // Parse the subset names:
102 std::vector<std::string> vssNames;
103 try
104 {
105 TokenizeString (ss_names, vssNames);
106 for (size_t k = 0; k < vssNames.size (); k++)
107 RemoveWhitespaceFromString (vssNames [k]);
108 m_ssGrp.clear ();
109 m_ssGrp.add (vssNames);
110 } UG_CATCH_THROW ("SubsetIndicatorUserData: Failed to parse subset names.");
111 }
112
115 (
116 SmartPtr<domain_type> spDomain,
118 )
119 : m_spData (spData), m_spDomain (spDomain), m_ssGrp (spDomain->subset_handler ())
120 {}
121
123 virtual bool continuous () const {return false;}
124
126 virtual bool requires_grid_fct () const {return m_spData->requires_grid_fct ();}
127 // Remark: Note that actually we have not enought data for that. This dependence is neglected.
128
130 template <int refDim>
131 inline void evaluate
132 (
133 vec_type vValue[],
134 const MathVector<dim> vGlobIP [],
135 number time,
136 int si,
137 GridObject * elem,
138 const MathVector<dim> vCornerCoords [],
139 const MathVector<refDim> vLocIP [],
140 const size_t nip,
141 LocalVector * u,
142 const MathMatrix<refDim, dim> * vJT = NULL
143 ) const
144 {
145 if (refDim == dim)
146 {
147 (* m_spData) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
148 return;
149 }
150 if (refDim != dim - 1)
151 {
152 UG_THROW ("OutNormCmp: Wrong dimensionality of the subset.");
153 }
154
155 // Get the full-dim. element associated with the given side
156 typedef typename grid_dim_traits<dim>::grid_base_object fd_elem_type;
157 fd_elem_type * fd_elem = NULL;
158 int fd_si = -1;
159
160 typedef typename Grid::traits<fd_elem_type>::secure_container fd_elem_secure_container_type;
161 fd_elem_secure_container_type fd_elem_list;
162 grid_type& grid = * (grid_type*) (m_spDomain->grid().get ());
163 grid.associated_elements (fd_elem_list, elem);
164
165 if (m_ssGrp.empty ()) // no subsets specified; we assume, elem should be the bnd of the whole domain
166 {
167 if (fd_elem_list.size () == 1)
168 {
169 fd_elem = fd_elem_list[0];
170 fd_si = m_spDomain->subset_handler()->get_subset_index (fd_elem);
171 }
172 // otherwise this is no boundary of the domain and we return 0
173 }
174 else
175 {
176 for (size_t k = 0; k < fd_elem_list.size (); k++)
177 {
178 fd_elem_type * e = fd_elem_list[k];
179 int e_si = m_ssGrp.subset_handler()->get_subset_index (e);
180 if (m_ssGrp.contains (e_si))
181 {
182 if (fd_elem != NULL) // i.e. e is already the second one
183 { // this is no boundary of the subset; return 0
184 fd_elem = NULL;
185 break;
186 }
187 fd_elem = e;
188 fd_si = e_si;
189 }
190 }
191 }
192 if (fd_elem == NULL)
193 { // this is no bondary, return 0
194 for (size_t ip = 0; ip < nip; ip++) vValue[ip] = 0;
195 return;
196 }
197
198 // Get the coordinates of the corners of the full-dim. element
199 std::vector<MathVector<dim> > fd_elem_corner_coords (domain_traits<dim>::MaxNumVerticesOfElem);
200 CollectCornerCoordinates (fd_elem->base_object_id (), fd_elem_corner_coords,
201 *fd_elem, *m_spDomain, true);
202
203 // Convert the local ip coordinates (use the global coordinates as they are the same)
204 const ReferenceObjectID fd_roid = fd_elem->reference_object_id ();
206 = ReferenceMappingProvider::get<dim, dim> (fd_roid, fd_elem_corner_coords);
207 std::vector<MathVector<dim> > fd_loc_ip (nip);
208 for (size_t ip = 0; ip < nip; ip++)
209 fd_map.global_to_local(fd_loc_ip[ip], vGlobIP[ip]);
210
211 // Call the original UserData, get the vectors
212 (* m_spData) (vValue, vGlobIP, time, fd_si, fd_elem, &(fd_elem_corner_coords[0]),
213 &(fd_loc_ip[0]), nip, u);
214 //TODO: Note that u is here a dummy parameter: We do not have enough data for it.
215
216 // Project the vectors
217 const ReferenceObjectID roid = elem->reference_object_id ();
219 = ReferenceMappingProvider::get<refDim, dim> (roid, vCornerCoords);
220 for (size_t ip = 0; ip < nip; ip++)
221 {
223 MathVector<dim> p (vValue[ip]);
224
225 map.jacobian (J, vLocIP[ip]);
226 OrthogProjectVec (p, J);
227 vValue[ip] -= p;
228 }
229 };
230
232 void operator()
233 (
234 vec_type & vValue,
235 const MathVector<dim> & globIP,
236 number time,
237 int si
238 )
239 const
240 {
241 UG_THROW("OutNormCmp: Element required for evaluation, but not passed. Cannot evaluate.");
242 }
243
245 void operator()
246 (
247 vec_type vValue [],
248 const MathVector<dim> vGlobIP [],
249 number time,
250 int si,
251 const size_t nip
252 ) const
253 {
254 UG_THROW("OutNormCmp: Element required for evaluation, but not passed. Cannot evaluate.");
255 }
256
257};
258
260
270template <typename TDomain>
272 : public StdUserData<ScaledOutNormCmp<TDomain>, MathVector<TDomain::dim>, TDomain::dim, void, UserData<MathVector<TDomain::dim>, TDomain::dim, void> >
273{
275 static const int dim = TDomain::dim;
276
278 typedef TDomain domain_type;
279
281 typedef typename TDomain::grid_type grid_type;
282
285
288
291
294
297
298public:
299
302 (
303 SmartPtr<domain_type> spDomain,
306 const char * ss_names
307 )
308 : m_spVecData (spVecData), m_spScalData (spScalData), m_spDomain (spDomain), m_ssGrp (spDomain->subset_handler ())
309 {
310 // Parse the subset names:
311 std::vector<std::string> vssNames;
312 try
313 {
314 TokenizeString (ss_names, vssNames);
315 for (size_t k = 0; k < vssNames.size (); k++)
316 RemoveWhitespaceFromString (vssNames [k]);
317 m_ssGrp.clear ();
318 m_ssGrp.add (vssNames);
319 } UG_CATCH_THROW ("SubsetIndicatorUserData: Failed to parse subset names.");
320 }
321
324 (
325 SmartPtr<domain_type> spDomain,
328 )
329 : m_spVecData (spVecData), m_spScalData (spScalData), m_spDomain (spDomain), m_ssGrp (spDomain->subset_handler ())
330 {}
331
333 virtual bool continuous () const {return false;}
334
336 virtual bool requires_grid_fct () const {return m_spVecData->requires_grid_fct () || m_spScalData->requires_grid_fct ();}
337 // Remark: Note that actually we have not enought data for that. This dependence is neglected.
338
340 template <int refDim>
341 inline void evaluate
342 (
343 vec_type vValue[],
344 const MathVector<dim> vGlobIP [],
345 number time,
346 int si,
347 GridObject * elem,
348 const MathVector<dim> vCornerCoords [],
349 const MathVector<refDim> vLocIP [],
350 const size_t nip,
351 LocalVector * u,
352 const MathMatrix<refDim, dim> * vJT = NULL
353 ) const
354 {
355 if (refDim == dim)
356 {
357 std::vector<number> scaling (nip);
358 (* m_spVecData) (vValue, vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
359 (* m_spScalData) (&(scaling[0]), vGlobIP, time, si, elem, vCornerCoords, vLocIP, nip, u, vJT);
360 for (size_t ip = 0; ip < nip; ip++)
361 vValue[ip] *= scaling[ip];
362 return;
363 }
364 if (refDim != dim - 1)
365 {
366 UG_THROW ("ScaledOutNormCmp: Wrong dimensionality of the subset.");
367 }
368
369 // Get the full-dim. element associated with the given side
370 typedef typename grid_dim_traits<dim>::grid_base_object fd_elem_type;
371 fd_elem_type * fd_elem = NULL;
372 int fd_si = -1;
373
374 typedef typename Grid::traits<fd_elem_type>::secure_container fd_elem_secure_container_type;
375 fd_elem_secure_container_type fd_elem_list;
376 grid_type& grid = * (grid_type*) (m_spDomain->grid().get ());
377 grid.associated_elements (fd_elem_list, elem);
378
379 if (m_ssGrp.empty ()) // no subsets specified; we assume, elem should be the bnd of the whole domain
380 {
381 if (fd_elem_list.size () == 1)
382 {
383 fd_elem = fd_elem_list[0];
384 fd_si = m_spDomain->subset_handler()->get_subset_index (fd_elem);
385 }
386 // otherwise this is no boundary of the domain and we return 0
387 }
388 else
389 {
390 for (size_t k = 0; k < fd_elem_list.size (); k++)
391 {
392 fd_elem_type * e = fd_elem_list[k];
393 int e_si = m_ssGrp.subset_handler()->get_subset_index (e);
394 if (m_ssGrp.contains (e_si))
395 {
396 if (fd_elem != NULL) // i.e. e is already the second one
397 { // this is no boundary of the subset; return 0
398 fd_elem = NULL;
399 break;
400 }
401 fd_elem = e;
402 fd_si = e_si;
403 }
404 }
405 }
406 if (fd_elem == NULL)
407 { // this is no bondary, return 0
408 for (size_t ip = 0; ip < nip; ip++) vValue[ip] = 0;
409 return;
410 }
411
412 // Get the coordinates of the corners of the full-dim. element
413 std::vector<MathVector<dim> > fd_elem_corner_coords (domain_traits<dim>::MaxNumVerticesOfElem);
414 CollectCornerCoordinates (fd_elem->base_object_id (), fd_elem_corner_coords,
415 *fd_elem, *m_spDomain, true);
416
417 // Convert the local ip coordinates (use the global coordinates as they are the same)
418 const ReferenceObjectID fd_roid = fd_elem->reference_object_id ();
420 = ReferenceMappingProvider::get<dim, dim> (fd_roid, fd_elem_corner_coords);
421 std::vector<MathVector<dim> > fd_loc_ip (nip);
422 for (size_t ip = 0; ip < nip; ip++)
423 fd_map.global_to_local(fd_loc_ip[ip], vGlobIP[ip]);
424
425 // Call the original UserData, get the vectors
426 std::vector<number> scaling (nip);
427 (* m_spVecData) (vValue, vGlobIP, time, fd_si, fd_elem, &(fd_elem_corner_coords[0]),
428 &(fd_loc_ip[0]), nip, u);
429 (* m_spScalData) (&(scaling[0]), vGlobIP, time, fd_si, fd_elem, &(fd_elem_corner_coords[0]),
430 &(fd_loc_ip[0]), nip, u);
431 //TODO: Note that u is here a dummy parameter: We do not have enough data for it.
432
433 // Scale and project the vectors
434 const ReferenceObjectID roid = elem->reference_object_id ();
436 = ReferenceMappingProvider::get<refDim, dim> (roid, vCornerCoords);
437 for (size_t ip = 0; ip < nip; ip++)
438 {
439 vValue[ip] *= scaling[ip];
440
442 MathVector<dim> p (vValue[ip]);
443
444 map.jacobian (J, vLocIP[ip]);
445 OrthogProjectVec (p, J);
446 vValue[ip] -= p;
447 }
448 };
449
451 void operator()
452 (
453 vec_type & vValue,
454 const MathVector<dim> & globIP,
455 number time,
456 int si
457 )
458 const
459 {
460 UG_THROW("ScaledOutNormCmp: Element required for evaluation, but not passed. Cannot evaluate.");
461 }
462
464 void operator()
465 (
466 vec_type vValue [],
467 const MathVector<dim> vGlobIP [],
468 number time,
469 int si,
470 const size_t nip
471 ) const
472 {
473 UG_THROW("ScaledOutNormCmp: Element required for evaluation, but not passed. Cannot evaluate.");
474 }
475
476};
477
479
489template <typename TDomain>
491 : public StdUserData<ScaledFluxData<TDomain>, number, TDomain::dim, void, UserData<number, TDomain::dim, void> >
492{
494 static const int dim = TDomain::dim;
495
497 typedef TDomain domain_type;
498
500 typedef typename TDomain::grid_type grid_type;
501
504
507
510
513
516
517public:
518
521 (
522 SmartPtr<domain_type> spDomain,
525 const char * ss_names
526 )
527 : m_spVecData (spVecData), m_spScalData (spScalData), m_spDomain (spDomain), m_ssGrp (spDomain->subset_handler ())
528 {
529 // Parse the subset names:
530 std::vector<std::string> vssNames;
531 try
532 {
533 TokenizeString (ss_names, vssNames);
534 for (size_t k = 0; k < vssNames.size (); k++)
535 RemoveWhitespaceFromString (vssNames [k]);
536 m_ssGrp.clear ();
537 m_ssGrp.add (vssNames);
538 } UG_CATCH_THROW ("SubsetIndicatorUserData: Failed to parse subset names.");
539 }
540
543 (
544 SmartPtr<domain_type> spDomain,
547 )
548 : m_spVecData (spVecData), m_spScalData (spScalData), m_spDomain (spDomain), m_ssGrp (spDomain->subset_handler ())
549 {}
550
552 virtual bool continuous () const {return false;}
553
555 virtual bool requires_grid_fct () const {return m_spVecData->requires_grid_fct () || m_spScalData->requires_grid_fct ();}
556 // Remark: Note that actually we have not enought data for that. This dependence is neglected.
557
559 template <int refDim>
560 inline void evaluate
561 (
562 number vValue[],
563 const MathVector<dim> vGlobIP [],
564 number time,
565 int si,
566 GridObject * elem,
567 const MathVector<dim> vCornerCoords [],
568 const MathVector<refDim> vLocIP [],
569 const size_t nip,
570 LocalVector * u,
571 const MathMatrix<refDim, dim> * vJT = NULL
572 ) const
573 {
574 if (refDim != dim - 1)
575 {
576 UG_THROW ("ScaledFluxData: Wrong dimensionality of the subset.");
577 }
578
579 // Get the full-dim. element associated with the given side
580 typedef typename grid_dim_traits<dim>::grid_base_object fd_elem_type;
581 fd_elem_type * fd_elem = NULL;
582 int fd_si = -1;
583
584 typedef typename Grid::traits<fd_elem_type>::secure_container fd_elem_secure_container_type;
585 fd_elem_secure_container_type fd_elem_list;
586 grid_type& grid = * (grid_type*) (m_spDomain->grid().get ());
587 grid.associated_elements (fd_elem_list, elem);
588
589 if (m_ssGrp.empty ()) // no subsets specified; we assume, elem should be the bnd of the whole domain
590 {
591 if (fd_elem_list.size () == 1)
592 {
593 fd_elem = fd_elem_list[0];
594 fd_si = m_spDomain->subset_handler()->get_subset_index (fd_elem);
595 }
596 // otherwise this is no boundary of the domain and we return 0
597 }
598 else
599 {
600 for (size_t k = 0; k < fd_elem_list.size (); k++)
601 {
602 fd_elem_type * e = fd_elem_list[k];
603 int e_si = m_ssGrp.subset_handler()->get_subset_index (e);
604 if (m_ssGrp.contains (e_si))
605 {
606 if (fd_elem != NULL) // i.e. e is already the second one
607 { // this is no boundary of the subset; return 0
608 fd_elem = NULL;
609 break;
610 }
611 fd_elem = e;
612 fd_si = e_si;
613 }
614 }
615 }
616 if (fd_elem == NULL)
617 { // this is no bondary, return 0
618 for (size_t ip = 0; ip < nip; ip++) vValue[ip] = 0;
619 return;
620 }
621
622 // Get the coordinates of the corners of the full-dim. element
623 std::vector<MathVector<dim> > fd_elem_corner_coords (domain_traits<dim>::MaxNumVerticesOfElem);
624 CollectCornerCoordinates (fd_elem->base_object_id (), fd_elem_corner_coords,
625 *fd_elem, *m_spDomain, true);
626
627 // Convert the local ip coordinates (use the global coordinates as they are the same)
628 const ReferenceObjectID fd_roid = fd_elem->reference_object_id ();
630 = ReferenceMappingProvider::get<dim, dim> (fd_roid, fd_elem_corner_coords);
631 std::vector<MathVector<dim> > fd_loc_ip (nip);
632 for (size_t ip = 0; ip < nip; ip++)
633 fd_map.global_to_local(fd_loc_ip[ip], vGlobIP[ip]);
634
635 // Get the normal to the face:
636 MathVector<dim> normal;
637 ElementNormal<dim> (elem->reference_object_id (), normal, vCornerCoords);
638 VecScale (normal, normal, 1 / VecLength (normal));
639 for (size_t co = 0; co < fd_elem->num_vertices (); co++)
640 {
641 MathVector<dim> s_vec;
642 VecSubtract (s_vec, fd_elem_corner_coords[co], vCornerCoords[0]);
643 if (VecDot (s_vec, normal) > 1e-12 * VecLength (s_vec))
644 { // this is the inner normal, invert its direction
645 VecScale (normal, normal, -1);
646 break;
647 }
648 }
649
650 // Call the original UserData, get the vectors
651 std::vector<MathVector<dim> > vecfield (nip);
652 std::vector<number> scaling (nip);
653 (* m_spVecData) (&(vecfield[0]), vGlobIP, time, fd_si, fd_elem, &(fd_elem_corner_coords[0]),
654 &(fd_loc_ip[0]), nip, u);
655 (* m_spScalData) (&(scaling[0]), vGlobIP, time, fd_si, fd_elem, &(fd_elem_corner_coords[0]),
656 &(fd_loc_ip[0]), nip, u);
657 //TODO: Note that u is here a dummy parameter: We do not have enough data for it.
658
659 // Scale and project the vectors
660 for (size_t ip = 0; ip < nip; ip++)
661 vValue[ip] = scaling[ip] * VecDot (vecfield[ip], normal);
662 };
663
665 void operator()
666 (
667 number & vValue,
668 const MathVector<dim> & globIP,
669 number time,
670 int si
671 )
672 const
673 {
674 UG_THROW("ScaledFluxData: Element required for evaluation, but not passed. Cannot evaluate.");
675 }
676
678 void operator()
679 (
680 number vValue [],
681 const MathVector<dim> vGlobIP [],
682 number time,
683 int si,
684 const size_t nip
685 ) const
686 {
687 UG_THROW("ScaledFluxData: Element required for evaluation, but not passed. Cannot evaluate.");
688 }
689
690};
691
692} // end namespace ug
693
694#endif // __H__UG__LIB_DISC__SPATIAL_DISC__USER_DATA__ONC_USER_DATA__
695
696/* End of File */
parameterString p
Definition smart_pointer.h:108
T * get()
returns encapsulated pointer
Definition smart_pointer.h:197
virtual base class for reference mappings
Definition reference_mapping_provider.h:53
virtual void global_to_local(MathVector< dim > &locPos, const MathVector< worldDim > &globPos, const size_t maxIter=1000, const number tol=1e-10) const =0
map global coordinate to local coordinate
virtual void jacobian(MathMatrix< worldDim, dim > &J, const MathVector< dim > &locPos) const =0
returns jacobian
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition grid_base_objects.h:157
virtual ReferenceObjectID reference_object_id() const =0
Definition local_algebra.h:198
A class for fixed size, dense matrices.
Definition math_matrix.h:63
a mathematical Vector with N entries.
Definition math_vector.h:97
Projection to the outer normal for a given vector user data.
Definition dim_dim_user_data.h:68
static const int dim
the world dimension
Definition dim_dim_user_data.h:70
void evaluate(vec_type 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
Evaluator.
Definition dim_dim_user_data.h:132
SubsetGroup m_ssGrp
the subset group for the inner part
Definition dim_dim_user_data.h:88
MathVector< dim > vec_type
the original data type
Definition dim_dim_user_data.h:79
SmartPtr< domain_type > m_spDomain
the domain
Definition dim_dim_user_data.h:85
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition dim_dim_user_data.h:126
SmartPtr< UserData< vec_type, dim, void > > m_spData
the original data
Definition dim_dim_user_data.h:82
TDomain domain_type
the domain type
Definition dim_dim_user_data.h:73
virtual bool continuous() const
Indicator functions are discontinuous.
Definition dim_dim_user_data.h:123
TDomain::grid_type grid_type
the grid type
Definition dim_dim_user_data.h:76
OutNormCmp(SmartPtr< domain_type > spDomain, SmartPtr< UserData< vec_type, dim, void > > spData, const char *ss_names)
constructor
Definition dim_dim_user_data.h:94
OutNormCmp(SmartPtr< domain_type > spDomain, SmartPtr< UserData< vec_type, dim, void > > spData)
constructor
Definition dim_dim_user_data.h:115
Scaled flux for a given vector user data.
Definition dim_dim_user_data.h:492
void evaluate(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, const MathMatrix< refDim, dim > *vJT=NULL) const
Evaluator.
Definition dim_dim_user_data.h:561
MathVector< dim > vec_type
the original data type
Definition dim_dim_user_data.h:503
SubsetGroup m_ssGrp
the subset group for the inner part
Definition dim_dim_user_data.h:515
SmartPtr< domain_type > m_spDomain
the domain
Definition dim_dim_user_data.h:512
SmartPtr< UserData< vec_type, dim, void > > m_spVecData
the original vector field data
Definition dim_dim_user_data.h:506
TDomain domain_type
the domain type
Definition dim_dim_user_data.h:497
virtual bool continuous() const
Indicator functions are discontinuous.
Definition dim_dim_user_data.h:552
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition dim_dim_user_data.h:555
TDomain::grid_type grid_type
the grid type
Definition dim_dim_user_data.h:500
static const int dim
the world dimension
Definition dim_dim_user_data.h:494
ScaledFluxData(SmartPtr< domain_type > spDomain, SmartPtr< UserData< number, dim, void > > spScalData, SmartPtr< UserData< vec_type, dim, void > > spVecData, const char *ss_names)
constructor
Definition dim_dim_user_data.h:521
SmartPtr< UserData< number, dim, void > > m_spScalData
the scaling data
Definition dim_dim_user_data.h:509
ScaledFluxData(SmartPtr< domain_type > spDomain, SmartPtr< UserData< number, dim, void > > spScalData, SmartPtr< UserData< vec_type, dim, void > > spVecData)
constructor
Definition dim_dim_user_data.h:543
Scaled projection to the outer normal for a given vector user data.
Definition dim_dim_user_data.h:273
ScaledOutNormCmp(SmartPtr< domain_type > spDomain, SmartPtr< UserData< number, dim, void > > spScalData, SmartPtr< UserData< vec_type, dim, void > > spVecData)
constructor
Definition dim_dim_user_data.h:324
void evaluate(vec_type 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
Evaluator.
Definition dim_dim_user_data.h:342
static const int dim
the world dimension
Definition dim_dim_user_data.h:275
TDomain::grid_type grid_type
the grid type
Definition dim_dim_user_data.h:281
SubsetGroup m_ssGrp
the subset group for the inner part
Definition dim_dim_user_data.h:296
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition dim_dim_user_data.h:336
ScaledOutNormCmp(SmartPtr< domain_type > spDomain, SmartPtr< UserData< number, dim, void > > spScalData, SmartPtr< UserData< vec_type, dim, void > > spVecData, const char *ss_names)
constructor
Definition dim_dim_user_data.h:302
virtual bool continuous() const
Indicator functions are discontinuous.
Definition dim_dim_user_data.h:333
SmartPtr< UserData< number, dim, void > > m_spScalData
the scaling data
Definition dim_dim_user_data.h:290
MathVector< dim > vec_type
the original data type
Definition dim_dim_user_data.h:284
TDomain domain_type
the domain type
Definition dim_dim_user_data.h:278
SmartPtr< UserData< vec_type, dim, void > > m_spVecData
the original vector field data
Definition dim_dim_user_data.h:287
SmartPtr< domain_type > m_spDomain
the domain
Definition dim_dim_user_data.h:293
Definition std_user_data.h:63
Group of subsets.
Definition subset_group.h:51
void clear()
clear all subsets
Definition subset_group.h:116
bool empty() const
returns if function group is empty
Definition subset_group.h:119
ConstSmartPtr< ISubsetHandler > subset_handler() const
get underlying subset handler
Definition subset_group.h:72
void add(int si)
adds a subset by number to this group
Definition subset_group.cpp:64
bool contains(int si) const
returns true if subset is contained in this group
Definition subset_group.cpp:272
Type based UserData.
Definition user_data.h:143
const FunctionIndexMapping & map() const
get function mapping
Definition user_data.h:78
void CollectCornerCoordinates(std::vector< typename TAAPos::ValueType > &vCornerCoordsOut, const TElem &elem, const TAAPos &aaPos, bool clearContainer=true)
returns the corner coordinates of a geometric object
Definition domain_util_impl.h:75
void RemoveWhitespaceFromString(std::string &str)
removes all white space from a string, also within the string
Definition string_util.cpp:50
#define UG_CATCH_THROW(msg)
Definition error.h:64
#define UG_THROW(msg)
Definition error.h:57
double number
Definition types.h:124
void OrthogProjectVec(vector_t &v, const matrix_t &A)
Orthogonal projection.
Definition math_matrix_vector_functions_common_impl.hpp:251
vector_t::value_type VecLength(const vector_t &v)
returns the length of v. Slower than VecLengthSq.
Definition math_vector_functions_common_impl.hpp:341
void VecSubtract(vector_t &vOut, const vector_t &v1, const vector_t &v2)
subtracts v2 from v1 and stores the result in a vOut
Definition math_vector_functions_common_impl.hpp:226
void VecScale(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
scales a MathVector<N>
Definition math_vector_functions_common_impl.hpp:252
vector_t::value_type VecDot(const vector_t &v1, const vector_t &v2)
returns the dot-product of two vector_ts
Definition math_vector_functions_common_impl.hpp:385
the ug namespace
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition grid_base_objects.h:74
void TokenizeString(const string &str, vector< string > &vToken, const char delimiter)
Definition string_util.cpp:56
PointerConstArray< TElem * > secure_container
Definition grid.h:146
Definition domain_traits.h:53
Definition grid_dim_traits.h:53