p4est  2.8.643-dbc7-dirty
p4est is a software library for parallel adaptive mesh refinement.
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  Additional copyright (C) 2011 individual authors
8  Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
9 
10  p4est is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  p4est is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with p4est; if not, write to the Free Software Foundation, Inc.,
22  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 */
24 
30 #ifndef P8EST_GEOMETRY_H
31 #define P8EST_GEOMETRY_H
32 
33 #include <p8est_connectivity.h>
34 
35 SC_EXTERN_C_BEGIN;
36 
38 typedef struct p8est_geometry p8est_geometry_t;
39 
43 typedef void (*p8est_geometry_X_t) (p8est_geometry_t * geom,
44  p4est_topidx_t which_tree,
45  const double abc[3],
46  double xyz[3]);
47 
52 typedef void (*p8est_geometry_destroy_t) (p8est_geometry_t * geom);
53 
58 {
59  const char *name;
60  void *user;
65 };
66 
72 
80  conn);
81 
90  double R2, double R1);
91 
101  double R2, double R1,
102  double R0);
103 
122  double R0, double R1,
123  double R2);
124 
125 SC_EXTERN_C_END;
126 
127 #endif /* !P8EST_GEOMETRY_H */
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:93
The coarse topological description of the forest.
void p8est_geometry_destroy(p8est_geometry_t *geom)
Can be used to conveniently destroy a geometry structure.
void(* p8est_geometry_destroy_t)(p8est_geometry_t *geom)
Destructor prototype for a user-allocated p8est_geometry_t.
Definition: p8est_geometry.h:52
p8est_geometry_t * p8est_geometry_new_connectivity(p8est_connectivity_t *conn)
Create a geometry structure based on the vertices in a connectivity.
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:43
p8est_geometry_t * p8est_geometry_new_torus(p8est_connectivity_t *conn, double R0, double R1, double R2)
Create a geometry structure for the torus.
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.
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.
This structure holds the 3D inter-tree connectivity information.
Definition: p8est_connectivity.h:174
This structure can be created by the user, p4est will never change its contents.
Definition: p8est_geometry.h:58
const char * name
User's choice is arbitrary.
Definition: p8est_geometry.h:59
p8est_geometry_destroy_t destroy
Destructor called by p8est_geometry_destroy.
Definition: p8est_geometry.h:62
p8est_geometry_X_t X
Coordinate transformation.
Definition: p8est_geometry.h:61
void * user
User's choice is arbitrary.
Definition: p8est_geometry.h:60