static int _init_join_writer(void) { int writer_id = cs_post_get_free_writer_id(); /* Special case for Catalyst: if matching co-processing script is not available, revert to EnSight Gold format */ int default_format_id = fvm_writer_get_format_id(cs_post_get_default_format()); if (default_format_id == fvm_writer_get_format_id("Catalyst")) { if (! cs_file_isreg("error.py")) return 0; } cs_post_define_writer(writer_id, "joining", "postprocessing", fvm_writer_format_name(default_format_id), cs_post_get_default_format_options(), FVM_WRITER_FIXED_MESH, false, -1, -1.0); return writer_id; }
BEGIN_C_DECLS /*============================================================================ * User function definitions *============================================================================*/ /*---------------------------------------------------------------------------- * Define post-processing writers. * * The default output format and frequency may be configured, and additional * post-processing writers allowing outputs in different formats or with * different format options and output frequency than the main writer may * be defined. *----------------------------------------------------------------------------*/ void cs_user_postprocess_writers(void) { /* Every writer has a a strictly positive or negative id. Negative ids * are for predefined writers, positive ids for user writers. * All predefined writers use the settings from writer -1, and * redefining that writer here allows changing from the default or GUI * settings. * * Defining or configuring a writer is done by calling the * cs_post_define_writer() function, whose arguments are: * writer_id <-- number of writer to create (< 0 reserved, > 0 for user) * case_name <-- associated case name * dir_name <-- associated directory name * fmt_name <-- associated format name * fmt_opts <-- associated format options string * time_dep <-- FVM_WRITER_FIXED_MESH if mesh definitions are fixed, * FVM_WRITER_TRANSIENT_COORDS if coordinates change, * FVM_WRITER_TRANSIENT_CONNECT if connectivity changes * output_at_end <-- force output at calculation end if not 0 * frequency_n <-- default output frequency in time-steps, or < 0 * frequency_t <-- default output frequency in seconds, or < 0 * (has priority over frequency_n) * * Allowed output format names: "EnSight Gold", "MED", or "CGNS". * (EnSight output is built-in; MED or CGNS are only available if the * code was built with these optional libraries) * * An output options string may contain options (separated by whitespace * or commas) from the following list: * 'text' (text format, for EnSight) * 'big_endian' (forces binary EnSight output to 'big-endian' mode) * 'discard_polygons' (ignore polygon-type faces) * 'discard_polyhedra' (ignore polyhedron-type cells) * 'divide_polygons' (subdivides polygon-type faces) * 'divide_polyhedra' (subdivides polyhedron-type cells) * 'split_tensors' (writes tensors as separate scalars) */ /* Default writer time dependency */ fvm_writer_time_dep_t time_dep = FVM_WRITER_FIXED_MESH; /* Default time step or physical time based output frequencies */ cs_bool_t output_at_end = true; int ntchr = -1; double frchr = -1.0; /* Default output format and options */ const char format_name[] = "EnSight Gold"; const char format_options[] = ""; /* Define default writer */ /* --------------------- */ if (false) cs_post_define_writer(-1, /* writer_id */ "results", /* writer name */ "postprocessing", /* directory name */ format_name, format_options, time_dep, output_at_end, ntchr, frchr); /* Define additional writers */ /* ------------------------- */ if (false) cs_post_define_writer(1, /* writer_id */ "user", /* writer name */ "postprocessing", /* directory name */ "EnSight Gold", /* format name */ "binary, discard_polygons, discard_polyhedra", time_dep, output_at_end, ntchr, frchr); if (false) cs_post_define_writer(2, /* writer_id */ "user_txt", /* writer name */ "postprocessing", /* directory name */ "ensight", /* format name */ "text, divide_polyhedra", time_dep, /* modification flag */ output_at_end, ntchr, frchr); if (false) cs_post_define_writer(3, /* writer_id */ "modif", /* writer name */ "postprocessing", /* directory name */ "ensight", /* format name */ "discard_polyhedra", FVM_WRITER_TRANSIENT_CONNECT, false, 3, frchr); if (false) cs_post_define_writer(4, /* writer_id */ "exchange", /* writer name */ "postprocessing", /* directory name */ "MED", /* format name */ "", /* format options */ FVM_WRITER_TRANSIENT_COORDS, /* modification flag */ false, ntchr, frchr); }