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-2015 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  *
67  * parameters:
68  * name <-- base output case name.
69  * options <-- whitespace separated, lowercase options list
70  * time_dependecy <-- indicates if and how meshes will change with time
71  * comm <-- associated MPI communicator.
72  *
73  * returns:
74  * pointer to opaque Catalyst writer structure.
75  *----------------------------------------------------------------------------*/
76 
77 #if defined(HAVE_MPI)
78 
79 void *
80 fvm_to_catalyst_init_writer(const char *name,
81  const char *path,
82  const char *options,
83  fvm_writer_time_dep_t time_dependency,
84  MPI_Comm comm);
85 
86 #else
87 
88 void *
89 fvm_to_catalyst_init_writer(const char *name,
90  const char *path,
91  const char *options,
92  fvm_writer_time_dep_t time_dependency);
93 
94 #endif
95 
96 /*----------------------------------------------------------------------------
97  * Finalize FVM to Catalyst object writer.
98  *
99  * parameters:
100  * this_writer_p <-- pointer to opaque Catalyst writer structure.
101  *
102  * returns:
103  * NULL pointer.
104  *----------------------------------------------------------------------------*/
105 
106 void *
107 fvm_to_catalyst_finalize_writer(void *this_writer_p);
108 
109 /*----------------------------------------------------------------------------
110  * Associate new time step with a Catalyst geometry.
111  *
112  * parameters:
113  * this_writer_p <-- pointer to associated writer
114  * time_step <-- time step number
115  * time_value <-- time_value number
116  *----------------------------------------------------------------------------*/
117 
118 void
119 fvm_to_catalyst_set_mesh_time(void *this_writer_p,
120  int time_step,
121  double time_value);
122 
123 /*----------------------------------------------------------------------------
124  * Write nodal mesh to a a Catalyst object
125  *
126  * parameters:
127  * this_writer_p <-- pointer to associated writer.
128  * mesh <-- pointer to nodal mesh structure that should be written.
129  *----------------------------------------------------------------------------*/
130 
131 void
132 fvm_to_catalyst_export_nodal(void *this_writer_p,
133  const fvm_nodal_t *mesh);
134 
135 /*----------------------------------------------------------------------------
136  * Write data to the MultiBlock aimed to be CoProcessed
137  *
138  * parameters:
139  * this_writer_p <-- pointer to associated writer
140  * ugrid <-- pointer to the vtkUnstructuredGrid
141  *----------------------------------------------------------------------------*/
142 
143 void
144 fvm_to_catalyst_export_field(void *this_writer_p,
145  const fvm_nodal_t *mesh,
146  const char *name,
147  fvm_writer_var_loc_t location,
148  int dimension,
149  cs_interlace_t interlace,
150  int n_parent_lists,
151  const cs_lnum_t parent_num_shift[],
152  cs_datatype_t datatype,
153  int time_step,
154  double time_value,
155  const void *const field_values[]);
156 
157 /*----------------------------------------------------------------------------
158  * Flush files associated with a given writer.
159  *
160  * In this case, the effective call to coprocessing is done.
161  *
162  * parameters:
163  * this_writer_p <-- pointer to associated writer
164  *----------------------------------------------------------------------------*/
165 
166 void
167 fvm_to_catalyst_flush(void *this_writer_p);
168 
169 /*----------------------------------------------------------------------------*/
170 
172 
173 #endif /* defined(HAVE_CATALYST) */
174 
175 #endif /* __FVM_TO_CATALYST_H__ */
cs_datatype_t
Definition: cs_defs.h:255
fvm_writer_var_loc_t
Definition: fvm_writer.h:69
cs_interlace_t
Definition: cs_defs.h:411
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
fvm_writer_time_dep_t
Definition: fvm_writer.h:57
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
#define END_C_DECLS
Definition: cs_defs.h:430
Definition: mesh.f90:26