MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Material.hxx
Go to the documentation of this file.
1 #ifndef _MATERIAL_
2 #define _MATERIAL_
3 
8 #include <math.h>
9 #include <vector>
10 #include "MureHeaders.hxx"
11 using namespace std;
12 
13 
15 
21 
26 
27 //________________________________________________________________________
28 //
29 // Material
31 
51 //________________________________________________________________________
52 
53 class Material
54 {
55  public:
57 
60  Material();
61 
63 
68  Material(int theNumber);
69  Material(const Material &m);
70  virtual ~Material();
71 
73 
76  virtual Material* Copy();
78 
97  virtual Material* Clone(double Temperature=-1);
98 
103 
116  void AddNucleus(int Z, int A, double Proportion=1., ProportionUnitType ProportionUnit=kpMOL, string ModeratorCatgory="");
118 
131  void AddNucleus(int Z, int A, int I,double Proportion, ProportionUnitType ProportionUnit=kpMOL, string ModeratorCatgory="");
133 
144  void AddNucleus(ZAI *zai, double Proportion=1., ProportionUnitType ProportionUnit=kpMOL, string ModeratorCatgory="");
146 
151  void AddNucleus(Nucleus_ptr nucleus, double Proportion=1., ProportionUnitType ProportionUnit=kpMOL);
152 
153  vector<Nucleus_ptr> &GetComposition(){return fComposition;}
154  Nucleus_ptr GetComposition(int i){return fComposition[i];}
155  void SetComposition(vector<Nucleus_ptr> f){fComposition = f;}
156  Nucleus_ptr GetNucleus(int Z, int A, int I=0);
157 
158  double GetProportion(int i,ProportionUnitType ProportionUnit);
159 
167  void SetProportion(int i, double proportion,ProportionUnitType ProportionUnit);
168  void ResetProportion();
169 
171 
180  Material* Mix(Material* M2, double part,ProportionUnitType ProportionUnit=kpMOL, Material* M3=0);
181 
182  virtual vector <Material*> Duplicate(int N,bool TrueClone=true);
183  void Proportion2AtomCM3();
184  ProportionUnitType GetProportionUnit(){return fProportionUnit;}
185  double SumProportion();
186  int GetZAIIndex(ZAI *zai);
187  int GetZAIIndex(int Z,int A, int I);
188  void UpdateZAI(bool WithReactions=true,bool WithSF=true);
189  void AddToGlobalNucleiVector();
190  void AddZAIDaughters(ZAI *zai);
191 
193 
198 
199  double GetDensity(DensityUnitType DensityUnit);
200 
205  void SetDensity(double Density, DensityUnitType DensityUnit=kdGCM3);
206  DensityUnitType GetDensityUnit(){return fDensityUnit;}
207  double GetTemperature(){return fTemperature;}
208  void SetTemperature(double T=293.6);
209  bool HasModerator(){return (fModeratorName.size()>0);}
210  double MeanMolarMass();
211  bool IsFuel(){return fFuel;}
212  bool IsModerator(){return fModerator;}
213  bool IsCladding(){return fCladding;}
214  bool IsCoolant() {return fCoolant;}
215  bool IsWaterGap() {return fWaterGap;}
216  bool IsModeratorBox() {return fModeratorBox;}
217  void SetFuel(bool flag = true){fFuel=flag;}
218  void SetModerator(bool flag = true){fModerator=flag;}
219  void SetCladding(bool flag = true){fCladding=flag;}
220  void SetCoolant(bool flag = true){fCoolant=flag;}
221  void SetWaterGap(bool flag = true){fWaterGap=flag;}
222  void SetModeratorBox(bool flag = true){fModeratorBox=flag;}
223 
224 
229 
231 
235  string Print();
236  string PrintAll();
237 
241  string PrintModerator();
242  string PrintCompositionInfo();
243 
248  void ForbidPrint(){fPrintable=false;}
249  void EnablePrint() {fPrintable=true;}
250 
251  void SetPseudoMaterial();
252  bool IsPseudoMaterial() {return fPseudoMaterial;}
253 
254  bool IsPrintable(){return fPrintable;}
255 
257 
260  string PrintDensityUnit(DensityUnitType DensityUnit=kdUNDEFINED);
262 
265  string PrintProportionUnit(ProportionUnitType ProportionUnit=kpUNDEFINED);
266  void DumpMaterial(string filename="material.dat");
267  void DumpCompositionInfo(string name="CompInfo.dat");
268 
269  void DumpMaterial(string Filename,double Mass,double Volume);
270 
271 
275  int GetNumber(){return fNumber;}
276  void SetNumber(int n){fNumber =n;}
277 
279 
284  void SetDefaultXSExtension(string name);
285  string GetDefaultXSExtension(){return fDefaultXSExtension;}
286  void SetEvolution();
287  bool IsEvolving(){return fEvolution;}
288  bool IsPerturbative(){return fPerturbative;}
289  void SetPerturbative(bool flag=true){fPerturbative=flag;}
290 
291  void SortCompositionByAmount();
292  void SortCompositionByMass();
293  void FindTotalSigmaPerNucleus();
294  Material *GetFatherOfPseudoClone(){return fFatherOfPseudoClone;}
295  void SetTemperatureEvolution(bool flag=true);
296 
297  bool IsOutCore(){return fOutCore;}
298  Cell* SetOutCore(int TheNumber,double TheVolume);
299  void SetMaterialName(string name){fMaterialName=name;}
300  string GetMaterialName(){return fMaterialName;}
301  void ResetTree(){delete fTree; fTree=0;}
302 
304 
305  protected:
307 
311  Material(Material *m);
312 
313  int fNumber;
314  double fDensity;
316  double fTemperature;
317  bool fEvolution;
319  string fModeratorName;
320  string fMaterialName;
322  bool fUpdated;
323  vector<Nucleus_ptr> fComposition;
324  vector<double> fProportion;
326  static NucleiTree *fTree;
327  map<int ,map<int ,map<int,int> > > fIndex;
330  bool fFuel ;
331  bool fModerator;
332  bool fCladding;
333  bool fCoolant;
334  bool fWaterGap;
336 
337  bool fPrintable;
338  bool fOutCore;
340 
341 };
342 #endif
ProportionUnitType GetProportionUnit()
return the proportion units
Definition: Material.hxx:184
double GetTemperature()
returns the temperature in K.
Definition: Material.hxx:207
void SetFuel(bool flag=true)
declares material as a Fuel
Definition: Material.hxx:217
Definition: Material.hxx:25
A Cell is a MCNP cell.
Definition: Cell.hxx:48
bool IsPseudoMaterial()
Is pesudo material.
Definition: Material.hxx:252
bool IsFuel()
return true if material has been declared as a Fuel
Definition: Material.hxx:211
void SetModeratorBox(bool flag=true)
declares material as a ModeratorBox
Definition: Material.hxx:222
double fDensity
Density of the Material.
Definition: Material.hxx:314
bool HasModerator()
Whether or not will this Material contains a Moderator.
Definition: Material.hxx:209
string GetMaterialName()
returns the name of material
Definition: Material.hxx:300
Definition: Material.hxx:19
DensityUnitType GetDensityUnit()
return the density units
Definition: Material.hxx:206
Handle dynamical object creation and pointer affectation.
Definition: TReference.hxx:40
bool IsPerturbative()
Whether the material is a virtual (perturbative) material.
Definition: Material.hxx:288
void SetCoolant(bool flag=true)
declares material as a Coolant
Definition: Material.hxx:220
bool IsCladding()
return true if material has been declared as a cladding
Definition: Material.hxx:213
void SetMaterialName(string name)
declares the name of the material (used when thermal coupling)
Definition: Material.hxx:299
vector< double > fProportion
the Proportion vector
Definition: Material.hxx:324
bool fOutCore
whether or not material is an Out core evolving material
Definition: Material.hxx:338
bool IsPrintable()
wether or not the Material is printable
Definition: Material.hxx:254
bool IsWaterGap()
return true if material has been declared as a water gap
Definition: Material.hxx:215
bool fEvolution
whether or not will this Material will evolve with the time
Definition: Material.hxx:317
void SetPerturbative(bool flag=true)
Whether the material is a virtual (perturbative) material.
Definition: Material.hxx:289
void ResetTree()
Delete the fTree static attribute.
Definition: Material.hxx:301
bool IsModerator()
return true if material has been declared as a moderator
Definition: Material.hxx:212
string GetDefaultXSExtension()
return default extension for all nuclei of the material.
Definition: Material.hxx:285
Definition: Material.hxx:19
bool fWaterGap
whether or not this material is considered WaterGap.
Definition: Material.hxx:334
void EnablePrint()
allow a Material print in MCNP.
Definition: Material.hxx:249
int GetNumber()
Returns the MCNP Material number.
Definition: Material.hxx:275
void SetNumber(int n)
sets the MCNP Material number
Definition: Material.hxx:276
Definition: Material.hxx:25
bool fPrintable
whether or not material is printable in MCNP input file (default)
Definition: Material.hxx:337
ProportionUnitType fProportionUnit
Proportion vector unit (mol (default), at/barn.cm, at/cm3 or g/cm3)
Definition: Material.hxx:325
bool fCladding
whether or not this material is considered cladding.
Definition: Material.hxx:332
bool IsModeratorBox()
return true if material has been declared as a moderator box
Definition: Material.hxx:216
Definition: Material.hxx:19
string fDefaultXSExtension
Give a default extension to all nucleus.
Definition: Material.hxx:321
bool fUpdated
true if ZAI have been updated (UpdateZAI) for evolution only
Definition: Material.hxx:322
File including all headers.
Definition: Material.hxx:19
bool IsCoolant()
return true if material has been declared as a coolant
Definition: Material.hxx:214
map< int,map< int,map< int, int > > > fIndex
The index of the ZAI in the material composition.
Definition: Material.hxx:327
static NucleiTree * fTree
The whole chart of Nucleide.
Definition: Material.hxx:326
A NucleiTree defines the whole tree of nuclei in case of evolution for a single ZAI.
Definition: NucleiTree.hxx:44
void SetModerator(bool flag=true)
declares material as a moderator
Definition: Material.hxx:218
vector< Nucleus_ptr > & GetComposition()
return the Composition vector
Definition: Material.hxx:153
DensityUnitType fDensityUnit
Density unit (either g/cm3 (default), at/cm3 or at/barn.cm)
Definition: Material.hxx:315
int fNumber
Number of the Material in MCNP file.
Definition: Material.hxx:313
Definition: Material.hxx:25
Material * fFatherOfPseudoClone
the father to used in cell in case of Pseudo clone
Definition: Material.hxx:328
string fMaterialName
Name of the material (uo2, water, ... used when thermal coupling)
Definition: Material.hxx:320
Nucleus_ptr GetComposition(int i)
return the Composition vector
Definition: Material.hxx:154
Definition: Material.hxx:19
bool fCoolant
whether or not this material is considered Coolant.
Definition: Material.hxx:333
ProportionUnitType
Define the proportion units.
Definition: Material.hxx:19
A Material constituing a Cell.
Definition: Material.hxx:53
void ForbidPrint()
Forbid Material print in MCNP.
Definition: Material.hxx:248
bool fModerator
whether or not this material is considered moderator.
Definition: Material.hxx:331
Material * GetFatherOfPseudoClone()
returns the father (&quot;original&quot;) of a pseudo clone
Definition: Material.hxx:294
A ZAI defined a (Z,A,Isomere) for a Nucleus.
Definition: ZAI.hxx:62
void SetWaterGap(bool flag=true)
declares material as a WaterGap
Definition: Material.hxx:221
double fTemperature
Temperature (in K) at which the Material is used (to find the right MCNP code)
Definition: Material.hxx:316
string fModeratorName
Name of the moderator to be print in MT card (e.g. grph.06t)
Definition: Material.hxx:319
bool fTemperatureEvolution
whether or not temperature will evolve
Definition: Material.hxx:329
bool fPerturbative
whether this Material is a virtual (perturbative) material for MCNP input
Definition: Material.hxx:318
bool IsOutCore()
wether or not the Material is evolving out of the core
Definition: Material.hxx:297
void SetCladding(bool flag=true)
declares material as a cladding
Definition: Material.hxx:219
bool fModeratorBox
whether or not this material is considered ModeratorBox.
Definition: Material.hxx:335
Definition: Material.hxx:25
void SetComposition(vector< Nucleus_ptr > f)
set the composition vector
Definition: Material.hxx:155
bool fFuel
whether or not this material is considered fuel.
Definition: Material.hxx:330
DensityUnitType
Define the density units.
Definition: Material.hxx:25
vector< Nucleus_ptr > fComposition
the Composition vector
Definition: Material.hxx:323
bool fPseudoMaterial
Is the material a pseudomaterial?
Definition: Material.hxx:339
bool IsEvolving()
Whether or not will this Material will evolve with the time.
Definition: Material.hxx:287

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014