Flow123d  release_2.2.0-41-g0958a8d
field_fe.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file field_fe.hh
15  * @brief
16  */
17 
18 #ifndef FIELD_FE_HH_
19 #define FIELD_FE_HH_
20 
21 #include "petscmat.h"
22 #include "system/system.hh"
24 #include "mesh/point.hh"
25 #include "fem/dofhandler.hh"
26 #include "fem/mapping.hh"
27 #include "input/factory.hh"
28 
29 
30 
31 /**
32  * Class representing fields given by finite element approximation.
33  *
34  */
35 template <int spacedim, class Value>
36 class FieldFE : public FieldAlgorithmBase<spacedim, Value>
37 {
38 public:
41 
42  /**
43  * Default constructor, optionally we need number of components @p n_comp in the case of Vector valued fields.
44  */
45  FieldFE(unsigned int n_comp=0);
46 
47  /**
48  * Setter for the finite element data. The mappings are required for computation of local coordinates.
49  * @param dh Dof handler.
50  * @param map1 1D mapping.
51  * @param map2 2D mapping.
52  * @param map3 3D mapping.
53  * @param data Vector of dof values.
54  */
55  void set_fe_data(const DOFHandlerMultiDim *dh,
56  Mapping<1,3> *map1,
57  Mapping<2,3> *map2,
58  Mapping<3,3> *map3,
59  const Vec *data);
60 
61  /**
62  * Returns one value in one given point. ResultType can be used to avoid some costly calculation if the result is trivial.
63  */
64  virtual typename Value::return_type const &value(const Point &p, const ElementAccessor<spacedim> &elm);
65 
66  /**
67  * Returns std::vector of scalar values in several points at once.
68  */
69  virtual void value_list (const std::vector< Point > &point_list, const ElementAccessor<spacedim> &elm,
71 
72 
73  virtual ~FieldFE();
74 
75 private:
76 
78  double *data_;
79  const Vec *data_vec_;
80  unsigned int *dof_indices;
81 
85 
86  /// Registrar of class to factory
87  static const int registrar;
88 };
89 
90 
91 #endif /* FIELD_FE_HH_ */
virtual ~FieldFE()
Mapping< 2, 3 > * map2_
Definition: field_fe.hh:83
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:78
FieldAlgorithmBase< spacedim, Value >::Point Point
Definition: field_fe.hh:39
static const int registrar
Registrar of class to factory.
Definition: field_fe.hh:87
Mapping< 1, 3 > * map1_
Definition: field_fe.hh:82
FieldAlgorithmBase< spacedim, Value > FactoryBaseType
Definition: field_fe.hh:40
unsigned int * dof_indices
Definition: field_fe.hh:80
Mapping< 3, 3 > * map3_
Definition: field_fe.hh:84
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:79
Provides the numbering of the finite element degrees of freedom on the computational mesh...
Definition: dofhandler.hh:248
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)
const DOFHandlerMultiDim * dh_
Definition: field_fe.hh:77
unsigned int n_comp() const