57 : fpReactant1(nullptr)
58 , fpReactant2(nullptr)
59 , fObservedReactionRate(0.)
60 , fEffectiveReactionRadius(0.)
68 : fpReactant1(pReactant1)
69 , fpReactant2(pReactant2)
70 , fObservedReactionRate(reactionRate)
71 , fEffectiveReactionRadius(0.)
80 : fpReactant1(nullptr)
81 , fpReactant2(nullptr)
82 , fObservedReactionRate(reactionRate)
83 , fEffectiveReactionRadius(0.)
222 double inv_temp = 1. / temp_K;
225 P[0] + P[1] * inv_temp + P[2] * pow(inv_temp, 2)
226 + P[3] * pow(inv_temp, 3) + P[4] * pow(inv_temp, 4))
232 return P[0] *
G4Exp(P[1] / temp_K)*
238 double rateCste_init)
242 return Df * rateCste_init / D0;
300 if (pReactant1 != pReactant2)
334 ReactivesMV::iterator itReactives;
336 std::map<Reactant*, std::map<Reactant*, G4bool>> alreadyPrint;
338 G4cout <<
"Number of chemical species involved in reactions = "
352 const vector<Reactant*>* reactivesVector =
CanReactWith(moleculeA);
358 for (
G4int iReact = 0; iReact < nbReactants; iReact++)
360 auto moleculeB = (
Reactant*)(*reactivesVector)[iReact];
366 if (!alreadyPrint[moleculeA][moleculeB])
368 outputReaction[
n] = moleculeA->
GetName() +
" + " + moleculeB->GetName();
376 for (
G4int j = 1; j < nbProducts; j++)
383 outputReaction[
n] +=
" -> No product";
394 if (pReactionModel) interactionRange =
397 if (interactionRange != -1)
407 alreadyPrint[moleculeB][moleculeA] =
TRUE;
419 G4int maxlengthOutputReaction = -1;
420 G4int maxlengthOutputReactionRate = -1;
422 for (
G4int i = 0; i <
n; i++)
424 if (maxlengthOutputReaction < (
G4int)outputReaction[i].
length())
426 maxlengthOutputReaction = outputReaction[i].length();
428 if (maxlengthOutputReactionRate < (
G4int)outputReactionRate[i].
length())
430 maxlengthOutputReactionRate = outputReactionRate[i].length();
434 maxlengthOutputReaction += 2;
435 maxlengthOutputReactionRate += 2;
437 if (maxlengthOutputReaction < 10) maxlengthOutputReaction = 10;
438 if (maxlengthOutputReactionRate < 30) maxlengthOutputReactionRate = 30;
442 if (pReactionModel) title =
new G4String[3];
445 title[0] =
"Reaction";
446 title[1] =
"Reaction Rate [dm3/(mol*s)]";
448 if (pReactionModel) title[2] =
449 "Interaction Range for chosen reaction model [nm]";
451 G4cout << setfill(
' ') << setw(maxlengthOutputReaction) <<
left << title[0]
452 << setw(maxlengthOutputReactionRate) <<
left << title[1];
454 if (pReactionModel)
G4cout << setw(2) <<
left << title[2];
459 if (pReactionModel)
G4cout.width(
460 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
462 else G4cout.width(maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
466 for (
G4int i = 0; i <
n; i++)
468 G4cout << setw(maxlengthOutputReaction) <<
left << outputReaction[i]
469 << setw(maxlengthOutputReactionRate) <<
left
470 << outputReactionRate[i];
472 if (pReactionModel)
G4cout << setw(2) <<
left << outputRange[i];
477 if (pReactionModel)
G4cout.width(
478 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
481 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
487 delete[] outputReaction;
488 delete[] outputReactionRate;
489 delete[] outputRange;
501 G4String errMsg =
"No reaction table was implemented";
502 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
511 "No reaction table was implemented for this molecule Definition : " + pReactant1
513 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
517 ReactionDataMap::mapped_type::const_iterator it2 = it1->second.find(pReactant2);
519 if (it2 == it1->second.end())
522 G4String errMsg =
"No reaction table was implemented for this molecule : "
527 return (it2->second);
541 dataList.emplace_back(pData.get());
554 G4String errMsg =
"No reaction table was implemented";
555 G4Exception(
"G4MolecularInteractionTable::CanReactWith",
"",
567 G4String errMsg =
"No reaction table was implemented for this molecule : "
570 G4cout <<
"--- G4MolecularInteractionTable::GetReactionData ---" <<
G4endl;
579 G4cout <<
" G4MolecularInteractionTable::CanReactWith :" <<
G4endl;
581 G4cout <<
" the number of reactants is : " << itReactivesMap->second.size() <<
G4endl;
583 auto itProductsVector = itReactivesMap->second.cbegin();
585 for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
590 return &(itReactivesMap->second);
600 G4String errMsg =
"No reaction table was implemented";
601 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
605 ReactionDataMap::const_iterator itReactivesMap =
fReactionData.find(molecule);
614 G4cout <<
" G4MolecularInteractionTable::CanReactWith :" <<
G4endl;
616 G4cout <<
" the number of reactants is : " << itReactivesMap->second.size() <<
G4endl;
618 SpecificDataList::const_iterator itProductsVector = itReactivesMap->second.begin();
620 for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
625 return &(itReactivesMap->second);
635 G4String errMsg =
"No reaction table was implemented";
636 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
643 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
648 return &(
it->second);
674 std::vector<double>
P = { A0, E_R };
684 std::placeholders::_1,
716 if (pData->GetReactionID() == reactionID)