39 stringstream log_name;
41 if ( log_filename ==
"//" ) {
59 PetscErrorCode ApplicationBase::petscvfprintf(FILE *fd,
const char format[], va_list Argp) {
63 if (fd != stdout && fd != stderr) {
64 ierr = PetscVFPrintfDefault(fd,format,Argp); CHKERRQ(ierr);
66 const int buf_size = 65000;
69 ierr = PetscVSNPrintf(buff,buf_size,format,&length,Argp);CHKERRQ(ierr);
74 PetscFunctionReturn(0);
82 PetscVFPrintf = this->petscvfprintf;
86 PetscInitialize(&argc,&argv,PETSC_NULL,PETSC_NULL);
100 PetscErrorCode ierr=0;
102 ierr = PetscFinalize(); CHKERRQ(ierr);
void system_init(MPI_Comm comm, const string &log_filename)
virtual ~ApplicationBase()
Destructor.
virtual void parse_cmd_line(const int argc, char **argv)
int xfclose(FILE *stream)
FCLOSE WITH ERROR HANDLING.
static bool petsc_initialized
static FILE * petsc_output_
File handler for redirecting PETSc output.
string petsc_redirect_file_
void init(int argc, char **argv)
Dedicated class for storing path to input and output files.
void petsc_initialize(int argc, char **argv)
ApplicationBase(int argc, char **argv)
static void init()
initialize XIO library
FILE * xfopen(const std::string &fname, const char *mode)