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 UniquePtr< 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 ( System ,
unsigned int  var_number 
)

Definition at line 143 of file coupled_system.h.

145  { var = var_number; }
virtual CoupledFEMFunctionsy::~CoupledFEMFunctionsy ( )
virtual

Definition at line 148 of file coupled_system.h.

148 {}

Member Function Documentation

virtual UniquePtr<FEMFunctionBase<Number> > CoupledFEMFunctionsy::clone ( ) const
virtual
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  {
153  }
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
CoupledFEMFunctionsy(System &, unsigned int var_number)
virtual Number libMesh::FEMFunctionBase< Number >::component ( const FEMContext ,
unsigned int  i,
const Point p,
Real  time = 0. 
)
virtualinherited
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.
virtual void libMesh::FEMFunctionBase< Number >::init_context ( const FEMContext )
virtualinherited

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

References libMesh::FEMFunctionBase< Output >::clone(), libMesh::FEMFunctionBase< Output >::component(), libMesh::FEMFunctionBase< Output >::operator()(), and libMesh::Real.

71 {}
void libMesh::FEMFunctionBase< Number >::operator() ( const FEMContext ,
const Point p,
DenseVector< Number > &  output 
)
inherited

Evaluation function for time-independent vector-valued functions.

Sets output values in the passed-in output DenseVector.

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.

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

Definition at line 155 of file coupled_system.h.

References libMesh::Real.

159  { libmesh_not_implemented(); }
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 445 of file coupled_system.C.

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

448 {
449  Number weight = 0.0;
450 
451  switch(var)
452  {
453  case 1:
454  {
455  Gradient grad_C = c.point_gradient(3, p);
456 
457  weight = grad_C(1);
458  }
459  break;
460 
461  case 3:
462  {
463  Number v = c.point_value(1, p);
464 
465  weight = v;
466  }
467  break;
468 
469  default:
470  libmesh_error_msg("Wrong variable number " \
471  << var \
472  << " passed to CoupledFEMFunctionsy object! Quitting!");
473  }
474 
475  return weight;
476 }
dof_id_type weight(const MeshBase &mesh, const processor_id_type pid)
Definition: mesh_tools.C:245

Member Data Documentation

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: