1
/*============================================================================
2
* User function for geometry and mesh modification.
3
*============================================================================*/
8
This file is part of Code_Saturne, a general-purpose CFD tool.
10
Copyright (C) 1998-2011 EDF S.A.
12
This program is free software; you can redistribute it and/or modify it under
13
the terms of the GNU General Public License as published by the Free Software
14
Foundation; either version 2 of the License, or (at your option) any later
17
This program is distributed in the hope that it will be useful, but WITHOUT
18
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22
You should have received a copy of the GNU General Public License along with
23
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
24
Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
/*----------------------------------------------------------------------------*/
29
#if defined(HAVE_CONFIG_H)
30
#include "cs_config.h"
33
/*----------------------------------------------------------------------------
34
* Standard C library headers
35
*----------------------------------------------------------------------------*/
44
/*----------------------------------------------------------------------------
46
*----------------------------------------------------------------------------*/
49
#include "bft_printf.h"
51
/*----------------------------------------------------------------------------
53
*----------------------------------------------------------------------------*/
56
#include "fvm_selector.h"
58
/*----------------------------------------------------------------------------
60
*----------------------------------------------------------------------------*/
64
#include "cs_mesh_quantities.h"
65
#include "cs_selector.h"
67
/*----------------------------------------------------------------------------
68
* Header for the current file
69
*----------------------------------------------------------------------------*/
71
#include "cs_prototypes.h"
72
#include "cs_mesh_thinwall.h"
74
/*----------------------------------------------------------------------------*/
78
/*============================================================================
79
* User function definitions
80
*============================================================================*/
82
/*----------------------------------------------------------------------------
83
* Insert thin wall into a mesh.
84
*----------------------------------------------------------------------------*/
87
cs_user_mesh_thinwall(cs_mesh_t *mesh)
89
return; /* REMOVE_LINE_FOR_USE_OF_SUBROUTINE */
91
/* Example: modify vertex coordinates */
92
/*------------------------------------*/
94
fvm_lnum_t n_selected_faces = 0;
95
fvm_lnum_t *selected_faces = NULL;
97
cs_real_t *i_face_cog = NULL, *i_face_normal = NULL;
99
/* example of multi-line character string */
101
const char criteria[] = "plane[0, -1, 0, 0.5, epsilon = 0.0001]"
102
" or plane[-1, 0, 0, 0.5, epsilon = 0.0001]";
104
cs_mesh_init_group_classes(mesh);
106
cs_mesh_quantities_i_faces(mesh, &i_face_cog, &i_face_normal);
108
cs_glob_mesh->select_i_faces = fvm_selector_create(mesh->dim,
116
BFT_MALLOC(selected_faces, mesh->n_i_faces, cs_int_t);
118
cs_selector_get_i_face_list(criteria,
121
cs_create_thinwall(mesh,
125
BFT_FREE(i_face_cog);
126
BFT_FREE(i_face_normal);
128
mesh->class_defs = fvm_group_class_set_destroy(mesh->class_defs);
129
fvm_selector_destroy(mesh->select_i_faces);
132
/*----------------------------------------------------------------------------*/