40 void output_flow_field_init(
char *fname)
44 if(
OptGetBool(
"Output",
"Write_output_file",
"no") ==
false )
47 xprintf(
Msg,
"%s: Writing output files... %s ", __func__, fname);
49 out =
xfopen( fname,
"wt" );
51 xfprintf( out,
"1.0 0 %d\n",
sizeof(
double ) );
61 void output_flow_field_in_time(
struct Problem *problem,
double time)
63 Mesh* mesh = (
Mesh*) ConstantDB::getInstance()->getObject(MESH::MAIN_INSTANCE);
70 ASSERT(!( problem == NULL ),
"NULL as argument of function output_flow_field_in_time()\n");
71 if(
OptGetBool(
"Output",
"Write_output_file",
"no") ==
false )
74 xprintf(
Msg,
"%s: Writing output file %s ... ", __func__, problem->out_fname_2);
76 out =
xfopen( problem->out_fname_2,
"at" );
77 sprintf( dbl_fmt,
"%%.%dg ", ConstantDB::getInstance()->getInt(
"Out_digit"));
87 xfprintf( out, dbl_fmt, ele->scalar);
89 for (i = 0; i < ele->
n_sides; i++)
92 for (i = 0; i < ele->
n_sides; i++)
95 xfprintf( out,
"%d ", ele->n_neighs_vv);
96 for (i = 0; i < ele->n_neighs_vv; i++)
101 xfprintf( out,
"$EndFlowField\n\n" );
Header: The functions for all outputs.
#define FOR_ELEMENTS(_mesh_, __i)
int xfclose(FILE *stream)
FCLOSE WITH ERROR HANDLING.
int xfprintf(FILE *out, const char *fmt,...)
FPRINTF WITH ERROR HANDLING.
bool OptGetBool(const char *section, const char *key, const char *defval)
I/O functions with filename storing, able to track current line in opened file. All standard stdio fu...
unsigned int n_elements() const
unsigned int n_sides() const
SideIter side(const unsigned int loc_index)
FILE * xfopen(const std::string &fname, const char *mode)