t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_geometry_base.hxx
Go to the documentation of this file.
1 /*
2  This file is part of t8code.
3  t8code is a C library to manage a collection (a forest) of multiple
4  connected adaptive space-trees of general element classes in parallel.
5 
6  Copyright (C) 2015 the developers
7 
8  t8code is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  t8code is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with t8code; if not, write to the Free Software Foundation, Inc.,
20  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22 
28 #ifndef T8_GEOMETRY_BASE_HXX
29 #define T8_GEOMETRY_BASE_HXX
30 
31 #include <t8.h>
32 #include <t8_cmesh.h>
33 
34 T8_EXTERN_C_BEGIN ();
35 
37 {
38  public:
39  /* Basic constructor that sets the dimension, the name, and the name for the attribute. */
40  t8_geometry (int dimension, const char *name, const char *attribute_name = NULL): dimension (dimension), name (name)
41  {
42  }
43 
44  /* Base constructor with no arguments. We need this since it
45  * is called from derived class constructors.
46  * Sets dimension and name to invalid values. */
47  t8_geometry (): t8_geometry (-1, "Invalid")
48  {
49  }
50 
56  virtual ~t8_geometry ()
57  {
58  }
59 
68  virtual void
69  t8_geom_evaluate (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords,
70  double *out_coords) const
71  = 0;
72 
82  virtual void
83  t8_geom_evaluate_jacobian (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords,
84  double *jacobian) const
85  = 0;
86 
94  virtual void
96  = 0;
97 
102  inline int
104  {
105  return dimension;
106  }
107 
112  inline const char *
114  {
115  return name;
116  }
117 
122  virtual t8_geometry_type_t
124  = 0;
125 
126  protected:
130  const char *name;
132 };
133 
134 T8_EXTERN_C_END ();
135 
136 #endif /* !T8_GEOMETRY_BASE_HXX! */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:88
Definition: t8_geometry_base.hxx:37
int dimension
The dimension of reference space for which this is a geometry.
Definition: t8_geometry_base.hxx:127
const char * t8_geom_get_name() const
Get the name of this geometry.
Definition: t8_geometry_base.hxx:113
const char * name
The name of this geometry.
Definition: t8_geometry_base.hxx:130
virtual void t8_geom_evaluate(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *out_coords) const =0
Maps points in the reference space .
virtual void t8_geom_evaluate_jacobian(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords, double *jacobian) const =0
Compute the jacobian of the t8_geom_evaluate map at a point in the reference space .
virtual t8_geometry_type_t t8_geom_get_type() const =0
Get the type of this geometry.
int t8_geom_get_dimension() const
Get the dimension of this geometry.
Definition: t8_geometry_base.hxx:103
virtual ~t8_geometry()
The destructor.
Definition: t8_geometry_base.hxx:56
virtual void t8_geom_load_tree_data(t8_cmesh_t cmesh, t8_gloidx_t gtreeid)=0
Update a possible internal data buffer for per tree data.
This is the administrative header file for t8code.
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:98
We define the coarse mesh of trees in this file.
enum t8_geometry_type t8_geometry_type_t
This enumeration contains all possible geometries.