programmer's documentation
cs_medcoupling_utils.hxx
Go to the documentation of this file.
1 #ifndef __CS_MEDCOUPLING_UTILS_HXX__
2 #define __CS_MEDCOUPLING_UTILS_HXX__
3 
4 /*============================================================================
5  * Usage of MEDCoupling base components.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2018 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 #include "cs_defs.h"
31 
32 /*----------------------------------------------------------------------------
33  * Standard C library headers
34  *----------------------------------------------------------------------------*/
35 
36 #include <stdarg.h>
37 #include <stdio.h>
38 #include <stdlib.h>
39 #include <string.h>
40 
41 #if defined(HAVE_MPI)
42 #include <mpi.h>
43 #endif
44 
45 /*----------------------------------------------------------------------------
46  * MEDCOUPLING library headers
47  *----------------------------------------------------------------------------*/
48 
49 #include <MEDCoupling_version.h>
50 #include <MEDCouplingUMesh.hxx>
51 
52 using namespace MEDCoupling;
53 
55 
56 /*----------------------------------------------------------------------------
57  * MEDCoupling mesh structure
58  *----------------------------------------------------------------------------*/
59 
60 typedef struct {
61 
62  char *sel_criteria; /* Element selection criteria */
63 
64  int elt_dim; /* Element dimension */
65 
66  cs_lnum_t n_elts; /* Number of coupled elements */
67  cs_lnum_t *elt_list; /* List of associated elements
68  (0 to n-1) */
69  int *new_to_old; /* Connectivity used if only a section of
70  the mesh is read */
71 
72  MEDCouplingUMesh *med_mesh; /* MED mesh structure */
73 
74  cs_real_t *bbox; /* Bounding box to optimize search */
75 
77 
78 /*=============================================================================
79  * Semi-private function prototypes
80  *============================================================================*/
81 
82 /*----------------------------------------------------------------------------
83  * Create a cs_medcoupling_mesh_t structure.
84  *
85  * parameters:
86  * name <-- mesh name
87  * select_criteria <-- Selection criteria
88  * elt_dim <-- Element type (3: cells, 2: faces)
89  *----------------------------------------------------------------------------*/
90 
92 cs_medcoupling_mesh_create(const char *name,
93  const char *select_criteria,
94  int elt_dim);
95 
96 /*----------------------------------------------------------------------------
97  * Copy a base mesh to a medcoupling mesh structure.
98  *
99  * parameters:
100  * csmesh <-- Code_Saturne FVM format mesh structure
101  * pmmesh <-> partially ParaMEDMEM mesh coupling structure
102  *----------------------------------------------------------------------------*/
103 
104 void
106  cs_medcoupling_mesh_t *pmmesh);
107 
108 /*----------------------------------------------------------------------------*/
109 
111 
112 #endif //__CS_MEDCOUPLING_UTILS_HXX__
Definition: cs_medcoupling_utils.hxx:60
cs_real_t * bbox
Definition: cs_medcoupling_utils.hxx:74
#define BEGIN_C_DECLS
Definition: cs_defs.h:462
MEDCouplingUMesh * med_mesh
Definition: cs_medcoupling_utils.hxx:72
int elt_dim
Definition: cs_medcoupling_utils.hxx:64
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_mesh.h:63
void cs_medcoupling_mesh_copy_from_base(cs_mesh_t *csmesh, cs_medcoupling_mesh_t *pmmesh)
Definition: cs_medcoupling_utils.cxx:532
cs_medcoupling_mesh_t * cs_medcoupling_mesh_create(const char *name, const char *select_criteria, int elt_dim)
Definition: cs_medcoupling_utils.cxx:497
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
#define END_C_DECLS
Definition: cs_defs.h:463
int * new_to_old
Definition: cs_medcoupling_utils.hxx:69
cs_lnum_t n_elts
Definition: cs_medcoupling_utils.hxx:66
cs_lnum_t * elt_list
Definition: cs_medcoupling_utils.hxx:67
char * sel_criteria
Definition: cs_medcoupling_utils.hxx:62