libMesh
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CoupledFEMFunctionsx Class Reference

#include <coupled_system.h>

Inheritance diagram for CoupledFEMFunctionsx:
[legend]

Public Member Functions

 CoupledFEMFunctionsx (System &, unsigned int var_number)
 
virtual ~CoupledFEMFunctionsx ()=default
 
virtual std::unique_ptr< FEMFunctionBase< Number > > clone () const
 
virtual void operator() (const FEMContext &, const Point &, const Real, DenseVector< Number > &)
 Evaluation function for time-dependent vector-valued functions.
 
virtual Number operator() (const FEMContext &, const Point &p, const Real time=0.)
 
virtual void init ()
 Any post-construction initialization.
 
virtual void init_context (const FEMContext &)
 Prepares a context object for use.
 
void operator() (const FEMContext &, const Point &p, DenseVector< Number > &output)
 Evaluation function for time-independent vector-valued functions.
 
virtual Number component (const FEMContext &, unsigned int i, const Point &p, Real time=0.)
 

Private Attributes

unsigned int var
 

Detailed Description

Definition at line 108 of file coupled_system.h.

Constructor & Destructor Documentation

◆ CoupledFEMFunctionsx()

CoupledFEMFunctionsx::CoupledFEMFunctionsx ( System ,
unsigned int  var_number 
)
inline

Definition at line 112 of file coupled_system.h.

114 {var = var_number;}

References var.

◆ ~CoupledFEMFunctionsx()

virtual CoupledFEMFunctionsx::~CoupledFEMFunctionsx ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< FEMFunctionBase< Number > > CoupledFEMFunctionsx::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::FEMFunctionBase< Number >.

Definition at line 119 of file coupled_system.h.

120 {
121 return std::make_unique<CoupledFEMFunctionsx>(*this);
122 }

◆ component()

Number libMesh::FEMFunctionBase< Number >::component ( const FEMContext context,
unsigned int  i,
const Point p,
Real  time = 0. 
)
inlinevirtualinherited
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.

Definition at line 129 of file fem_function_base.h.

141{
142 DenseVector<Output> outvec(i+1);
143 (*this)(context, p, time, outvec);
144 return outvec(i);
145}

◆ init()

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

Any post-construction initialization.

Definition at line 69 of file fem_function_base.h.

69{}

◆ init_context()

virtual void libMesh::FEMFunctionBase< Number >::init_context ( const FEMContext )
inlinevirtualinherited

Prepares a context object for use.

Most problems will want to reimplement this for efficiency, in order to call FE::get_*() as their particular function requires.

Reimplemented in SlitFunc.

Definition at line 77 of file fem_function_base.h.

77{}

◆ operator()() [1/3]

virtual void CoupledFEMFunctionsx::operator() ( const FEMContext ,
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::FEMFunctionBase< Number >.

Definition at line 124 of file coupled_system.h.

128 { libmesh_not_implemented(); }

◆ operator()() [2/3]

Number CoupledFEMFunctionsx::operator() ( const FEMContext ,
const Point p,
const Real  time = 0. 
)
virtual
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::FEMFunctionBase< Number >.

Definition at line 444 of file coupled_system.C.

447{
448 Number weight = 0.0;
449
450 switch(var)
451 {
452 case 0:
453 {
454 Gradient grad_C = c.point_gradient(3, p);
455
456 weight = grad_C(0);
457 }
458 break;
459
460 case 3:
461 {
462 Number u = c.point_value(0, p);
463
464 weight = u;
465 }
466 break;
467
468 default:
469 libmesh_error_msg("Wrong variable number " \
470 << var \
471 << " passed to CoupledFEMFunctionsx object! Quitting!");
472 }
473
474 return weight;
475}
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
dof_id_type weight(const MeshBase &mesh, const processor_id_type pid)
Definition mesh_tools.C:444

References libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_value(), and var.

◆ operator()() [3/3]

void libMesh::FEMFunctionBase< Number >::operator() ( const FEMContext context,
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 102 of file fem_function_base.h.

152{
153 // Call the time-dependent function with t=0.
154 this->operator()(context, p, 0., output);
155}
virtual Number operator()(const FEMContext &, const Point &p, const Real time=0.)=0

Member Data Documentation

◆ var

unsigned int CoupledFEMFunctionsx::var
private

Definition at line 135 of file coupled_system.h.

Referenced by CoupledFEMFunctionsx(), and operator()().


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