My Project
programmer's documentation
fvm_to_medcoupling.h
Go to the documentation of this file.
1 #ifndef __FVM_TO_MEDCOUPLING_H__
2 #define __FVM_TO_MEDCOUPLING_H__
3 
4 #if defined(HAVE_MEDCOUPLING)
5 
6 /*============================================================================
7  * Write a nodal representation associated with a mesh and associated
8  * variables to MEDCoupling objects
9  *============================================================================*/
10 
11 /*
12  This file is part of Code_Saturne, a general-purpose CFD tool.
13 
14  Copyright (C) 2005-2016 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 
46 
47 /*=============================================================================
48  * Macro definitions
49  *============================================================================*/
50 
51 /*============================================================================
52  * Type definitions
53  *============================================================================*/
54 
55 /*=============================================================================
56  * Public function prototypes
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------
60  * Initialize FVM to MEDCoupling object writer.
61  *
62  * No options are available for this format.
63  *
64  * parameters:
65  * name <-- base output case name.
66  * options <-- whitespace separated, lowercase options list
67  * time_dependecy <-- indicates if and how meshes will change with time
68  * comm <-- associated MPI communicator.
69  *
70  * returns:
71  * pointer to opaque MEDCoupling writer structure.
72  *----------------------------------------------------------------------------*/
73 
74 #if defined(HAVE_MPI)
75 
76 void *
77 fvm_to_medcoupling_init_writer(const char *name,
78  const char *path,
79  const char *options,
80  fvm_writer_time_dep_t time_dependency,
81  MPI_Comm comm);
82 
83 #else
84 
85 void *
86 fvm_to_medcoupling_init_writer(const char *name,
87  const char *path,
88  const char *options,
89  fvm_writer_time_dep_t time_dependency);
90 
91 #endif
92 
93 /*----------------------------------------------------------------------------
94  * Finalize FVM to MEDCoupling object writer.
95  *
96  * parameters:
97  * this_writer_p <-- pointer to opaque MEDCoupling writer structure.
98  *
99  * returns:
100  * NULL pointer.
101  *----------------------------------------------------------------------------*/
102 
103 void *
104 fvm_to_medcoupling_finalize_writer(void *this_writer_p);
105 
106 /*----------------------------------------------------------------------------
107  * Associate new time step with a MEDCoupling geometry.
108  *
109  * parameters:
110  * this_writer_p <-- pointer to associated writer
111  * time_step <-- time step number
112  * time_value <-- time_value number
113  *----------------------------------------------------------------------------*/
114 
115 void
116 fvm_to_medcoupling_set_mesh_time(void *this_writer_p,
117  const int time_step,
118  const double time_value);
119 
120 /*----------------------------------------------------------------------------
121  * Write nodal mesh to a a MEDCoupling object
122  *
123  * parameters:
124  * this_writer_p <-- pointer to associated writer.
125  * mesh <-- pointer to nodal mesh structure that should be written.
126  *----------------------------------------------------------------------------*/
127 
128 void
129 fvm_to_medcoupling_export_nodal(void *this_writer_p,
130  const fvm_nodal_t *mesh);
131 
132 /*----------------------------------------------------------------------------
133  * Write field associated with a nodal mesh to a MEDCoupling object.
134  *
135  * Assigning a negative value to the time step indicates a time-independent
136  * field (in which case the time_value argument is unused).
137  *
138  * parameters:
139  * this_writer_p <-- pointer to associated writer
140  * mesh <-- pointer to associated nodal mesh structure
141  * name <-- variable name
142  * location <-- variable definition location (nodes or elements)
143  * dimension <-- variable dimension (0: constant, 1: scalar,
144  * 3: vector, 6: sym. tensor, 9: asym. tensor)
145  * interlace <-- indicates if variable in memory is interlaced
146  * n_parent_lists <-- indicates if variable values are to be obtained
147  * directly through the local entity index (when 0) or
148  * through the parent entity numbers (when 1 or more)
149  * parent_num_shift <-- parent number to value array index shifts;
150  * size: n_parent_lists
151  * datatype <-- indicates the data type of (source) field values
152  * time_step <-- number of the current time step
153  * time_value <-- associated time value
154  * field_values <-- array of associated field value arrays
155  *----------------------------------------------------------------------------*/
156 
157 void
158 fvm_to_medcoupling_export_field(void *this_writer_p,
159  const fvm_nodal_t *mesh,
160  const char *name,
161  fvm_writer_var_loc_t location,
162  int dimension,
163  cs_interlace_t interlace,
164  int n_parent_lists,
165  const cs_lnum_t parent_num_shift[],
166  cs_datatype_t datatype,
167  int time_step,
168  double time_value,
169  const void *const field_values[]);
170 
171 /*----------------------------------------------------------------------------
172  * Flush files associated with a given writer.
173  *
174  * In this case, the effective call to coprocessing is done.
175  *
176  * parameters:
177  * this_writer_p <-- pointer to associated writer
178  *----------------------------------------------------------------------------*/
179 
180 void
181 fvm_to_medcoupling_flush(void *this_writer_p);
182 
183 /*----------------------------------------------------------------------------*/
184 
186 
187 #endif /* defined(HAVE_MEDCOUPLING) */
188 
189 #endif /* __FVM_TO_MEDCOUPLING_H__ */
fvm_writer_var_loc_t
fvm_writer_var_loc_t
Definition: fvm_writer.h:69
cs_defs.h
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
fvm_writer.h
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
mesh
Definition: mesh.f90:26
cs_datatype_t
cs_datatype_t
Definition: cs_defs.h:260
fvm_writer_time_dep_t
fvm_writer_time_dep_t
Definition: fvm_writer.h:57
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_interlace_t
cs_interlace_t
Definition: cs_defs.h:439
fvm_nodal.h
fvm_defs.h