PostGrid2Grid ------------- Description ~~~~~~~~~~~ ``PostGrid2Grid`` is a HOS post-processing class. It generates 3D VTK files of wave fields for visualization and wave elevation time series computed from ``Vol2Vol`` class. Wave fields at desired simulation time and spatial domain and wave elevation time series can be re-generated at some provided wave probes position. ``PostGrid2Grid`` algorithm is depicted in :numref:`fig:postGrid2GridAlgorighm`. ``PostGrid2Grid`` is initialised with input file. The input file ``postGrid2Grid.dict`` contains HOS grid information and post processing information which have dictionary format. ``PostGrid2Grid`` first reads and checks the input file and then build 3D visualization grid and wave probes. ``Vol2Vol`` class is also initialised. The subroutine ``doPostProcessing`` do time loop of ``correct``. Subroutine ``correct`` first corrects the ``Vol2Vol`` class and gets the wave fields. If the grid option is set to no air mesh, 3D grid is fitted to wave elevation. It writes the results on files (3D VTK file and wave elevation time series). .. figure:: figures/c1.structure/postGrid2Grid_Algorithm.png :alt: ``PostGrid2Grid`` Algorithm :name: fig:postGrid2GridAlgorighm ``PostGrid2Grid`` Algorithm Class(Type) ~~~~~~~~~~~ **Class** : ``PostGrid2Grid`` - Data : - ``hosVol2Vol_`` : ``Vol2Vol`` class - ``rectLGrid_`` : Rectangular linear grid for 3D wave fields (VTK output) - ``waveProbe_(:)`` : Wave probe - Functionality (Public) : - ``initialize`` : Initialise PostGrid2Grid class - ``correct`` : Correct ``Vol2Vol``, ``rectLGrid_`` and ``waveProbe_`` and write output - ``writeVTK`` : Write 3D wave fields in VTK format - ``doPostProcessing`` : Do post processing - ``destroy`` : Destuctor of PostGrid2Grid class - Functionality (Private) : - ``readPostG2GInputFileDict`` : Read ``PostGrid2Grid`` input file - ``checkPostG2GParameter`` : Check ``PostGrid2Grid`` input file - ``writeVTKtotalASCII`` : Write wave fields (Including air domain) - ``writeVTKnoAirASCII`` : Write wave fields (Grid is fitted to wave elevation) - ``writeWaveProbe`` : Write wave elevation time series Input File of PostGrid2Grid ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``PostGrid2Grid`` needs the input file. The input file name is ``postGrid2Grid.dict``. The input is recognized by ``dictionary(keyword + value with sub-dictionary)``. The special characters are treated as a comment (``!, # and \\``) and C++ style comment block is also allowed. - PostGrid2Grid variables .. code:: bash ### Select HOS dictionary and set post processing option ----------------------------------- # Grid2Grid HOSDict; # HOS dictionary writeVTK true; # 3D visualization option; true or false writeWaveProbe true; # Wave probe option; true or false - HOS dictionary .. code:: bash ### HOS dictionary ----------------------------------- # HOSDict { type Ocean; # HOS solver type; NWT or Ocean filePath example/modes_HOS_SWENSE.dat; # HOS file path fileType ASCII; # Option; HOS result file type, ASCII or HDF5 interpolationOrder 3; # Option; 3:Cubic spline [Default] zMin -0.6; # HOS domain zMin zMax 0.6; # HOS domain zMax nZMin 50; # HOS domain nZMin nZMax 50; # HOS domain nZMax zMeshType meshRatio; # Mesh type (uniform, sine, meshRatio) zMinRatio 3.0; # Option, z<=0 meshing ratio (meshRatio) zMaxRatio 3.0; # Option, z<=0 meshing ratio (meshRatio) writeLog true; # Option; write log option } - Simulation Dictionary .. code:: bash ### Simulation dictionary ------------------------------------------- # simulation { startTime 2712.0; endTime 2812.0; dt 0.1; } - 3D visualization dictionary .. code:: bash ### VTK mesh dictionary ------------------------------ # vtkMesh { airMesh false; # Air meshing option xMin 0.0; # VTK mesh xMin xMax 100.0; # VTK mesh xMax yMin 0.0; # VTK mesh yMin yMax 100.0; # VTK mesh yMax nX 50; # VTK mesh nX nY 50; # VTK mesh nX zMin -0.6; # VTK mesh zMin zMax 0.6; # VTK mesh zMax nZMin 50; # VTK mesh nZMin nZMax 50; # VTK mesh nZMax zMeshType meshRatio; # Mesh type (uniform, sine, meshRatio) zMinRatio 3.0; # Option, z<=0 meshing ratio (meshRatio) zMaxRatio 3.0; # Option, z<=0 meshing ratio (meshRatio) } - Wave probe dictionary .. code:: bash ### Wave probe dictionary ------------------------------------------ # waveProbe { waveProbeFile waveElevation.dat; # Output file name waveProbes { probe1 { position ( 0.0 10.0 ); # wave probe position } probe2 { position ( 0.0 15.0 ); } } } How to use ~~~~~~~~~~ .. code:: fortran !! Subroutine to run PostGrid2Grid ----------------------------------- Subroutine runPostGrid2Grid(inputFileName) !! ------------------------------------------------------------------- Use modPostGrid2Grid !! Use PostGrid2Grid Module !! ------------------------------------------------------------------- Implicit none Character(Len = * ),intent(in) :: inputFileName !! postGrid2Grid.inp Type(typPostGrid2Grid) :: postG2G !! postGrid2Grid Class !! ------------------------------------------------------------------- !! Initialize PostGrid2Grid with Input File Call postG2G%initialize(inputFileName) !! Do Post Processing Call postG2G%doPostProcessing() !! Destroy Call postG2G%destroy !! ------------------------------------------------------------------- End Subroutine !! -------------------------------------------------------------------