7.0
general 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-2021 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 #if defined(HAVE_MEDCOUPLING)
50 
51 #include "MEDCouplingUMesh.hxx"
52 
53 using namespace MEDCoupling;
54 
55 #endif
56 
57 
59 
60 /*----------------------------------------------------------------------------
61  * MEDCoupling mesh structure
62  *----------------------------------------------------------------------------*/
63 
64 typedef struct {
65 
66  char *sel_criteria; /* Element selection criteria */
67 
68  int elt_dim; /* Element dimension */
69 
70  cs_lnum_t n_elts; /* Number of coupled elements */
71  cs_lnum_t *elt_list; /* List of associated elements
72  (0 to n-1) */
73  cs_lnum_t *new_to_old; /* Connectivity used if only a section of
74  the mesh is read */
75 
76  cs_real_t *bbox; /* Bounding box to optimize search */
77 
78 #if defined(HAVE_MEDCOUPLING)
79  MEDCouplingUMesh *med_mesh; /* MED mesh structure */
80 #else
81  void *med_mesh;
82 #endif
83 
85 
86 /*=============================================================================
87  * Public functions
88  *============================================================================*/
89 
90 /*----------------------------------------------------------------------------*/
102 /*----------------------------------------------------------------------------*/
103 
105 cs_medcoupling_mesh_create(const char *name,
106  const char *selection_criteria,
107  int elt_dim);
108 
109 /*----------------------------------------------------------------------------*/
120 /*----------------------------------------------------------------------------*/
121 
122 void
124  cs_medcoupling_mesh_t *pmmesh,
125  int use_bbox);
126 
127 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 void
137 
138 /*----------------------------------------------------------------------------*/
146 /*----------------------------------------------------------------------------*/
147 
148 int
150 
151 /*----------------------------------------------------------------------------*/
159 /*----------------------------------------------------------------------------*/
160 
161 cs_lnum_t
163 
164 /*----------------------------------------------------------------------------*/
172 /*----------------------------------------------------------------------------*/
173 
174 const cs_lnum_t *
176 
177 /*----------------------------------------------------------------------------*/
185 /*----------------------------------------------------------------------------*/
186 
187 const cs_lnum_t *
189 
190 /*----------------------------------------------------------------------------*/
191 
193 
194 #endif /* __CS_MEDCOUPLING_UTILS_HXX__ */
Definition: cs_medcoupling_utils.hxx:64
void cs_medcoupling_mesh_copy_from_base(cs_mesh_t *csmesh, cs_medcoupling_mesh_t *pmmesh, int use_bbox)
copy a cs_mesh_t into a cs_medcoupling_mesh_t
Definition: cs_medcoupling_utils.cxx:640
const cs_lnum_t * cs_medcoupling_mesh_get_elt_list(cs_medcoupling_mesh_t *m)
Return a cs_medcoupling_mesh_t structure&#39;s (parent) elements list.
Definition: cs_medcoupling_utils.cxx:775
cs_real_t * bbox
Definition: cs_medcoupling_utils.hxx:76
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
MEDCouplingUMesh * med_mesh
Definition: cs_medcoupling_utils.hxx:79
int elt_dim
Definition: cs_medcoupling_utils.hxx:68
const cs_lnum_t * cs_medcoupling_mesh_get_connectivity(cs_medcoupling_mesh_t *m)
Return a cs_medcoupling_mesh_t structure&#39;s (parent) elements list.
Definition: cs_medcoupling_utils.cxx:796
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
Definition: cs_mesh.h:84
cs_lnum_t * new_to_old
Definition: cs_medcoupling_utils.hxx:73
int cs_medcoupling_mesh_get_dim(cs_medcoupling_mesh_t *m)
Return a cs_medcoupling_mesh_t structure&#39;s spatial dimension.
Definition: cs_medcoupling_utils.cxx:735
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
cs_medcoupling_mesh_t * cs_medcoupling_mesh_create(const char *name, const char *selection_criteria, int elt_dim)
create a new cs_medcoupling_mesh_t instance
Definition: cs_medcoupling_utils.cxx:588
#define END_C_DECLS
Definition: cs_defs.h:496
cs_lnum_t n_elts
Definition: cs_medcoupling_utils.hxx:70
cs_lnum_t * elt_list
Definition: cs_medcoupling_utils.hxx:71
cs_lnum_t cs_medcoupling_mesh_get_n_elts(cs_medcoupling_mesh_t *m)
Return a cs_medcoupling_mesh_t structure&#39;s number of elements.
Definition: cs_medcoupling_utils.cxx:755
char * sel_criteria
Definition: cs_medcoupling_utils.hxx:66
Definition: mesh.f90:26
void cs_medcoupling_mesh_destroy(cs_medcoupling_mesh_t *mesh)
Destroy a cs_medcoupling_mesh_t.
Definition: cs_medcoupling_utils.cxx:710