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

#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 > &)
 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 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; }

References var.

◆ ~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 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 CoupledFEMFunctionsy::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 155 of file coupled_system.h.

159 { libmesh_not_implemented(); }

◆ operator()() [2/3]

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.

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: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 CoupledFEMFunctionsy::var
private

Definition at line 166 of file coupled_system.h.

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


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