Flow123d  jenkins-Flow123d-windows32-release-multijob-51
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
FieldFormula< spacedim, Value > Class Template Reference

#include <field_formula.hh>

Inheritance diagram for FieldFormula< spacedim, Value >:
Inheritance graph
[legend]
Collaboration diagram for FieldFormula< spacedim, Value >:
Collaboration graph
[legend]

Public Types

typedef FieldAlgorithmBase
< spacedim, Value >::Point 
Point
 
- Public Types inherited from FieldAlgorithmBase< spacedim, Value >
typedef Space< spacedim >::Point Point
 
typedef Value ValueType
 

Public Member Functions

 FieldFormula (unsigned int n_comp=0)
 
virtual void init_from_input (const Input::Record &rec)
 
virtual bool set_time (double time)
 
virtual Value::return_type const & value (const Point &p, const ElementAccessor< spacedim > &elm)
 
virtual void value_list (const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
 
virtual ~FieldFormula ()
 
- Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
 FieldAlgorithmBase (unsigned int n_comp=0)
 
virtual void set_mesh (const Mesh *mesh, bool boundary_domain)
 
unsigned int n_comp () const
 
FieldResult field_result () const
 
virtual double next_change_time ()
 
virtual ~FieldAlgorithmBase ()
 

Static Public Member Functions

static Input::Type::Record get_input_type (Input::Type::AbstractRecord &a_type, const typename Value::ElementInputType *eit)
 
- Static Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
static std::string template_name ()
 
static Input::Type::AbstractRecord get_input_type (const typename Value::ElementInputType *element_input_type=nullptr)
 
static std::shared_ptr
< FieldAlgorithmBase< spacedim,
Value > > 
function_factory (const Input::AbstractRecord &rec, unsigned int n_comp=0)
 

Static Public Attributes

static Input::Type::Record input_type = get_input_type(FieldAlgorithmBase<spacedim,Value>::input_type, NULL)
 Implementation. More...
 
- Static Public Attributes inherited from FieldAlgorithmBase< spacedim, Value >
static const unsigned int spacedim_ =spacedim
 
static Input::Type::AbstractRecord input_type
 

Private Types

typedef FieldValue_
< Value::NRows_, Value::NCols_,
std::string > 
StringValue
 

Private Attributes

StringValue::return_type formula_matrix_
 
StringValue formula_matrix_helper_
 
std::vector< std::vector
< FunctionParser > > 
parser_matrix_
 
std::string value_input_address_
 

Additional Inherited Members

- Protected Attributes inherited from FieldAlgorithmBase< spacedim, Value >
double time_
 Actual time level; initial value is -infinity. More...
 
Value value_
 Last value, prevents passing large values (vectors) by value. More...
 
Value::return_type r_value_
 
FieldResult field_result_
 Indicator of particular values (zero, one) constant over space. More...
 

Detailed Description

template<int spacedim, class Value>
class FieldFormula< spacedim, Value >

Class representing fields given by runtime parsed formulas.

Using library: http://warp.povusers.org/FunctionParser/

TODO: correct support for discrete functions (use integer parser), actually we just convert double to int

Definition at line 32 of file field_formula.hh.

Member Typedef Documentation

template<int spacedim, class Value >
typedef FieldAlgorithmBase<spacedim, Value>::Point FieldFormula< spacedim, Value >::Point

Definition at line 35 of file field_formula.hh.

template<int spacedim, class Value >
typedef FieldValue_<Value::NRows_, Value::NCols_, std::string> FieldFormula< spacedim, Value >::StringValue
private

Definition at line 67 of file field_formula.hh.

Constructor & Destructor Documentation

template<int spacedim, class Value >
FieldFormula< spacedim, Value >::FieldFormula ( unsigned int  n_comp = 0)

Definition at line 49 of file field_formula.impl.hh.

template<int spacedim, class Value >
FieldFormula< spacedim, Value >::~FieldFormula ( )
virtual

Definition at line 168 of file field_formula.impl.hh.

Member Function Documentation

template<int spacedim, class Value >
Input::Type::Record FieldFormula< spacedim, Value >::get_input_type ( Input::Type::AbstractRecord a_type,
const typename Value::ElementInputType *  eit 
)
static

Definition at line 25 of file field_formula.impl.hh.

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldFormula< spacedim, Value >::init_from_input ( const Input::Record rec)
virtual

Function can provide way to initialize itself from the input data.

TODO: make protected, should be called through function factory

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 62 of file field_formula.impl.hh.

template<int spacedim, class Value >
bool FieldFormula< spacedim, Value >::set_time ( double  time)
virtual

For time dependent formulas returns always true. For time independent formulas returns true only for the first time.

Reimplemented from FieldAlgorithmBase< spacedim, Value >.

Definition at line 70 of file field_formula.impl.hh.

template<int spacedim, class Value >
Value::return_type const & FieldFormula< spacedim, Value >::value ( const Point p,
const ElementAccessor< spacedim > &  elm 
)
virtual

Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.

Implements FieldAlgorithmBase< spacedim, Value >.

Definition at line 135 of file field_formula.impl.hh.

template<int spacedim, class Value >
void FieldFormula< spacedim, Value >::value_list ( const std::vector< Point > &  point_list,
const ElementAccessor< spacedim > &  elm,
std::vector< typename Value::return_type > &  value_list 
)
virtual

Returns std::vector of scalar values in several points at once.

Implements FieldAlgorithmBase< spacedim, Value >.

Definition at line 149 of file field_formula.impl.hh.

Member Data Documentation

template<int spacedim, class Value >
StringValue::return_type FieldFormula< spacedim, Value >::formula_matrix_
private

Definition at line 70 of file field_formula.hh.

template<int spacedim, class Value >
StringValue FieldFormula< spacedim, Value >::formula_matrix_helper_
private

Definition at line 73 of file field_formula.hh.

template<int spacedim, class Value >
it::Record FieldFormula< spacedim, Value >::input_type = get_input_type(FieldAlgorithmBase<spacedim,Value>::input_type, NULL)
static

Implementation.

Definition at line 40 of file field_formula.hh.

template<int spacedim, class Value >
std::vector< std::vector<FunctionParser> > FieldFormula< spacedim, Value >::parser_matrix_
private

Definition at line 76 of file field_formula.hh.

template<int spacedim, class Value >
std::string FieldFormula< spacedim, Value >::value_input_address_
private

Definition at line 80 of file field_formula.hh.


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