Flow123d  jenkins-Flow123d-linux-release-multijob-198
field_fe.hh
Go to the documentation of this file.
1 /*
2  * field_constant.hh
3  *
4  * Created on: Dec 15, 2012
5  * Author: jb
6  */
7 
8 
9 #ifndef FIELD_FE_HH_
10 #define FIELD_FE_HH_
11 
12 #include "petscmat.h"
13 #include "system/system.hh"
15 #include "mesh/point.hh"
16 #include "fem/dofhandler.hh"
17 #include "fem/mapping.hh"
18 
19 
20 
21 
22 /**
23  * Class representing fields given by finite element approximation.
24  *
25  */
26 template <int spacedim, class Value>
27 class FieldFE : public FieldAlgorithmBase<spacedim, Value>
28 {
29 public:
31 
32  /**
33  * Default constructor, optionally we need number of components @p n_comp in the case of Vector valued fields.
34  */
35  FieldFE(unsigned int n_comp=0);
36 
37  /**
38  * Setter for the finite element data. The mappings are required for computation of local coordinates.
39  * @param dh Dof handler.
40  * @param map1 1D mapping.
41  * @param map2 2D mapping.
42  * @param map3 3D mapping.
43  * @param data Vector of dof values.
44  */
45  void set_fe_data(const DOFHandlerMultiDim *dh,
46  Mapping<1,3> *map1,
47  Mapping<2,3> *map2,
48  Mapping<3,3> *map3,
49  const Vec *data);
50 
51  /**
52  * Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.
53  */
54  virtual typename Value::return_type const &value(const Point &p, const ElementAccessor<spacedim> &elm);
55 
56  /**
57  * Returns std::vector of scalar values in several points at once.
58  */
59  virtual void value_list (const std::vector< Point > &point_list, const ElementAccessor<spacedim> &elm,
61 
62 
63  virtual ~FieldFE();
64 
65 private:
66 
68  double *data_;
69  const Vec *data_vec_;
70  unsigned int *dof_indices;
71 
75 };
76 
77 
78 #endif /* FIELD_FE_HH_ */
virtual ~FieldFE()
Mapping< 2, 3 > * map2_
Definition: field_fe.hh:73
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
double * data_
Definition: field_fe.hh:68
FieldAlgorithmBase< spacedim, Value >::Point Point
Definition: field_fe.hh:30
Mapping< 1, 3 > * map1_
Definition: field_fe.hh:72
unsigned int * dof_indices
Definition: field_fe.hh:70
Mapping< 3, 3 > * map3_
Definition: field_fe.hh:74
void set_fe_data(const DOFHandlerMultiDim *dh, Mapping< 1, 3 > *map1, Mapping< 2, 3 > *map2, Mapping< 3, 3 > *map3, const Vec *data)
const Vec * data_vec_
Definition: field_fe.hh:69
Provides the numbering of the finite element degrees of freedom on the computational mesh...
Definition: dofhandler.hh:251
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)
Space< spacedim >::Point Point
Class Mapping calculates data related to the mapping of the reference cell to the actual cell...
FieldFE(unsigned int n_comp=0)
Implementation.
const DOFHandlerMultiDim * dh_
Definition: field_fe.hh:67
unsigned int n_comp() const