pencil.sim.remesh ================= .. py:module:: pencil.sim.remesh .. autoapi-nested-parse:: Remesh mature simulation snapshot with [nx,ny,nz] dimensions onto new simulation with new grid dimensions and optionally alternate cpu layout copying the base simulation files, existing start output files. uses: local_remesh to apply the interpolation onto a variable array get_dstgrid to derive the new grid layout src2dst_remesh to create the new simulation object and files Attributes ---------- .. autoapisummary:: pencil.sim.remesh.lnml Functions --------- .. autoapisummary:: pencil.sim.remesh.local_remesh pencil.sim.remesh.get_dstgrid pencil.sim.remesh.src2dst_remesh Module Contents --------------- .. py:data:: lnml :value: True .. py:function:: local_remesh(var, xsrc, ysrc, zsrc, xdst, ydst, zdst, quiet=True, kind='linear') local_remesh(var, xsrc, ysrc, zsrc, xdst, ydst, zdst, quiet=True, kind="linear") :param var: Snapshot scalar numpy array of shape [mz, my, mx]. :type var: np.array :param xsrc: Grid x, y, z arrays from source simulation. :type xsrc: ndarrays :param ysrc: Grid x, y, z arrays from source simulation. :type ysrc: ndarrays :param zsrc: Grid x, y, z arrays from source simulation. :type zsrc: ndarrays :param xdst: Grid x, y, z arrays for destination simulation. :type xdst: ndarrays :param ydst: Grid x, y, z arrays for destination simulation. :type ydst: ndarrays :param zdst: Grid x, y, z arrays for destination simulation. :type zdst: ndarrays :param kind: interpolation method :type kind: string :param quiet: Flag for switching of output. :type quiet: bool :param Useage: grid of alternate shape :type Useage: interpolate a 3D data array of arbitrary shape onto an equivalent .. py:function:: get_dstgrid(srch5, srcsim, dsth5, dstsim, ncpus=[1, 1, 1], nxyz=None, multxyz=[2, 2, 2], fracxyz=[1, 1, 1], srcghost=3, dstghost=3, dtype=np.float64, lsymmetric=True, quiet=True, dstprecision=[b'D'], srcchunks=None) get_dstgrid(srch5, srcsim, dsth5, dstsim, ncpus=[1,1,1], multxyz=[2,2,2], nxyz=None, fracxyz=[1,1,1], srcghost=3, dstghost=3, dtype=np.float64, lsymmetric=True, quiet=True, dstprecision=[b"D"], srchunks=srchunks) :param srch5: hdf5 object from source simulation. :type srch5: obj :param srcsim: src simulation object :type srcsim: simulation object :param dsth5: hdf5 object for destination simulation data. :type dsth5: obj :param dstsim: dst simulation object :type dstsim: simulation object :param ncpus: Array of nprocx, nprocy, and nprocz to apply for new simulation. :type ncpus: int :param nxyz: integer list of lenght 3 with new size of grid excluding ghosts. :type nxyz: bool :param multxyz: Factors by which to multiply old sim dimensions yxz order. :type multxyz: list :param fracxyz: Factors by which to divide old sim dimensions yxz order. :type fracxyz: list :param srcghost: Number of ghost zones from the source order of accuracy (mx-nx)/2 :type srcghost: int :param dstghost: Number of ghost zones for the destination order of accuracy (mx-nx)/2 :type dstghost: int :param dtype: Precision used in destination simulation. Default double. :type dtype: 'string' :param lsymmetric: Option to make non-periodic grid symmetric about old sim centre. Otherwise the lower boundary is retained from old sim grid. :type lsymmetric: bool :param quiet: Flag for switching of output. :type quiet: bool :param dstprecision: floating point precision of new simulation grid. :param srcchunks: list of index limits [l[0]:l[1],m[0]:m[1],n[0]:n[1]] for subdomain remesh :type srcchunks: bool .. py:function:: src2dst_remesh(src=None, dst=None, h5in='var.h5', h5out='var.h5', nxyz=None, multxyz=[2, 2, 2], fracxyz=[1, 1, 1], srcchunks=None, srcghost=3, dstghost=3, srcdatadir='data/allprocs', dstdatadir='data/allprocs', dstprecision=[b'D'], lsymmetric=True, quiet=True, kind='linear', check_grid=True, optionals=True, nmin=32, rename_submit_script=False, MBmin=64.0, ncpus=[1, 1, 1], start_optionals=False, hostfile=None, submit_new=False, chunksize=5000.0, lfs=False, MB=32, count=1, size=1, rank=0, comm=None, farray=None, index_farray=None, datasets='all', remesh=True, newtime=None) src2dst_remesh(src=None, dst=None, h5in='var.h5', h5out='var.h5', nxyz=None, multxyz=[2, 2, 2], fracxyz=[1, 1, 1], srcchunks=None, srcghost=3, dstghost=3, srcdatadir='data/allprocs', dstdatadir='data/allprocs', dstprecision=[b'D'], lsymmetric=True, quiet=True, kind="linear", check_grid=True, OVERWRITE=False, optionals=True, nmin=32, rename_submit_script=False, MBmin=5.0, ncpus=[1, 1, 1], start_optionals=False, hostfile=None, submit_new=False, chunksize=1000.0, lfs=False, MB=1, count=1, size=1, rank=0, comm=None, farray=None, index_farray=None, datasets='all', remesh=True) :param src: Source relative or absolute path to source simulation. :type src: string :param dst: Destination relative or absolute path to destination simulation. :type dst: string :param h5in: Source simulation data file to be copied and remeshed. :type h5in: string :param h5out: Destination simulation file to be written. :type h5out: string :param nxyz: If not None a list of 3 integers [nx, ny, nz] defining the size of the destination domain :type nxyz: list :param multxyz: Factors by which to multiply old sim dimensions xyz order. :type multxyz: list :param fracxyz: Factors by which to divide old sim dimensions xyz order. :type fracxyz: list :param srcghost: Number of ghost zones from the source order of accuracy (mx-nx)/2. :type srcghost: int :param dstghost: Number of ghost zones for the destination order of accuracy (mx-nx)/2. :type dstghost: int :param srcdatadir: Path from source simulation directory to data. :type srcdatadir: string :param dstdatadir: Path from destination simulation directory to data. :param dstprecision: Floating point precision settings [b'S'] or [b'D']. :type dstprecision: string :param lsymmetric: Option to make non-periodic grid symmetric about old sim centre. Otherwise the lower boundary is retained from old sim grid. :type lsymmetric: bool :param quiet: Flag for switching of output. :type quiet: bool :param check_grid: Flag to run check on grid and cpu layout before executing remesh. :type check_grid: bool :param OVERWRITE: Flag to overwrite existing simulation directory and filesin dst. :type OVERWRITE: bool :param optionals: Copy simulation files with True or specify list of names (string) for additional files from src sim directory. :type optionals: bool :param nmin: Minimum length along coordinate after splitting by proc. :type nmin: int :param rename_submit_script: Edit lines in submission files vcopied from src to dst. Not yet operational. :type rename_submit_script: bool :param MBmin: Minimum size in MB of data on a sinlge proc pf ncpus total processes. :type MBmin: float :param ncpus: Array of nprocx, nprocy, and nprocz to apply for new simulation. :type ncpus: ndarray :param start_optionals: Copy simulation files output by start.x with True or specify list of names (string) for additional files from src sim data directory. :type start_optionals: bool :param hostfile: Specify name of host config file argument in pc_build. Not yet operational. :type hostfile: string :param submit_new: Execute changes to submission files, compile and run simulation. Not yet operational. :type submit_new: bool :param chunksize: Size in megabytes of snapshot variable before chunked remesh is used. :type chunksize: float :param lfs: Flag to set the striping for large file sizes to improve IO efficiency. :type lfs: bool :param MB: Size of data to write contiguously before moving to new OST on lustre. :type MB: float :param count: Number of OSTs across which the data will be shared for IO operations. :type count: int :param size: Number of MPI processes :type size: int :param rank: ID of processor :type rank: int :param comm: MPI library calls :param farray: Select subset of the farray from src. :type farray: string list :param index_farray: set of index at which interpolation shall start :type index_farray: integer list :param datasets: "all" default to interpolate full farray, or specify selection :type datasets: string :param remesh: remesh or just copy :type remesh: bool