src/fvm/fvm_to_ccm.h Source File

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fvm_to_ccm.h
Go to the documentation of this file.
1 #ifndef __FVM_TO_CCM_H__
2 #define __FVM_TO_CCM_H__
3
4 #if defined(HAVE_CCM)
5
6 /*============================================================================
7 * Write a nodal representation associated with a mesh and associated
8 * variables to CCM-IO files
9 *============================================================================*/
10
11 /*
12 This file is part of Code_Saturne, a general-purpose CFD tool.
13
14 Copyright (C) 1998-2013 EDF S.A.
15
16 This program is free software; you can redistribute it and/or modify it under
17 the terms of the GNU General Public License as published by the Free Software
18 Foundation; either version 2 of the License, or (at your option) any later
19 version.
20
21 This program is distributed in the hope that it will be useful, but WITHOUT
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
23 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
24 details.
25
26 You should have received a copy of the GNU General Public License along with
27 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
28 Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 /*----------------------------------------------------------------------------*/
32
33 #include "cs_defs.h"
34
35 /*----------------------------------------------------------------------------
36 * Local headers
37 *----------------------------------------------------------------------------*/
38
39 #include "fvm_defs.h"
40 #include "fvm_nodal.h"
41 #include "fvm_writer.h"
42
43 /*----------------------------------------------------------------------------*/
44
45 BEGIN_C_DECLS
46
47 /*=============================================================================
48 * Macro definitions
49 *============================================================================*/
50
51 /*============================================================================
52 * Type definitions
53 *============================================================================*/
54
55 /*=============================================================================
56 * Public function prototypes
57 *============================================================================*/
58
59 /*----------------------------------------------------------------------------
60 * Returns number of library version strings associated with the CCM-IO format.
61 *
62 * returns:
63 * number of library version strings associated with the CCM-IO format.
64 *----------------------------------------------------------------------------*/
65
66 int
67 fvm_to_ccm_n_version_strings(void);
68
69 /*----------------------------------------------------------------------------
70 * Returns a library version string associated with the CCM-IO format.
71 *
72 * In certain cases, when using dynamic libraries, fvm may be compiled
73 * with one library version, and linked with another. If both run-time
74 * and compile-time version information is available, this function
75 * will return the run-time version string by default.
76 *
77 * Setting the compile_time flag to 1, the compile-time version string
78 * will be returned if this is different from the run-time version.
79 * If the version is the same, or only one of the 2 version strings are
80 * available, a NULL character string will be returned with this flag set.
81 *
82 * parameters:
83 * string_index <-- index in format's version string list (0 to n-1)
84 * compile_time <-- 0 by default, 1 if we want the compile-time version
85 * string, if different from the run-time version.
86 *
87 * returns:
88 * pointer to constant string containing the library's version.
89 *----------------------------------------------------------------------------*/
90
91 const char *
92 fvm_to_ccm_version_string(int string_index,
93 int compile_time_version);
94
95 /*----------------------------------------------------------------------------
96 * Initialize FVM to CCM-IO file writer.
97 *
98 * parameters:
99 * name <-- base output case name.
100 * options <-- whitespace separated, lowercase options list
101 * time_dependecy <-- indicates if and how meshes will change with time
102 * comm <-- associated MPI communicator.
103 *
104 * returns:
105 * pointer to opaque CCM-IO writer structure.
106 *----------------------------------------------------------------------------*/
107
108 #if defined(HAVE_MPI)
109
110 void *
111 fvm_to_ccm_init_writer(const char *name,
112 const char *path,
113 const char *options,
114 fvm_writer_time_dep_t time_dependency,
115 MPI_Comm comm);
116
117 #else
118
119 void *
120 fvm_to_ccm_init_writer(const char *name,
121 const char *path,
122 const char *options,
123 fvm_writer_time_dep_t time_dependency);
124
125 #endif
126
127 /*----------------------------------------------------------------------------
128 * Finalize FVM to CCM-IO file writer.
129 *
130 * parameters:
131 * this_writer_p <-- pointer to opaque CCM-IO writer structure.
132 *
133 * returns:
134 * NULL pointer.
135 *----------------------------------------------------------------------------*/
136
137 void *
138 fvm_to_ccm_finalize_writer(void *this_writer_p);
139
140 /*----------------------------------------------------------------------------
141 * Associate new time step with a CCM-IO geometry.
142 *
143 * parameters:
144 * this_writer_p <-- pointer to associated writer
145 * time_step <-- time step number
146 * time_value <-- time_value number
147 *----------------------------------------------------------------------------*/
148
149 void
150 fvm_to_ccm_set_mesh_time(void *this_writer_p,
151 int time_step,
152 double time_value);
153
154 /*----------------------------------------------------------------------------
155 * Indicate if elements of a given type in a mesh associated with a given
156 * CCM-IO file writer need to be tesselated.
157 *
158 * parameters:
159 * this_writer_p <-- pointer to associated writer
160 * mesh <-- pointer to nodal mesh structure that should be written
161 * element_type <-- element type we are interested in
162 *
163 * returns:
164 * always 0 for this format.
165 *----------------------------------------------------------------------------*/
166
167 int
168 fvm_to_ccm_needs_tesselation(fvm_writer_t *this_writer_p,
169 const fvm_nodal_t *mesh,
170 fvm_element_t element_type);
171
172 /*----------------------------------------------------------------------------
173 * Write nodal mesh to a CCM-IO file
174 *
175 * parameters:
176 * this_writer_p <-- pointer to associated writer.
177 * mesh <-- pointer to nodal mesh structure that should be written.
178 *----------------------------------------------------------------------------*/
179
180 void
181 fvm_to_ccm_export_nodal(void *this_writer_p,
182 const fvm_nodal_t *mesh);
183
184 /*----------------------------------------------------------------------------
185 * Write field associated with a nodal mesh to a CCM-IO file.
186 *
187 * Assigning a negative value to the time step indicates a time-independent
188 * field (in which case the time_value argument is unused).
189 *
190 * parameters:
191 * this_writer_p <-- pointer to associated writer
192 * mesh <-- pointer to associated nodal mesh structure
193 * name <-- variable name
194 * location <-- variable definition location (nodes or elements)
195 * dimension <-- variable dimension (0: constant, 1: scalar,
196 * 3: vector, 6: sym. tensor, 9: asym. tensor)
197 * interlace <-- indicates if variable in memory is interlaced
198 * n_parent_lists <-- indicates if variable values are to be obtained
199 * directly through the local entity index (when 0) or
200 * through the parent entity numbers (when 1 or more)
201 * parent_num_shift <-- parent number to value array index shifts;
202 * size: n_parent_lists
203 * datatype <-- indicates the data type of (source) field values
204 * time_step <-- number of the current time step
205 * time_value <-- associated time value
206 * field_values <-- array of associated field value arrays
207 *----------------------------------------------------------------------------*/
208
209 void
210 fvm_to_ccm_export_field(void *this_writer_p,
211 const fvm_nodal_t *mesh,
212 const char *name,
213 fvm_writer_var_loc_t location,
214 int dimension,
215 cs_interlace_t interlace,
216 int n_parent_lists,
217 const cs_lnum_t parent_num_shift[],
218 cs_datatype_t datatype,
219 int time_step,
220 double time_value,
221 const void *const field_values[]);
222
223 /*----------------------------------------------------------------------------*/
224
225 END_C_DECLS
226
227 #endif /* HAVE_CCM */
228
229 #endif /* __FVM_TO_CCM_H__ */