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

#include <field_python.hh>

Inheritance diagram for FieldPython< spacedim, Value >:
Inheritance graph
[legend]
Collaboration diagram for FieldPython< 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

 FieldPython (unsigned int n_comp=0)
 
virtual void init_from_input (const Input::Record &rec)
 
void set_python_field_from_file (const FilePath &file_name, const string &func_name)
 
void set_python_field_from_string (const string &python_source, const string &func_name)
 
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 ~FieldPython ()
 
- Public Member Functions inherited from FieldAlgorithmBase< spacedim, Value >
 FieldAlgorithmBase (unsigned int n_comp=0)
 
virtual bool set_time (const TimeStep &time)
 
virtual void set_mesh (const Mesh *mesh, bool boundary_domain)
 
void set_component_idx (unsigned int idx)
 
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 Member Functions

void set_func (const string &func_name)
 
void set_value (const Point &p, const ElementAccessor< spacedim > &elm, Value &value)
 

Additional Inherited Members

- Protected Attributes inherited from FieldAlgorithmBase< spacedim, Value >
TimeStep 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...
 
unsigned int component_idx_
 Specify if the field is part of a MultiField and which component it is. More...
 

Detailed Description

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

This class assumes field python field with spacedim arguments containing coordinates of the given point. The field should return a tuple representing a vector value (possibly of size one for scalar fields)

TODO:

Definition at line 36 of file field_python.hh.

Member Typedef Documentation

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

Definition at line 39 of file field_python.hh.

Constructor & Destructor Documentation

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

Definition at line 46 of file field_python.impl.hh.

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

Definition at line 211 of file field_python.impl.hh.

Member Function Documentation

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

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

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldPython< 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 75 of file field_python.impl.hh.

template<int spacedim, class Value >
void FieldPython< spacedim, Value >::set_func ( const string &  func_name)
private

Common part of set_python_field_from_* methods

Definition at line 101 of file field_python.impl.hh.

template<int spacedim, class Value >
void FieldPython< spacedim, Value >::set_python_field_from_file ( const FilePath file_name,
const string &  func_name 
)

Set the file and field to be called. TODO: use FilePath

Definition at line 89 of file field_python.impl.hh.

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldPython< spacedim, Value >::set_python_field_from_string ( const string &  python_source,
const string &  func_name 
)

Set the source in a string and name of the field to be called.

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

template<int spacedim, class Value >
void FieldPython< spacedim, Value >::set_value ( const Point p,
const ElementAccessor< spacedim > &  elm,
Value &  value 
)
inlineprivate

Implementation.

Returns one vector value in one given point.

Definition at line 184 of file field_python.impl.hh.

template<int spacedim, class Value >
Value::return_type const & FieldPython< 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 156 of file field_python.impl.hh.

Here is the caller graph for this function:

template<int spacedim, class Value >
void FieldPython< 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 167 of file field_python.impl.hh.

Member Data Documentation

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

Implementation.

Definition at line 43 of file field_python.hh.


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