libMesh
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Attributes | List of all members
SolutionFunction< dim > Class Template Reference

#include <solution_function.h>

Inheritance diagram for SolutionFunction< dim >:
[legend]

Public Member Functions

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

Protected Attributes

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

Private Attributes

GradDivExactSolution soln
 
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 ( )
default

◆ ~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.

36 :
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) {}

◆ ~SolutionFunction() [3/7]

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

◆ SolutionFunction() [4/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) {}

◆ ~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

Clears the function.

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

Definition at line 92 of file function_base.h.

92{}

◆ clone() [1/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 62 of file solution_function.h.

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

◆ clone() [2/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); }

References SolutionFunction< dim >::_u_var.

◆ clone() [3/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 64 of file solution_function.h.

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

References SolutionFunction< dim >::_u_var.

◆ 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 65 of file solution_function.h.

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

References SolutionFunction< dim >::_u_var.

◆ 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 52 of file solution_function.h.

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

◆ clone() [6/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() [7/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 }

◆ component() [1/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 53 of file solution_function.h.

56 {
57 DenseVector<Number> outvec(3);
58 (*this)(p, 0, outvec);
59 return outvec(component_in);
60 }
Defines a dense vector for use in Finite Element-type computations.

◆ component() [2/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 58 of file solution_function.h.

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

References libMesh::Real, and SolutionFunction< dim >::soln.

◆ component() [3/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.

60 {
61 return soln(p)(component_in);
62 }

References SolutionFunction< dim >::soln.

◆ component() [4/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.

60 {
61 const Real x=p(0), y=p(1), z=p(2);
62 return soln(x, y, z)(component_in);
63 }

References libMesh::Real, and SolutionFunction< dim >::soln.

◆ component() [5/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() [6/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.

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

References dim.

◆ component() [7/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.

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

References dim.

◆ init()

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

The actual initialization process.

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

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 154 of file function_base.h.

211{
212 return (this->_initialized);
213}

◆ 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 168 of file function_base.h.

225{
226 return (this->_is_time_dependent);
227}

◆ operator()() [1/21]

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 39 of file solution_function.h.

41 { libmesh_not_implemented(); }

◆ operator()() [2/21]

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()() [3/21]

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()() [4/21]

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()() [5/21]

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()() [6/21]

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()() [7/21]

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()() [8/21]

template<unsigned int dim>
virtual void SolutionFunction< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 43 of file solution_function.h.

46 {
47 output.zero();
48 output(0) = soln(p)(0);
49 output(1) = soln(p)(1);
50 output(2) = soln(p)(2);
51 }
virtual void zero() override final
Set every element in the vector to 0.

References SolutionFunction< dim >::soln, and libMesh::DenseVector< T >::zero().

◆ operator()() [9/21]

template<unsigned int dim>
virtual void SolutionFunction< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 45 of file solution_function.h.

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 }

References SolutionFunction< dim >::_u_var, libMesh::Real, SolutionFunction< dim >::soln, and libMesh::DenseVector< T >::zero().

◆ operator()() [10/21]

template<unsigned int dim>
virtual void SolutionFunction< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 45 of file solution_function.h.

48 {
49 output.zero();
50 // libMesh assumes each component of the vector-valued variable is stored
51 // contiguously.
52 output(_u_var) = soln(p)(0);
53 output(_u_var+1) = soln(p)(1);
54 output(_u_var+2) = soln(p)(2);
55 }

References SolutionFunction< dim >::_u_var, SolutionFunction< dim >::soln, and libMesh::DenseVector< T >::zero().

◆ operator()() [11/21]

template<unsigned int dim>
virtual void SolutionFunction< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 44 of file solution_function.h.

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 }

References SolutionFunction< dim >::_u_var, libMesh::Real, SolutionFunction< dim >::soln, and libMesh::DenseVector< T >::zero().

◆ operator()() [12/21]

template<unsigned int dim>
virtual void SolutionFunction< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

◆ operator()() [13/21]

void SolutionFunction< 2 >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 61 of file solution_function.h.

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}

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

◆ operator()() [14/21]

void SolutionFunction< 3 >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 73 of file solution_function.h.

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}

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

◆ operator()() [15/21]

void SolutionFunction< 2 >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 62 of file solution_function.h.

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 unsigned int size() const override final
libmesh_assert(ctx)

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

◆ operator()() [16/21]

void SolutionFunction< 3 >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 80 of file solution_function.h.

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}

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

◆ operator()() [17/21]

void SolutionFunction< 2 >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 62 of file solution_function.h.

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}

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

◆ operator()() [18/21]

void SolutionFunction< 3 >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

Definition at line 80 of file solution_function.h.

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}

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

◆ operator()() [19/21]

template<unsigned int dim>
virtual void SolutionFunction< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

◆ operator()() [20/21]

template<unsigned int dim>
virtual void SolutionFunction< dim >::operator() ( const Point p,
const Real  time,
DenseVector< Number > &  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< Number >.

◆ operator()() [21/21]

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 116 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

◆ 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 162 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.

◆ _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.

◆ _u_var

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

◆ soln [1/5]

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

◆ soln [2/5]

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

Definition at line 72 of file solution_function.h.

◆ soln [3/5]

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

Definition at line 70 of file solution_function.h.

◆ soln [4/5]

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

Definition at line 57 of file solution_function.h.

◆ soln [5/5]

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

Definition at line 57 of file solution_function.h.


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