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 ()
 
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 138 of file coupled_system.h.

Constructor & Destructor Documentation

◆ CoupledFEMFunctionsy()

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

Definition at line 142 of file coupled_system.h.

144  { var = var_number; }

◆ ~CoupledFEMFunctionsy()

virtual CoupledFEMFunctionsy::~CoupledFEMFunctionsy ( )
inlinevirtual

Definition at line 147 of file coupled_system.h.

147 {}

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 149 of file coupled_system.h.

150  {
151  return libmesh_make_unique<CoupledFEMFunctionsy>(*this);
152  }

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

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

Definition at line 154 of file coupled_system.h.

158  { libmesh_not_implemented(); }

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

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 448 of file coupled_system.C.

451 {
452  Number weight = 0.0;
453 
454  switch(var)
455  {
456  case 1:
457  {
458  Gradient grad_C = c.point_gradient(3, p);
459 
460  weight = grad_C(1);
461  }
462  break;
463 
464  case 3:
465  {
466  Number v = c.point_value(1, p);
467 
468  weight = v;
469  }
470  break;
471 
472  default:
473  libmesh_error_msg("Wrong variable number " \
474  << var \
475  << " passed to CoupledFEMFunctionsy object! Quitting!");
476  }
477 
478  return weight;
479 }

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

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

Member Data Documentation

◆ var

unsigned int CoupledFEMFunctionsy::var
private

Definition at line 165 of file coupled_system.h.


The documentation for this class was generated from the following files:
libMesh::Number
Real Number
Definition: libmesh_common.h:195
libMesh::FEMFunctionBase< Number >::operator()
virtual Number operator()(const FEMContext &, const Point &p, const Real time=0.)=0
libMesh::VectorValue< Number >
CoupledFEMFunctionsy::var
unsigned int var
Definition: coupled_system.h:165
libMesh::MeshTools::weight
dof_id_type weight(const MeshBase &mesh, const processor_id_type pid)
Definition: mesh_tools.C:236