libMesh
Public Member Functions | Private Attributes | List of all members
CoupledFEMFunctionsy Class Referenceabstract

#include <coupled_system.h>

Inheritance diagram for CoupledFEMFunctionsy:
[legend]

Public Member Functions

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

Private Attributes

unsigned int var
 

Detailed Description

Definition at line 139 of file coupled_system.h.

Constructor & Destructor Documentation

◆ CoupledFEMFunctionsy()

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

Definition at line 143 of file coupled_system.h.

145  { var = var_number; }

◆ ~CoupledFEMFunctionsy()

virtual CoupledFEMFunctionsy::~CoupledFEMFunctionsy ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr<FEMFunctionBase<Number> > CoupledFEMFunctionsy::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 150 of file coupled_system.h.

151  {
152  return std::make_unique<CoupledFEMFunctionsy>(*this);
153  }

◆ 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 132 of file fem_function_base.h.

136 {
137  DenseVector<Output> outvec(i+1);
138  (*this)(context, p, time, outvec);
139  return outvec(i);
140 }

◆ 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 72 of file fem_function_base.h.

72 {}

◆ operator()() [1/4]

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 144 of file fem_function_base.h.

147 {
148  // Call the time-dependent function with t=0.
149  this->operator()(context, p, 0., output);
150 }
virtual Number operator()(const FEMContext &, const Point &p, const Real time=0.)=0

◆ operator()() [2/4]

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

◆ operator()() [3/4]

virtual void CoupledFEMFunctionsy::operator() ( const FEMContext ,
const Point ,
const Real  ,
DenseVector< Number > &   
)
inlinevirtual

Definition at line 155 of file coupled_system.h.

159  { libmesh_not_implemented(); }

◆ operator()() [4/4]

Number CoupledFEMFunctionsy::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 477 of file coupled_system.C.

References libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_value(), and libMesh::MeshTools::weight().

480 {
481  Number weight = 0.0;
482 
483  switch(var)
484  {
485  case 1:
486  {
487  Gradient grad_C = c.point_gradient(3, p);
488 
489  weight = grad_C(1);
490  }
491  break;
492 
493  case 3:
494  {
495  Number v = c.point_value(1, p);
496 
497  weight = v;
498  }
499  break;
500 
501  default:
502  libmesh_error_msg("Wrong variable number " \
503  << var \
504  << " passed to CoupledFEMFunctionsy object! Quitting!");
505  }
506 
507  return weight;
508 }
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:436

Member Data Documentation

◆ var

unsigned int CoupledFEMFunctionsy::var
private

Definition at line 166 of file coupled_system.h.


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