MURE
Loading...
Searching...
No Matches
SerpentDetectorOutputReader.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef SERPENTDETECTOROUTPUTREADER_HXX
20#define SERPENTDETECTOROUTPUTREADER_HXX
21#include <sstream>
22#include <string>
23#include <vector>
24
26#include "SerpentTallyData.hxx"
27
28
30
36namespace Serpent
37{
38class BinResult;
39class TallyData;
40class TallyResult;
41
43
52{
53 public:
55 ~DetectorOutputReader() override;
56 void Clear() override;
57 int GetNumberOfTallies() const;
58 TallyResult *GetTally(int index);
59 void Read(const string &fileName) override;
60 void Read(const vector < string > &fileNames);
61 string Print() override;
63
64 protected:
65 void ParseBlock(const string &block) override;
67
68 private:
69 BinResult *ParseTallyLine(const string &line) const;
70 void ParseEnergyBlock(istringstream &stream, const string &tallyName);
71 void ParseTallyBlock(istringstream &stream, const string &tallyName);
72 int GetTallyNumber(const string &name) const;
73 bool IsEnergyGrid(const string &name) const;
75 TallyData *GetMultiRunData(const vector < TallyData *> &tallyDataVector);
76
77 const static string PREFIX;
78 const static char ENERGY_GRID_PREFIX = 'E';
79 const static unsigned ENERGY_GRID_VALUE_COLUMN = 1;
81
82};
83
84
85}
86
87#endif // SERPENTDETECTOROUTPUTREADER_HXX
Definition SerpentTallyData.hxx:95
Definition SerpentDetectorOutputReader.hxx:52
void ParseEnergyBlock(istringstream &stream, const string &tallyName)
parses energy grid block in output file
Definition SerpentDetectorOutputReader.cxx:95
~DetectorOutputReader() override
destructor
Definition SerpentDetectorOutputReader.cxx:40
int GetTallyNumber(const string &name) const
parses heading of detector block (e.g DETd3) to get tally number
Definition SerpentDetectorOutputReader.cxx:149
TallyData * GetMultiRunData(const vector< TallyData * > &tallyDataVector)
sum data from a suite of multi-run tallies
Definition SerpentDetectorOutputReader.cxx:221
TallyData * fData
Definition SerpentDetectorOutputReader.hxx:80
void FillEnergyGridsInTallies()
fills energy grid data in tally results
Definition SerpentDetectorOutputReader.cxx:177
void ParseTallyBlock(istringstream &stream, const string &tallyName)
parses detector block in output file
Definition SerpentDetectorOutputReader.cxx:119
DetectorOutputReader()
constructor
Definition SerpentDetectorOutputReader.cxx:33
int GetNumberOfTallies() const
returns number of tallies read
Definition SerpentDetectorOutputReader.cxx:163
void Read(const string &fileName) override
Reads and parses single file.
Definition SerpentDetectorOutputReader.cxx:198
void Clear() override
cleaning data
Definition SerpentDetectorOutputReader.cxx:46
static const string PREFIX
Definition SerpentDetectorOutputReader.hxx:77
static const unsigned ENERGY_GRID_VALUE_COLUMN
Definition SerpentDetectorOutputReader.hxx:79
BinResult * ParseTallyLine(const string &line) const
parses detector line in detector block in output file
Definition SerpentDetectorOutputReader.cxx:52
TallyData * GetData()
returns all the data (for copy constructor)
Definition SerpentDetectorOutputReader.cxx:285
void ParseBlock(const string &block) override
parses block of data between semicolons
Definition SerpentDetectorOutputReader.cxx:82
TallyResult * GetTally(int index)
returns tally result at position "index"
Definition SerpentDetectorOutputReader.cxx:169
static const char ENERGY_GRID_PREFIX
Definition SerpentDetectorOutputReader.hxx:78
DetectorOutputReader * GetNewInstance() override
creates new reader (for multi-run)
Definition SerpentDetectorOutputReader.cxx:279
bool IsEnergyGrid(const string &name) const
answer if parsed block is energy grid (can be detector) data.
Definition SerpentDetectorOutputReader.cxx:139
string Print() override
Printing method used when multi-run data is merged into one file.
Definition SerpentDetectorOutputReader.cxx:262
Definition SerpentOutputReader.hxx:72
Definition SerpentTallyData.hxx:174
Definition SerpentTallyData.hxx:127
the namespace use to couple MURE and Serpent

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024