OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
BCond.h
Go to the documentation of this file.
1// -*- C++ -*-
2/***************************************************************************
3 *
4 * The IPPL Framework
5 *
6 ***************************************************************************/
7
8#ifndef BCOND_H
9#define BCOND_H
10
11#include "Utility/IpplInfo.h"
12#include "Utility/RefCounted.h"
13#include "Utility/vmap.h"
14
15#include <iostream>
16#include <complex>
17
18// forward declarations
19template <unsigned D> class NDIndex;
20template <class T, unsigned D> class Vektor;
21template <class T, unsigned D> class Tenzor;
22template <class T, unsigned D> class SymTenzor;
23template <class T, unsigned D> class AntiSymTenzor;
24template<unsigned D, class T> class UniformCartesian;
25template<class T, unsigned D> class LField;
26template<class T, unsigned D> class BareField;
27template<class T, unsigned D, class M, class C> class Field;
28template <class T, unsigned D, class M, class C> class BCondBase;
29template <class T, unsigned D, class M, class C>
30std::ostream& operator<<(std::ostream&, const BCondBase<T,D,M,C>&);
31template <class T, unsigned D, class M, class C> class BConds;
32template <class T, unsigned D, class M, class C>
33std::ostream& operator<<(std::ostream&, const BConds<T,D,M,C>&);
34
36
37//
38// Traits used by the single-component version of the applicative templates.
39// General case: this covers intrinsic types like double, bool automatically:
40//
41
42template<class T>
44{
45 typedef T type;
46};
47
48//
49// Specializations for multicomponent IPPL types;
50//
51template<class T,unsigned D>
53{
54 typedef T type;
55};
56
57template<class T,unsigned D>
59{
60 typedef T type;
61};
62
63template<class T,unsigned D>
65{
66 typedef T type;
67};
68
69template<class T,unsigned D>
71{
72 typedef T type;
73};
74
75// Helper classes for getting info about number of indices into
76// BCond-class ctor functions.
77// Define tag types (like iterator tags in stl):
78
80{
81};
82
84{
85};
86
88{
89};
90
92{
93};
94
96{
97};
98
99// Implement tag types for intrinsic types:
100inline scalar_tag get_tag(std::complex<double>) { return scalar_tag(); }
101inline scalar_tag get_tag(double) { return scalar_tag(); }
102inline scalar_tag get_tag(float) { return scalar_tag(); }
103inline scalar_tag get_tag(int) { return scalar_tag(); }
104inline scalar_tag get_tag(bool) { return scalar_tag(); }
105inline scalar_tag get_tag(short) { return scalar_tag(); }
106
107// Tag for Vektor types:
108template<class T, unsigned D>
109inline vektor_tag
111
112// Tag for Tenzor types:
113template<class T, unsigned D>
114inline tenzor_tag
116
117// Tag for AntiSymTenzor types
118template<class T, unsigned D>
119inline antisymtenzor_tag
121
122// Tag for SymTenzor types
123template<class T, unsigned D>
124inline symtenzor_tag
126
127// Functions which return an enum value indicating scalar, vector, tensor,
128// or anti/symtensor type; used in constructors for PeriodicFace, etc., to
129// determine how to turn two 1D component indices into a single index value
130// for pointer offsetting into the Tenzor/Anti/SymTenzor object:
134{return IPPL_SCALAR;}
136{return IPPL_VECTOR;}
138{return IPPL_TENSOR;}
140{return IPPL_ANTISYMTENSOR;}
142{return IPPL_SYMTENSOR;}
143
145
146template<class T, unsigned D, class M, class C>
147class BCondBase : public RefCounted
148{
149public:
150
151 // Special value designating application to all components of elements:
152 static int allComponents;
153
154 // Constructor takes:
155 // face: the face to apply the boundary condition on.
156 // i,j : what component of T to apply the boundary condition to.
157 // The components default to setting all components.
158 BCondBase(unsigned int face,
159 int i = allComponents,
160 int j = allComponents);
161 virtual ~BCondBase() { }
162
163 virtual void apply( Field<T,D,M,C>& ) = 0;
164 virtual BCondBase<T,D,M,C>* clone() const = 0;
165
166 virtual void write(std::ostream&) const;
167
168 // Return component of Field element on which BC applies
169 int getComponent() const { return m_component; }
170
171 // Return face on which BC applies
172 unsigned int getFace() const { return m_face; }
173
174 // Returns whether or not this BC changes physical cells.
175 bool changesPhysicalCells() const { return m_changePhysical; }
176
177protected:
178
179 // Following are hooks for BC-by-Field-element-component support:
180 // Component of Field elements (Vektor, e.g.) on which the BC applies:
182
183 // What face to apply the boundary condition to.
184 unsigned int m_face;
185
186 // True if this boundary condition changes physical cells.
188};
189
191
192template<
193 class T,
194 unsigned D,
196 class C=typename M::DefaultCentering>
198 : public vmap<int, RefCountedP< BCondBase<T,D,M,C> > >
199{
200public:
205 void apply( Field<T,D,M,C>& a );
206 bool changesPhysicalCells() const;
207 virtual void write(std::ostream&) const;
208};
209
211
212// TJW: so far, componentwise specification of BCondNoAction not possible
213
214template<class T,
215 unsigned D,
217 class C=typename M::DefaultCentering>
218class BCondNoAction : public BCondBase<T,D,M,C>
219{
220public:
221 BCondNoAction(int face) : BCondBase<T,D,M,C>(face) {}
222
223 virtual void apply( Field<T,D,M,C>& ) {}
225 {
226 return new BCondNoAction<T,D,M,C>( *this );
227 }
228
229 // Print out information about the BC to a stream.
230 virtual void write(std::ostream& out) const;
231};
232
234
235template<class T,
236 unsigned D,
238 class C=typename M::DefaultCentering>
239class PeriodicFace : public BCondBase<T,D,M,C>
240{
241public:
242 // Constructor takes zero, one, or two int's specifying components of
243 // multicomponent types like Vektor/Tenzor/Anti/SymTenzor this BC applies to.
244 // Zero int's specified means apply to all components; one means apply to
245 // component (i), and two means apply to component (i,j),
247
248 PeriodicFace(unsigned f,
251
252 // Apply the boundary condition to a particular Field.
253 virtual void apply( Field<T,D,M,C>& );
254
255 // Make a copy of the concrete type.
256 virtual BCondBase<T,D,M,C>* clone() const
257 {
258 return new PeriodicFace<T,D,M,C>( *this );
259 }
260
261 // Print out information about the BC to a stream.
262 virtual void write(std::ostream& out) const;
263};
264
265
266
268//BENI adds Periodic Boundary Conditions for Interpolations///////////
270template<class T,
271 unsigned D,
273 class C=typename M::DefaultCentering>
274class InterpolationFace : public BCondBase<T,D,M,C>
275{
276public:
277 // Constructor takes zero, one, or two int's specifying components of
278 // multicomponent types like Vektor/Tenzor/Anti/SymTenzor this BC applies to.
279 // Zero int's specified means apply to all components; one means apply to
280 // component (i), and two means apply to component (i,j),
282
283 InterpolationFace(unsigned f,
286
287 // Apply the boundary condition to a particular Field.
288 virtual void apply( Field<T,D,M,C>& );
289
290 // Make a copy of the concrete type.
291 virtual BCondBase<T,D,M,C>* clone() const
292 {
293 return new InterpolationFace<T,D,M,C>( *this );
294 }
295
296 // Print out information about the BC to a stream.
297 virtual void write(std::ostream& out) const;
298};
299
301
302template<class T, unsigned D,
304 class C=typename M::DefaultCentering>
305class ParallelPeriodicFace : public PeriodicFace<T,D,M,C>
306{
307public:
308
309 // Constructor takes zero, one, or two int's specifying components
310 // of multicomponent types like Vektor/Tenzor/AntiTenzor/SymTenzor
311 // this BC applies to. Zero int's means apply to all components;
312 // one means apply to component (i), and two means apply to
313 // component (i,j),
314
316
318 int i = Base_t::allComponents,
319 int j = Base_t::allComponents)
320 : PeriodicFace<T,D,M,C>(f,i,j)
321 { }
322
323 // Apply the boundary condition to a particular Field.
324
325 virtual void apply( Field<T,D,M,C>& );
326
327 // Make a copy of the concrete type.
328
329 virtual Base_t * clone() const
330 {
331 return new ParallelPeriodicFace<T,D,M,C>( *this );
332 }
333
334 // Print out information about the BC to a stream.
335
336 virtual void write(std::ostream& out) const;
337};
338
340
341
343// BENI adds parallel Interpolation Face
345
346template<class T, unsigned D,
348 class C=typename M::DefaultCentering>
350{
351public:
352
353 // Constructor takes zero, one, or two int's specifying components
354 // of multicomponent types like Vektor/Tenzor/AntiTenzor/SymTenzor
355 // this BC applies to. Zero int's means apply to all components;
356 // one means apply to component (i), and two means apply to
357 // component (i,j),
358
360
362 int i = Base_t::allComponents,
363 int j = Base_t::allComponents)
364 : InterpolationFace<T,D,M,C>(f,i,j)
365 { }
366
367 // Apply the boundary condition to a particular Field.
368
369 virtual void apply( Field<T,D,M,C>& );
370
371 // Make a copy of the concrete type.
372
373 virtual Base_t * clone() const
374 {
375 return new ParallelInterpolationFace<T,D,M,C>( *this );
376 }
377
378 // Print out information about the BC to a stream.
379
380 virtual void write(std::ostream& out) const;
381};
382
384
385
386template<class T,
387 unsigned D,
389 class C=typename M::DefaultCentering>
390class ExtrapolateFace : public BCondBase<T,D,M,C>
391{
392public:
393 // Constructor takes zero, one, or two int's specifying components of
394 // multicomponent types like Vektor/Tenzor/Anti/SymTenzor this BC applies to.
395 // Zero int's specified means apply to all components; one means apply to
396 // component (i), and two means apply to component (i,j),
398 ExtrapolateFace(unsigned f, T o, T s,
401
402 // Apply the boundary condition to a given Field.
403 virtual void apply( Field<T,D,M,C>& );
404
405 // Make a copy of the concrete type.
406 virtual BCondBase<T,D,M,C>* clone() const
407 {
408 return new ExtrapolateFace<T,D,M,C>( *this );
409 }
410
411 // Print out some information about the BC to a given stream.
412 virtual void write(std::ostream&) const;
413
414 const T& getOffset() const { return Offset; }
415 const T& getSlope() const { return Slope; }
416
417protected:
419};
420
421
423
424// TJW added 12/16/1997 as per Tecolote team's request: this one sets last
425// physical element layer to zero for vert-centered elements/components. For
426// cell-centered, doesn't need to do this because the zero point of an odd
427// function is halfway between the last physical element and the first guard
428// element.
429
430template<class T,
431 unsigned D,
433 class C=typename M::DefaultCentering>
434class ExtrapolateAndZeroFace : public BCondBase<T,D,M,C>
435{
436public:
437 // Constructor takes zero, one, or two int's specifying components of
438 // multicomponent types like Vektor/Tenzor/Anti/SymTenzor this BC applies to.
439 // Zero int's specified means apply to all components; one means apply to
440 // component (i), and two means apply to component (i,j),
442 ExtrapolateAndZeroFace(unsigned f, T o, T s,
445
446 // Apply the boundary condition to a given Field.
447 virtual void apply( Field<T,D,M,C>& );
448
449 // Make a copy of the concrete type.
450 virtual BCondBase<T,D,M,C>* clone() const
451 {
452 return new ExtrapolateAndZeroFace<T,D,M,C>( *this );
453 }
454
455 // Print out some information about the BC to a given stream.
456 virtual void write(std::ostream&) const;
457
458 const T& getOffset() const { return Offset; }
459 const T& getSlope() const { return Slope; }
460
461protected:
463};
464
465
467
468template<class T,
469 unsigned D,
471 class C=typename M::DefaultCentering>
472class PosReflectFace : public ExtrapolateFace<T,D,M,C>
473{
474public:
476 PosReflectFace(unsigned f,
479 : ExtrapolateFace<T,D,M,C>(f,0,1,i,j) {}
480
481 // Print out information about the BC to a stream.
482 virtual void write(std::ostream& out) const;
483};
484
486
487template<class T,
488 unsigned D,
490 class C=typename M::DefaultCentering>
491class NegReflectFace : public ExtrapolateFace<T,D,M,C>
492{
493public:
495 NegReflectFace(unsigned f,
498 : ExtrapolateFace<T,D,M,C>(f,0,-1,i,j) {}
499
500 // Print out information about the BC to a stream.
501 virtual void write(std::ostream& out) const;
502};
503
505
506// TJW added 12/16/1997 as per Tecolote team's request: this one sets last
507// physical element layer to zero for vert-centered elements/components. For
508// cell-centered, doesn't need to do this because the zero point of an odd
509// function is halfway between the last physical element and the first guard
510// element.
511
512template<class T,
513 unsigned D,
515 class C=typename M::DefaultCentering>
517{
518public:
523 : ExtrapolateAndZeroFace<T,D,M,C>(f,0,-1,i,j) {}
524
525 // Print out information about the BC to a stream.
526 virtual void write(std::ostream& out) const;
527};
528
530
531template<class T,
532 unsigned D,
534 class C=typename M::DefaultCentering>
535class ConstantFace : public ExtrapolateFace<T,D,M,C>
536{
537public:
539 ConstantFace(unsigned f, T c,
542 : ExtrapolateFace<T,D,M,C>(f,c,0,i,j) {}
543
544 // Print out information about the BC to a stream.
545 virtual void write(std::ostream& out) const;
546};
547
549
550template<class T,
551 unsigned D,
553 class C=typename M::DefaultCentering>
554class ZeroFace : public ExtrapolateFace<T,D,M,C>
555{
556public:
558 ZeroFace(unsigned f,
561 : ExtrapolateFace<T,D,M,C>(f,0,0,i,j) {}
562
563 // Print out information about the BC to a stream.
564 virtual void write(std::ostream& out) const;
565};
566
568
569// TJW added 1/25/1998 as per Blanca's (Don Marshal's, for the Lagrangian
570// code) request: this one sets last physical element layer to zero for
571// vert-centered elements/components. For cell-centered, doesn't need to do
572// this because the zero point of an odd function is halfway between the last
573// physical element and the first guard element.
574
575template<class T,
576 unsigned D,
578 class C=typename M::DefaultCentering>
580{
581public:
586 : ExtrapolateAndZeroFace<T,D,M,C>(f,0,0,i,j) {}
587
588 // Print out information about the BC to a stream.
589 virtual void write(std::ostream& out) const;
590};
591
593
594//-----------------------------------------------------------------------------
595// Had to depart from the paradigm of the other boundary condition types to
596// implement FunctionFace. Couldn't use the same single FunctionFace class for
597// both whole-Field-element and componentwise functions, because the return
598// of the user-provided function has to be different for the two cases.
599// Instead, left FunctionFace as whole-element-only (no component specification
600// allowed) and introduced new ComponentFunctionFace for componentwise,
601// disallowing via runtime error the allComponents specification allowed in all
602// the other BC types. --Tim Williams 3/31/1997
603//-----------------------------------------------------------------------------
604
605template<class T,
606 unsigned D,
608 class C=typename M::DefaultCentering>
609class FunctionFace : public BCondBase<T,D,M,C>
610{
611public:
612 // Constructor does *not* allow extra one or two arguments specifying
613 // components of multicomponent types, as PeriodicFace and all other BC types
614 // here do; user must use ComponentFunctionFace for these cases. This
615 // constructor only takes the takes arguments for the user-supplied function
616 // and for the active face on the mesh to which this BC applies. The function
617 // must have return type T (can't return single components; must use the
618 // other class ComponentFunctionFace to do this):
619 FunctionFace(T (*func)(const T&), unsigned face);
620
621 void apply( Field<T,D,M,C>& );
622
624 {
625 return new FunctionFace<T,D,M,C>( *this );
626 }
627
628 // Print out information about the BC to a stream.
629 virtual void write(std::ostream& out) const;
630
631 // tjw 3/12/1999: see below
632 T (*Func)(const T&);
633
634private:
635 // tjw 3/12/1999; had to make this public for test/simple/bc2.cpp to work:
636 // T (*Func)(T&);
637};
638
640
641template<class T,
642 unsigned D,
644 class C=typename M::DefaultCentering>
645class ComponentFunctionFace : public BCondBase<T,D,M,C>
646{
647public:
648 // In addition to arguments for FunctionFace, this constructor takes
649 // one, or two unsigned's specifying components of multicomponent types like
650 // Vektor/Tenzor/Anti/SymTenzor this BC applies to.
651 // One unsigned means apply to component (i), and two means apply to
652 // component (i,j). Note: unlike all other non-FunctionFace BC types here,
653 // you *can't* specify nothing or BCondBase<T,D,M,C>::allComponents to
654 // indicate all components; you *must* use FunctionFace class for doing
655 // all components.
656 // ComponentFunctionFace() will give a runtime error if you try to construct
657 // it for all components (which it defaults to, meaning the default is a
658 // runtime error, which should probably be changed some time if somebody can
659 // figure out how). This is not as bad as you might think, though; most
660 // likely the user would be specifying T as the return type of his supplied
661 // function when he is trying to do the all-component case, in which he'd
662 // get a compile error on the type of the constructor argument Func.
665 (*func)( typename ApplyToComponentType<T>::type),
666 unsigned face,
669
670 void apply( Field<T,D,M,C>& );
671
673 {
674 return new ComponentFunctionFace<T,D,M,C>( *this );
675 }
676
677 // Print out information about the BC to a stream.
678 virtual void write(std::ostream& out) const;
679
680 // tjw 3/12/1999: see below
682 (*Func)( typename ApplyToComponentType<T>::type );
683
684private:
685 // tjw 3/12/1999; had to make this public for test/simple/bc2.cpp to work:
686 // typename ApplyToComponentType<T>::type
687 // (*Func)( typename ApplyToComponentType<T>::type );
688};
689
691
692/*
693 Special for Conejo: The Eureka boundary condition.
694
695 This is an augmented zero boundary condition which sets
696 more locations to zero for some cases.
697
698 Instead of setting just the guard layers to zero, it sets the guard
699 layers plus one to zero in all cases except one:
700 Face centered data (which as all but one dimension cell centered),
701 on the directions in which it is cell centered.
702
703*/
704
705template<class T,
706 unsigned D,
708 class C=typename M::DefaultCentering>
709class EurekaFace : public BCondBase<T,D,M,C>
710{
711public:
712 // Constructor takes:
713 // face: the face to apply the boundary condition on.
714 // i,j : what component of T to apply the boundary condition to.
715 // The components default to setting all components.
716 // All it has to do is tell the base class to set itself up.
718 EurekaFace(unsigned int face,
721 : BCondBase<T,D,M,C>(face,i,j) { BCondBase<T,D,M,C>::m_changePhysical = true; }
722
723 // Apply the boundary condition to a given Field.
724 virtual void apply( Field<T,D,M,C>& ) ;
725
726 // Make a copy of one of these.
728 {
729 return new EurekaFace<T,D,M,C>(*this);
730 }
731
732 // Print out information about the BC to a stream.
733 virtual void write(std::ostream& out) const;
734
735};
736
738
739// ----------------------------------------------------------------------------
740// TJW added 1/26/1998 as per Blanca's (Jerry Brock's, for the tracer particle
741// code) request: this one takes the values of the last two physical elements,
742// and linearly extrapolates from the line through them out to all the guard
743// elements. This is independent of centering. The intended use is for filling
744// global guard layers of a Field of Vektors holding the mesh node position
745// values, for which this does the right thing at hi and lo faces (exactly
746// right for uniform cartesian meshes, and a reasonable thing to do for
747// nonuniform cartesian meshes).
748//
749// Had to depart from the paradigm of the other boundary condition types to
750// implement LinearExtrapolateFace. Couldn't use the same single
751// LinearExtrapolateFace class for both whole-Field-element and componentwise
752// functions, because I couldn't figure out how to implement it using PETE and
753// applicative templates. Instead, created LinearExtrapolateFace as
754// whole-element-only (no component specification allowed) and separate
755// ComponentLinearExtrapolateFace for componentwise, disallowing via runtime
756// error the allComponents specification allowed in all the other BC
757// types. --Tim Williams 1/26/1999
758// ----------------------------------------------------------------------------
759
760template<class T,
761 unsigned D,
763 class C=typename M::DefaultCentering>
764class LinearExtrapolateFace : public BCondBase<T,D,M,C>
765{
766public:
767 // Constructor takes zero, one, or two int's specifying components of
768 // multicomponent types like Vektor/Tenzor/Anti/SymTenzor this BC applies to.
769 // Zero int's specified means apply to all components; one means apply to
770 // component (i), and two means apply to component (i,j),
773 BCondBase<T,D,M,C>(f) {}
774
775 // Apply the boundary condition to a given Field.
776 virtual void apply( Field<T,D,M,C> &A);
777
778 // Make a copy of the concrete type.
779 virtual BCondBase<T,D,M,C>* clone() const
780 {
781 return new LinearExtrapolateFace<T,D,M,C>( *this );
782 }
783
784 // Print out some information about the BC to a given stream.
785 virtual void write(std::ostream&) const;
786
787};
788
789
790template<class T,
791 unsigned D,
793 class C=typename M::DefaultCentering>
795{
796public:
797 // Constructor takes zero, one, or two int's specifying components of
798 // multicomponent types like Vektor/Tenzor/Anti/SymTenzor this BC applies to.
799 // Zero int's specified means apply to all components; one means apply to
800 // component (i), and two means apply to component (i,j),
805 BCondBase<T,D,M,C>(f,i,j) {
806 // Disallow specification of all components (default, unfortunately):
809 ERRORMSG("ComponentLinearExtrapolateFace(): allComponents specified; "
810 << "not allowed; use LinearExtrapolateFace "
811 << "class instead." << endl);
812 }
813
814 // Apply the boundary condition to a given Field.
815 virtual void apply( Field<T,D,M,C> &A);
816
817 // Make a copy of the concrete type.
818 virtual BCondBase<T,D,M,C>* clone() const
819 {
820 return new ComponentLinearExtrapolateFace<T,D,M,C>( *this );
821 }
822
823 // Print out some information about the BC to a given stream.
824 virtual void write(std::ostream&) const;
825
826};
827
828
830
831template<class T,
832 unsigned D,
834 class C=typename M::DefaultCentering>
835class PatchBC : public BCondBase<T,D,M,C>
836{
837public:
838
839 //
840 // Initialize with a functor and the face to apply that functor to.
841 //
842 PatchBC(unsigned face);
843
844 //
845 // Virtual function to apply this BC to a Field.
846 //
847 void apply( Field<T,D,M,C>& );
848
849 //
850 // Virtual function for the user to supply to apply this BC to
851 // a given vnode.
852 //
854 const NDIndex<D>&) = 0;
855
856 //
857 // Print out information about the BC to a stream.
858 //
859 virtual void write(std::ostream& out) const
860 {
861 out << "PatchBC(" << this->getFace() << ")";
862 }
863
864private:
865
866};
867
869
870//
871// Define global streaming functions that just call the
872// write function for each of the above base classes.
873//
874
875template<class T, unsigned D, class M, class C >
876inline std::ostream&
877operator<<(std::ostream& o, const BCondBase<T,D,M,C>& bc)
878{
879 bc.write(o);
880 return o;
881}
882
883
884template<class T, unsigned D, class M, class C >
885inline std::ostream&
886operator<<(std::ostream& o, const BConds<T,D,M,C>& bc)
887{
888 bc.write(o);
889 return o;
890}
891
893
894#include "Field/BCond.hpp"
895
896#endif // BCOND_H
897
898/***************************************************************************
899 * $RCSfile: BCond.h,v $ $Author: adelmann $
900 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:26 $
901 * IPPL_VERSION_ID: $Id: BCond.h,v 1.1.1.1 2003/01/23 07:40:26 adelmann Exp $
902 ***************************************************************************/
scalar_tag get_tag(std::complex< double >)
Definition: BCond.h:100
TensorOrder_e getTensorOrder(const scalar_tag &)
Definition: BCond.h:133
std::ostream & operator<<(std::ostream &, const BCondBase< T, D, M, C > &)
Definition: BCond.h:877
TensorOrder_e
Definition: BCond.h:131
@ IPPL_TENSOR
Definition: BCond.h:131
@ IPPL_SYMTENSOR
Definition: BCond.h:132
@ IPPL_SCALAR
Definition: BCond.h:131
@ IPPL_VECTOR
Definition: BCond.h:131
@ IPPL_ANTISYMTENSOR
Definition: BCond.h:132
std::complex< double > a
Inform & endl(Inform &inf)
Definition: Inform.cpp:42
#define ERRORMSG(msg)
Definition: IpplInfo.h:350
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:45
Definition: Tenzor.h:35
Definition: Vektor.h:32
Definition: Field.h:33
Definition: LField.h:58
bool changesPhysicalCells() const
Definition: BCond.h:175
BCondBase(unsigned int face, int i=allComponents, int j=allComponents)
Definition: BCond.hpp:56
virtual BCondBase< T, D, M, C > * clone() const =0
int getComponent() const
Definition: BCond.h:169
virtual ~BCondBase()
Definition: BCond.h:161
int m_component
Definition: BCond.h:181
unsigned int getFace() const
Definition: BCond.h:172
virtual void write(std::ostream &) const
Definition: BCond.hpp:107
static int allComponents
Definition: BCond.h:152
unsigned int m_face
Definition: BCond.h:184
bool m_changePhysical
Definition: BCond.h:187
virtual void apply(Field< T, D, M, C > &)=0
Definition: BCond.h:199
vmap< int, RefCountedP< BCondBase< T, D, M, C > > >::const_iterator const_iterator
Definition: BCond.h:204
bool changesPhysicalCells() const
Definition: BCond.hpp:268
void apply(Field< T, D, M, C > &a)
Definition: BCond.hpp:258
vmap< int, RefCountedP< BCondBase< T, D, M, C > > >::iterator iterator
Definition: BCond.h:202
virtual void write(std::ostream &) const
Definition: BCond.hpp:236
virtual void write(std::ostream &out) const
BCondNoAction(int face)
Definition: BCond.h:221
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.h:223
BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:224
PeriodicFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.hpp:282
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:246
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:474
virtual BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:256
virtual void write(std::ostream &out) const
Definition: BCond.hpp:113
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:483
virtual void write(std::ostream &out) const
Definition: BCond.hpp:120
virtual BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:291
InterpolationFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.hpp:292
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:281
ParallelPeriodicFace(unsigned f, int i=Base_t::allComponents, int j=Base_t::allComponents)
Definition: BCond.h:317
virtual Base_t * clone() const
Definition: BCond.h:329
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:1314
virtual void write(std::ostream &out) const
Definition: BCond.hpp:133
BCondBase< T, D, M, C > Base_t
Definition: BCond.h:315
virtual Base_t * clone() const
Definition: BCond.h:373
ParallelInterpolationFace(unsigned f, int i=Base_t::allComponents, int j=Base_t::allComponents)
Definition: BCond.h:361
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:2031
virtual void write(std::ostream &out) const
Definition: BCond.hpp:127
BCondBase< T, D, M, C > Base_t
Definition: BCond.h:359
ExtrapolateFace(unsigned f, T o, T s, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.hpp:300
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:397
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:2792
virtual BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:406
const T & getOffset() const
Definition: BCond.h:414
virtual void write(std::ostream &) const
Definition: BCond.hpp:197
const T & getSlope() const
Definition: BCond.h:415
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:441
const T & getSlope() const
Definition: BCond.h:459
virtual void write(std::ostream &) const
Definition: BCond.hpp:207
const T & getOffset() const
Definition: BCond.h:458
ExtrapolateAndZeroFace(unsigned f, T o, T s, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.hpp:309
virtual BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:450
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:3605
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:475
virtual void write(std::ostream &out) const
Definition: BCond.hpp:151
PosReflectFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:476
virtual void write(std::ostream &out) const
Definition: BCond.hpp:139
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:494
NegReflectFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:495
virtual void write(std::ostream &out) const
Definition: BCond.hpp:145
NegReflectAndZeroFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:520
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:519
virtual void write(std::ostream &out) const
Definition: BCond.hpp:169
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:538
ConstantFace(unsigned f, T c, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:539
virtual void write(std::ostream &out) const
Definition: BCond.hpp:157
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:557
ZeroFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:558
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:582
ZeroGuardsAndZeroFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:583
virtual void write(std::ostream &out) const
Definition: BCond.hpp:163
FunctionFace(T(*func)(const T &), unsigned face)
Definition: BCond.hpp:318
T(* Func)(const T &)
Definition: BCond.h:632
virtual void write(std::ostream &out) const
Definition: BCond.hpp:184
BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:623
void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:4534
BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:672
void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:4986
virtual void write(std::ostream &out) const
Definition: BCond.hpp:190
ApplyToComponentType< T >::type(* Func)(typename ApplyToComponentType< T >::type)
Definition: BCond.h:682
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:663
ComponentFunctionFace(typename ApplyToComponentType< T >::type(*func)(typename ApplyToComponentType< T >::type), unsigned face, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.hpp:327
virtual void write(std::ostream &out) const
Definition: BCond.hpp:178
EurekaFace(unsigned int face, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:718
BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:727
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:717
virtual void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:5377
virtual BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:779
virtual void apply(Field< T, D, M, C > &A)
Definition: BCond.hpp:5748
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:771
LinearExtrapolateFace(unsigned f)
Definition: BCond.h:772
virtual void write(std::ostream &) const
Definition: BCond.hpp:217
virtual BCondBase< T, D, M, C > * clone() const
Definition: BCond.h:818
BCondBase< T, D, M, C > BCondBaseTDMC
Definition: BCond.h:801
virtual void write(std::ostream &) const
Definition: BCond.hpp:226
ComponentLinearExtrapolateFace(unsigned f, int i=BCondBaseTDMC::allComponents, int j=BCondBaseTDMC::allComponents)
Definition: BCond.h:802
virtual void apply(Field< T, D, M, C > &A)
Definition: BCond.hpp:5930
Definition: BCond.h:836
virtual void applyPatch(typename Field< T, D, M, C >::iterator, const NDIndex< D > &)=0
void apply(Field< T, D, M, C > &)
Definition: BCond.hpp:6112
PatchBC(unsigned face)
Definition: BCond.hpp:6097
virtual void write(std::ostream &out) const
Definition: BCond.h:859
Definition: vmap.h:59