26#include <libmctal/TMTally.hxx>
43 LOG_ERROR(
"USE OF Connector::BuildDetectors() is deprecated in case of Evolution. PLEASE REMOVE IT FROM YOUR CODE.");
45 LOG_INFO(
"---------------------------------------------------------------------------");
46 LOG_INFO(
"Connector::BuildDetectors : Building tallies ...");
50 gMURE->GetEvolutionSolver()->BuildPerturbativeMaterials();
52 map<int, int> TheTemperatureMap;
54 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector().size()); i++)
56 if(!(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell()->GetNumber() < 0))
58 double T =
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell()->GetMaterial()->GetTemperature();
59 int TempIndex =
gMURE->GetTemperatureMap()->AddUsedTemp(T);
62 LOG_ERROR(
"Temperature " << T <<
" K is not in the fTemperatureMap with the current precision " <<
gMURE->GetTemperatureMap()->GetDeltaTPrecision() <<
"K."
63 <<
"\t This temperature is at " << -TempIndex <<
" K from the closest fTemperatureMap index.");
65 if(TheTemperatureMap[TempIndex] == 0)
67 TheTemperatureMap[TempIndex] = num;
73 vector<Tally *> Flux(
gMURE->GetTemperatureMap()->GetNumberOfUsedfTemperatures());
74 vector<Tally *> FM(
gMURE->GetTemperatureMap()->GetNumberOfUsedfTemperatures());
75 for(
int i = 0; i < int(Flux.size()); i++)
80 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector().size()); i++)
82 Cell *TheCell =
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell();
86 int TempIndex =
gMURE->GetTemperatureMap()->AddUsedTemp(T);
87 int index = TheTemperatureMap[TempIndex] - 1;
88 Flux[index]->Add(TheCell);
89 FM[index]->Add(TheCell);
93 LOG_DEBUG(
"for tally " << Flux[index]->GetNumber() <<
" bin is " <<
int(Flux[index]->GetBin().size()) - 1 <<
" for cell" << TheCell->
GetNumber());
97 int TallyBinNum = int(Flux[index]->GetBin().size()) - 1;
99 nucleus->AddNucleusMCRecord(FM[index]->GetNumber(), TheCell->
GetNumber(), TallyBinNum);
107 for(
int i = 0; i < int(
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial().size()) ; i++)
109 if(!(
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial()[i]->IsOutCore()))
111 Nucleus_ptr nucleus =
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial()[i]->GetComposition()[0];
112 int TempIndex =
gMURE->GetTemperatureMap()->AddUsedTemp(nucleus->GetTemperature());
113 int tallypos = TheTemperatureMap[TempIndex] - 1;
114 int tallynum = FM[tallypos]->GetNumber();
115 for(
int j = 0; j < int(nucleus->GetNucleusMCRecord().size()); j++)
119 if(tallynum != OldTallyNum)
121 OldTallyNum = tallynum;
124 if (nucleus->GetZAI()->GetReactionDaughterSize() > 0)
127 for(
int k = 0; k < int(XScode.size()); k++)
129 FM[tallypos]->AddMultiplicator(
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial()[i], XScode[k]);
132 FM[tallypos]->AddMultiplicator(
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial()[i], 1);
144 LOG_INFO(
"---------------------------------------------------------------------------");
151 LOG_INFO(
"---------------------------------------------------------------------------");
156 if(
gMURE->GetSource()->GetKcode())
161 int NumberOfTallies =
fMCOutput->GetNbTal();
166 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector().size()); i++)
168 Cell *TheCell =
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell();
173 for(
int j = 0; j < NumberOfTallies; j++)
175 TMTally *TheTally =
fMCOutput->GetTally(j);
177 if(
int(TheTally->fNo) == TallyNum)
179 ValErr_t UnNormalizedPhi = TheTally->fVal[TallyBinNum][0][0][0][0][0][0][0];
180 TheCell->
SetFlux(UnNormalizedPhi.fVal);
192 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial().size()); i++)
194 if(!(
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial()[i]->IsOutCore()))
196 Nucleus_ptr nucleus =
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial()[i]->GetComposition()[0];
197 LOG_DEBUG(
"fPerturbativeMaterial[i]->GetComposition()[0] :" <<
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial()[i]->GetComposition()[0]->GetZAI()->GetFullName());
199 for(
int RecIdx = 0; RecIdx < int(nucleus->GetNucleusMCRecord().size()) ; RecIdx++)
203 TMTally *TheTally = 0;
204 for(
int j = 0; j < NumberOfTallies; j++)
216 if (nucleus->GetZAI()->GetReactionDaughterSize() > 0)
225 ValErr_t UnNormalizedSigmaPhi = TheTally->fVal[n][0][0][0][m][0][0][0];
231 if(UnNormalizedSigmaPhi.fErr == 0) UnNormalizedSigmaPhi.fErr = 1.e-10;
233 if(
gMURE->GetEvolutionSolver()->IsPartialMCRun() &&
gMURE->GetEvolutionSolver()->IsPartialParticleMCRun())
235 nucleus->SetMCSigmaPhi2(CellIdx, k, UnNormalizedSigmaPhi);
239 nucleus->SetMCSigmaPhi(CellIdx, k, UnNormalizedSigmaPhi);
244 double UnNormalizedTotalSigmaPhi = TheTally->fVal[n][0][0][0][m][0][0][0].fVal;
250 nucleus->SetTotalSigmaPhi(CellIdx, UnNormalizedTotalSigmaPhi);
267 LOG_INFO(
"All Detectors read and updated.");
268 LOG_INFO(
"---------------------------------------------------------------------------");
274 LOG_INFO(
"---------------------------------------------------------------------------");
275 LOG_INFO(
"Connector::BuildMultiGroupDetectors: Building tallies ...");
277 gMURE->GetEvolutionSolver()->BuildPerturbativeMaterials();
278 vector<Material *> MaterialVector =
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial();
281 LOG_INFO(
"Multigroup Detectors are built.");
282 LOG_INFO(
"---------------------------------------------------------------------------");
291 LOG_ERROR(
"USE OF Connector::BuildDetectors is deprecated in case of Evolution. PLEASE REMOVE IT FROM YOUR CODE.");
297 map<int, int> TheTemperatureMap;
299 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector().size()); i++)
301 if(!(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell()->GetNumber() < 0))
303 double T =
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell()->GetMaterial()->GetTemperature();
304 int TempIndex =
gMURE->GetTemperatureMap()->AddUsedTemp(T);
307 LOG_ERROR(
"Temperature " << T <<
" K is not in the fTemperatureMap with the current precision " <<
gMURE->GetTemperatureMap()->GetDeltaTPrecision() <<
"K."
308 <<
"\t This temperature is at " << -TempIndex <<
" K from the closest fTemperatureMap index.");
310 if(TheTemperatureMap[TempIndex] == 0)
312 TheTemperatureMap[TempIndex] = num;
318 vector<Tally *> Flux(1);
319 vector<Tally *> FM(1);
320 vector<Tally *> FM8(1);
326 if(
gMURE->GetEvolutionSolver()->IsU8StdTally())
328 FM8.resize(
gMURE->GetTemperatureMap()->GetNumberOfUsedfTemperatures());
329 for(
int i = 0; i < int(FM8.size()); i++)
336 Flux[0]->
AddMultiGroupEnergy(
gMURE->GetEvolutionSolver()->GetMultiGroupLowerEnergy(),
gMURE->GetEvolutionSolver()->GetMultiGroupUpperEnergy(),
gMURE->GetEvolutionSolver()->GetMultiGroupDecadeMultiplicator());
338 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector().size()); i++)
340 Cell *TheCell =
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell();
344 int TempIndex =
gMURE->GetTemperatureMap()->AddUsedTemp(T);
345 Flux[0]->Add(TheCell);
346 FM[0]->Add(TheCell,
false);
347 int index = TheTemperatureMap[TempIndex] - 1;
348 if(
gMURE->GetEvolutionSolver()->IsU8StdTally())
350 FM8[index]->Add(TheCell);
355 LOG_DEBUG(
"for tally " << Flux[0]->GetNumber() <<
" bin is " <<
int(Flux[0]->GetBin().size()) - 1 <<
" for cell" << TheCell->
GetNumber());
356 for(
int j = 0; j < int(TheMaterial->
GetComposition().size()); j++)
359 int TallyBinNum = int(Flux[0]->GetBin().size()) - 1;
360 int TallyNum = FM[0]->GetNumber();
361 if(
gMURE->GetEvolutionSolver()->IsU8StdTally() && nucleus->Z() == 92 && nucleus->A() == 238)
363 TallyBinNum = int(FM8[index]->GetBin().size()) - 1;
364 TallyNum = FM8[index]->GetNumber();
373 nucleus->AddNucleusMCRecord(TallyNum, TheCell->
GetNumber(), TallyBinNum);
385 int OldTallyNum8 = 0;
386 for(
int i = 0; i < int(MaterialVector.size()) ; i++)
388 if(!(MaterialVector[i]->IsOutCore()))
390 for(
int kkk = 0; kkk < int(MaterialVector[i]->GetComposition().size()); kkk++)
392 Nucleus_ptr nucleus = MaterialVector[i]->GetComposition()[kkk];
393 int TempIndex =
gMURE->GetTemperatureMap()->AddUsedTemp(nucleus->GetTemperature());
396 for(
int j = 0; j < int(nucleus->GetNucleusMCRecord().size()); j++)
399 if(
gMURE->GetEvolutionSolver()->IsU8StdTally() && nucleus->Z() == 92 && nucleus->A() == 238)
401 tallypos = TheTemperatureMap[TempIndex] - 1;
402 tallynum = FM8[tallypos]->GetNumber();
406 if(tallynum != OldTallyNum8)
408 OldTallyNum8 = tallynum;
414 tallynum = FM[tallypos]->GetNumber();
419 if(tallynum != OldTallyNum)
421 OldTallyNum = tallynum;
425 if (nucleus->GetZAI()->GetReactionDaughterSize() > 0)
428 if(
gMURE->GetEvolutionSolver()->IsU8StdTally() && nucleus->Z() == 92 && nucleus->A() == 238)
434 if(
gMURE->GetEvolutionSolver()->IsU8StdTally() && nucleus->Z() == 92 && nucleus->A() == 238)
439 for(
int k = 0; k < int(XScode.size()); k++)
441 if(
gMURE->GetEvolutionSolver()->IsU8StdTally() && nucleus->Z() == 92 && nucleus->A() == 238)
443 FM8[tallypos]->AddMultiplicator(MaterialVector[i], XScode[k]);
450 if(XScode[k] == -6 && nucleus->Z() == 92 && nucleus->A() == 235)
452 FM[tallypos]->AddMultiplicator(MaterialVector[i], XScode[k]);
455 nucleus->SetXSCode(XScode);
457 if(
gMURE->GetEvolutionSolver()->IsU8StdTally() && nucleus->Z() == 92 && nucleus->A() == 238)
459 FM8[tallypos]->AddMultiplicator(MaterialVector[i], 1);
467 FM[tallypos]->AddMultiplicator(MaterialVector[i], 1);
489 ifstream MyFile(Mfile.c_str());
496 LOG_ERROR(
"Error while reading tallies from m file : could not open file " << Mfile);
504 LOG_INFO(
"---------------------------------------------------------------------------");
507 vector<Material *> MaterialVector =
gMURE->GetEvolutionSolver()->GetPerturbativeMaterial();
510 LOG_INFO(
"All Multigroup Detector read and updated.");
511 LOG_INFO(
"---------------------------------------------------------------------------");
520 if(
gMURE->GetSource()->GetKcode())
525 int NumberOfTallies =
fMCOutput->GetNbTal();
530 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector().size()); i++)
532 Cell *TheCell =
gMURE->GetEvolutionSolver()->GetEvolutiveSystemVector()[i]->GetCell();
539 for(
int j = 0; j < NumberOfTallies; j++)
541 TMTally *TheTally =
fMCOutput->GetTally(j);
543 if(
int(TheTally->fNo) == TallyNum)
545 float *EnergyBins = TheTally->fEV;
547 NRJ.assign(EnergyBins, EnergyBins + (TheTally->fEN - 1));
552 for(
int e = 0; e < int(TheTally->fEN) - 1; e++)
554 ValErr_t UnNormalizedPhi = TheTally->fVal[TallyBinNum][0][0][0][0][0][e][0];
560 ValErr_t Phi = TheTally->fVal[TallyBinNum][0][0][0][0][0][int(TheTally->fEN) - 1][0];
573 char Wheele[8] = {
'|',
'/',
'-',
'\\',
'|',
'/',
'-',
'\\'};
574 cout <<
"Reading Sigma from ACE file. Please Wait.... " << flush;
575 #pragma omp parallel for reduction(+:kkk) schedule(static)
576 for(
int i = 0 ; i < int(MaterialVector.size()); i++)
578 bool IsEvolvingOrPerturbative = (MaterialVector[i]->IsEvolving() || MaterialVector[i]->IsPerturbative());
579 if(!(MaterialVector[i]->IsOutCore()) && IsEvolvingOrPerturbative )
583 for(
int jjj = 0; jjj < int(MaterialVector[i]->GetComposition().size()); jjj++)
585 if(MaterialVector[i]->GetComposition(jjj)->GetZAI()->IsInDataBase())
590 printf(
"%c%c",
char(8), Wheele[kkk]);
597 Nucleus_ptr nucleus = MaterialVector[i]->GetComposition()[jjj];
603 if(
gMURE->GetEvolutionSolver()->IsU8StdTally() && nucleus->Z() == 92 && nucleus->A() == 238)
606 for(
int RecIdx = 0; RecIdx < int(nucleus->GetNucleusMCRecord().size()); RecIdx++)
610 TMTally *TheTally = 0;
611 for(
int j = 0; j < NumberOfTallies; j++)
625 if (nucleus->GetZAI()->GetReactionDaughterSize() > 0)
634 ValErr_t UnNormalizedSigmaPhi = TheTally->fVal[n][0][0][0][m][0][0][0];
635 if(UnNormalizedSigmaPhi.fErr == 0)
636 UnNormalizedSigmaPhi.fErr = 1.e-10;
637 if(
gMURE->GetEvolutionSolver()->IsPartialMCRun() &&
gMURE->GetEvolutionSolver()->IsPartialParticleMCRun())
639 nucleus->SetMCSigmaPhi2(CellIdx, k, UnNormalizedSigmaPhi);
642 nucleus->SetMCSigmaPhi(CellIdx, k, UnNormalizedSigmaPhi);
645 double UnNormalizedTotalSigmaPhi = TheTally->fVal[n][0][0][0][m][0][0][0].fVal;
646 nucleus->SetTotalSigmaPhi(CellIdx, UnNormalizedTotalSigmaPhi);
661 stringstream KeyWord;
663 KeyWord << XSTMPDirectory[0] << XSTMPDirectory[1] << XSTMPDirectory[2] << XSTMPDirectory[3] << XSTMPDirectory[4] << XSTMPDirectory[5] << XSTMPDirectory[6];
664 string TestWord =
"_xs_tmp";
665 if(!strcmp(TestWord.c_str(), KeyWord.str().c_str()))
669 thebase.open(KeyWord.str().c_str());
690 if (nucleus->GetZAI()->GetReactionDaughterSize() > 0)
695 for(
int RecIdx = 0; RecIdx < int(nucleus->GetNucleusMCRecord().size()); RecIdx++)
702 for(
int ii = 0; ii < int(nucleus->GetXSCode().size()); ii++)
704 int ReactionCode = nucleus->GetXSCode()[ii];
705 int k = nucleus-> FindFMBin(ReactionCode);
722 if(UnNormalizedSigmaPhi.fErr == 0)
723 UnNormalizedSigmaPhi.fErr = 1.e-10;
724 if(
gMURE->GetEvolutionSolver()->IsPartialMCRun() &&
gMURE->GetEvolutionSolver()->IsPartialParticleMCRun())
726 nucleus->SetMCSigmaPhi2(CellIdx, k, UnNormalizedSigmaPhi);
729 nucleus->SetMCSigmaPhi(CellIdx, k, UnNormalizedSigmaPhi);
731 if(
gMURE->IsBetaCalculation())
732 if(
gMURE->IsNucleusUsedForBeta(nucleus->GetZAI()->Z(), nucleus->GetZAI()->A()))
736 nucleus->SetNuSigmaFisPhi(CellIdx, UnNormalizedNuSigmaFisPhi.fVal);
741 nucleus->SetTotalSigmaPhi(CellIdx, UnNormalizedTotalSigmaPhi);
775 bool IsMCOutfileRead =
true;
778 IsMCOutfileRead =
false;
782 TMKcode *TheKcode =
fMCOutput->GetKcode();
783 unsigned long Taille = TheKcode->GetTaille();
784 unsigned long LastCycle = TheKcode->GetTotalCycle() - 1;
786 if(Taille == 19)
gMURE->SetKeff(TheKcode->GetCycle19(LastCycle)->fKEffAll.fVal);
787 if(Taille == 19)
gMURE->SetKeff_Err(TheKcode->GetCycle19(LastCycle)->fKEffAll.fErr);
802 for(
int i = 0; i < int(
gMURE->GetCellVector().size()); i++)
804 if(
gMURE->GetCellVector()[i]->GetMaterial() && !(
gMURE->GetCellVector()[i]->GetNumber() < 0) )
807 gMURE->GetTrueCellVector().push_back(
gMURE->GetCellVector()[i]);
808 gMURE->GetCellVector()[i]->SetTrueCell();
816 if(
gMURE->GetEvolutionSolver()->IsMaterialControl())
818 if(
gMURE->GetTrueCellVector().size())
823 vector<Tally *> GlobalTally(
gMURE->GetTrueCellVector().size());
824 for(
int i = 0; i < int(GlobalTally.size()); i++)
826 GlobalTally[i] =
new Tally;
828 for(
int i = 0; i < int(
gMURE->GetTrueCellVector().size()); i++)
830 GlobalTally[i]->
Add(
gMURE->GetTrueCellVector()[i],
false);
832 gMURE->GetTrueCellVector()[i]->SetGlobalTallyNumber(GlobalTally[i]->GetNumber());
833 Material *Mat =
gMURE->GetTrueCellVector()[i]->GetMaterial();
834 GlobalTally[i]->SetBinVolume(0, 1e-6);
835 GlobalTally[i]->AddMultiplicator(Mat, -2, -1);
836 GlobalTally[i]->AddMultiplicator(Mat, 16, -1);
837 GlobalTally[i]->AddMultiplicator(Mat, 17, -1);
838 GlobalTally[i]->AddMultiplicator(Mat, -6, -1);
839 GlobalTally[i]->AddMultiplicator(Mat, Nufiss, -1);
844 Material *TheControlMat =
gMURE->GetEvolutionSolver()->FindPerturbativeMaterial(Mat);
846 LOG_ERROR(
"No perturbative ControlMaterial found.");
848 for(
int j = 0; j < int(((
ControlMaterial *)Mat)->GetControlReactions().size()); j++)
850 GlobalTally[i]->AddMultiplicator(TheControlMat, &((
ControlMaterial *)Mat)->GetControlReactions()[j], -1);
857 if(
gMURE->GetOutermostShape().Get() == 0)
859 LOG_ERROR(
"Most outer shape has not been specified for control material loss evaluation.Give it with gMURE->SetOutermostShape(Ext) where Ext is the exterior Shape.");
861 GlobalLosses->
Add(
gMURE->GetOutermostShape());
863 gMURE->GetEvolutionSolver()->SetGlobalLossesTallyNumber(GlobalLosses->
GetNumber());
867 if(
gMURE->GetEvolutionSolver()->GetControlRodCell().size())
870 vector<Tally *> GlobalTally(
gMURE->GetEvolutionSolver()->GetControlRodCell().size());
871 for(
int i = 0; i < int(GlobalTally.size()); i++)
873 GlobalTally[i] =
new Tally;
876 for(
int i = 0; i < int(
gMURE->GetEvolutionSolver()->GetControlRodCell().size()); i++)
878 PinCell *ControlRodPinCell =
dynamic_cast<PinCell *
>(
gMURE->GetEvolutionSolver()->GetControlRodCell()[i]);
879 if (ControlRodPinCell != NULL)
882 if(ControlLayerNumber == -1)
884 LOG_ERROR(
"One of the ControlRod is a PinCell and the layer containing control material in this PinCell has not been defined.Give it with gMURE->SetControlLayerNumber(i) where i is the number of the layer, 0 being the central one.");
886 GlobalTally[i]->Add(ControlRodPinCell, ControlLayerNumber);
890 GlobalTally[i]->Add(
gMURE->GetEvolutionSolver()->GetControlRodCell()[i]);
892 gMURE->GetEvolutionSolver()->GetControlRodCell()[i]->SetGlobalTallyNumber(GlobalTally[i]->GetNumber());
893 GlobalTally[i]->SetBinVolume(0, 1e-6);
896 if (ControlRodPinCell != NULL)
903 Mat =
gMURE->GetEvolutionSolver()->GetControlRodCell()[i]->GetMaterial();
906 GlobalTally[i]->AddMultiplicator(Mat, -2, -1);
929 if(
gMURE->IsESpectrum())
932 for(
int i = 0; i < (int)
gMURE->GetTrueCellVector().size(); i++)
933 ESpectrum->
Add(
gMURE->GetTrueCellVector()[i]);
934 if(
gMURE->IsUseEnergyBinsFile())
937 ESpectrum->
AddEnergy(10000, 0.00011, 19640330.00);
948 int NumberOfTallies =
fMCOutput->GetNbTal();
950 if(
gMURE->GetEvolutionSolver()->IsMaterialControl())
953 LOG_DEBUG(
"Material control: finding corresponding tallies...");
954 for(
int i = 0 ; i < int(
gMURE->GetTrueCellVector().size()); i++)
956 Cell *TheCell =
gMURE->GetTrueCellVector()[i];
959 for(
int j = 0; j < NumberOfTallies; j++)
961 TMTally *TheTally =
fMCOutput->GetTally(j);
962 if(
int(TheTally->fNo) == GlobalTallyNum)
965 for(
int m = 0; m < 5; m++)
968 ValErr_t UnNormalizedRate = TheTally->fVal[0][0][0][0][m][0][0][0];
971 if(m == 1) TheCell->
SetCellN2N(UnNormalizedRate);
972 if(m == 2) TheCell->
SetCellN3N(UnNormalizedRate);
979 LOG_DEBUG(
"Control material CELL FOUND");
981 for(
int m = 5 ; m < 5 + int(React.size()); m++)
983 ValErr_t UnNormalizedRate = TheTally->fVal[0][0][0][0][m][0][0][0];
988 if(
int(TheTally->fNo) ==
gMURE->GetEvolutionSolver()->GetGlobalLossesTallyNumber())
989 gMURE->GetEvolutionSolver()->SetNeutronLosses(TheTally->fVal[0][0][0][0][0][0][0][0]);
992 gMURE->GetEvolutionSolver()->SetGlobalRates();
996 if(
gMURE->GetEvolutionSolver()->GetControlRodCell().size())
998 for(
int i = 0 ; i < int(
gMURE->GetEvolutionSolver()->GetControlRodCell().size()); i++)
1000 Cell *TheCell =
gMURE->GetEvolutionSolver()->GetControlRodCell()[i];
1003 for(
int j = 0; j < NumberOfTallies; j++)
1005 TMTally *TheTally =
fMCOutput->GetTally(j);
1006 if(
int(TheTally->fNo) == GlobalTallyNum)
1008 ValErr_t UnNormalizedRate = TheTally->fVal[0][0][0][0][0][0][0][0];
1015 if(
gMURE->IsESpectrum())
1018 int NumberOfCells =
gMURE->GetTrueCellVector().size();
1019 double Zero = 1.e-18 ;
1022 name <<
"ESPECTRUM";
1023 string filename =
gMURE->GetMCRunDirectory() +
"/" + name.str();
1024 ofstream eoutfile(filename.c_str(), ios::app);
1026 for(
int j = 0; j < NumberOfTallies; j++)
1028 TMTally *TheTally =
fMCOutput->GetTally(j);
1029 if(
int(TheTally->fNo) ==
gMURE->GetESpectrumTallyNumber())
1031 LOG_DEBUG(
"ESpectrumTallyNum = " <<
gMURE->GetESpectrumTallyNumber());
1032 float *EnergyBins = TheTally->fEV;
1035 for(
int f = 0; f < NumberOfCells; f++)
1037 for(
int e = 0; e < int(TheTally->fEN) - 1; e++)
1039 double Flux_E = TheTally->fVal[f][0][0][0][0][0][e][0].fVal;
1040 double Flux_E_err = TheTally->fVal[f][0][0][0][0][0][e][0].fErr;
1041 if ( Flux_E == 0. ) Flux_E = Zero;
1042 eoutfile << EnergyBins[e] <<
" " << Flux_E <<
" " << Flux_E_err << endl;
1044 eoutfile <<
"&" << endl;
1055 LOG_INFO(
"---------------------------------------------------------------------------");
1056 LOG_INFO(
"Thermal Hydraulics Tallies building.");
1057 LOG_IMP_WARN(
"No perturbative materials built : this method must be used carefully");
1059 vector<Material *> MaterialVector =
gMURE->GetMaterialVector();
1064 LOG_INFO(
"---------------------------------------------------------------------------");
1070 LOG_INFO(
"---------------------------------------------------------------------------");
1073 vector<Material *> MaterialVector =
gMURE->GetMaterialVector();
1076 LOG_INFO(
"All Thermal Hydraulics Tallies read and updated.");
1077 LOG_INFO(
"---------------------------------------------------------------------------");
Header file for MCNP::Connector class.
Header file for MCNP::Cylinder class.
Header file for MCNP::Node class.
Header file for MCNP SimpleBin, GroupBin, LatticeBin and Tally classes.
#define LOG_DEBUG(msg)
Definition MUREGlobal.hxx:45
#define LOG_ERROR(msg)
Print an error and terminate the program by calling exit(999).
Definition MUREGlobal.hxx:55
std::unique_ptr< MURE > gMURE
#define LOG_IMP_WARN(msg)
Print a important warning (something happened, but MURE took care)
Definition MUREGlobal.hxx:51
#define LOG_INFO(msg)
Print info message (Now MURE is doing this ...)
Definition MUREGlobal.hxx:47
Header file for vector operation, Regression and FindFitParameters functions.
Header file for ReadXSFile class.
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
int GetNEnergyGroup()
Definition Cell.hxx:350
void SetCellFissions(ValErr_t rate)
Definition Cell.hxx:400
void SetMultiGroupFlux(int i, ValErr_t Flux)
Definition Cell.hxx:338
void SetFlux(double phi)
Definition Cell.hxx:320
int GetNumber()
Definition Cell.hxx:158
int GetTallyNumber()
Definition Cell.hxx:276
void SetCellN3N(ValErr_t rate)
Definition Cell.hxx:396
void SetEnergyGroup(vector< float > &nrj)
Definition Cell.hxx:354
void SetMCFlux(ValErr_t phi)
Definition Cell.hxx:324
void SetCellN2N(ValErr_t rate)
Definition Cell.hxx:392
void SetTallyNumber(int num)
Definition Cell.hxx:272
ValErr_t GetMultiGroupFlux(int i)
Definition Cell.hxx:342
Material * GetMaterial()
Definition Cell.hxx:135
void SetCellNuFissions(ValErr_t rate)
Definition Cell.hxx:404
vector< float > & GetEnergyGroups()
Definition Cell.hxx:359
void SetControlRate(Reaction r, ValErr_t rate)
Definition Cell.hxx:417
int GetTallyBinNumber()
Definition Cell.hxx:284
void BuildMultiGroupFlux()
Build the group flux for multigroup run.
Definition Cell.cxx:720
void SetCellAbsorptions(ValErr_t rate)
Definition Cell.hxx:388
void SetTallyBinNumber(int num)
Definition Cell.hxx:280
int GetGlobalTallyNumber()
Definition Cell.hxx:383
bool fRebuildDetector
whether or not rebuild detectors (for thermo-hydraulics)
Definition ConnectorPlugin.hxx:186
bool fTHMultigroupTallies
True in Thermal hydraulics multigroup calculation.
Definition ConnectorPlugin.hxx:192
A ControlMaterial.
Definition ControlMaterial.hxx:51
void BuildTHMultiGroupDetectors() override
Definition MCNPConnector_detectors_legacy.cxx:1053
TMctal * fMCOutput
A result tallies from a MCNP m's files.
Definition MCNPConnector.hxx:234
void UpdateKeff() override
read from MC output the keff and give it to MURE
Definition MCNPConnector_detectors_legacy.cxx:773
void UpdateTHMultiGroupSigmaPhiDetectors() override
Definition MCNPConnector_detectors_legacy.cxx:1068
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
void BuildDetectors() override
build automatic tallies for standard evolution
Definition MCNPConnector_detectors_legacy.cxx:39
void BuildMultiGroupDetectors() override
build automatic tallies for in a multigroup evolution
Definition MCNPConnector_detectors_legacy.cxx:272
void ReadDetectorFile()
Definition MCNPConnector_detectors_legacy.cxx:485
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
string GetMCDetectorOutputFileName(string InputFileName, bool OnlyKeff=false) override
Definition MCNPConnector.hxx:90
Define a MCNP Tally.
Definition MCNPTally.hxx:161
void SetBinSurface(int i, double S)
set the ith bin surface of Tally bin
Definition MCNPTally.cxx:399
A Material constituing a Cell.
Definition Material.hxx:83
double GetTemperature()
Definition Material.hxx:271
vector< Nucleus_ptr > & GetComposition()
Definition Material.hxx:182
void SetPrintable(bool flag=true)
Definition MureTally.hxx:282
void AddMultiGroupEnergy(double Emin, double Emax, double decad_mult=1)
Definition MureTally.cxx:320
int GetNumber()
Definition MureTally.hxx:154
void AddEnergy(int NE, double *E)
Definition MureTally.cxx:236
void Add(Cell *C, bool SetCellTally=true)
Add a cell bin.
Definition MureTally.cxx:438
A NucleusMCRecord allows to record data for writing &reading reaction rates tallies.
Definition NucleusMCRecord.hxx:54
vector< int > & GetMultiplicatorBinIndex()
Definition NucleusMCRecord.hxx:87
int GetTallyNumber()
Definition NucleusMCRecord.hxx:73
vector< int > AddMultiplicatorBinIndex(int &FMBinIdx, Nucleus *nuc)
Set Multiplicator tally bin index for reaction rates.
Definition NucleusMCRecord.cxx:67
int GetNumberOfMultiplicatorBin()
Definition NucleusMCRecord.hxx:110
int GetCellNumber(int i)
Definition NucleusMCRecord.hxx:115
void SetTotalXSMultiplicatorBinIndex(int FMbin)
Definition NucleusMCRecord.hxx:91
int GetTallyBinIndex(int i)
Definition NucleusMCRecord.hxx:119
int GetTotalXSMultiplicatorBinIndex()
Definition NucleusMCRecord.hxx:95
int GetNumberOfCellBin()
Definition NucleusMCRecord.hxx:106
PinCell class allows to create cylindrical cell set included as Matrioshka.
Definition PinCell.hxx:53
Material * GetLayerMaterial(int i)
return the material of the layer i (i=0, innerest layer)
Definition PinCell.cxx:162
int GetControlLayerNumber()
Definition PinCell.hxx:226
Define a Reaction list for Tally multiplicator inputs.
Definition Reaction.hxx:41
void Multiply(int code)
multiply reaction (e.g. nu*fission)
Definition Reaction.cxx:77
Allows to read XS file in the MCNP ACE format.
Definition ReadXSFile.hxx:83
ValErr_t NuSigmaFisPhi(int N, vector< ValErr_t > &Phi, float *Ephi)
return
Definition ReadXSFile.cxx:770
ValErr_t SigmaPhi(int N, vector< ValErr_t > &Phi, float *Ephi, int MT, double emin=0, double emax=1e40)
return
Definition ReadXSFile.cxx:794
Handle dynamical object creation and pointer affectation.
Definition TReference.hxx:74
T * Get() const
Definition TReference.hxx:102
Extract all parameters from an XSDIR line.
Definition XSDIRLine.hxx:43
int GetTableLength()
Definition XSDIRLine.hxx:79
int GetDataType()
Definition XSDIRLine.hxx:71
int GetStartRecord()
Definition XSDIRLine.hxx:75
int GetRecordLength()
Definition XSDIRLine.hxx:83
string GetXSFileName()
Definition XSDIRLine.hxx:131
int GetEntriesPerRecord()
Definition XSDIRLine.hxx:87
This MCNP (concrete) class is used to built a reactor assembly.
Definition MCNPBrick.hxx:41
the namespace of the Standard C++