Flow123d  release_2.2.0-33-g759111d
generic_field.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 generic_field.hh
15  * @brief
16  */
17 
18 #ifndef GENERIC_FIELDS_HH_
19 #define GENERIC_FIELDS_HH_
20 
21 /**
22  * @file
23  * @brief Fields computed from the mesh data.
24  *
25  * This file collects fields that are independent of particular equation and
26  * depends only on data in mesh.
27  */
28 
29 #include "fields/field.hh"
30 #include "fields/field_constant.hh"
32 
33 class Mesh;
34 
35 template <int spacedim>
36 class GenericField {
37 public:
38 
39  /// Index value type
41  /// Index valued field
43 
44  /**
45  * Returns an instance of a scalar integer field that provides ID's of regions.
46  */
47  static auto region_id(Mesh &mesh) -> IndexField;
48 
49  /**
50  * Returns an instance of a scalar integer field that provides ID's of subdomains used for
51  * domain decomposition.
52  *
53  * TODO: FieldElementwise just use provided data pointer (unsafe solution), so currently we store the data into a mesh.
54  * Which is safe as long as we have one mesh for whol calculation.
55  * After we have FieldFE that use some sort of Vector class with own memory management, we should use these
56  * to pass the data in safe way.
57  */
58  static auto subdomain(Mesh &mesh) -> IndexField;
59 };
60 
61 
62 #endif /* GENERAL_FIELDS_HH_ */
static auto subdomain(Mesh &mesh) -> IndexField
FieldValue< spacedim >::Integer IntegerScalar
Index value type.
Class template representing a field with values dependent on: point, element, and region...
Definition: field.hh:62
Definition: mesh.h:97
Field< spacedim, IntegerScalar > IndexField
Index valued field.
static auto region_id(Mesh &mesh) -> IndexField