i-RIC / iriclib

1 stars 3 forks source link

Add functions to output calculation result at cell center #15

Closed kskinoue0612 closed 6 years ago

kskinoue0612 commented 7 years ago

This function will be beneficial for solver developers, because in many cases results are not defined at grid nodes, but cells.

Functions to add:

For C/C++:

For FORTRAN:

How to record result in CGNS files

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

For calculation result defined at grid cells, data is stored in FlowSolution_t nodes with GridLocation_t value CellCenter, named "FlowCellSolution1", "FlowCellSolution", ... The names of the nodes is stored in "FlowCellSolutionPointers" in "ZoneIterativeData".

How to implement

  1. CgnsFile::Impl::addSolutionNode() should add "FlowCellSolution1", etc.
  2. Implement CgnsFile::Impl::writeFlowCellSolutionPointers(), to do similar things to CgnsFile::Impl::writeFlowSolutionPointers().
  3. Define CgnsFile::SolutionWriter::Sol_Write_Cell_Integer(), CgnsFile::SolutionWriter::Sol_Write_Cell_Integer() 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
scharlton2 commented 7 years ago

Hi Keisuke,

Adding FlowCellSolutions is doubling the number of solutions (for example case_SolWriteStd now contains 10 solutions when it had 5 before). I think we should just divide the result by two and add three new functions to retrieve CellCentered solutions:

cg_iRIC_Read_Sol_Cell_Count_Mul cg_iRIC_Read_Sol_Cell_Real_Mul and cg_iRIC_Read_Sol_Cell_Integer_Mul

Let me know if you have any other ideas on how to handle this.

Thanks, Scott

kskinoue0612 commented 7 years ago

Hi Scott,

Yes, I think that will be the right solution about handling that issue.

And, thank you for proposing the functions to read the solutions. Please implement those three functions too.

Thanks, Keisuke