8.3
general documentation
cs_mesh_cartesian.h
Go to the documentation of this file.
1#ifndef __CS_MESH_CARTESIAN_H__
2#define __CS_MESH_CARTESIAN_H__
3
4/*============================================================================
5 * Cartesian mesh generation
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 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 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "cs_defs.h"
33
35
36/*============================================================================
37 * Type definitions
38 *============================================================================*/
39
40typedef enum {
41
42 CS_MESH_CARTESIAN_CONSTANT_LAW, /* Constant step law */
43 CS_MESH_CARTESIAN_GEOMETRIC_LAW, /* Geometric step law */
44 CS_MESH_CARTESIAN_PARABOLIC_LAW, /* Parabolic step law */
45 CS_MESH_CARTESIAN_USER_LAW, /* User defined discretization */
46 CS_MESH_CARTESIAN_N_LAW_TYPES /* Number of step discretization laws */
47
49
50typedef struct _cs_mesh_cartesian_params_t cs_mesh_cartesian_params_t;
51
52/*============================================================================
53 * Public C function prototypes
54 *============================================================================*/
55
56/*----------------------------------------------------------------------------*/
62/*----------------------------------------------------------------------------*/
63
64int
66
67/*----------------------------------------------------------------------------*/
75/*----------------------------------------------------------------------------*/
76
77cs_mesh_cartesian_params_t *
78cs_mesh_cartesian_by_id(const int id);
79
80/*----------------------------------------------------------------------------*/
89/*----------------------------------------------------------------------------*/
90
91cs_mesh_cartesian_params_t *
92cs_mesh_cartesian_by_name_try(const char *name);
93
94/*----------------------------------------------------------------------------*/
103/*----------------------------------------------------------------------------*/
104
105cs_mesh_cartesian_params_t *
106cs_mesh_cartesian_by_name(const char *name);
107
108/*----------------------------------------------------------------------------*/
115/*----------------------------------------------------------------------------*/
116
117cs_mesh_cartesian_params_t *
118cs_mesh_cartesian_create(const char *name);
119
120/*----------------------------------------------------------------------------*/
130/*----------------------------------------------------------------------------*/
131
132int
133cs_mesh_cartesian_define_simple(const char *name,
134 int ncells[3],
135 cs_real_t xyz[6]);
136
137/*----------------------------------------------------------------------------*/
146/*----------------------------------------------------------------------------*/
147
148void
149cs_mesh_cartesian_define_dir_user(cs_mesh_cartesian_params_t *mp,
150 int idir,
151 int ncells,
152 cs_real_t vtx_coord[]);
153
154/*----------------------------------------------------------------------------*/
174/*----------------------------------------------------------------------------*/
175
176void
177cs_mesh_cartesian_define_dir_geom_by_part(cs_mesh_cartesian_params_t *mp,
178 int idir,
179 int n_parts,
180 const cs_real_t part_coords[],
181 const cs_lnum_t n_part_cells[],
182 const cs_real_t amp_factors[]);
183
184/*----------------------------------------------------------------------------*/
201/*----------------------------------------------------------------------------*/
202
203void
204cs_mesh_cartesian_define_from_csv(const char *name,
205 const char *csv_file_name);
206
207/*----------------------------------------------------------------------------*/
220/*----------------------------------------------------------------------------*/
221
222void
223cs_mesh_cartesian_define_dir_params(cs_mesh_cartesian_params_t *mp,
224 int idim,
226 int ncells,
228 cs_real_t smax,
229 cs_real_t progression);
230
231/*----------------------------------------------------------------------------*/
236/*----------------------------------------------------------------------------*/
237
238int
240
241/*----------------------------------------------------------------------------*/
249/*----------------------------------------------------------------------------*/
250
251const char *
253
254/*----------------------------------------------------------------------------*/
262/*----------------------------------------------------------------------------*/
263
264int
266
267/*----------------------------------------------------------------------------*/
275/*----------------------------------------------------------------------------*/
276
277void
279 int shift);
280
281/*----------------------------------------------------------------------------*/
289/*----------------------------------------------------------------------------*/
290
293
294/*----------------------------------------------------------------------------*/
302/*----------------------------------------------------------------------------*/
303
306
307/*----------------------------------------------------------------------------*/
315/*----------------------------------------------------------------------------*/
316
319
320/*----------------------------------------------------------------------------*/
328/*----------------------------------------------------------------------------*/
329
330int
332 int idim);
333
334/*----------------------------------------------------------------------------*/
342/*----------------------------------------------------------------------------*/
343
344void
346 cs_mesh_t *m,
348 long echo);
349
350/*----------------------------------------------------------------------------*/
354/*----------------------------------------------------------------------------*/
355
356void
358
359/*----------------------------------------------------------------------------*/
362/*----------------------------------------------------------------------------*/
363
364void
366
367/*----------------------------------------------------------------------------*/
373/*----------------------------------------------------------------------------*/
374
375void
377
378/*----------------------------------------------------------------------------*/
379
381
382#endif /* __CS_MESH_CARTESIAN_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
uint64_t cs_gnum_t
global mesh entity number
Definition: cs_defs.h:325
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
void cs_mesh_cartesian_set_gc_id_shift(int id, int shift)
Set group class id shift of cartesian mesh.
Definition: cs_mesh_cartesian.cpp:1121
cs_mesh_cartesian_params_t * cs_mesh_cartesian_by_id(const int id)
Return pointer to cartesian mesh parameters structure.
Definition: cs_mesh_cartesian.cpp:638
cs_gnum_t cs_mesh_cartesian_get_n_g_vtx(int id)
Get global number of vertices of a cartesian mesh.
Definition: cs_mesh_cartesian.cpp:1176
cs_mesh_cartesian_params_t * cs_mesh_cartesian_create(const char *name)
Create cartesian mesh structure.
Definition: cs_mesh_cartesian.cpp:703
cs_mesh_cartesian_params_t * cs_mesh_cartesian_by_name_try(const char *name)
Get function for structured mesh based on its name.
Definition: cs_mesh_cartesian.cpp:657
int cs_mesh_cartesian_get_number_of_meshes(void)
Return number of structured meshes to build.
Definition: cs_mesh_cartesian.cpp:622
cs_mesh_cartesian_params_t * cs_mesh_cartesian_by_name(const char *name)
Get function for structured mesh based on its name.
Definition: cs_mesh_cartesian.cpp:676
void cs_mesh_cartesian_set_max_number_of_blocks(int n_blocks)
Set maximum number of cartesian blocks (by default is set to None)
Definition: cs_mesh_cartesian.cpp:1470
void cs_mesh_cartesian_finalize_definition(void)
Compute all global values for meshes.
Definition: cs_mesh_cartesian.cpp:1413
void cs_mesh_cartesian_block_connectivity(int id, cs_mesh_t *m, cs_mesh_builder_t *mb, long echo)
Build unstructured connectivity needed for partitionning.
Definition: cs_mesh_cartesian.cpp:1213
cs_gnum_t cs_mesh_cartesian_get_n_g_faces(int id)
Get global number of faces of a cartesian mesh.
Definition: cs_mesh_cartesian.cpp:1158
int cs_mesh_cartesian_define_simple(const char *name, int ncells[3], cs_real_t xyz[6])
Define a simple cartesian mesh with a constant step in all directions.
Definition: cs_mesh_cartesian.cpp:725
int cs_mesh_cartesian_need_build(void)
Indicate if a cartesian mesh is to be built.
Definition: cs_mesh_cartesian.cpp:1067
void cs_mesh_cartesian_define_dir_params(cs_mesh_cartesian_params_t *mp, int idim, cs_mesh_cartesian_law_t law, int ncells, cs_real_t smin, cs_real_t smax, cs_real_t progression)
Define parameters for a given direction.
Definition: cs_mesh_cartesian.cpp:1001
void cs_mesh_cartesian_define_dir_user(cs_mesh_cartesian_params_t *mp, int idir, int ncells, cs_real_t vtx_coord[])
Define directions parameters based on a user input.
Definition: cs_mesh_cartesian.cpp:755
int cs_mesh_cartesian_get_gc_id_shift(int id)
Get group class id shift of cartesian mesh.
Definition: cs_mesh_cartesian.cpp:1103
int cs_mesh_cartesian_get_ncells(int id, int idim)
Get number of cells in a given direction.
Definition: cs_mesh_cartesian.cpp:1194
void cs_mesh_cartesian_define_from_csv(const char *name, const char *csv_file_name)
Define a simple cartesian mesh based on a CSV file. CSV file needs to contain : (1) First line which ...
Definition: cs_mesh_cartesian.cpp:904
const char * cs_mesh_cartesian_get_name(int id)
Get name of structured mesh.
Definition: cs_mesh_cartesian.cpp:1085
void cs_mesh_cartesian_define_dir_geom_by_part(cs_mesh_cartesian_params_t *mp, int idir, int n_parts, const cs_real_t part_coords[], const cs_lnum_t n_part_cells[], const cs_real_t amp_factors[])
Define direction parameters based on a piecewise definition. Each part follows a geometric (or unifor...
Definition: cs_mesh_cartesian.cpp:809
void cs_mesh_cartesian_params_destroy(void)
Destroy cartesian mesh parameters.
Definition: cs_mesh_cartesian.cpp:1443
cs_mesh_cartesian_law_t
Definition: cs_mesh_cartesian.h:40
@ CS_MESH_CARTESIAN_USER_LAW
Definition: cs_mesh_cartesian.h:45
@ CS_MESH_CARTESIAN_CONSTANT_LAW
Definition: cs_mesh_cartesian.h:42
@ CS_MESH_CARTESIAN_N_LAW_TYPES
Definition: cs_mesh_cartesian.h:46
@ CS_MESH_CARTESIAN_PARABOLIC_LAW
Definition: cs_mesh_cartesian.h:44
@ CS_MESH_CARTESIAN_GEOMETRIC_LAW
Definition: cs_mesh_cartesian.h:43
cs_gnum_t cs_mesh_cartesian_get_n_g_cells(int id)
Get global number of cells of a cartesian mesh.
Definition: cs_mesh_cartesian.cpp:1140
integer(c_int), pointer, save smin
starting min
Definition: atincl.f90:176
Definition: cs_mesh_builder.h:57
Definition: cs_mesh.h:85