Chombo + EB + MF  3.2
TensorFunction.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _TENSORFUNCTION_H_
12 #define _TENSORFUNCTION_H_
13 
14 #include "REAL.H"
15 #include "RealVect.H"
16 #include "RealTensor.H"
17 #include "NamespaceHeader.H"
18 
19 //! \class TensorFunction
20 //! This base class represents a tensor function \f$T: \mathbf{R}^D \rightarrow \mathbf{R}^D\otimes\mathbf{R}^D\f$.
22 {
23  public:
24 
25  //! Base class constructor. Must be called by subclasses.
26  //! \param a_homogeneous This flag indicates whether the tensor function
27  //! is constant in space.
28  //! \param a_constant This flag indicates whether the tensor function
29  //! is constant in time.
30  TensorFunction(bool a_homogeneous,
31  bool a_constant);
32 
33  //! Destructor.
34  virtual ~TensorFunction();
35 
36  //! Override this method to evaluate this function at the given
37  //! point in space and time.
38  //! \param a_x A point in \f$D\f$-dimensional space.
39  //! \param a_t The time at which the function is evaluated.
40  virtual RealTensor operator()(const RealVect& a_x,
41  Real a_t) const = 0;
42 
43  //! This evaluates the function at time 0.
44  //! \param a_x A point in \f$D\f$-dimensional space.
45  RealTensor operator()(const RealVect& a_x) const
46  {
47  return operator()(a_x, 0.0);
48  }
49 
50  //! Returns true if this function is homogeneous, false otherwise.
51  bool isHomogeneous() const
52  {
53  return m_isHomogeneous;
54  }
55 
56  //! Returns true if this function is constant, false otherwise.
57  bool isConstant() const
58  {
59  return m_isConstant;
60  }
61 
62  protected:
63 
65 
66  private:
67 
68  // Disallowed!
72 };
73 
74 #include "NamespaceFooter.H"
75 #endif
virtual RealTensor operator()(const RealVect &a_x, Real a_t) const =0
Definition: TensorFunction.H:21
Definition: RealTensor.H:24
bool isHomogeneous() const
Returns true if this function is homogeneous, false otherwise.
Definition: TensorFunction.H:51
bool m_isHomogeneous
Definition: TensorFunction.H:64
virtual ~TensorFunction()
Destructor.
RealTensor operator()(const RealVect &a_x) const
Definition: TensorFunction.H:45
double Real
Definition: REAL.H:33
TensorFunction & operator=(const TensorFunction &)
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
bool isConstant() const
Returns true if this function is constant, false otherwise.
Definition: TensorFunction.H:57
bool m_isConstant
Definition: TensorFunction.H:64