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

#include <solution_function.h>

Inheritance diagram for SolutionFunction< dim >:
[legend]

Public Member Functions

 SolutionFunction (const unsigned int u_var)
 
 ~SolutionFunction ()=default
 
virtual Number operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual Number component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const
 
 SolutionFunction (const unsigned int u_var)
 
 ~SolutionFunction ()=default
 
virtual Number operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual Number component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const
 
 SolutionFunction (const unsigned int u_var)
 
 ~SolutionFunction ()=default
 
virtual Number operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual Number component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const
 
 SolutionFunction ()=default
 
 ~SolutionFunction ()=default
 
virtual Number operator() (const Point &, const Real=0)
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual Number component (unsigned int component_in, const Point &p, const Real)
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const
 
 SolutionFunction ()=default
 
 ~SolutionFunction ()=default
 
virtual Number operator() (const Point &, const Real=0) override
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output) override
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const override
 
virtual Number component (unsigned int i, const Point &p, Real time=0.) override
 
 SolutionFunction ()=default
 
 ~SolutionFunction ()=default
 
virtual Number operator() (const Point &, const Real=0) override
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output) override
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const override
 
virtual Number component (unsigned int i, const Point &p, Real time=0.) override
 
 SolutionFunction ()=default
 
 ~SolutionFunction ()=default
 
virtual Number operator() (const Point &, const Real=0) override
 
virtual void operator() (const Point &p, const Real, DenseVector< Number > &output) override
 
virtual std::unique_ptr< FunctionBase< Number > > clone () const override
 
virtual Number component (unsigned int i, const Point &p, Real time=0.) override
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
template<>
void operator() (const Point &p, const Real, DenseVector< Number > &output)
 
virtual void init ()
 The actual initialization process. More...
 
virtual void clear ()
 Clears the function. More...
 
void operator() (const Point &p, DenseVector< Number > &output)
 Evaluation function for time-independent vector-valued functions. More...
 
virtual void operator() (const Point &p, const Real time, DenseVector< Number > &output)=0
 Evaluation function for time-dependent 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
 
LaplaceExactSolution soln
 
CurlCurlExactSolution soln
 
DivGradExactSolution soln
 
MixedExactSolution soln
 

Detailed Description

template<unsigned int dim>
class SolutionFunction< dim >

Definition at line 32 of file solution_function.h.

Constructor & Destructor Documentation

◆ SolutionFunction() [1/7]

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

Definition at line 36 of file solution_function.h.

36  :
37  _u_var(u_var) {}
const unsigned int _u_var

◆ ~SolutionFunction() [1/7]

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

◆ SolutionFunction() [2/7]

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

Definition at line 36 of file solution_function.h.

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

◆ ~SolutionFunction() [2/7]

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

◆ SolutionFunction() [3/7]

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

Definition at line 36 of file solution_function.h.

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

◆ ~SolutionFunction() [3/7]

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

◆ SolutionFunction() [4/7]

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

◆ ~SolutionFunction() [4/7]

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

◆ SolutionFunction() [5/7]

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

◆ ~SolutionFunction() [5/7]

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

◆ SolutionFunction() [6/7]

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

◆ ~SolutionFunction() [6/7]

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

◆ SolutionFunction() [7/7]

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

◆ ~SolutionFunction() [7/7]

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

Member Function Documentation

◆ clear()

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

◆ clone() [1/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Number> > SolutionFunction< 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< Number >.

Definition at line 43 of file solution_function.h.

44  {
45  return std::make_unique<SolutionFunction>();
46  }

◆ clone() [2/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Number> > SolutionFunction< 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< Number >.

Definition at line 43 of file solution_function.h.

44  {
45  return std::make_unique<SolutionFunction>();
46  }

◆ clone() [3/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Number> > SolutionFunction< 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< Number >.

Definition at line 43 of file solution_function.h.

44  {
45  return std::make_unique<SolutionFunction>();
46  }

◆ clone() [4/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Number> > SolutionFunction< 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< Number >.

Definition at line 52 of file solution_function.h.

53  { return std::make_unique<SolutionFunction>(); }

◆ clone() [5/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Number> > SolutionFunction< 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< Number >.

Definition at line 65 of file solution_function.h.

66  { return std::make_unique<SolutionFunction>(_u_var); }
const unsigned int _u_var

◆ clone() [6/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Number> > SolutionFunction< 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< Number >.

Definition at line 65 of file solution_function.h.

66  { return std::make_unique<SolutionFunction>(_u_var); }
const unsigned int _u_var

◆ clone() [7/7]

template<unsigned int dim>
virtual std::unique_ptr<FunctionBase<Number> > SolutionFunction< 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< Number >.

Definition at line 66 of file solution_function.h.

67  { return std::make_unique<SolutionFunction>(_u_var); }
const unsigned int _u_var

◆ component() [1/7]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 48 of file solution_function.h.

References dim.

49  {
50  const auto size = dim == 2 ? 4 : 5;
51  DenseVector<Number> outvec(size);
52  (*this)(p, time, outvec);
53  return outvec(i);
54  }
unsigned int dim

◆ component() [2/7]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 48 of file solution_function.h.

References dim.

49  {
50  const auto size = dim == 2 ? 4 : 5;
51  DenseVector<Number> outvec(size);
52  (*this)(p, time, outvec);
53  return outvec(i);
54  }
unsigned int dim

◆ component() [3/7]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

◆ component() [4/7]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 48 of file solution_function.h.

References dim.

49  {
50  const auto size = 2 * (dim == 2 ? 3 : 4);
51  DenseVector<Number> outvec(size);
52  (*this)(p, time, outvec);
53  return outvec(i);
54  }
unsigned int dim

◆ component() [5/7]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 57 of file solution_function.h.

References libMesh::Real.

60  {
61  const Real x=p(0), y=p(1), z=p(2);
62  return soln(x, y, z)(component_in);
63  }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactSolution soln

◆ component() [6/7]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 57 of file solution_function.h.

References libMesh::Real.

60  {
61  const Real x=p(0), y=p(1);
62  return soln(x, y)(component_in);
63  }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactSolution soln

◆ component() [7/7]

template<unsigned int dim>
Number SolutionFunction< 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< Number >.

Definition at line 58 of file solution_function.h.

References libMesh::Real.

61  {
62  const Real x=p(0), y=p(1), z=p(2);
63  return soln(component_in, x, y, z);
64  }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LaplaceExactSolution soln

◆ init()

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

The actual initialization process.

Reimplemented in libMesh::MeshFunction, libMesh::MeshlessInterpolationFunction, libMesh::MeshlessInterpolationFunction, ExampleOneFunction, and ExampleOneFunction.

Definition at line 87 of file function_base.h.

87 {}

◆ initialized()

bool libMesh::FunctionBase< Number >::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.

Referenced by libMesh::MeshFunction::disable_out_of_mesh_mode(), libMesh::MeshFunction::discontinuous_gradient(), libMesh::MeshFunction::discontinuous_value(), libMesh::MeshFunction::enable_out_of_mesh_mode(), libMesh::MeshFunction::get_point_locator(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), and libMesh::MeshFunction::operator()().

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< Number >::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/24]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 39 of file solution_function.h.

39 { libmesh_not_implemented(); }

◆ operator()() [2/24]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 39 of file solution_function.h.

39 { libmesh_not_implemented(); }

◆ operator()() [3/24]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 39 of file solution_function.h.

39 { libmesh_not_implemented(); }

◆ operator()() [4/24]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 40 of file solution_function.h.

42  { libmesh_not_implemented(); }

◆ operator()() [5/24]

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

◆ operator()() [6/24]

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

◆ operator()() [7/24]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 41 of file solution_function.h.

43  { libmesh_not_implemented(); }

◆ operator()() [8/24]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 41 of file solution_function.h.

42  { libmesh_not_implemented(); }

◆ operator()() [9/24]

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

◆ operator()() [10/24]

template<unsigned int dim>
virtual Number SolutionFunction< 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< Number >.

Definition at line 41 of file solution_function.h.

43  { libmesh_not_implemented(); }

◆ operator()() [11/24]

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

Definition at line 44 of file solution_function.h.

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

47  {
48  output.zero();
49  const Real x=p(0), y=p(1), z=p(2);
50  // libMesh assumes each component of the vector-valued variable is stored
51  // contiguously.
52  output(_u_var) = soln(x, y, z)(0);
53  output(_u_var+1) = soln(x, y, z)(1);
54  output(_u_var+2) = soln(x, y, z)(2);
55  }
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
LaplaceExactSolution soln

◆ operator()() [12/24]

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

◆ operator()() [13/24]

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

Definition at line 45 of file solution_function.h.

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

48  {
49  output.zero();
50  const Real x=p(0), y=p(1), z=p(2);
51  // libMesh assumes each component of the vector-valued variable is stored
52  // contiguously.
53  output(_u_var) = soln(0, x, y, z);
54  output(_u_var+1) = soln(1, x, y, z);
55  output(_u_var+2) = soln(2, x, y, z);
56  }
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
LaplaceExactSolution soln

◆ operator()() [14/24]

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

Definition at line 45 of file solution_function.h.

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

48  {
49  output.zero();
50  const Real x=p(0), y=p(1);
51  // libMesh assumes each component of the vector-valued variable is stored
52  // contiguously.
53  output(_u_var) = soln(x, y)(0);
54  output(_u_var+1) = soln(x, y)(1);
55  }
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
LaplaceExactSolution soln

◆ operator()() [15/24]

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

Definition at line 61 of file solution_function.h.

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

64 {
65  output.zero();
66  const Real x=p(0), y=p(1);
67  output(0) = soln(x, y)(0);
68  output(1) = soln(x, y)(1);
69  output(2) = soln.scalar(x, y);
70 }
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
LaplaceExactSolution soln

◆ operator()() [16/24]

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

Definition at line 62 of file solution_function.h.

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

63 {
64  // We should have 2 x vector variable and 2 x scalar variable
65  output.zero();
66  const Real x = p(0), y = p(1);
67  // libMesh assumes each component of a vector-valued variable is stored
68  // contiguously.
69  const auto vector = soln(x, y);
70  output(0) = vector(0);
71  output(1) = vector(1);
72  output(2) = vector(0);
73  output(3) = vector(1);
74  const auto scalar = soln.scalar(x, y);
75  output(4) = scalar;
76  output(5) = scalar;
77 }
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
LaplaceExactSolution soln

◆ operator()() [17/24]

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

Definition at line 62 of file solution_function.h.

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

63 {
64  // We should have our vector variable, our scalar variable, and our higher order scalar variable
65  libmesh_assert(output.size() <= 4);
66  output.zero();
67  const Real x = p(0), y = p(1);
68  // libMesh assumes each component of a vector-valued variable is stored
69  // contiguously.
70  const auto vector = soln(x, y);
71  output(0) = vector(0);
72  output(1) = vector(1);
73  const auto scalar = soln.scalar(x, y);
74  output(2) = scalar;
75  output(3) = scalar;
76 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
libmesh_assert(ctx)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int size() const override final
Definition: dense_vector.h:104
LaplaceExactSolution soln

◆ operator()() [18/24]

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

Definition at line 62 of file solution_function.h.

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

63 {
64  // We should have our vector variable, our scalar variable, and our higher order scalar variable
65  libmesh_assert(output.size() <= 4);
66  output.zero();
67  const Real x = p(0), y = p(1);
68  // libMesh assumes each component of a vector-valued variable is stored
69  // contiguously.
70  const auto vector = soln(x, y);
71  output(0) = vector(0);
72  output(1) = vector(1);
73  const auto scalar = soln.scalar(x, y);
74  output(2) = scalar;
75  output(3) = scalar;
76 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
libmesh_assert(ctx)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int size() const override final
Definition: dense_vector.h:104
LaplaceExactSolution soln

◆ operator()() [19/24]

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

Definition at line 73 of file solution_function.h.

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

76 {
77  output.zero();
78  const Real x=p(0), y=p(1), z=p(2);
79  output(0) = soln(x, y, z)(0);
80  output(1) = soln(x, y, z)(1);
81  output(2) = soln(x, y, z)(2);
82  output(3) = soln.scalar(x, y, z);
83 }
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
LaplaceExactSolution soln

◆ operator()() [20/24]

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

Definition at line 80 of file solution_function.h.

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

81 {
82  // We should have our vector variable, our scalar variable, and our higher order scalar variable
83  libmesh_assert(output.size() <= 5);
84  output.zero();
85  const Real x = p(0), y = p(1), z = p(2);
86  // libMesh assumes each component of the vector-valued variable is stored
87  // contiguously.
88  const auto vector = soln(x, y, z);
89  output(0) = vector(0);
90  output(1) = vector(1);
91  output(2) = vector(2);
92  const auto scalar = soln.scalar(x, y, z);
93  output(3) = scalar;
94  output(4) = scalar;
95 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
libmesh_assert(ctx)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int size() const override final
Definition: dense_vector.h:104
LaplaceExactSolution soln

◆ operator()() [21/24]

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

Definition at line 80 of file solution_function.h.

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

81 {
82  // We should have our vector variable, our scalar variable, and our higher order scalar variable
83  libmesh_assert(output.size() <= 5);
84  output.zero();
85  const Real x = p(0), y = p(1), z = p(2);
86  // libMesh assumes each component of the vector-valued variable is stored
87  // contiguously.
88  const auto vector = soln(x, y, z);
89  output(0) = vector(0);
90  output(1) = vector(1);
91  output(2) = vector(2);
92  const auto scalar = soln.scalar(x, y, z);
93  output(3) = scalar;
94  output(4) = scalar;
95 }
virtual void zero() override final
Set every element in the vector to 0.
Definition: dense_vector.h:398
libmesh_assert(ctx)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int size() const override final
Definition: dense_vector.h:104
LaplaceExactSolution soln

◆ operator()() [22/24]

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

Definition at line 81 of file solution_function.h.

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

82 {
83  // We should have 2 x vector variable and 2 x scalar variable
84  output.zero();
85  const Real x = p(0), y = p(1), z = p(2);
86  // libMesh assumes each component of the vector-valued variable is stored
87  // contiguously.
88  const auto vector = soln(x, y, z);
89  output(0) = vector(0);
90  output(1) = vector(1);
91  output(2) = vector(2);
92  output(3) = vector(0);
93  output(4) = vector(1);
94  output(5) = vector(2);
95  const auto scalar = soln.scalar(x, y, z);
96  output(6) = scalar;
97  output(7) = scalar;
98 }
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
LaplaceExactSolution soln

◆ operator()() [23/24]

void libMesh::FunctionBase< Number >::operator() ( const Point p,
DenseVector< Number > &  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 Number operator()(const Point &p, const Real time=0.)=0

◆ operator()() [24/24]

virtual void libMesh::FunctionBase< Number >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  output 
)
pure virtualinherited

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.

Implemented in libMesh::MeshFunction, libMesh::MeshlessInterpolationFunction, and libMesh::MeshlessInterpolationFunction.

◆ set_is_time_dependent()

void libMesh::FunctionBase< Number >::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< Number >::_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.

Referenced by libMesh::MeshFunction::clear(), and libMesh::MeshFunction::init().

◆ _is_time_dependent

bool libMesh::FunctionBase< Number >::_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< Number >::_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.

Referenced by libMesh::MeshFunction::clear(), libMesh::MeshFunction::find_element(), and libMesh::MeshFunction::find_elements().

◆ _u_var

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

Definition at line 71 of file solution_function.h.

◆ soln [1/4]

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

Definition at line 57 of file solution_function.h.

◆ soln [2/4]

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

Definition at line 57 of file solution_function.h.

◆ soln [3/4]

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

Definition at line 71 of file solution_function.h.

◆ soln [4/4]

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

Definition at line 72 of file solution_function.h.


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