libMesh
Public Member Functions | Protected Attributes | Private Attributes | List of all members
SolutionGradient< dim > Class Template Reference

#include <solution_function.h>

Inheritance diagram for SolutionGradient< dim >:
[legend]

Public Member Functions

 SolutionGradient (const unsigned int u_var)
 
 ~SolutionGradient ()=default
 
virtual Gradient operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual Gradient component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Gradient > > clone () const
 
 SolutionGradient (const unsigned int u_var)
 
 ~SolutionGradient ()=default
 
virtual Gradient operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual Gradient component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Gradient > > clone () const
 
 SolutionGradient (const unsigned int u_var)
 
 ~SolutionGradient ()=default
 
virtual Gradient operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual Gradient component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Gradient > > clone () const
 
 SolutionGradient ()=default
 
 ~SolutionGradient ()=default
 
virtual Gradient operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual Gradient component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Gradient > > clone () const
 
 SolutionGradient ()=default
 
 ~SolutionGradient ()=default
 
virtual Gradient operator() (const Point &, const Real=0) override
 
virtual void operator() (const Point &p, const Real, DenseVector< Gradient > &output) override
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual std::unique_ptr< FunctionBase< Gradient > > clone () const override
 
virtual Gradient component (unsigned int i, const Point &p, Real time=0.) override
 
 SolutionGradient ()=default
 
 ~SolutionGradient ()=default
 
virtual Gradient operator() (const Point &, const Real=0) override
 
virtual void operator() (const Point &p, const Real, DenseVector< Gradient > &output) override
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual std::unique_ptr< FunctionBase< Gradient > > clone () const override
 
virtual Gradient component (unsigned int i, const Point &p, Real time=0.) override
 
 SolutionGradient ()=default
 
 ~SolutionGradient ()=default
 
virtual Gradient operator() (const Point &, const Real=0) override
 
virtual void operator() (const Point &p, const Real, DenseVector< Gradient > &output) override
 Evaluation function for time-dependent vector-valued functions. More...
 
virtual std::unique_ptr< FunctionBase< Gradient > > clone () const override
 
virtual Gradient component (unsigned int i, const Point &p, Real time=0.) override
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Gradient > &output)
 
virtual void init ()
 The actual initialization process. More...
 
virtual void clear ()
 Clears the function. More...
 
void operator() (const Point &p, DenseVector< Gradient > &output)
 Evaluation function for time-independent vector-valued functions. More...
 
bool initialized () const
 
void set_is_time_dependent (bool is_time_dependent)
 Function to set whether this is a time-dependent function or not. More...
 
bool is_time_dependent () const
 

Protected Attributes

const FunctionBase_master
 Const pointer to our master, initialized to nullptr. More...
 
bool _initialized
 When init() was called so that everything is ready for calls to operator() (...), then this bool is true. More...
 
bool _is_time_dependent
 Cache whether or not this function is actually time-dependent. More...
 

Private Attributes

const unsigned int _u_var
 
LaplaceExactGradient soln
 
CurlCurlExactSolution soln
 
DivGradExactSolution soln
 
MixedExactSolution soln
 

Detailed Description

template<unsigned int dim>
class SolutionGradient< dim >

Definition at line 77 of file solution_function.h.

Constructor & Destructor Documentation

◆ SolutionGradient() [1/7]

template<unsigned int dim>
SolutionGradient< dim >::SolutionGradient ( const unsigned int  u_var)
inline

Definition at line 81 of file solution_function.h.

82  : _u_var(u_var) {}
const unsigned int _u_var

◆ ~SolutionGradient() [1/7]

template<unsigned int dim>
SolutionGradient< dim >::~SolutionGradient ( )
default

◆ SolutionGradient() [2/7]

template<unsigned int dim>
SolutionGradient< dim >::SolutionGradient ( const unsigned int  u_var)
inline

Definition at line 78 of file solution_function.h.

79  : _u_var(u_var) {}
const unsigned int _u_var

◆ ~SolutionGradient() [2/7]

template<unsigned int dim>
SolutionGradient< dim >::~SolutionGradient ( )
default

◆ SolutionGradient() [3/7]

template<unsigned int dim>
SolutionGradient< dim >::SolutionGradient ( const unsigned int  u_var)
inline

Definition at line 78 of file solution_function.h.

79  : _u_var(u_var) {}
const unsigned int _u_var

◆ ~SolutionGradient() [3/7]

template<unsigned int dim>
SolutionGradient< dim >::~SolutionGradient ( )
default

◆ SolutionGradient() [4/7]

template<unsigned int dim>
SolutionGradient< dim >::SolutionGradient ( )
default

◆ ~SolutionGradient() [4/7]

template<unsigned int dim>
SolutionGradient< dim >::~SolutionGradient ( )
default

◆ SolutionGradient() [5/7]

template<unsigned int dim>
SolutionGradient< dim >::SolutionGradient ( )
default

◆ ~SolutionGradient() [5/7]

template<unsigned int dim>
SolutionGradient< dim >::~SolutionGradient ( )
default

◆ SolutionGradient() [6/7]

template<unsigned int dim>
SolutionGradient< dim >::SolutionGradient ( )
default

◆ ~SolutionGradient() [6/7]

template<unsigned int dim>
SolutionGradient< dim >::~SolutionGradient ( )
default

◆ SolutionGradient() [7/7]

template<unsigned int dim>
SolutionGradient< dim >::SolutionGradient ( )
default

◆ ~SolutionGradient() [7/7]

template<unsigned int dim>
SolutionGradient< dim >::~SolutionGradient ( )
default

Member Function Documentation

◆ clear()

virtual void libMesh::FunctionBase< Gradient >::clear ( )
inlinevirtualinherited

Clears the function.

Definition at line 92 of file function_base.h.

92 {}

◆ clone() [1/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Gradient> > SolutionGradient< dim >::clone ( ) const
inlinevirtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 103 of file solution_function.h.

104  { return std::make_unique<SolutionGradient>(_u_var); }
const unsigned int _u_var

◆ clone() [2/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Gradient> > SolutionGradient< dim >::clone ( ) const
inlinevirtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 105 of file solution_function.h.

106  { return std::make_unique<SolutionGradient>(_u_var); }
const unsigned int _u_var

◆ clone() [3/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Gradient> > SolutionGradient< dim >::clone ( ) const
inlinevirtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 107 of file solution_function.h.

108  { return std::make_unique<SolutionGradient>(_u_var); }
const unsigned int _u_var

◆ clone() [4/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Gradient> > SolutionGradient< dim >::clone ( ) const
inlineoverridevirtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 108 of file solution_function.h.

109  {
110  return std::make_unique<SolutionGradient>();
111  }

◆ clone() [5/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Gradient> > SolutionGradient< dim >::clone ( ) const
inlineoverridevirtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 108 of file solution_function.h.

109  {
110  return std::make_unique<SolutionGradient>();
111  }

◆ clone() [6/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Gradient> > SolutionGradient< dim >::clone ( ) const
inlineoverridevirtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 111 of file solution_function.h.

112  {
113  return std::make_unique<SolutionGradient>();
114  }

◆ clone() [7/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Gradient> > SolutionGradient< dim >::clone ( ) const
inlinevirtual
Returns
A new copy of the function.

The new copy should be as "deep" as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 114 of file solution_function.h.

115  { return std::make_unique<SolutionGradient>(); }

◆ component() [1/7]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::component ( unsigned int  i,
const Point p,
const Real  time 
)
inlinevirtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Gradient >.

Definition at line 96 of file solution_function.h.

References libMesh::Real.

98  {
99  const Real x=p(0), y=p(1);
100  return soln.grad(x, y).row(component_in);
101  }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ component() [2/7]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::component ( unsigned int  i,
const Point p,
const Real  time 
)
inlinevirtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Gradient >.

Definition at line 97 of file solution_function.h.

References libMesh::Real.

100  {
101  const Real x=p(0), y=p(1), z=p(2);
102  return soln.grad(x, y, z).row(component_in);
103  }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ component() [3/7]

template<unsigned int dim>
Gradient SolutionGradient< dim >::component ( unsigned int  i,
const Point p,
const Real  time 
)
inlinevirtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Gradient >.

Definition at line 99 of file solution_function.h.

References libMesh::Real.

102  {
103  const Real x=p(0), y=p(1), z=p(2);
104  return soln(component_in, x, y, z);
105  }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ component() [4/7]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::component ( unsigned int  i,
const Point p,
const Real  time 
)
virtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Gradient >.

◆ component() [5/7]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::component ( unsigned int  i,
const Point p,
Real  time = 0. 
)
inlineoverridevirtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Gradient >.

Definition at line 113 of file solution_function.h.

References dim.

114  {
115  const auto size = dim == 2 ? 4 : 5;
116  DenseVector<Gradient> outvec(size);
117  (*this)(p, time, outvec);
118  return outvec(i);
119  }
unsigned int dim
Defines a dense vector for use in Finite Element-type computations.

◆ component() [6/7]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::component ( unsigned int  i,
const Point p,
Real  time = 0. 
)
inlineoverridevirtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Gradient >.

Definition at line 113 of file solution_function.h.

References dim.

114  {
115  const auto size = dim == 2 ? 4 : 5;
116  DenseVector<Gradient> outvec(size);
117  (*this)(p, time, outvec);
118  return outvec(i);
119  }
unsigned int dim
Defines a dense vector for use in Finite Element-type computations.

◆ component() [7/7]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::component ( unsigned int  i,
const Point p,
Real  time = 0. 
)
inlineoverridevirtual
Returns
The vector component i at coordinate p and time time.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.
The default implementation calls operator() with a DenseVector of size i+1 which will result in unexpected behaviour if operator() makes any access beyond that limit.

Reimplemented from libMesh::FunctionBase< Gradient >.

Definition at line 116 of file solution_function.h.

References dim.

117  {
118  const auto size = 2 * (dim == 2 ? 3 : 4);
119  DenseVector<Gradient> outvec(size);
120  (*this)(p, time, outvec);
121  return outvec(i);
122  }
unsigned int dim
Defines a dense vector for use in Finite Element-type computations.

◆ init()

virtual void libMesh::FunctionBase< Gradient >::init ( )
inlinevirtualinherited

The actual initialization process.

Reimplemented in libMesh::GradientMeshFunction.

Definition at line 87 of file function_base.h.

87 {}

◆ initialized()

bool libMesh::FunctionBase< Gradient >::initialized ( ) const
inlineinherited
Returns
true when this object is properly initialized and ready for use, false otherwise.

Definition at line 210 of file function_base.h.

211 {
212  return (this->_initialized);
213 }
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...

◆ is_time_dependent()

bool libMesh::FunctionBase< Gradient >::is_time_dependent ( ) const
inlineinherited
Returns
true when the function this object represents is actually time-dependent, false otherwise.

Definition at line 224 of file function_base.h.

225 {
226  return (this->_is_time_dependent);
227 }
bool _is_time_dependent
Cache whether or not this function is actually time-dependent.

◆ operator()() [1/23]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::operator() ( const Point p,
const Real  time = 0 
)
inlinevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 82 of file solution_function.h.

84  { libmesh_not_implemented(); }

◆ operator()() [2/23]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::operator() ( const Point p,
const Real  time = 0 
)
inlinevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 83 of file solution_function.h.

84  { libmesh_not_implemented(); }

◆ operator()() [3/23]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::operator() ( const Point p,
const Real  time = 0 
)
inlinevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 85 of file solution_function.h.

86  { libmesh_not_implemented(); }

◆ operator()() [4/23]

template<unsigned int dim>
virtual void SolutionGradient< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Gradient > &  output 
)
inlinevirtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 86 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

89  {
90  output.zero();
91  const Real x=p(0), y=p(1), z=p(2);
92  output(_u_var) = soln.grad(x, y, z).row(0);
93  output(_u_var+1) = soln.grad(x, y, z).row(1);
94  output(_u_var+2) = soln.grad(x, y, z).row(2);
95  }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
const unsigned int _u_var
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [5/23]

template<unsigned int dim>
virtual void SolutionGradient< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Gradient > &  output 
)
inlinevirtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 86 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

89  {
90  output.zero();
91  const Real x=p(0), y=p(1);
92  output(_u_var) = soln.grad(x, y).row(0);
93  output(_u_var+1) = soln.grad(x, y).row(1);
94  }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
const unsigned int _u_var
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [6/23]

template<unsigned int dim>
virtual void SolutionGradient< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Gradient > &  output 
)
inlinevirtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 88 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

91  {
92  output.zero();
93  const Real x=p(0), y=p(1), z=p(2);
94  output(_u_var) = soln(0, x, y, z);
95  output(_u_var+1) = soln(1, x, y, z);
96  output(_u_var+2) = soln(2, x, y, z);
97  }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
const unsigned int _u_var
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [7/23]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::operator() ( const Point p,
const Real  time = 0 
)
inlinevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 103 of file solution_function.h.

104  { libmesh_not_implemented(); }

◆ operator()() [8/23]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::operator() ( const Point p,
const Real  time = 0 
)
inlineoverridevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 104 of file solution_function.h.

104 { libmesh_not_implemented(); }

◆ operator()() [9/23]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::operator() ( const Point p,
const Real  time = 0 
)
inlineoverridevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 104 of file solution_function.h.

104 { libmesh_not_implemented(); }

◆ operator()() [10/23]

template<unsigned int dim>
virtual void SolutionGradient< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Gradient > &  output 
)
overridevirtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

◆ operator()() [11/23]

template<unsigned int dim>
virtual void SolutionGradient< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Gradient > &  output 
)
overridevirtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

◆ operator()() [12/23]

template<unsigned int dim>
virtual void SolutionGradient< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Gradient > &  output 
)
virtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

◆ operator()() [13/23]

template<unsigned int dim>
virtual Gradient SolutionGradient< dim >::operator() ( const Point p,
const Real  time = 0 
)
inlineoverridevirtual
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

Definition at line 107 of file solution_function.h.

107 { libmesh_not_implemented(); }

◆ operator()() [14/23]

template<unsigned int dim>
virtual void SolutionGradient< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Gradient > &  output 
)
overridevirtual

Evaluation function for time-dependent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Gradient >.

◆ operator()() [15/23]

void libMesh::FunctionBase< Gradient >::operator() ( const Point p,
DenseVector< Gradient > &  output 
)
inlineinherited

Evaluation function for time-independent vector-valued functions.

Sets output values in the passed-in output DenseVector.

Definition at line 245 of file function_base.h.

247 {
248  // Call the time-dependent function with t=0.
249  this->operator()(p, 0., output);
250 }
virtual Gradient operator()(const Point &p, const Real time=0.)=0

◆ operator()() [16/23]

template<>
void SolutionGradient< 2 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 123 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

126 {
127  output.zero();
128  const Real x=p(0), y=p(1);
129  output(0) = soln.grad(x, y).row(0);
130  output(1) = soln.grad(x, y).row(1);
131  output(2) = -soln(x, y);
132 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [17/23]

template<>
void SolutionGradient< 2 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 127 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

128 {
129  output.zero();
130  const Real x = p(0), y = p(1);
131  output(0) = soln.grad(x, y).row(0);
132  output(1) = soln.grad(x, y).row(1);
133 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [18/23]

template<>
void SolutionGradient< 2 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 127 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

128 {
129  output.zero();
130  const Real x = p(0), y = p(1);
131  output(0) = soln.grad(x, y).row(0);
132  output(1) = soln.grad(x, y).row(1);
133 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [19/23]

template<>
void SolutionGradient< 2 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 130 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

131 {
132  output.zero();
133  const Real x = p(0), y = p(1);
134  output(0) = soln.grad(x, y).row(0);
135  output(1) = soln.grad(x, y).row(1);
136  output(2) = output(0);
137  output(3) = output(1);
138 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [20/23]

template<>
void SolutionGradient< 3 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 135 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

138 {
139  output.zero();
140  const Real x=p(0), y=p(1), z=p(2);
141  output(0) = soln.grad(x, y, z).row(0);
142  output(1) = soln.grad(x, y, z).row(1);
143  output(2) = soln.grad(x, y, z).row(2);
144  output(3) = -soln(x, y, z);
145 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [21/23]

template<>
void SolutionGradient< 3 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 137 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

138 {
139  output.zero();
140  const Real x = p(0), y = p(1), z = p(2);
141  output(0) = soln.grad(x, y, z).row(0);
142  output(1) = soln.grad(x, y, z).row(1);
143  output(2) = soln.grad(x, y, z).row(2);
144 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [22/23]

template<>
void SolutionGradient< 3 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 137 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

138 {
139  output.zero();
140  const Real x = p(0), y = p(1), z = p(2);
141  output(0) = soln.grad(x, y, z).row(0);
142  output(1) = soln.grad(x, y, z).row(1);
143  output(2) = soln.grad(x, y, z).row(2);
144 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ operator()() [23/23]

template<>
void SolutionGradient< 3 >::operator() ( const Point p,
const Real  ,
DenseVector< Gradient > &  output 
)

Definition at line 142 of file solution_function.h.

References libMesh::Real, and libMesh::DenseVector< T >::zero().

143 {
144  output.zero();
145  const Real x = p(0), y = p(1), z = p(2);
146  output(0) = soln.grad(x, y, z).row(0);
147  output(1) = soln.grad(x, y, z).row(1);
148  output(2) = soln.grad(x, y, z).row(2);
149  output(3) = output(0);
150  output(4) = output(1);
151  output(5) = output(2);
152 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactGradient soln

◆ set_is_time_dependent()

void libMesh::FunctionBase< Gradient >::set_is_time_dependent ( bool  is_time_dependent)
inlineinherited

Function to set whether this is a time-dependent function or not.

This is intended to be only used by subclasses who cannot natively determine time-dependence. In such a case, this function should be used immediately following construction.

Definition at line 217 of file function_base.h.

218 {
220 }
bool _is_time_dependent
Cache whether or not this function is actually time-dependent.

Member Data Documentation

◆ _initialized

bool libMesh::FunctionBase< Gradient >::_initialized
protectedinherited

When init() was called so that everything is ready for calls to operator() (...), then this bool is true.

Definition at line 184 of file function_base.h.

◆ _is_time_dependent

bool libMesh::FunctionBase< Gradient >::_is_time_dependent
protectedinherited

Cache whether or not this function is actually time-dependent.

Definition at line 189 of file function_base.h.

◆ _master

const FunctionBase* libMesh::FunctionBase< Gradient >::_master
protectedinherited

Const pointer to our master, initialized to nullptr.

There may be cases where multiple functions are required, but to save memory, one master handles some centralized data.

Definition at line 178 of file function_base.h.

◆ _u_var

template<unsigned int dim>
const unsigned int SolutionGradient< dim >::_u_var
private

Definition at line 112 of file solution_function.h.

◆ soln [1/4]

template<unsigned int dim>
CurlCurlExactSolution SolutionGradient< dim >::soln
private

Definition at line 109 of file solution_function.h.

◆ soln [2/4]

template<unsigned int dim>
MixedExactSolution SolutionGradient< dim >::soln
private

Definition at line 113 of file solution_function.h.

◆ soln [3/4]

template<unsigned int dim>
DivGradExactSolution SolutionGradient< dim >::soln
private

Definition at line 119 of file solution_function.h.

◆ soln [4/4]

template<unsigned int dim>
MixedExactSolution SolutionGradient< dim >::soln
private

Definition at line 122 of file solution_function.h.


The documentation for this class was generated from the following file: