programmer's documentation
fvm_to_melissa.h
Go to the documentation of this file.
1 #ifndef __FVM_TO_MELISSA_H__
2 #define __FVM_TO_MELISSA_H__
3 
4 /*============================================================================
5  * Write a nodal representation associated with a mesh and associated
6  * variables to Melissa daemon output.
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2019 EDF S.A.
13 
14  This program is free software; you can redistribute it and/or modify it under
15  the terms of the GNU General Public License as published by the Free Software
16  Foundation; either version 2 of the License, or (at your option) any later
17  version.
18 
19  This program is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22  details.
23 
24  You should have received a copy of the GNU General Public License along with
25  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26  Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 */
28 
29 /*----------------------------------------------------------------------------*/
30 
31 #include "cs_defs.h"
32 
33 /*----------------------------------------------------------------------------
34  * Local headers
35  *----------------------------------------------------------------------------*/
36 
37 #include "fvm_defs.h"
38 #include "fvm_nodal.h"
39 #include "fvm_writer.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*=============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 /*=============================================================================
54  * Public function prototypes
55  *============================================================================*/
56 
57 /*----------------------------------------------------------------------------
58  * Initialize FVM to Melissa output writer.
59  *
60  * No options are currently handled
61  *
62  * parameters:
63  * name <-- base output case name.
64  * options <-- whitespace separated, lowercase options list
65  * time_dependecy <-- indicates if and how meshes will change with time
66  * comm <-- associated MPI communicator.
67  *
68  * returns:
69  * pointer to opaque Melissa output writer structure.
70  *----------------------------------------------------------------------------*/
71 
72 #if defined(HAVE_MPI)
73 
74 void *
75 fvm_to_melissa_init_writer(const char *name,
76  const char *path,
77  const char *options,
78  fvm_writer_time_dep_t time_dependency,
79  MPI_Comm comm);
80 
81 #else
82 
83 void *
84 fvm_to_melissa_init_writer(const char *name,
85  const char *path,
86  const char *options,
87  fvm_writer_time_dep_t time_dependency);
88 
89 #endif
90 
91 /*----------------------------------------------------------------------------
92  * Finalize FVM to Melissa output writer.
93  *
94  * parameters:
95  * this_writer_p <-- pointer to opaque Cp_Stat Gold writer structure.
96  *
97  * returns:
98  * NULL pointer.
99  *----------------------------------------------------------------------------*/
100 
101 void *
102 fvm_to_melissa_finalize_writer(void *this_writer_p);
103 
104 /*----------------------------------------------------------------------------
105  * Associate new time step with an Cp_Stat geometry.
106  *
107  * parameters:
108  * this_writer_p <-- pointer to associated writer
109  * time_step <-- time step number
110  * time_value <-- time_value number
111  *----------------------------------------------------------------------------*/
112 
113 void
114 fvm_to_melissa_set_mesh_time(void *this_writer_p,
115  const int time_step,
116  const double time_value);
117 
118 /*----------------------------------------------------------------------------
119  * Indicate if a elements of a given type in a mesh associated to a given
120  * Melissa output writer need to be tesselated.
121  *
122  * parameters:
123  * this_writer_p <-- pointer to associated writer
124  * mesh <-- pointer to nodal mesh structure that should be written
125  * element_type <-- element type we are interested in
126  *
127  * returns:
128  * 1 if tesselation of the given element type is needed, 0 otherwise
129  *----------------------------------------------------------------------------*/
130 
131 int
132 fvm_to_melissa_needs_tesselation(void *this_writer_p,
133  const fvm_nodal_t *mesh,
134  fvm_element_t element_type);
135 
136 /*----------------------------------------------------------------------------
137  * Write nodal mesh to a a Melissa output
138  *
139  * parameters:
140  * this_writer_p <-- pointer to associated writer.
141  * mesh <-- pointer to nodal mesh structure that should be written.
142  *----------------------------------------------------------------------------*/
143 
144 void
145 fvm_to_melissa_export_nodal(void *this_writer_p,
146  const fvm_nodal_t *mesh);
147 
148 /*----------------------------------------------------------------------------
149  * Write field associated with a nodal mesh to a Melissa output.
150  *
151  * Assigning a negative value to the time step indicates a time-independent
152  * field (in which case the time_value argument is unused).
153  *
154  * parameters:
155  * writer <-- pointer to associated writer
156  * mesh <-- pointer to associated nodal mesh structure
157  * name <-- variable name
158  * location <-- variable definition location (nodes or elements)
159  * dimension <-- variable dimension (0: constant, 1: scalar,
160  * 3: vector, 6: sym. tensor, 9: asym. tensor)
161  * interlace <-- indicates if variable in memory is interlaced
162  * n_parent_lists <-- indicates if variable values are to be obtained
163  * directly through the local entity index (when 0) or
164  * through the parent entity numbers (when 1 or more)
165  * parent_num_shift <-- parent number to value array index shifts;
166  * size: n_parent_lists
167  * datatype <-- indicates the data type of (source) field values
168  * time_step <-- number of the current time step
169  * time_value <-- associated time value
170  * field_values <-- array of associated field value arrays
171  *----------------------------------------------------------------------------*/
172 
173 void
174 fvm_to_melissa_export_field(void *this_writer_p,
175  const fvm_nodal_t *mesh,
176  const char *name,
177  fvm_writer_var_loc_t location,
178  int dimension,
179  cs_interlace_t interlace,
180  int n_parent_lists,
181  const cs_lnum_t parent_num_shift[],
182  cs_datatype_t datatype,
183  int time_step,
184  double time_value,
185  const void *const field_values[]);
186 
187 /*----------------------------------------------------------------------------*/
188 
190 
191 #endif /* __FVM_TO_MELISSA_H__ */
cs_datatype_t
Definition: cs_defs.h:260
void * fvm_to_melissa_init_writer(const char *name, const char *path, const char *options, fvm_writer_time_dep_t time_dependency)
Definition: fvm_to_melissa.c:436
void fvm_to_melissa_set_mesh_time(void *this_writer_p, const int time_step, const double time_value)
Definition: fvm_to_melissa.c:551
fvm_writer_var_loc_t
Definition: fvm_writer.h:69
cs_interlace_t
Definition: cs_defs.h:439
int fvm_to_melissa_needs_tesselation(void *this_writer_p, const fvm_nodal_t *mesh, fvm_element_t element_type)
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
fvm_writer_time_dep_t
Definition: fvm_writer.h:57
fvm_element_t
Definition: fvm_defs.h:48
void fvm_to_melissa_export_nodal(void *this_writer_p, const fvm_nodal_t *mesh)
Definition: fvm_to_melissa.c:571
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
void fvm_to_melissa_export_field(void *this_writer_p, const fvm_nodal_t *mesh, const char *name, fvm_writer_var_loc_t location, int dimension, cs_interlace_t interlace, int n_parent_lists, const cs_lnum_t parent_num_shift[], cs_datatype_t datatype, int time_step, double time_value, const void *const field_values[])
Definition: fvm_to_melissa.c:603
#define END_C_DECLS
Definition: cs_defs.h:468
Definition: mesh.f90:26
void * fvm_to_melissa_finalize_writer(void *this_writer_p)
Definition: fvm_to_melissa.c:527