/*1This file is part of t8code.2t8code is a C library to manage a collection (a forest) of multiple3connected adaptive space-trees of general element classes in parallel.45Copyright (C) 2015 the developers67t8code is free software; you can redistribute it and/or modify8it under the terms of the GNU General Public License as published by9the Free Software Foundation; either version 2 of the License, or10(at your option) any later version.1112t8code is distributed in the hope that it will be useful,13but WITHOUT ANY WARRANTY; without even the implied warranty of14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15GNU General Public License for more details.1617You should have received a copy of the GNU General Public License18along with t8code; if not, write to the Free Software Foundation, Inc.,1951 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.20*/2122/** \file t8_element_shape.h23* TODO: comment24*/2526#ifndef T8_ELEMENT_SHAPE_H27#define T8_ELEMENT_SHAPE_H2829#include <t8.h>30#include <t8_eclass.h>3132/** We want to export the whole implementation to be callable from "C". */33T8_EXTERN_C_BEGIN ();3435/** Type definition for the geometric shape of an element.36* Currently the possible shapes are the same as the possible element classes.37* I.e. T8_ECLASS_VERTEX, T8_ECLASS_TET, etc... */38typedef t8_eclass_t t8_element_shape_t;3940/** The MPI datatype used for t8_element_shape_t */41#define T8_MPI_ELEMENT_SHAPE_TYPE (T8_ASSERT (sizeof (int) == sizeof (t8_element_shape_t)), sc_MPI_INT)4243/** The maximum number of boundary faces an element class can have. */44#define T8_ELEMENT_SHAPE_MAX_FACES 645/** The maximum number of corners a 3-dimensional element class can have. */46#define T8_ELEMENT_SHAPE_MAX_CORNERS 84748/** Maximum possible number of corner nodes of an element in a specific dimension */49extern const int t8_element_shape_max_num_corner[T8_ECLASS_MAX_DIM + 1];5051/** The number of codimension-one boundaries of an element class. */52int53t8_element_shape_num_faces (int element_shape);5455/** For each dimension the maximum possible number of faces of an element_shape of that dimension. */56int57t8_element_shape_max_num_faces (int element_shape);5859/** The number of vertices of an element class. */60int61t8_element_shape_num_vertices (int element_shape);6263/** The vtk cell type for the element_shape */64int65t8_element_shape_vtk_type (int element_shape);6667/** Maps the t8code corner number of the element to the vtk corner number68* \param [in] element_shape The shape of the element.69* \param [in] index The index of the corner in z-order (t8code numeration).70* \return The corresponding vtk index.71*/72int73t8_element_shape_t8_to_vtk_corner_number (int element_shape, int index);7475/** Maps the vtk corner number of the element to the t8code corner number76* \param [in] element_shape The shape of the element.77* \param [in] index The index of the corner in vtk ordering.78* \return The corresponding t8code index.79*/80int81t8_element_shape_t8_corner_number (int element_shape, int index);8283/** For each element_shape, the name of this class as a string */84const char*85t8_element_shape_to_string (int element_shape);8687/** Compare two element_shapes of the same dimension88* as necessary for face neighbor orientation.89* The implemented order is Triangle < Square in 2D and90* Tet < Hex < Prism < Pyramid in 3D.91* \param [in] element_shape1 The first element_shape to compare.92* \param [in] element_shape2 The second element_shape to compare.93* \return 0 if the element_shapes are equal, 1 if element_shape1 > element_shape294* and -1 if element_shape1 < element_shape295*/96int97t8_element_shape_compare (t8_element_shape_t element_shape1, t8_element_shape_t element_shape2);9899/** End of code that is callable from "C".*/100T8_EXTERN_C_END ();101102#endif /* !T8_ELEMENT_SHAPE_H */103104105