7.2
general documentation
cs_medcoupling_mesh.hxx
Go to the documentation of this file.
1 #ifndef __CS_MEDCOUPLING_MESH_HXX__
2 #define __CS_MEDCOUPLING_MESH_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-2022 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 #include "cs_mesh.h"
42 
43 /*----------------------------------------------------------------------------
44  * MEDCOUPLING library headers
45  *----------------------------------------------------------------------------*/
46 
47 #if defined(HAVE_MEDCOUPLING)
48 
49 #include "MEDCouplingUMesh.hxx"
50 
51 using namespace MEDCoupling;
52 
53 #endif
54 
56 
57 /*----------------------------------------------------------------------------
58  * MEDCoupling mesh structure
59  *----------------------------------------------------------------------------*/
60 
61 typedef struct {
62 
63  char *sel_criteria; /* Element selection criteria */
64 
65  int elt_dim; /* Element dimension */
66 
67  cs_lnum_t n_elts; /* Number of coupled elements */
68  cs_lnum_t *elt_list; /* List of associated elements
69  (0 to n-1) */
70  cs_lnum_t *new_to_old; /* Connectivity used if only a section of
71  the mesh is read */
72 
73  cs_real_t *bbox; /* Bounding box to optimize search */
74 
75 #if defined(HAVE_MEDCOUPLING)
76  MEDCouplingUMesh *med_mesh; /* MED mesh structure */
77 #else
78  void *med_mesh;
79 #endif
80 
82 
83 /*=============================================================================
84  * Public functions
85  *============================================================================*/
86 
87 /*----------------------------------------------------------------------------*/
99 /*----------------------------------------------------------------------------*/
100 
103  const char *name,
104  const char *selection_criteria,
105  const int elt_dim,
106  const int use_bbox);
107 
108 /*----------------------------------------------------------------------------*/
114 /*----------------------------------------------------------------------------*/
115 
116 void
118 
119 /*----------------------------------------------------------------------------*/
123 /*----------------------------------------------------------------------------*/
124 
125 void
127 
128 /*----------------------------------------------------------------------------*/
136 /*----------------------------------------------------------------------------*/
137 
138 int
140 
141 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 
151 cs_lnum_t
153 
154 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
164 const cs_lnum_t *
166 
167 /*----------------------------------------------------------------------------*/
175 /*----------------------------------------------------------------------------*/
176 
177 const cs_lnum_t *
179 
180 /*----------------------------------------------------------------------------*/
181 
183 
184 #endif /* __CS_MEDCOUPLING_MESH_HXX__ */
Definition: cs_medcoupling_mesh.hxx:61
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_mesh.cxx:842
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_mesh.cxx:882
cs_real_t * bbox
Definition: cs_medcoupling_mesh.hxx:73
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
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_mesh.cxx:862
MEDCouplingUMesh * med_mesh
Definition: cs_medcoupling_mesh.hxx:76
int elt_dim
Definition: cs_medcoupling_mesh.hxx:65
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_mesh.h:84
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_mesh.cxx:903
cs_lnum_t * new_to_old
Definition: cs_medcoupling_mesh.hxx:70
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
#define END_C_DECLS
Definition: cs_defs.h:511
void cs_medcoupling_mesh_destroy_all(void)
Destroy all cs_medcoupling_mesh_t instances.
Definition: cs_medcoupling_mesh.cxx:817
void cs_medcoupling_mesh_destroy(cs_medcoupling_mesh_t *mesh)
Destroy a cs_medcoupling_mesh_t.
Definition: cs_medcoupling_mesh.cxx:796
cs_medcoupling_mesh_t * cs_medcoupling_mesh_from_base(cs_mesh_t *csmesh, const char *name, const char *selection_criteria, const int elt_dim, const int use_bbox)
create a new cs_medcoupling_mesh_t instance based on cs_mesh_t
Definition: cs_medcoupling_mesh.cxx:757
cs_lnum_t n_elts
Definition: cs_medcoupling_mesh.hxx:67
cs_lnum_t * elt_list
Definition: cs_medcoupling_mesh.hxx:68
char * sel_criteria
Definition: cs_medcoupling_mesh.hxx:63
Definition: mesh.f90:26