Flow123d
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
FieldInterpolatedP0< spacedim, Value > Class Template Reference

#include <field_interpolated_p0.hh>

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

Public Types

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

Public Member Functions

 FieldInterpolatedP0 (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)
 
- Public Member Functions inherited from FieldBase< spacedim, Value >
 FieldBase (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 ~FieldBase ()
 

Static Public Member Functions

static Input::Type::Record get_input_type (Input::Type::AbstractRecord &a_type, const typename Value::ElementInputType *eit)
 
static void create_tetrahedron (Element *ele, TTetrahedron &te)
 
static void create_triangle (const Element *ele, TTriangle &tr)
 
static void create_abscissa (const Element *ele, TAbscissa &ab)
 
static void create_point (const Element *ele, TPoint &p)
 
- Static Public Member Functions inherited from FieldBase< 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
< FieldBase< spacedim, Value > > 
function_factory (const Input::AbstractRecord &rec, unsigned int n_comp=0)
 

Static Public Attributes

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

Protected Attributes

Meshsource_mesh_
 mesh, which is interpolated More...
 
GmshMeshReaderreader_
 mesh reader More...
 
double * data_
 Raw buffer of n_entities rows each containing Value::size() doubles. More...
 
std::vector< unsigned int > searched_elements_
 vector stored suspect elements in calculating the intersection More...
 
std::string field_name_
 field name read from input More...
 
BIHTreebih_tree_
 tree of mesh elements More...
 
unsigned int computed_elm_idx_ = numeric_limits<unsigned int>::max()
 stored index to last computed element More...
 
TTetrahedron tetrahedron_
 3D (tetrahedron) element, used for computing intersection More...
 
TTriangle triangle_
 2D (triangle) element, used for computing intersection More...
 
TAbscissa abscissa_
 1D (abscissa) element, used for computing intersection More...
 
TPoint point_
 0D (point) element, used for computing intersection More...
 
- Protected Attributes inherited from FieldBase< 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 FieldInterpolatedP0< spacedim, Value >

Copyright (C) 2007 Technical University of Liberec. All rights reserved.

Please make a following refer to Flow123d on your project site if you use the program for any purpose, especially for academic research: Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.

Id:
function_interpolated_p0.hh 1567 2012-02-28 13:24:58Z jan.brezina
Revision:
1567
LastChangedBy:
jan.brezina
LastChangedDate:
2012-02-28 14:24:58 +0100 (Tue, 28 Feb 2012)

Definition at line 45 of file field_interpolated_p0.hh.

Member Typedef Documentation

template<int spacedim, class Value >
typedef FieldBase<spacedim, Value>::Point FieldInterpolatedP0< spacedim, Value >::Point

Definition at line 48 of file field_interpolated_p0.hh.

Constructor & Destructor Documentation

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

Constructor

Definition at line 81 of file field_interpolated_p0_impl.hh.

Member Function Documentation

template<int spacedim, class Value >
void FieldInterpolatedP0< spacedim, Value >::create_abscissa ( const Element ele,
TAbscissa ab 
)
static

Create abscissa from element

Definition at line 153 of file field_interpolated_p0_impl.hh.

template<int spacedim, class Value >
void FieldInterpolatedP0< spacedim, Value >::create_point ( const Element ele,
TPoint p 
)
static

Create point from element

Definition at line 163 of file field_interpolated_p0_impl.hh.

template<int spacedim, class Value >
void FieldInterpolatedP0< spacedim, Value >::create_tetrahedron ( Element ele,
TTetrahedron te 
)
static

Read scalar element data with name field_name using tokenizer tok initialized over a GMSH file or stream.

This needs lot of work to be general enough to be outside of this class TODO:

  • we need concept of Fields so that we can fill corresponding vectors
  • then we should support scalar as well as vector or even tensor data
  • support for time dependent data
  • selective reading on submesh (parallelism - subdomains, or boundary data) Calculate values in triangle element Calculate values in abscissa element Calculate values in point element Create tetrahedron from element

TODO: nahradit pressure_ -> value_

for(unsigned int i=0; i < value_.n_rows(); i ++) for( ... n_cols() ) value_.at(i,j) = 0.0;

Value tmp_value; Value::from_raw(tmp_value, (typename Value::element_type *)(data_+idx)); for(unsigned int i=0; i < value_.n_rows(); i ++) for( ... n_cols() ) value_.at(i,j) += measure * tmp_value.at(i,j);

?? spojit caluculate_abscissa a calculate_triangle

Definition at line 130 of file field_interpolated_p0_impl.hh.

template<int spacedim, class Value >
void FieldInterpolatedP0< spacedim, Value >::create_triangle ( const Element ele,
TTriangle tr 
)
static

Create triangle from element

Definition at line 142 of file field_interpolated_p0_impl.hh.

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

Definition at line 63 of file field_interpolated_p0_impl.hh.

Here is the caller graph for this function:

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

Initialization from the input interface.

Reimplemented from FieldBase< spacedim, Value >.

Definition at line 89 of file field_interpolated_p0_impl.hh.

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

Update time and possibly update data from GMSH file.

Reimplemented from FieldBase< spacedim, Value >.

Definition at line 172 of file field_interpolated_p0_impl.hh.

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

Set sources files of interpolation

Parameters
mesh_filefile contained data of mesh
raw_outputfile contained output

TODO: use streams instead of filenames (better testing) TODO: use just one GMSH file for both mesh and data (consistency) Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.

Implements FieldBase< spacedim, Value >.

Definition at line 199 of file field_interpolated_p0_impl.hh.

template<int spacedim, class Value >
void FieldInterpolatedP0< 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 FieldBase< spacedim, Value >.

Definition at line 319 of file field_interpolated_p0_impl.hh.

Member Data Documentation

template<int spacedim, class Value >
TAbscissa FieldInterpolatedP0< spacedim, Value >::abscissa_
protected

1D (abscissa) element, used for computing intersection

Definition at line 128 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
BIHTree* FieldInterpolatedP0< spacedim, Value >::bih_tree_
protected

tree of mesh elements

Definition at line 116 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
unsigned int FieldInterpolatedP0< spacedim, Value >::computed_elm_idx_ = numeric_limits<unsigned int>::max()
protected

stored index to last computed element

Definition at line 119 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
double* FieldInterpolatedP0< spacedim, Value >::data_
protected

Raw buffer of n_entities rows each containing Value::size() doubles.

Definition at line 107 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
std::string FieldInterpolatedP0< spacedim, Value >::field_name_
protected

field name read from input

Definition at line 113 of file field_interpolated_p0.hh.

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

Declare Input type.

Copyright (C) 2007 Technical University of Liberec. All rights reserved.

Please make a following refer to Flow123d on your project site if you use the program for any purpose, especially for academic research: Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.

Id:
function_interpolated_p0.cc 1567 2012-02-28 13:24:58Z jan.brezina
Revision:
1567
LastChangedBy:
jan.brezina
LastChangedDate:
2012-02-28 14:24:58 +0100 (Tue, 28 Feb 2012)

Definition at line 59 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
TPoint FieldInterpolatedP0< spacedim, Value >::point_
protected

0D (point) element, used for computing intersection

Definition at line 131 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
GmshMeshReader* FieldInterpolatedP0< spacedim, Value >::reader_
protected

mesh reader

Definition at line 104 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
std::vector<unsigned int> FieldInterpolatedP0< spacedim, Value >::searched_elements_
protected

vector stored suspect elements in calculating the intersection

Definition at line 110 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
Mesh* FieldInterpolatedP0< spacedim, Value >::source_mesh_
protected

mesh, which is interpolated

Definition at line 101 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
TTetrahedron FieldInterpolatedP0< spacedim, Value >::tetrahedron_
protected

3D (tetrahedron) element, used for computing intersection

Definition at line 122 of file field_interpolated_p0.hh.

template<int spacedim, class Value >
TTriangle FieldInterpolatedP0< spacedim, Value >::triangle_
protected

2D (triangle) element, used for computing intersection

Definition at line 125 of file field_interpolated_p0.hh.


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