writedata.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 static char const Id[] = "$Id: writedata.c 2962 2010-02-04 19:50:44Z scholz $\n\n";
00025 static char const Td[] = "$Today: " __FILE__ " " __DATE__ " " __TIME__ " $\n\n";
00026
00027 #include "magpario.h"
00028 #include "util/util.h"
00029 #ifdef ADDONS
00030 #include "addons/addons.h"
00031 #endif
00032 #ifdef PNG
00033 #include "png/writepng.h"
00034 #endif
00035
00036 int WriteSet(GridData *gdata)
00037 {
00038 MagparFunctionInfoBegin;
00039
00040 int rank,size;
00041 ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr);
00042 ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&rank);CHKERRQ(ierr);
00043
00044
00045 if (gdata->inp<0) MagparFunctionInfoReturn(0);
00046 int maxint=10000;
00047 if (gdata->inp>maxint) {
00048 PetscPrintf(PETSC_COMM_WORLD,
00049 "inp number reached maximum: %i\n"
00050 "no output files stored!\n",
00051 maxint
00052 );
00053 MagparFunctionInfoReturn(0);
00054 }
00055
00056
00057
00058
00059
00060 WriteAVS(gdata);
00061 ierr = WriteDat(gdata);CHKERRQ(ierr);
00062 #ifdef PNG
00063 ierr = WritePNG(gdata);CHKERRQ(ierr);
00064 ierr = WritePNG2(gdata);CHKERRQ(ierr);
00065 #endif
00066 #ifdef ADDONS
00067 ierr = WriteFld(gdata);CHKERRQ(ierr);
00068 #endif
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 gdata->inp=-(gdata->inp+1);
00081
00082 MagparFunctionInfoReturn(0);
00083 }
00084