My Project
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  * Options are:
61  * dry_run trace output to <name>.log file, but do not
62  * actually communicate with Melissa server
63  * rank_step=<integer> MPI rank step
64  * trace trace output to <name>.log file
65  *
66  * parameters:
67  * name <-- base output case name.
68  * options <-- whitespace separated, lowercase options list
69  * time_dependecy <-- indicates if and how meshes will change with time
70  * comm <-- associated MPI communicator.
71  *
72  * returns:
73  * pointer to opaque Melissa output writer structure.
74  *----------------------------------------------------------------------------*/
75 
76 #if defined(HAVE_MPI)
77 
78 void *
79 fvm_to_melissa_init_writer(const char *name,
80  const char *path,
81  const char *options,
82  fvm_writer_time_dep_t time_dependency,
83  MPI_Comm comm);
84 
85 #else
86 
87 void *
88 fvm_to_melissa_init_writer(const char *name,
89  const char *path,
90  const char *options,
91  fvm_writer_time_dep_t time_dependency);
92 
93 #endif
94 
95 /*----------------------------------------------------------------------------
96  * Finalize FVM to Melissa output writer.
97  *
98  * parameters:
99  * this_writer_p <-- pointer to opaque Melissa writer structure.
100  *
101  * returns:
102  * NULL pointer.
103  *----------------------------------------------------------------------------*/
104 
105 void *
106 fvm_to_melissa_finalize_writer(void *this_writer_p);
107 
108 /*----------------------------------------------------------------------------
109  * Associate new time step with a Melissa geometry.
110  *
111  * parameters:
112  * this_writer_p <-- pointer to associated writer
113  * time_step <-- time step number
114  * time_value <-- time_value number
115  *----------------------------------------------------------------------------*/
116 
117 void
118 fvm_to_melissa_set_mesh_time(void *this_writer_p,
119  const int time_step,
120  const double time_value);
121 
122 /*----------------------------------------------------------------------------
123  * Indicate if a elements of a given type in a mesh associated to a given
124  * Melissa output writer need to be tesselated.
125  *
126  * parameters:
127  * this_writer_p <-- pointer to associated writer
128  * mesh <-- pointer to nodal mesh structure that should be written
129  * element_type <-- element type we are interested in
130  *
131  * returns:
132  * 1 if tesselation of the given element type is needed, 0 otherwise
133  *----------------------------------------------------------------------------*/
134 
135 int
136 fvm_to_melissa_needs_tesselation(void *this_writer_p,
137  const fvm_nodal_t *mesh,
138  fvm_element_t element_type);
139 
140 /*----------------------------------------------------------------------------
141  * Write nodal mesh to a Melissa output
142  *
143  * parameters:
144  * this_writer_p <-- pointer to associated writer.
145  * mesh <-- pointer to nodal mesh structure that should be written.
146  *----------------------------------------------------------------------------*/
147 
148 void
149 fvm_to_melissa_export_nodal(void *this_writer_p,
150  const fvm_nodal_t *mesh);
151 
152 /*----------------------------------------------------------------------------
153  * Write field associated with a nodal mesh to a Melissa output.
154  *
155  * Assigning a negative value to the time step indicates a time-independent
156  * field.
157  *
158  * Fields already exported by another Melissa writer will be ignored,
159  * as will fields already exported for the same or greater time step,
160  * or exported with a different time dependency.
161  * Use a different field name if you really need to output fields in such
162  * a configuration.
163  *
164  * parameters:
165  * writer <-- pointer to associated writer
166  * mesh <-- pointer to associated nodal mesh structure
167  * name <-- variable name
168  * location <-- variable definition location (nodes or elements)
169  * dimension <-- variable dimension (0: constant, 1: scalar,
170  * 3: vector, 6: sym. tensor, 9: asym. tensor)
171  * interlace <-- indicates if variable in memory is interlaced
172  * n_parent_lists <-- indicates if variable values are to be obtained
173  * directly through the local entity index (when 0) or
174  * through the parent entity numbers (when 1 or more)
175  * parent_num_shift <-- parent number to value array index shifts;
176  * size: n_parent_lists
177  * datatype <-- indicates the data type of (source) field values
178  * time_step <-- number of the current time step
179  * time_value <-- associated time value (ignored)
180  * field_values <-- array of associated field value arrays
181  *----------------------------------------------------------------------------*/
182 
183 void
184 fvm_to_melissa_export_field(void *this_writer_p,
185  const fvm_nodal_t *mesh,
186  const char *name,
187  fvm_writer_var_loc_t location,
188  int dimension,
189  cs_interlace_t interlace,
190  int n_parent_lists,
191  const cs_lnum_t parent_num_shift[],
192  cs_datatype_t datatype,
193  int time_step,
194  double time_value,
195  const void *const field_values[]);
196 
197 /*----------------------------------------------------------------------------*/
198 
200 
201 #endif /* __FVM_TO_MELISSA_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
fvm_to_melissa_export_nodal
void fvm_to_melissa_export_nodal(void *this_writer_p, const fvm_nodal_t *mesh)
Definition: fvm_to_melissa.c:528
mesh
Definition: mesh.f90:26
cs_datatype_t
cs_datatype_t
Definition: cs_defs.h:260
fvm_element_t
fvm_element_t
Definition: fvm_defs.h:48
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
fvm_to_melissa_export_field
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:567
cs_interlace_t
cs_interlace_t
Definition: cs_defs.h:439
fvm_nodal.h
fvm_to_melissa_finalize_writer
void * fvm_to_melissa_finalize_writer(void *this_writer_p)
Definition: fvm_to_melissa.c:470
fvm_to_melissa_needs_tesselation
int fvm_to_melissa_needs_tesselation(void *this_writer_p, const fvm_nodal_t *mesh, fvm_element_t element_type)
fvm_to_melissa_set_mesh_time
void fvm_to_melissa_set_mesh_time(void *this_writer_p, const int time_step, const double time_value)
Definition: fvm_to_melissa.c:510
fvm_defs.h
fvm_to_melissa_init_writer
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:301