OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
Public Member Functions | List of all members
Summary Class Reference

The Summary class manages the output in the summary file. More...

#include <OCPOutput.hpp>

Public Member Functions

void InputParam (const OutputSummary &summary_param)
 TODO: Add Doxygen.
 
void Setup (const Reservoir &reservoir, const OCP_DBL &totalTime)
 TODO: Add Doxygen.
 
void SetVal (const Reservoir &reservoir, const OCPControl &ctrl)
 TODO: Add Doxygen.
 
void PrintInfo (const string &dir) const
 Write output information to a file. More...
 

Detailed Description

The Summary class manages the output in the summary file.

Definition at line 91 of file OCPOutput.hpp.

Member Function Documentation

◆ PrintInfo()

void Summary::PrintInfo ( const string &  dir) const

Write output information to a file.

Write output information in the dir/SUMMARY.out file.

Definition at line 578 of file OCPOutput.cpp.

579 {
580  string FileOut = dir + "SUMMARY.out";
581  ofstream outF(FileOut);
582  if (!outF.is_open())
583  {
584  OCP_ABORT("Can not open " + FileOut);
585  }
586 
587  USI ns = 12;
588  USI col = 10;
589  USI row = 0;
590  USI num = Sumdata.size();
591  USI len = Sumdata[0].val.size();
592  USI id = 0;
593  USI ID = 1;
594 
595  while (id != num)
596  {
597 
598  outF << "Row " << ++row << endl;
599 
600  // Item
601  // Time
602  outF << "\t" << setw(ns) << Sumdata[0].Item;
603 
604  id = ID;
605  for (USI i = 1; i < col; i++)
606  {
607  outF << "\t" << setw(ns) << Sumdata[id++].Item;
608  if (id == num)
609  break;
610  }
611  outF << endl;
612 
613  // Unit
614  // Time
615  outF << "\t" << setw(ns) << Sumdata[0].Unit;
616 
617  id = ID;
618  for (USI i = 1; i < col; i++)
619  {
620  outF << "\t" << setw(ns) << Sumdata[id++].Unit;
621  if (id == num)
622  break;
623  }
624  outF << endl;
625 
626  // Obj
627  // Time
628  outF << "\t" << setw(ns) << Sumdata[0].Obj;
629 
630  id = ID;
631  for (USI i = 1; i < col; i++)
632  {
633  outF << "\t" << setw(ns) << Sumdata[id++].Obj;
634  if (id == num)
635  break;
636  }
637  outF << endl;
638 
639  // Data
640  for (USI l = 0; l < len; l++)
641  {
642 
643  // Time
644  outF << "\t" << setw(ns) << Sumdata[0].val[l];
645 
646  id = ID;
647  for (USI i = 1; i < col; i++)
648  {
649  outF << "\t" << setw(ns) << Sumdata[id++].val[l];
650  if (id == num)
651  break;
652  }
653  outF << endl;
654  }
655 
656  ID += (col - 1);
657 
658  outF << endl;
659  }
660 
661  outF.close();
662 }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47

References OCP_ABORT.


The documentation for this class was generated from the following files: