MURE
Loading...
Searching...
No Matches
MCNPConnector.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 _Connector_HXX_
20#define _Connector_HXX_
21
22#include "ConnectorPlugin.hxx"
23#include "MCNPNode.hxx"
24#include "StringLine.hxx"
25#include "MCNPTally.hxx"
26#include <libmctal/TMctal.hxx>
27
33namespace MCNP
34{
35
37
45{
46
47 public :
52 Connector();
53 ~Connector();
54 Connector(const Connector &plugin);
56 {
57 return new Connector( *this);
58 }
60
65 void BuildXSDIR() override;
67
72 void BuildDetectors() override;
73 void UpdateSigmaPhiDetectors() override;
74 void BuildMultiGroupDetectors() override;
75 void BuildMultiGroupDetectors(vector < Material *> &MaterialVector);
76 void UpdateMultiGroupSigmaPhiDetectors() override;
77 void UpdateMultiGroupSigmaPhiDetectors(vector < Material *> &MaterialVector);
78 void UpdateKeff() override;
79 void FindDetectorMCUserFile() override;
89 void SumOutputDetectorFile(string DetectorBaseFileName, int N, string SumDetectorFileName) override;
90 string GetMCDetectorOutputFileName(string InputFileName, bool OnlyKeff = false) override
91 {
92 return InputFileName + fMCDetectorOutputSuffix;
93 }
95
108 string GetMCExecCommandString(string InputFileName, string Arg = "", string FileArg = "") override;
110
111 void BuildTHMultiGroupDetectors() override;
113
114
119 void SetPRDMP(string prdmp = "2J -1 1")
120 {
121 fPRDMP = prdmp;
122 }
123 void SetRemove_r_files(bool flag = true)
124 {
125 fRemove_r_files = flag;
126 }
128 {
129 return fRemove_r_files;
130 }
131 bool IsMCNP4B()
132 {
133 return fMCNP4B;
134 }
135 void SetMCNP4B(bool flag = true)
136 {
137 fMCNP4B = flag;
138 }
140
141
146 void BuildMCFile(string FileString = "") override;
147
155 void BuildPinCells(bool Auto = false) override;
156
167 void FindMissingVolume() override;
168 void UpdateTallyBinVolume() override;
169
170 string Print(Cell *TheCell) override;
171 string Print(Material *mat) override;
172 string PrintModeratorMaterial(Material *mat) override;
173 string Print(Transformation *Transfo) override;
174 void WriteMCFileWithoutDetector(string FileName = "inp", bool tmpvol = false) override;
176
184 void WriteLine(string line, ostream &Out = cout, int IsComment = 0, int IsTruncated = 0, char separator = '&');
185
187
192 Node *GetNewNode(int sign) override;
194 {
195 return new SimpleBin;
196 }
198 {
199 return new GroupBin;
200 }
201 string PrintId(Material *material) override
202 {
203 return string(StringLine::convert < string > (material -> GetNumber()));
204 }
205 string PrintId(Cell *cell) override
206 {
207 return string(StringLine::convert < string > (cell -> GetNumber()));
208 }
210
211 private:
212
213 void CheckXSDIR();
214 void BuildGlobalTallies();
215 void UpdateGlobalTallies();
216
217 void ReadDetectorFile();
218
220
223 void FillTallyBinVolume();
224
225 void WriteCell(ostream &Out);
226 void WriteSurface(ostream &Out, bool tmpvol = false);
227 void WriteMaterial(ostream &Out);
228 void WriteMCNPFile(string FileName = "inp", bool tmpvol = false);
229 void CopyMCNPFile(string FileName);
230
231 string fPRDMP;
233 bool fMCNP4B;
234 TMctal *fMCOutput;
235 string fDATAPATH;
236
237};
238
239}
240
241#endif
Header file for ConnectorPlugin abstract class.
#define sign(a)
Definition GenericReactorAssembly.cxx:43
Header file for MCNP::Node class.
Header file for MCNP SimpleBin, GroupBin, LatticeBin and Tally classes.
Header file for StingLine class.
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
Define a Connector plugin.
Definition ConnectorPlugin.hxx:55
string fMCDetectorOutputSuffix
"m" files for MCNP or "_det0.m" for Serpent
Definition ConnectorPlugin.hxx:189
Define a MCNP Connector.
Definition MCNPConnector.hxx:45
void WriteMCNPFile(string FileName="inp", bool tmpvol=false)
write the MCNP input file on disk
Definition MCNPConnector_core.cxx:281
bool IsMCNP4B()
Definition MCNPConnector.hxx:131
void SetPRDMP(string prdmp="2J -1 1")
Definition MCNPConnector.hxx:119
void BuildPinCells(bool Auto=false) override
Definition MCNPConnector_core.cxx:92
void BuildTHMultiGroupDetectors() override
Definition MCNPConnector_detectors_legacy.cxx:1053
string Print(Cell *TheCell) override
Print a cell in the cell block (1st bloc) of MCNP's input file.
Definition MCNPConnector_core.cxx:1123
GroupBin * GetNewGroupBin() override
a way to obtain a new roupBin (here a MureGroupBin) from every where
Definition MCNPConnector.hxx:197
TMctal * fMCOutput
A result tallies from a MCNP m's files.
Definition MCNPConnector.hxx:234
Connector()
Definition MCNPConnector_core.cxx:63
void UpdateKeff() override
read from MC output the keff and give it to MURE
Definition MCNPConnector_detectors_legacy.cxx:773
bool fMCNP4B
If MCNP4B is used (use for PVM argument)
Definition MCNPConnector.hxx:233
void UpdateTHMultiGroupSigmaPhiDetectors() override
Definition MCNPConnector_detectors_legacy.cxx:1068
void StochasticVolumeCalculation()
a stochastic volume calculation is performed to find missing volumes for tallies
Definition MCNPConnector_findvolumes.cxx:199
string PrintId(Material *material) override
print a "generic" id name to material number (e.g. "m"=>m1)
Definition MCNPConnector.hxx:201
void BuildGlobalTallies()
build global tallies for global reaction rates (Control Rod, ...) for special evolution controls
Definition MCNPConnector_detectors_legacy.cxx:797
void UpdateSigmaPhiDetectors() override
update (read from MC output) automatic tallies for standard evolution
Definition MCNPConnector_detectors_legacy.cxx:149
string GetMCExecCommandString(string InputFileName, string Arg="", string FileArg="") override
Definition MCNPConnector_core.cxx:190
void BuildDetectors() override
build automatic tallies for standard evolution
Definition MCNPConnector_detectors_legacy.cxx:39
bool fRemove_r_files
Whether to remove "r" files of MCNP.
Definition MCNPConnector.hxx:232
SimpleBin * GetNewSimpleBin() override
a way to obtain a new SimpleBin (here a MureSimpleBin) from every where
Definition MCNPConnector.hxx:193
void BuildMultiGroupDetectors() override
build automatic tallies for in a multigroup evolution
Definition MCNPConnector_detectors_legacy.cxx:272
void SumOutputDetectorFile(string DetectorBaseFileName, int N, string SumDetectorFileName) override
Definition MCNPConnector_core.cxx:1048
void UpdateTallyBinVolume() override
Reread all bins and assign necessary volume.
Definition MCNPConnector_findvolumes.cxx:69
void ReadDetectorFile()
Definition MCNPConnector_detectors_legacy.cxx:485
void FindMissingVolume() override
Definition MCNPConnector_findvolumes.cxx:55
string fPRDMP
PRDMP argument (default=2J -1 1)
Definition MCNPConnector.hxx:231
Node * GetNewNode(int sign) override
a way to obrain a new node (here a MCNP::Node) from every where
Definition MCNPConnector_core.cxx:1117
void WriteMaterial(ostream &Out)
write MCNP materials in the 3rd block of MCNP's input file
Definition MCNPConnector_core.cxx:733
void WriteSurface(ostream &Out, bool tmpvol=false)
write MCNP all surface cards in the surface block (2nd bloc) of MCNP's input file
Definition MCNPConnector_core.cxx:718
~Connector()
Definition MCNPConnector_core.cxx:77
void CheckXSDIR()
Check if a xsdir exist ; if not call MCNP::Connector::BuildXSDIR.
Definition MCNPConnector_core.cxx:894
ConnectorPlugin * Clone() override
Clone method.
Definition MCNPConnector.hxx:55
string PrintModeratorMaterial(Material *mat) override
print MT card associated to a Material
Definition MCNPConnector_core.cxx:1420
void UpdateGlobalTallies()
update the global tallies
Definition MCNPConnector_detectors_legacy.cxx:945
void UpdateMultiGroupSigmaPhiDetectors() override
update (read from MC output) automatic tallies for multigroup evolution
Definition MCNPConnector_detectors_legacy.cxx:502
void TryToFindVolumeFromMCNPTable()
no MCNP run is performed, just read of table 50
Definition MCNPConnector_findvolumes.cxx:517
string PrintId(Cell *cell) override
print a "generic" id name to cell number (e.g. "c"=>c1)
Definition MCNPConnector.hxx:205
void FindTallyInMCNPUserFile()
void BuildXSDIR() override
build the xsdir according to the BaseSummary.dat file
Definition MCNPConnector_core.cxx:935
bool GetRemove_r_files()
Definition MCNPConnector.hxx:127
void SetRemove_r_files(bool flag=true)
Definition MCNPConnector.hxx:123
string GetMCDetectorOutputFileName(string InputFileName, bool OnlyKeff=false) override
Definition MCNPConnector.hxx:90
void CopyMCNPFile(string FileName)
copy part of the MCNP user defined geometry
Definition MCNPConnector_core.cxx:410
void SetMCNP4B(bool flag=true)
Definition MCNPConnector.hxx:135
void FindDetectorMCUserFile() override
Find tallies in a MCUser input files.
Definition MCNPConnector_core.cxx:639
void WriteMCFileWithoutDetector(string FileName="inp", bool tmpvol=false) override
Definition MCNPConnector_core.cxx:826
string fDATAPATH
path to xsdir and cross sections
Definition MCNPConnector.hxx:235
void WriteLine(string line, ostream &Out=cout, int IsComment=0, int IsTruncated=0, char separator='&')
Write a MCNP line.
Definition MCNPConnector_core.cxx:764
void FillTallyBinVolume()
fill tally bins volume (SD card)
Definition MCNPConnector_findvolumes.cxx:100
void BuildMCFile(string FileString="") override
Build the MC input file from the MURE one.
Definition MCNPConnector_core.cxx:223
void WriteCell(ostream &Out)
write MCNP all cells in the cell block (1st bloc) of MCNP's input file
Definition MCNPConnector_core.cxx:688
Define MCNP group a cell or surface bin.
Definition MCNPTally.hxx:99
Node allows to construct Union or Intersection of Shape.
Definition MCNPNode.hxx:51
Define a MCNP Simple Bin.
Definition MCNPTally.hxx:69
A Material constituing a Cell.
Definition Material.hxx:83
Spatial Transformation for cell or universe.
Definition Transformation.hxx:59
This MCNP (concrete) class is used to built a reactor assembly.
Definition MCNPBrick.hxx:41

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