/*@@ @file ChooseOutput.c @author Gabrielle Allen @date July 6 2000 @desc Choose what data to write for different IO methods in IOHDF5 @enddesc @history @hauthor @hdesc @version $Header$ @@*/ #include #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" #include "CactusBase/IOUtil/src/ioGH.h" #include "ioFlexGH.h" static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusPUGHIO_IOHDF5_ChooseOutput_c) /*@@ @routine IOFlexIO_Choose2D @author Gabrielle Allen @date July 6 2000 @desc Use parameters to choose the 2D planes through the output data. @enddesc @history @hauthor @hdesc @version $Header$ @@*/ void IOFlexIO_Choose2D(CCTK_ARGUMENTS) { DECLARE_CCTK_PARAMETERS int i; int maxdim; flexioGH *myGH; /* FlexIO extension handle */ int *origin_index; /* Specify output planes by indices */ CCTK_REAL *origin_phys; /* Specify output planes by coordinates */ myGH = (flexioGH *) cctkGH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Set up lines to be output */ maxdim = CCTK_MaxDim(); origin_phys = (CCTK_REAL *)calloc(maxdim,sizeof(CCTK_REAL )); origin_index = (int *)calloc(maxdim,sizeof(int )); /* Set parameters using 1. Indices from IOFlexIO 2. Indices from IOUtil 3. Coords from IOFlexIO 4. Coords from IOUtil */ if (CCTK_ParameterQueryTimesSet("out2D_yzplane_xi","IOFlexIO")>0) { origin_index[0] = out2D_yzplane_xi; } else if (CCTK_ParameterQueryTimesSet("out_yzplane_xi","IOUtil")>0) { origin_index[0] = out_yzplane_xi; } else { origin_index[0] = -1; if (CCTK_ParameterQueryTimesSet("out2D_yzplane_x","IOFlexIO")>0) { origin_phys[0] = out2D_yzplane_x; } else { origin_phys[0] = out_yzplane_x; } } if (CCTK_ParameterQueryTimesSet("out2D_xzplane_yi","IOFlexIO")>0) { origin_index[1] = out2D_xzplane_yi; } else if (CCTK_ParameterQueryTimesSet("out_xzplane_yi","IOUtil")>0) { origin_index[1] = out_xzplane_yi; } else { origin_index[1] = -1; if (CCTK_ParameterQueryTimesSet("out2D_xzplane_y","IOFlexIO")>0) { origin_phys[1] = out2D_xzplane_y; } else { origin_phys[1] = out_xzplane_y; } } if (CCTK_ParameterQueryTimesSet("out2D_xyplane_zi","IOFlexIO")>0) { origin_index[2] = out2D_xyplane_zi; } else if (CCTK_ParameterQueryTimesSet("out_xyplane_zi","IOUtil")>0) { origin_index[2] = out_xyplane_zi; } else { origin_index[2] = -1; if (CCTK_ParameterQueryTimesSet("out2D_xyplane_z","IOFlexIO")>0) { origin_phys[2] = out2D_xyplane_z; } else { origin_phys[2] = out_xyplane_z; } } if (myGH) { for (i=1;i<=CCTK_MaxDim();i++) { IOUtil_2DPlanes (cctkGH, i, origin_index, origin_phys, myGH->sp2xyz[i-1]); } } else { CCTK_WARN(1,"IOFlexIO_Choose2D: FlexIO GH extension not found"); } return; }