t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_geometry_analytic.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 
27 #ifndef T8_GEOMETRY_ANALYTIC_HXX
28 #define T8_GEOMETRY_ANALYTIC_HXX
29 
30 #include <t8.h>
32 
44 typedef void (*t8_geom_analytic_fn) (t8_cmesh_t cmesh,
45  t8_gloidx_t gtreeid,
46  const double *ref_coords,
47  double out_coords[3],
48  const void *tree_data,
49  const void *user_data);
50 
62  t8_gloidx_t gtreeid,
63  const double *ref_coords,
64  double *jacobian,
65  const void *tree_data,
66  const void *user_data);
67 
68 /* TODO: Document. */
69 typedef void (*t8_geom_load_tree_data_fn) (t8_cmesh_t cmesh,
70  t8_gloidx_t gtreeid,
71  const void **tree_data);
72 
74 {
75 public:
76 
85  t8_geometry_analytic (int dimension, const char *name,
86  t8_geom_analytic_fn analytical,
88  t8_geom_load_tree_data_fn load_tree_data,
89  const void *user_data);
90 
95  {
96  /* Nothing to do */
97  }
98 
107  virtual void t8_geom_evaluate (t8_cmesh_t cmesh,
108  t8_gloidx_t gtreeid,
109  const double *ref_coords,
110  double out_coords[3]) const;
111 
124  virtual void t8_geom_evalute_jacobian (t8_cmesh_t cmesh,
125  t8_gloidx_t gtreeid,
126  const double *ref_coords,
127  double *jacobian) const;
128 
136  virtual void t8_geom_load_tree_data (t8_cmesh_t cmesh,
137  t8_gloidx_t gtreeid);
138 
139  inline const void *t8_geom_analytic_get_user_data ()
140  {
141  return user_data;
142  }
143 
144 private:
145  t8_geom_analytic_fn analytical_function;
149  t8_geom_load_tree_data_fn load_tree_data;
151  const void *tree_data;
154  const void *user_data;
156 };
157 
158 /* TODO: Document */
159 void t8_geom_load_tree_data_vertices (t8_cmesh_t cmesh,
160  t8_gloidx_t gtreeid,
161  const void
162  **vertices_out);
163 
164 #endif /* !T8_GEOMETRY_ANALYTICAL_HXX! */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:83
Definition: t8_geometry_analytic.hxx:74
virtual void t8_geom_load_tree_data(t8_cmesh_t cmesh, t8_gloidx_t gtreeid)
Update a possible internal data buffer for per tree data.
Definition: t8_geometry_analytic.cxx:86
virtual void t8_geom_evaluate(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, double out_coords[3]) const
Map a point in the reference space $$[0,1]^dimension$$ to $$\mathbb R^3$$.
Definition: t8_geometry_analytic.cxx:53
virtual void t8_geom_evalute_jacobian(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, double *jacobian) const
Compute the jacobian of the t8_geom_evaluate map at a point in the reference space $$[0,...
Definition: t8_geometry_analytic.cxx:74
t8_geometry_analytic(int dimension, const char *name, t8_geom_analytic_fn analytical, t8_geom_analytic_jacobian_fn jacobian, t8_geom_load_tree_data_fn load_tree_data, const void *user_data)
Constructor with analytical and jacobian functions.
Definition: t8_geometry_analytic.cxx:25
virtual ~ t8_geometry_analytic()
The destructor.
Definition: t8_geometry_analytic.hxx:94
Definition: t8_geometry_base.hxx:38
int dimension
The dimension of reference space for which this is a geometry.
Definition: t8_geometry_base.hxx:117
const char * name
The name of this geometry.
Definition: t8_geometry_base.hxx:120
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:105
void(* t8_geom_analytic_jacobian_fn)(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, double *jacobian, const void *tree_data, const void *user_data)
Definition for the jacobian of an analytic geometry function.
Definition: t8_geometry_analytic.hxx:61
void(* t8_geom_analytic_fn)(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, double out_coords[3], const void *tree_data, const void *user_data)
Definition of an analytic geometry function.
Definition: t8_geometry_analytic.hxx:44
Implements the base pure virtual class t8_geometry and the inherited class t8_geometry_w_vertices.