i-RIC / iriclib

1 stars 3 forks source link

Add function to read / write calculation result values defined at cell edges #63

Closed kskinoue0612 closed 4 years ago

kskinoue0612 commented 4 years ago

Add function to read / write calculation result values defined at cell edges. Functions should handle I-direction edge values and J-direction edge values separately.

scharlton2 commented 4 years ago

Based on i-RIC/iriclib#15

Functions to add (for the 2D case):

For C/C++:

For FORTRAN:

How to record results in CGNS files

Currently, calculation results defined at grid nodes are stored in FlowSolution_t nodes named "FlowSolution1", "FlowSolution2",... The names of the nodes are stored in "FlowSolutionPointers" in "ZoneIterativeData".

For calculation results defined at grid faces, data are stored in FlowSolution_t nodes with GridLocation_t value IFaceCenter and JFaceCenter, named "FlowIFaceSolution1", "FlowIFaceSolution2", ... and "FlowJFaceSolution1", "FlowJFaceSolution2"... The names of the nodes are stored in "FlowIFaceSolutionPointers" and "FlowJFaceSolutionPointers" in "ZoneIterativeData".

How to implement

  1. CgnsFile::Impl::addSolutionNode() should add "FlowIFaceSolution1", "FlowJFaceSolution1" , etc.
  2. Implement CgnsFile::Impl::writeFlowIFaceSolutionPointers() and CgnsFile::Impl::writeFlowJFaceSolutionPointers(), to do similar things to CgnsFile::Impl::writeFlowSolutionPointers().
  3. Define CgnsFile::SolutionWriter::Sol_Write_IFace_Integer(), CgnsFile::SolutionWriter::Sol_Write_IFace_Real() as pure virtual functions, and implement them in subclasses.
  4. Add description to iriclib.h, iriclib.cpp, to make it possible to call from C/C++
  5. Add description to iric_ftoc.c, to make it possible to call from FORTRAN
  6. May want/need to reimplement CgnsFile::Impl::solIndex(CGNS_ENUMT(GridLocation_t) location, int step)
kskinoue0612 commented 4 years ago

Hi Scott,

Thanks for the comment. I think this seems good, so please implement in this way.

Thanks, Keisuke