MURE
Loading...
Searching...
No Matches
EWrapper.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 _EWrapper_
20#define _EWrapper_
21
22#include <libValErr/ValErr.hxx>
23#include <fstream>
24#include <cmath>
25#include <sstream>
26#include <vector>
27#include <algorithm>
28#include <string>
29
30#include "Material.hxx"
31#include "LatticeCell.hxx"
32#include "MureTally.hxx"
33#include "EvolutionControl.hxx"
34
35class Cell;
36class LatticeCell;
37class Material;
38class MureTally;
39class Reaction;
40
41using namespace std;
42
56class MatX
57{
58 public:
60 {
61 fMaterial = nullptr;
62 }
63 MatX(const MatX &mx);
64 ~MatX() = default;
65
67 double fValue;
68};
69class MatY
70{
71 public:
73 {
74 fMaterial = nullptr;
75 }
76 MatY(const MatY &my);
77 ~MatY() = default;
78
80 int fValue;
81};
82
84typedef vector<MatX> MatXX;
85typedef vector<MatY> MatYY;
86
96{
97 public:
99 {
100 fCell = nullptr;
101 }
102 CellOccupy(const CellOccupy &co);
103 ~CellOccupy() = default;
104
106 vector < int > fX;
107 vector < int > fY;
108 vector < int > fZ;
110};
111
120{
121 public:
124 {
125 fLattice = nullptr;
126 }
132 void AddChain(
133 vector < Cell *> Chain
134 );
136 void StartChain();
138 void AddToChain(Cell *C);
141 LatticeCell *Lat
142 )
143 {
144 fLattice = Lat;
145 }
147 void Proceed();
148
149 private:
153 vector < vector < CellOccupy > > fChains;
154};
155
289{
290 public:
291
298 {
299 return new EvolutionWrapper(*this);
300 }
302 ~EvolutionWrapper() override;
303
310 {
311 outDens.push_back(M);
312 }
314 {
315 outTemp.push_back(M);
316 }
318 {
319 outBoron.push_back(M);
320 }
321 void PrintFinalComposition(Material *M, string Title)
322 {
323 fFinalCompositionMaterial.push_back(M);
324 fFinalCompositionTitles.push_back(Title);
325 }
327 void PrintFinalCompositionNuclide(int Z, int A);
329 void SetOutFile(string fn)
330 {
331 fOutFilename = fn;
332 }
334
340 void ControlAfterEachMCRun() override;
341 void ControlBeforeEachSubStep() override;
342 void ControlAfterEachEvolutionStep() override;
344
346
350 void Evolve(
351 int start = 0,
352 string startd = ""
353 );
354
361
373 void AddPhase(
374 float T,
375 int steps,
376 int dlog = 0,
377 float bas = 2
378 );
380 void SetPowerConstant(
381 float P
382 );
384
388 void SetPowerLinear(
389 float P1,
390 float P2
391 );
393 void SetPowerCooling();
396 Material *M,
397 float X
398 );
400 void SetMaterialBoron(
401 Material *M,
402 float X
403 );
409 Material *M,
410 float Content1,
411 float Content2
412 );
414 void SetMaterialDensity(Material *M, float X);
416 void SetMaterialNumberDensity(Material *M, int X);
418
419
422 void AddTally(MureTally *t, int *index);
424
429 void Reshuffle(LatticeCell *CLatGen);
430 void ReshuffleAddChain(vector < Cell *> Chain);
431 void ReshuffleStartChain();
432 void ReshuffleAddToChain(Cell *C);
434 vector < vector < ValErr_t > > &GetTallyValues()
435 {
436 return fTallyValues;
437 }
438 vector < double > &GetBurnup()
439 {
440 return fBurnup;
441 }
442
443 void AddSumTally(Cell *c, Reaction *r, int *index);
444
445 vector < ValErr_t > &GetSumTallyValues(int SumTally)
446 {
447 return fSumTallyValues[SumTally];
448 }
449 void SetSumTallyEnergies(int nE, double *E);
450
451 protected:
452
453 vector < double > fPower;
454
455 private:
456
457 vector<double> fSumTallyEnergies;
459 vector < Reaction *> fSumTallyReactions;
460 vector < Cell *> fSumTallyCells;
461 vector < int *> fSumTallyIndices;
462 vector < vector < ValErr_t > > fSumTallyValues;
463 vector < int *> fTallies;
464 vector < vector < ValErr_t > > fTallyValues;
465 vector < double > fBurnup;
466
467 vector < ReshufflingScheme *> fReshufflingScheme;
468 vector < int > fPhaseStep;
469 vector < int > fPhaseCum;
470 vector < double > fTime;
472 vector < bool > fCool;
473
474 vector < MatXX > MatTTs;
475 vector < MatXX > MatBBs;
476 vector < MatXX > MatDDs;
477 vector < MatYY > MatMMs;
478
479 vector < string > fFinalCompositionTitles;
480 vector < Material *> fFinalCompositionMaterial;
481 vector < int > fFinalCompositionZ;
482 vector < int > fFinalCompositionA;
483
484 ofstream fOutFile;
486
487 vector < Material *> outTemp;
488 vector < Material *> outDens;
489 vector < Material *> outBoron;
490
491 void BuildSumTallies();
492 void EvaluateSumTallies();
493
494 void outT(int start = 0);
495 void outD(int start = 0);
496 void outB(int start = 0);
497 void outH(int start = 0);
499
500 void UpdatePower(int step);
501 void UpdateTempBoronDens(int step);
502 void UpdateTallies();
503 void UpdateMaterialComposition(int step);
504};
505
506#endif
vector< MatX > MatXX
Vector of material-value pairs.
Definition EWrapper.hxx:84
vector< MatY > MatYY
Definition EWrapper.hxx:85
Header file for EvolutionControl class.
Header file for Material class.
Header file for TallyMultiplicator and MureTally classes.
This class holds a list of all positions in the core lattice occupied by one cell (one universe numbe...
Definition EWrapper.hxx:96
~CellOccupy()=default
Destructor.
Cell * fCell
The cell pointer.
Definition EWrapper.hxx:105
int fUniverse
the cell universe
Definition EWrapper.hxx:109
vector< int > fY
Vector of Y-coordinates of the positions.
Definition EWrapper.hxx:107
CellOccupy()
Definition EWrapper.hxx:98
vector< int > fZ
Vector of Z-coordinates of the positions.
Definition EWrapper.hxx:108
vector< int > fX
Vector of X-coordinates of the positions.
Definition EWrapper.hxx:106
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
EvolutionControl allows interactions with the evolution.
Definition EvolutionControl.hxx:60
Front-end class for Evolution(): enables easy and comprehensive specification of operation history,...
Definition EWrapper.hxx:289
vector< Material * > fFinalCompositionMaterial
Materials for final composition.
Definition EWrapper.hxx:480
vector< vector< ValErr_t > > fTallyValues
Definition EWrapper.hxx:464
vector< double > & GetBurnup()
Definition EWrapper.hxx:438
~EvolutionWrapper() override
Destructor.
Definition EWrapper.cxx:214
void Reshuffle(LatticeCell *CLatGen)
Reshuffle at beginning of this phase.
Definition EWrapper.cxx:593
vector< Material * > outBoron
Vector of materials where boron is to be plotted.
Definition EWrapper.hxx:489
vector< int > fFinalCompositionZ
Z of isotopes for final composition.
Definition EWrapper.hxx:481
vector< string > fFinalCompositionTitles
Titles of materials for final composition.
Definition EWrapper.hxx:479
vector< int > fPhaseStep
Number of MC steps in this phase.
Definition EWrapper.hxx:468
void outB(int start=0)
Print out the boron content.
Definition EWrapper.cxx:655
vector< Reaction * > fSumTallyReactions
Definition EWrapper.hxx:459
void SetMaterialBoron(Material *M, float X)
Set boron content in a material during this phase.
Definition EWrapper.cxx:715
void outH(int start=0)
Print out basic info (step no., fTime, fPower)
Definition EWrapper.cxx:613
vector< double > fTime
fTime vector (begining of steps)
Definition EWrapper.hxx:470
vector< int * > fTallies
Definition EWrapper.hxx:463
void ControlAfterEachEvolutionStep() override
from EvolutionControl
Definition EWrapper.cxx:1092
vector< Material * > outDens
Vector of materials where density is to be plotted.
Definition EWrapper.hxx:488
vector< MatYY > MatMMs
Vector of (vector of materials) with changing number densities>
Definition EWrapper.hxx:477
vector< bool > fCool
vector of flags denoting the cooling periods
Definition EWrapper.hxx:472
int fSumTallyEnergiesN
Definition EWrapper.hxx:458
void UpdatePower(int step)
Update fPower for a MC step.
Definition EWrapper.cxx:964
vector< ValErr_t > & GetSumTallyValues(int SumTally)
Definition EWrapper.hxx:445
vector< ReshufflingScheme * > fReshufflingScheme
Reshuffling schemes for lattice cores.
Definition EWrapper.hxx:467
void ReshuffleAddToChain(Cell *C)
Add a cell to the last reshuffling chain.
Definition EWrapper.cxx:479
vector< int * > fSumTallyIndices
Definition EWrapper.hxx:461
vector< int > fFinalCompositionA
A of isotopes for final composition.
Definition EWrapper.hxx:482
vector< int > fPhaseCum
Number of MC steps before this phase (cumulative)
Definition EWrapper.hxx:469
vector< vector< ValErr_t > > & GetTallyValues()
Definition EWrapper.hxx:434
vector< MatXX > MatBBs
Vector of (vector of materials) with changing boron.
Definition EWrapper.hxx:475
EvolutionWrapper()
Normal constructor.
Definition EWrapper.cxx:100
void ReshuffleAddChain(vector< Cell * > Chain)
Add a new reshuffling chain (fresh->a->b->..->z, z goes out)
Definition EWrapper.cxx:600
void SetSumTallyEnergies(int nE, double *E)
Definition EWrapper.cxx:263
string fOutFilename
output file name
Definition EWrapper.hxx:485
vector< MatXX > MatTTs
Vector of (vector of materials) with changing temperature.
Definition EWrapper.hxx:474
vector< Cell * > fSumTallyCells
Definition EWrapper.hxx:460
void ControlAfterEachMCRun() override
from EvolutionControl
Definition EWrapper.cxx:1114
void PrepareTemperatureEvolution()
Set flags for temperature evolution.
Definition EWrapper.cxx:677
void SetOutFile(string fn)
Definition EWrapper.hxx:329
void SetPowerConstant(float P)
This phase is burn phase, power is constant.
Definition EWrapper.cxx:760
void SetMaterialBoronLinear(Material *M, float Content1, float Content2)
Set linearly changing boron content in a material during this phase.
Definition EWrapper.cxx:726
void AddPhase(float T, int steps, int dlog=0, float bas=2)
Add new depletion phase.
Definition EWrapper.cxx:811
void PrintFinalCompositionNuclide(int Z, int A)
Dump final composition of M with title.
Definition EWrapper.cxx:606
vector< vector< ValErr_t > > fSumTallyValues
Definition EWrapper.hxx:462
void ControlBeforeEachSubStep() override
from EvolutionControl
Definition EWrapper.cxx:1126
void outD(int start=0)
Print out the density.
Definition EWrapper.cxx:643
ofstream fOutFile
Output file for evolution table.
Definition EWrapper.hxx:484
vector< Material * > outTemp
Vector of materials where temperature is to be plotted.
Definition EWrapper.hxx:487
void SetPowerCooling()
This phase is cooling (no flux).
Definition EWrapper.cxx:801
vector< MatXX > MatDDs
Vector of (vector of materials) with changing density.
Definition EWrapper.hxx:476
void UpdateTempBoronDens(int step)
Update boron, temperatures &densities in this step.
Definition EWrapper.cxx:978
void UpdateMaterialComposition(int step)
Update material number densitites.
Definition EWrapper.cxx:1015
void AddSumTally(Cell *c, Reaction *r, int *index)
Definition EWrapper.cxx:432
void PrintMaterialTemperature(Material *M)
Definition EWrapper.hxx:313
void SetPowerLinear(float P1, float P2)
This phase is burn phase, power is linearly changing.
Definition EWrapper.cxx:770
vector< double > fBurnup
Definition EWrapper.hxx:465
void UpdateTallies()
Definition EWrapper.cxx:366
void SetMaterialNumberDensity(Material *M, int X)
Set number density of isotopes in a material during this phase.
Definition EWrapper.cxx:705
void Evolve(int start=0, string startd="")
Start the evolution.
Definition EWrapper.cxx:858
void AddTally(MureTally *t, int *index)
Definition EWrapper.cxx:453
void SetMaterialDensity(Material *M, float X)
Set boron content in a material during this phase.
Definition EWrapper.cxx:695
void EvaluateSumTallies()
Definition EWrapper.cxx:303
vector< double > fSumTallyEnergies
Definition EWrapper.hxx:457
EvolutionControl * Clone() override
Object cloning.
Definition EWrapper.hxx:297
void PrintFinalComposition(Material *M, string Title)
Dump final composition of M with title.
Definition EWrapper.hxx:321
void outT(int start=0)
Print out the temperature.
Definition EWrapper.cxx:631
void SetMaterialTemperature(Material *M, float X)
Set temperature of a material during this phase.
Definition EWrapper.cxx:685
void PrintMaterialDensity(Material *M)
Definition EWrapper.hxx:309
vector< double > fPower
fPower vector (watts)
Definition EWrapper.hxx:453
void BuildSumTallies()
Definition EWrapper.cxx:270
void ReshuffleStartChain()
Add a new empty reshuffling chain.
Definition EWrapper.cxx:473
void PrintMaterialBoron(Material *M)
Definition EWrapper.hxx:317
double fPhaseEndTime
Ending time of the last defined phase (use to start a new phase)
Definition EWrapper.hxx:471
A LatticeCell is used to fill a cell with universes..
Definition LatticeCell.hxx:69
Structure holding Material and a number (e.g. density, temperature etc.)
Definition EWrapper.hxx:57
MatX()
Definition EWrapper.hxx:59
double fValue
The characteristic value (proportion, temperature, ...) associated to the material.
Definition EWrapper.hxx:67
~MatX()=default
Destructor.
Material * fMaterial
The material.
Definition EWrapper.hxx:66
Definition EWrapper.hxx:70
int fValue
The material number to be manipulated.
Definition EWrapper.hxx:80
Material * fMaterial
The material.
Definition EWrapper.hxx:79
MatY()
Definition EWrapper.hxx:72
~MatY()=default
Destructor.
A Material constituing a Cell.
Definition Material.hxx:83
Define a MURE Tally.abstract class.
Definition MureTally.hxx:141
Define a Reaction list for Tally multiplicator inputs.
Definition Reaction.hxx:41
This class performs reshuffling of a lattice.
Definition EWrapper.hxx:120
vector< vector< CellOccupy > > fChains
List of reshuffling chains.
Definition EWrapper.hxx:153
void AddToChain(Cell *C)
Add a cell to the end of current chain.
Definition EWrapper.cxx:485
~ReshufflingScheme()=default
Destructor.
LatticeCell * fLattice
Cell containing the lattice.
Definition EWrapper.hxx:151
void AddChain(vector< Cell * > Chain)
Add a reshuffling chain.
Definition EWrapper.cxx:566
void StartChain()
Start a new chain.
Definition EWrapper.cxx:507
void SetLatticeCell(LatticeCell *Lat)
Set the cell containing the lattice.
Definition EWrapper.hxx:140
ReshufflingScheme()
Normal constructor.
Definition EWrapper.hxx:123
void Proceed()
Do the reshuffling of the lattice cell, according to given reshuffling chains.
Definition EWrapper.cxx:514
the namespace of the Standard C++

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