t8  UNKNOWN
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>
33 
46 typedef void (*t8_geom_analytic_fn) (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords,
47  const size_t num_coords, double *out_coords, const void *tree_data,
48  const void *user_data);
49 
61 typedef void (*t8_geom_analytic_jacobian_fn) (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords,
62  const size_t num_coords, double *jacobian, const void *tree_data,
63  const void *user_data);
64 
65 /* TODO: Document. */
66 typedef void (*t8_geom_load_tree_data_fn) (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const void **tree_data);
67 
69 {
70  public:
81  t8_geometry_analytic (int dim, const char *name, t8_geom_analytic_fn analytical,
82  t8_geom_analytic_jacobian_fn jacobian, t8_geom_load_tree_data_fn load_tree_data,
83  const void *user_data);
84 
89  {
90  /* Nothing to do */
91  }
92 
97  inline t8_geometry_type_t
99  {
101  };
102 
111  virtual void
112  t8_geom_evaluate (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords,
113  double *out_coords) const;
114 
128  virtual void
129  t8_geom_evaluate_jacobian (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_coords,
130  double *jacobian) const;
131 
139  virtual void
141 
142  inline const void *
143  t8_geom_analytic_get_user_data ()
144  {
145  return user_data;
146  }
147 
148  private:
149  t8_geom_analytic_fn analytical_function;
153  t8_geom_load_tree_data_fn load_tree_data;
155  const void *tree_data;
158  const void *user_data;
160 };
161 
162 /* TODO: Document */
163 void
164 t8_geom_load_tree_data_vertices (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const void **vertices_out);
165 
166 #endif /* !T8_GEOMETRY_ANALYTICAL_HXX! */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:88
Definition: t8_geometry_analytic.hxx:69
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
Compute the jacobian of the t8_geom_evaluate map at a point in the reference space .
Definition: t8_geometry_analytic.cxx:49
virtual ~t8_geometry_analytic()
The destructor.
Definition: t8_geometry_analytic.hxx:88
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:57
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
Maps points in the reference space .
Definition: t8_geometry_analytic.cxx:41
t8_geometry_type_t t8_geom_get_type() const
Get the type of this geometry.
Definition: t8_geometry_analytic.hxx:98
t8_geometry_analytic(int dim, 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 of the analytic geometry with a given dimension.
Definition: t8_geometry_analytic.cxx:25
Definition: t8_geometry_base.hxx:37
const char * name
The name of this geometry.
Definition: t8_geometry_base.hxx:130
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
@ T8_GEOMETRY_TYPE_ANALYTIC
The analytic geometry uses a user-defined analytic function to map into the physical domain.
Definition: t8_geometry.h:43
enum t8_geometry_type t8_geometry_type_t
This enumeration contains all possible geometries.
void(* t8_geom_analytic_jacobian_fn)(t8_cmesh_t cmesh, t8_gloidx_t gtreeid, const double *ref_coords, const size_t num_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, const size_t num_coords, double *out_coords, const void *tree_data, const void *user_data)
Definition of an analytic geometry function.
Definition: t8_geometry_analytic.hxx:46
This header file provides a C interface for functions for the t8_geometry_with_vertices class.
Implements the inherited class t8_geometry_with_vertices, which can be used for geometries that use v...