MURE
Loading...
Searching...
No Matches
SerpentConnector.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 SERPENTCONNECTOR_H
20#define SERPENTCONNECTOR_H
21#include <iomanip>
22#include <string>
23
24#include "ConnectorPlugin.hxx"
25#include "MUREGlobal.hxx"
26#include "SerpentNode.hxx"
27#include "SerpentTally.hxx"
28#include "LatticeCell.hxx"
29using namespace std;
30
33
40namespace Serpent
41{
43
50{
51 public:
56 Connector();
57 ~Connector() override;
58 Connector(const Connector &plugin);
59 Connector *Clone() override;
61
66 void BuildXSDIR() override;
68
73 void BuildDetectors() override;
74 void UpdateSigmaPhiDetectors() override;
75 void BuildMultiGroupDetectors() override;
76 void BuildMultiGroupDetectors(vector < Material *> &MaterialVector);
77 void UpdateMultiGroupSigmaPhiDetectors() override;
78 void UpdateMultiGroupSigmaPhiDetectors(vector < Material *> &MaterialVector);
79 void UpdateKeff() override;
80 void FindDetectorMCUserFile() override;
90 void SumOutputDetectorFile(string DetectorBaseFileName, int N, string SumDetectorFileName) override;
91 string GetMCDetectorOutputFileName(string InputFileName, bool OnlyKeff = false) override;
93
106 string GetMCExecCommandString(string InputFileName, string Arg = "", string FileArg = "") override;
108
113 void BuildMCFile(string FileString = "") override;
114
125 void BuildPinCells(bool Auto = false) override;
126
140 void FindMissingVolume() override;
141 void UpdateTallyBinVolume() override;
142
143 string Print(Cell *TheCell) override;
144 string Print(Material *mat) override;
145 string PrintModeratorMaterial(Material *mat) override;
146 string Print(Transformation *Transfo) override;
147 void WriteMCFileWithoutDetector(string FileName = "inp", bool tmpvol = false) override;
148
150
151 void BuildTHMultiGroupDetectors() override;
153
158 Node *GetNewNode(int sign) override;
160 {
161 return new SimpleBin;
162 }
164 {
165 return new MureGroupBin;
166 }
167 string PrintId(Material *material) override;
168 string PrintId(Cell *cell) override;
169 string PrintMaterialId(int id) override;
171
172 protected:
174
175 private:
176 void CheckXSDIR();
177 void EncapsulateGeometry();
178
179 void BuildGlobalTallies();
180 void UpdateGlobalTallies();
181
182 void ReadDetectorFile();
183
184 void FillTallyBinVolume();
186 void AddTestMaterialForCell(Cell *oldCell);
187 void AddTestMaterialForPinCell(PinCell *oldCell);
189
190 string PrintLattice(LatticeCell *TheLattice);
191 unsigned GetLatticeType(LatticeCell *TheLattice);
192 unsigned GetNumberOfLatticeDimentions(unsigned LatticeType) const;
193 string PrintLatticeCardHead(LatticeCell *TheLattice);
194 string PrintLatticeLayout(LatticeCell *TheLattice);
195
196 string PrintPinCell(PinCell *ThePinCell);
197
198 string PrintBasicCell(Cell *TheCell);
199
200
201 string PrintAllMaterials();
202 string PrintAllSurfaceCards(bool tmpvol);
203 string PrintAllPinCells();
204 string PrintAllCells();
205
206 string PrintAllSpecialCards();
208 string PrintMCSource();
209 string PrintAllTallies();
210 void PrintAllEnergyGrids(ofstream &Out);
211
212 void WriteSerpentFile(string FileName, bool tmpvol = false);
213 void CopySerpentFile(string FileName, bool tmpvol = false);
214
216 string PrintModeratorName(Material *mat, unsigned nucleusIndex);
217
219
220 string GetResultFileName(const string &inputFileName) const;
221 string GetSumResultFileName(const string &SumDetectorFileName);
222
224
225 static string MATERIAL_NAME_PREFIX;
226 const static string LATTICE_COMMAND;
227 const static string CELL_NAME_PREFIX;
228 const static string CELL_COMMAND;
229 const static char COMMENT_SIGN = '%';
230 const static unsigned X_HEX_LATTICE_TYPE = 2;
231 const static unsigned Y_HEX_LATTICE_TYPE = 3;
232 const static unsigned CUBOID_LATTICE_2D_TYPE = 1;
233 const static unsigned CUBOID_LATTICE_3D_TYPE = 11;
234 const static unsigned X_HEX_LATTICE_3D_TYPE = 12;
235 const static unsigned Y_HEX_LATTICE_3D_TYPE = 13;
236
237};
238
239}
240
241#endif // SERPENTCONNECTOR_H
Header file for ConnectorPlugin abstract class.
#define sign(a)
Definition GenericReactorAssembly.cxx:43
Header file for Serpent::Node class.
Header file for Serpent SimpleBin and Tally classes.
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
Define a Connector plugin.
Definition ConnectorPlugin.hxx:55
A LatticeCell is used to fill a cell with universes..
Definition LatticeCell.hxx:69
A Material constituing a Cell.
Definition Material.hxx:83
Define group cell or surface bin.
Definition MureGroupBin.hxx:58
PinCell class allows to create cylindrical cell set included as Matrioshka.
Definition PinCell.hxx:53
Define a Serpent Connector.
Definition SerpentConnector.hxx:50
void WriteSerpentFile(string FileName, bool tmpvol=false)
write the Serpent input file on disk
Definition SerpentConnector_core.cxx:921
void FindMissingVolume() override
Definition SerpentConnector_findvolumes.cxx:54
string GetMCExecCommandString(string InputFileName, string Arg="", string FileArg="") override
Definition SerpentConnector_core.cxx:613
string Print(Cell *TheCell) override
Print a cell in the cell block (1st bloc) of MCNP's input file.
Definition SerpentConnector_core.cxx:335
string PrintAllTransformationCards()
write all transformation card in the Serpent input file
Definition SerpentConnector_core.cxx:878
void BuildGlobalTallies()
build global tallies for global reaction rates (Control Rod, ...) for special evolution controls
Definition SerpentConnector_detectors.cxx:895
static const string CELL_COMMAND
the "cell" Serpent key word
Definition SerpentConnector.hxx:228
void UpdateTallyBinVolume() override
Reread all bins and assign necessary volume.
Definition SerpentConnector_findvolumes.cxx:246
string PrintModeratorMaterial(Material *mat) override
print "therm" card associated to a Material
Definition SerpentConnector_core.cxx:1149
Node * GetNewNode(int sign) override
a way to obrain a new node (here a MCNP::Node) from every where
Definition SerpentConnector_core.cxx:113
void BuildMCFile(string FileString="") override
Build the MC input file from the MURE one.
Definition SerpentConnector_core.cxx:754
void ReadDetectorFile()
Definition SerpentConnector_detectors.cxx:1336
void CopySerpentFile(string FileName, bool tmpvol=false)
copy part of the MCNP user defined geometry
Definition SerpentConnector_core.cxx:800
void FillTallyBinVolume()
fill tally bins volume ("dv" card)
Definition SerpentConnector_findvolumes.cxx:277
void WriteMCFileWithoutDetector(string FileName="inp", bool tmpvol=false) override
build a Serpent file without tally just to obtain keff for void, temperature coefficient,...
Definition SerpentConnector_core.cxx:1259
string PrintAllPinCells()
write all pins in the Serpent input file
Definition SerpentConnector_core.cxx:806
static const string LATTICE_COMMAND
the "lat" Serpent key word
Definition SerpentConnector.hxx:226
string PrintSerpentDopplerBroadening(Material *mat)
Definition SerpentConnector_core.cxx:1193
static const string CELL_NAME_PREFIX
a prefix string before the cell number: e.g. "c1" for the cell 1
Definition SerpentConnector.hxx:227
string PrintMCSource()
write tje SerpentSource in the Serpent input file
Definition SerpentConnector_core.cxx:888
string PrintLatticeCardHead(LatticeCell *TheLattice)
print "lat" card with type, origin, nb elements and pitch
Definition SerpentConnector_core.cxx:181
static const unsigned Y_HEX_LATTICE_TYPE
Definition SerpentConnector.hxx:231
void EncapsulateGeometry()
If the "outside" cell is not a simple shape, put the whole geometry in a Sphere.
Definition SerpentConnector_core.cxx:716
void UpdateSigmaPhiDetectors() override
update (read from MC output) automatic tallies for standard evolution
Definition SerpentConnector_detectors.cxx:229
void BuildDetectors() override
build automatic tallies for standard evolution
Definition SerpentConnector_detectors.cxx:60
void SetBoundaryCondition(Shape_ptr S)
Add a "set bc" card for boundary mirror condition.
Definition SerpentConnector_core.cxx:1218
string PrintLatticeLayout(LatticeCell *TheLattice)
print the array of universe number
Definition SerpentConnector_core.cxx:226
SimpleBin * GetNewSimpleBin() override
a way to obtain a new SimpleBin (here a MureSimpleBin) from every where
Definition SerpentConnector.hxx:159
unsigned GetNumberOfLatticeDimentions(unsigned LatticeType) const
return 2 or 3 for 2D or 3D lattice
Definition SerpentConnector_core.cxx:170
static const char COMMENT_SIGN
Definition SerpentConnector.hxx:229
static const unsigned Y_HEX_LATTICE_3D_TYPE
Definition SerpentConnector.hxx:235
void BuildXSDIR() override
build the xsdir according to the BaseSummary.dat file
Definition SerpentConnector_core.cxx:383
void UpdateGlobalTallies()
update the global tallies
Definition SerpentConnector_detectors.cxx:1126
void CheckXSDIR()
Check if a xsdir exist ; if not call MCNP::Connector::BuildXSDIR.
Definition SerpentConnector_core.cxx:344
void PrintAllEnergyGrids(ofstream &Out)
write all tally (time)energy grids in the Serpent input file
Definition SerpentConnector_core.cxx:901
string PrintAllMaterials()
write all materials in the Serpent input file
Definition SerpentConnector_core.cxx:844
void SumOutputDetectorFile(string DetectorBaseFileName, int N, string SumDetectorFileName) override
Definition SerpentConnector_core.cxx:558
void FindDetectorMCUserFile() override
Find tallies in a MCUser input files.
Definition SerpentConnector_core.cxx:534
string PrintLattice(LatticeCell *TheLattice)
write 1 Lattice in the Serpent input file
Definition SerpentConnector_core.cxx:250
string PrintAllSpecialCards()
write all special cards (i.e. the one not implemented in MURE) in the Serpent input file
Definition SerpentConnector_core.cxx:863
string PrintModeratorName(Material *mat, unsigned nucleusIndex)
print the name on "therm" card ("m_matnum_n_moderatornucleusidx_")
Definition SerpentConnector_core.cxx:1167
unsigned GetLatticeType(LatticeCell *TheLattice)
return number corresponding to the serpent "lat" type
Definition SerpentConnector_core.cxx:119
void BuildMultiGroupDetectors() override
build automatic tallies for in a multigroup evolution
Definition SerpentConnector_detectors.cxx:347
string PrintBasicCell(Cell *TheCell)
write 1 Cell in the Serpent input file
Definition SerpentConnector_core.cxx:299
void StochasticVolumeCalculation()
a stochastic volume calculation is performed to find missing volumes for tallies
Definition SerpentConnector_findvolumes.cxx:134
static const unsigned X_HEX_LATTICE_3D_TYPE
Definition SerpentConnector.hxx:234
MureGroupBin * GetNewGroupBin() override
a way to obtain a new roupBin (here a MureGroupBin) from every where
Definition SerpentConnector.hxx:163
void UpdateTHMultiGroupSigmaPhiDetectors() override
Definition SerpentConnector_detectors.cxx:1322
string GetResultFileName(const string &inputFileName) const
return the "_res.m" Serpent output file
Definition SerpentConnector_core.cxx:540
void BuildTHMultiGroupDetectors() override
Definition SerpentConnector_detectors.cxx:1307
void UpdateMultiGroupSigmaPhiDetectors() override
update (read from MC output) automatic tallies for multigroup evolution
Definition SerpentConnector_detectors.cxx:600
static const unsigned CUBOID_LATTICE_2D_TYPE
Definition SerpentConnector.hxx:232
string GetMCDetectorOutputFileName(string InputFileName, bool OnlyKeff=false) override
Definition SerpentConnector_core.cxx:1274
string PrintMaterialModeratorOption(Material *mat)
print the "moder" card
Definition SerpentConnector_core.cxx:1176
string PrintPinCell(PinCell *ThePinCell)
write 1 PinCell (i.e. a "pin") in the Serpent input file
Definition SerpentConnector_core.cxx:259
void UpdateKeff() override
read from MC output the keff and give it to MURE
Definition SerpentConnector_detectors.cxx:1111
Connector()
Definition SerpentConnector_core.cxx:72
void BuildPinCells(bool Auto=false) override
Definition SerpentConnector_core.cxx:627
string PrintId(Material *material) override
print a "generic" id name to material number (e.g. "m"=>m1)
Definition SerpentConnector_core.cxx:275
static const unsigned CUBOID_LATTICE_3D_TYPE
Definition SerpentConnector.hxx:233
string PrintAllTallies()
write all tallies (detectors) in the Serpent input file
Definition SerpentConnector_core.cxx:911
void AddTestMaterialForPinCell(PinCell *oldCell)
use "test material" to find PinCell volumes
Definition SerpentConnector_findvolumes.cxx:100
static string MATERIAL_NAME_PREFIX
a prefix string before the materia number: e.g. "m1" for the material 1
Definition SerpentConnector.hxx:225
DetectorOutputReader * fDetectorFileReader
A detector reader from Serpent "_det0.m" file.
Definition SerpentConnector.hxx:173
static const unsigned X_HEX_LATTICE_TYPE
Definition SerpentConnector.hxx:230
Material * GetTestMaterial()
return a pure hydrogen material
Definition SerpentConnector_findvolumes.cxx:65
string GetSumResultFileName(const string &SumDetectorFileName)
Definition SerpentConnector_core.cxx:548
void AddTestMaterialForCell(Cell *oldCell)
use "test material" to find cell volumes
Definition SerpentConnector_findvolumes.cxx:74
~Connector() override
Definition SerpentConnector_core.cxx:100
Connector * Clone() override
Clone method.
Definition SerpentConnector_core.cxx:107
string PrintAllSurfaceCards(bool tmpvol)
write all surfaces in the Serpent input file
Definition SerpentConnector_core.cxx:834
string PrintAllCells()
write all cells in the Serpent input file
Definition SerpentConnector_core.cxx:818
string PrintMaterialId(int id) override
convert material number in string
Definition SerpentConnector_core.cxx:283
Definition SerpentDetectorOutputReader.hxx:52
Node allows to construct Union or Intersection of Shape.
Definition SerpentNode.hxx:50
Define a Serpent Tally simple bin.
Definition SerpentTally.hxx:60
Spatial Transformation for cell or universe.
Definition Transformation.hxx:59
the namespace use to couple MURE and Serpent
the namespace of the Standard C++

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