Flow123d  JS_before_hm-1008-g3dab983
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" // for Field
30 #include "fields/field_values.hh" // for FieldValue
31 #include "input/type_base.hh" // for Array
32 #include "input/type_generic.hh" // for Instance
33 
34 class Mesh;
35 
36 template <int spacedim>
37 class GenericField {
38 public:
39 
40  /// Index value type
42  /// Index valued field
44 
45  /**
46  * Returns an instance of a scalar integer field that provides ID's of regions.
47  */
48  static auto region_id(Mesh &mesh) -> IndexField;
49 
50  /**
51  * Returns an instance of a scalar integer field that provides ID's of subdomains used for
52  * domain decomposition.
53  *
54  * TODO: FieldFE just use provided data pointer (unsafe solution), so currently we store the data into a mesh.
55  * Which is safe as long as we have one mesh for whol calculation.
56  * After we have FieldFE that use some sort of Vector class with own memory management, we should use these
57  * to pass the data in safe way.
58  */
59  static auto subdomain(Mesh &mesh) -> IndexField;
60 };
61 
62 
63 #endif /* GENERAL_FIELDS_HH_ */
static auto subdomain(Mesh &mesh) -> IndexField
Class template representing a field with values dependent on: point, element, and region...
Definition: field.hh:92
Definition: mesh.h:78
Field< spacedim, DoubleScalar > IndexField
Index valued field.
static auto region_id(Mesh &mesh) -> IndexField
FieldValue< spacedim >::Scalar DoubleScalar
Index value type.