My Project
programmer's documentation
fvm_to_catalyst.h
Go to the documentation of this file.
1 #ifndef __FVM_TO_CATALYST_H__
2 #define __FVM_TO_CATALYST_H__
3 
4 #if defined(HAVE_CATALYST)
5 
6 /*============================================================================
7  * Write a nodal representation associated with a mesh and associated
8  * variables to Catalyst objects
9  *============================================================================*/
10 
11 /*
12  This file is part of Code_Saturne, a general-purpose CFD tool.
13 
14  Copyright (C) 1998-2019 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 Catalyst object writer.
61  *
62  * Options are:
63  * private_comm use private MPI communicator (default: false)
64  * names=<fmt> use same naming rules as <fmt> format
65  * (default: ensight)
66  * input_name=<name> define input name (default: writer name)
67  *
68  * parameters:
69  * name <-- base output case name.
70  * options <-- whitespace separated, lowercase options list
71  * time_dependecy <-- indicates if and how meshes will change with time
72  * comm <-- associated MPI communicator.
73  *
74  * returns:
75  * pointer to opaque Catalyst writer structure.
76  *----------------------------------------------------------------------------*/
77 
78 #if defined(HAVE_MPI)
79 
80 void *
81 fvm_to_catalyst_init_writer(const char *name,
82  const char *path,
83  const char *options,
84  fvm_writer_time_dep_t time_dependency,
85  MPI_Comm comm);
86 
87 #else
88 
89 void *
90 fvm_to_catalyst_init_writer(const char *name,
91  const char *path,
92  const char *options,
93  fvm_writer_time_dep_t time_dependency);
94 
95 #endif
96 
97 /*----------------------------------------------------------------------------
98  * Finalize FVM to Catalyst object writer.
99  *
100  * parameters:
101  * this_writer_p <-- pointer to opaque Catalyst writer structure.
102  *
103  * returns:
104  * NULL pointer.
105  *----------------------------------------------------------------------------*/
106 
107 void *
108 fvm_to_catalyst_finalize_writer(void *this_writer_p);
109 
110 /*----------------------------------------------------------------------------
111  * Associate new time step with a Catalyst geometry.
112  *
113  * parameters:
114  * this_writer_p <-- pointer to associated writer
115  * time_step <-- time step number
116  * time_value <-- time_value number
117  *----------------------------------------------------------------------------*/
118 
119 void
120 fvm_to_catalyst_set_mesh_time(void *this_writer_p,
121  int time_step,
122  double time_value);
123 
124 /*----------------------------------------------------------------------------
125  * Write nodal mesh to a a Catalyst object
126  *
127  * parameters:
128  * this_writer_p <-- pointer to associated writer.
129  * mesh <-- pointer to nodal mesh structure that should be written.
130  *----------------------------------------------------------------------------*/
131 
132 void
133 fvm_to_catalyst_export_nodal(void *this_writer_p,
134  const fvm_nodal_t *mesh);
135 
136 /*----------------------------------------------------------------------------
137  * Write data to the MultiBlock aimed to be CoProcessed
138  *
139  * parameters:
140  * this_writer_p <-- pointer to associated writer
141  * ugrid <-- pointer to the vtkUnstructuredGrid
142  *----------------------------------------------------------------------------*/
143 
144 void
145 fvm_to_catalyst_export_field(void *this_writer_p,
146  const fvm_nodal_t *mesh,
147  const char *name,
148  fvm_writer_var_loc_t location,
149  int dimension,
150  cs_interlace_t interlace,
151  int n_parent_lists,
152  const cs_lnum_t parent_num_shift[],
153  cs_datatype_t datatype,
154  int time_step,
155  double time_value,
156  const void *const field_values[]);
157 
158 /*----------------------------------------------------------------------------
159  * Flush files associated with a given writer.
160  *
161  * In this case, the effective call to coprocessing is done.
162  *
163  * parameters:
164  * this_writer_p <-- pointer to associated writer
165  *----------------------------------------------------------------------------*/
166 
167 void
168 fvm_to_catalyst_flush(void *this_writer_p);
169 
170 /*----------------------------------------------------------------------------*/
171 
173 
174 #endif /* defined(HAVE_CATALYST) */
175 
176 #endif /* __FVM_TO_CATALYST_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