Path: blob/main/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h
926 views
/*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_cmesh_readmshfile.h23* We define a function here that serves to open a mesh file generated by24* GMSH and constructing a cmesh from it.25*/2627#ifndef T8_CMESH_READMSHFILE_H28#define T8_CMESH_READMSHFILE_H2930#include <t8.h>31#include <t8_eclass.h>32#include <t8_cmesh/t8_cmesh.h>3334/** The supported .msh file versions.35* Currently, we only support gmsh's file version 4 in ASCII format.36*/37#define T8_CMESH_N_SUPPORTED_MSH_FILE_VERSIONS 13839/** The gmsh file versions that are supported. Currently version 4 in ASCII format */40const int t8_cmesh_supported_msh_file_versions[T8_CMESH_N_SUPPORTED_MSH_FILE_VERSIONS] = { 4 };4142T8_EXTERN_C_BEGIN ();4344/* put declarations here */4546/** Read a .msh file and create a cmesh from it.47* \param [in] fileprefix The prefix of the mesh file.48* The file fileprefix.msh is read.49* \param [in] partition If true the file is only opened on one process50* specified by the \a master argument and saved as51* a partitioned cmesh where each other process does not52* have any trees.53* \param [in] comm The MPI communicator with which the cmesh is to be committed.54* \param [in] dim The dimension to read from the .msh files. The .msh format55* can store several dimensions of the mesh and therefore the56* dimension to read has to be set manually.57* \param [in] master If partition is true, a valid MPI rank that will58* read the file and store all the trees alone.59* \param [in] use_cad_geometry Read the parameters of a parametric msh file and use the60* cad geometry.61* \return A committed cmesh holding the mesh of dimension \a dim in the62* specified .msh file.63*/64t8_cmesh_t65t8_cmesh_from_msh_file (const char *fileprefix, int partition, sc_MPI_Comm comm, int dim, int master,66int use_cad_geometry);6768T8_EXTERN_C_END ();6970#endif /* !T8_CMESH_READMSHFILE_H */717273