p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p8est_geometry.h
Go to the documentation of this file.
1 /*
2  This file is part of p4est.
3  p4est is a C library to manage a collection (a forest) of multiple
4  connected adaptive quadtrees or octrees in parallel.
5 
6  Copyright (C) 2010 The University of Texas System
7  Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
8 
9  p4est is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  p4est is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with p4est; if not, write to the Free Software Foundation, Inc.,
21  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23 
29 #ifndef P8EST_GEOMETRY_H
30 #define P8EST_GEOMETRY_H
31 
32 #include <p8est_connectivity.h>
33 
34 SC_EXTERN_C_BEGIN;
35 
36 typedef struct p8est_geometry p8est_geometry_t;
37 
41 typedef void (*p8est_geometry_X_t) (p8est_geometry_t * geom,
42  p4est_topidx_t which_tree,
43  const double abc[3],
44  double xyz[3]);
45 
50 typedef void (*p8est_geometry_destroy_t) (p8est_geometry_t * geom);
51 
56 {
57  const char *name;
58  void *user;
63 };
64 
69 void p8est_geometry_destroy (p8est_geometry_t * geom);
70 
78  conn);
79 
87 p8est_geometry_t *p8est_geometry_new_shell (p8est_connectivity_t * conn,
88  double R2, double R1);
89 
98 p8est_geometry_t *p8est_geometry_new_sphere (p8est_connectivity_t * conn,
99  double R2, double R1,
100  double R0);
101 
102 SC_EXTERN_C_END;
103 
104 #endif /* !P8EST_GEOMETRY_H */
p8est_geometry_t * p8est_geometry_new_sphere(p8est_connectivity_t *conn, double R2, double R1, double R0)
Create a geometry structure for the solid sphere of 13 trees.
Definition: p8est_geometry.c:267
p8est_geometry_destroy_t destroy
Destructor called by p8est_geometry_destroy.
Definition: p8est_geometry.h:60
void * user
User's choice is arbitrary.
Definition: p8est_geometry.h:58
p8est_geometry_X_t X
Coordinate transformation.
Definition: p8est_geometry.h:59
void(* p8est_geometry_destroy_t)(p8est_geometry_t *geom)
Destructor prototype for a user-allocated p8est_geometry_t.
Definition: p8est_geometry.h:50
This structure holds the 3D inter-tree connectivity information.
Definition: p8est_connectivity.h:158
const char * name
User's choice is arbitrary.
Definition: p8est_geometry.h:57
void p8est_geometry_destroy(p8est_geometry_t *geom)
Can be used to conveniently destroy a geometry structure.
void(* p8est_geometry_X_t)(p8est_geometry_t *geom, p4est_topidx_t which_tree, const double abc[3], double xyz[3])
Forward transformation from the reference unit square to physical space.
Definition: p8est_geometry.h:41
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:63
This structure can be created by the user, p4est will never change its contents.
Definition: p8est_geometry.h:55
The coarse topological description of the forest.
p8est_geometry_t * p8est_geometry_new_connectivity(p8est_connectivity_t *conn)
Create a geometry structure based on the vertices in a connectivity.
p8est_geometry_t * p8est_geometry_new_shell(p8est_connectivity_t *conn, double R2, double R1)
Create a geometry structure for the spherical shell of 24 trees.
Definition: p8est_geometry.c:140