Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4CrystalExtension Class Reference

#include <G4CrystalExtension.hh>

Inheritance diagram for G4CrystalExtension:
Collaboration diagram for G4CrystalExtension:

Public Types

typedef G4double Elasticity [3][3][3][3]
 
typedef G4double ReducedElasticity [6][6]
 

Public Member Functions

 G4CrystalExtension (G4Material *, const G4String &name="crystal")
 
 ~G4CrystalExtension ()
 
void Print () const
 
G4MaterialGetMaterial ()
 
void SetMaterial (G4Material *aMat)
 
void SetUnitCell (G4CrystalUnitCell *aUC)
 
G4CrystalUnitCellGetUnitCell () const
 
const ElasticityGetElasticity () const
 
const ReducedElasticityGetElReduced () const
 
G4double GetCijkl (G4int i, G4int j, G4int k, G4int l) const
 
void SetElReduced (const ReducedElasticity &mat)
 
void SetCpq (G4int p, G4int q, G4double value)
 
G4double GetCpq (G4int p, G4int q) const
 
G4CrystalAtomBaseGetAtomBase (const G4Element *anElement)
 
void AddAtomBase (const G4Element *anElement, G4CrystalAtomBase *aBase)
 
G4CrystalAtomBaseGetAtomBase (G4int anElIdx)
 
void AddAtomBase (G4int anElIdx, G4CrystalAtomBase *aLattice)
 
G4bool GetAtomPos (const G4Element *anEl, std::vector< G4ThreeVector > &vecout)
 
G4bool GetAtomPos (std::vector< G4ThreeVector > &vecout)
 
G4bool GetAtomPos (G4int anElIdx, std::vector< G4ThreeVector > &vecout)
 
G4complex ComputeStructureFactor (G4double kScatteringVector, G4int h, G4int k, G4int l)
 
G4complex ComputeStructureFactorGeometrical (G4int h, G4int k, G4int l)
 
void AddAtomicBond (G4AtomicBond *aBond)
 
G4AtomicBondGetAtomicBond (G4int idx)
 
std::vector< G4AtomicBond * > GetAtomicBondVector ()
 
- Public Member Functions inherited from G4VMaterialExtension
 G4VMaterialExtension (const G4String &name)
 
virtual ~G4VMaterialExtension ()
 
const std::size_t & GetHash () const
 
const G4StringGetName () const
 

Protected Attributes

Elasticity fElasticity
 
ReducedElasticity fElReduced
 
- Protected Attributes inherited from G4VMaterialExtension
const G4StringfName
 
const std::size_t fHash
 

Detailed Description

Definition at line 61 of file G4CrystalExtension.hh.

Member Typedef Documentation

typedef G4double G4CrystalExtension::Elasticity[3][3][3][3]

Definition at line 97 of file G4CrystalExtension.hh.

typedef G4double G4CrystalExtension::ReducedElasticity[6][6]

Definition at line 98 of file G4CrystalExtension.hh.

Constructor & Destructor Documentation

G4CrystalExtension::G4CrystalExtension ( G4Material mat,
const G4String name = "crystal" 
)

Definition at line 40 of file G4CrystalExtension.cc.

40  :
42 fMaterial(mat),
43 theUnitCell(0){;}
G4VMaterialExtension(const G4String &name)
G4CrystalExtension::~G4CrystalExtension ( )

Definition at line 47 of file G4CrystalExtension.cc.

47 {;}

Member Function Documentation

void G4CrystalExtension::AddAtomBase ( const G4Element anElement,
G4CrystalAtomBase aBase 
)
inline

Definition at line 129 of file G4CrystalExtension.hh.

129  {
130  theCrystalAtomBaseMap.insert(std::pair<const G4Element*,G4CrystalAtomBase*>(anElement,aBase));
131  }

Here is the caller graph for this function:

void G4CrystalExtension::AddAtomBase ( G4int  anElIdx,
G4CrystalAtomBase aLattice 
)
inline

Definition at line 138 of file G4CrystalExtension.hh.

138  {
139  AddAtomBase(fMaterial->GetElement(anElIdx),aLattice);
140  }
void AddAtomBase(const G4Element *anElement, G4CrystalAtomBase *aBase)
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:202

Here is the call graph for this function:

void G4CrystalExtension::AddAtomicBond ( G4AtomicBond aBond)
inline

Definition at line 176 of file G4CrystalExtension.hh.

176 {theAtomicBondVector.push_back(aBond);};
G4complex G4CrystalExtension::ComputeStructureFactor ( G4double  kScatteringVector,
G4int  h,
G4int  k,
G4int  l 
)

Definition at line 52 of file G4CrystalExtension.cc.

55  {
56  //SF == Structure Factor
57  //AFF == Atomic Form Factor
58  //GFS == Geometrical Structure Factor
59  G4complex SF = G4complex(0.,0.);
60 
61  for(auto anElement: *(fMaterial->GetElementVector())){
62  G4double AFF = G4AtomicFormFactor::GetManager()->Get(kScatteringVector,anElement->GetZ());
63 
64  G4complex GFS = G4complex(0.,0.);
65 
66  for(auto anAtomPos: GetAtomBase(anElement)->GetPos())
67  {
68  G4double aDouble = h * anAtomPos.x()
69  + k * anAtomPos.y()
70  + l * anAtomPos.z();
71  GFS += G4complex(std::cos(2 * CLHEP::pi * aDouble),
72  std::sin(2 * CLHEP::pi * aDouble));
73  }
74 
75 
76  SF += G4complex(AFF * GFS.real(),AFF * GFS.imag());
77  }
78  return SF;
79 }
static G4AtomicFormFactor * GetManager()
G4double Get(G4double kScatteringVector, G4int Z, G4int charge=0)
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
std::complex< G4double > G4complex
Definition: G4Types.hh:81
G4CrystalAtomBase * GetAtomBase(const G4Element *anElement)
double G4double
Definition: G4Types.hh:76
static constexpr double pi
Definition: SystemOfUnits.h:54

Here is the call graph for this function:

G4complex G4CrystalExtension::ComputeStructureFactorGeometrical ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 84 of file G4CrystalExtension.cc.

86  {
87  //GFS == Geometrical Structure Form Factor
88  G4complex GFS = G4complex(0.,0.);
89 
90  for(auto anElement: *(fMaterial->GetElementVector())){
91  for(auto anAtomPos: GetAtomBase(anElement)->GetPos())
92  {
93  G4double aDouble = h * anAtomPos.x()
94  + k * anAtomPos.y()
95  + l * anAtomPos.z();
96  GFS += G4complex(std::cos(2 * CLHEP::pi * aDouble),
97  std::sin(2 * CLHEP::pi * aDouble));
98  }
99  }
100  return GFS;
101 }
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
std::vector< G4ThreeVector > GetPos()
std::complex< G4double > G4complex
Definition: G4Types.hh:81
G4CrystalAtomBase * GetAtomBase(const G4Element *anElement)
double G4double
Definition: G4Types.hh:76
static constexpr double pi
Definition: SystemOfUnits.h:54

Here is the call graph for this function:

G4CrystalAtomBase * G4CrystalExtension::GetAtomBase ( const G4Element anElement)

Definition at line 121 of file G4CrystalExtension.cc.

121  {
122  if((theCrystalAtomBaseMap.count(anElement)<1)){
123  G4String astring = "Atom base for element " + anElement->GetName()
124  + " is not registered." ;
125  G4Exception ("G4CrystalExtension::GetAtomBase()", "cry001", JustWarning,astring);
126 
127  AddAtomBase(anElement, new G4CrystalAtomBase());
128  }
129  return theCrystalAtomBaseMap[anElement];
130 }
void AddAtomBase(const G4Element *anElement, G4CrystalAtomBase *aBase)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4String & GetName() const
Definition: G4Element.hh:127

Here is the call graph for this function:

Here is the caller graph for this function:

G4CrystalAtomBase* G4CrystalExtension::GetAtomBase ( G4int  anElIdx)
inline

Definition at line 134 of file G4CrystalExtension.hh.

134  {
135  return GetAtomBase(fMaterial->GetElement(anElIdx));
136  }
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:202
G4CrystalAtomBase * GetAtomBase(const G4Element *anElement)

Here is the call graph for this function:

G4AtomicBond* G4CrystalExtension::GetAtomicBond ( G4int  idx)
inline

Definition at line 177 of file G4CrystalExtension.hh.

177 {return theAtomicBondVector[idx];};
std::vector<G4AtomicBond*> G4CrystalExtension::GetAtomicBondVector ( )
inline

Definition at line 178 of file G4CrystalExtension.hh.

178 {return theAtomicBondVector;};
G4bool G4CrystalExtension::GetAtomPos ( const G4Element anEl,
std::vector< G4ThreeVector > &  vecout 
)

Definition at line 134 of file G4CrystalExtension.cc.

134  {
135  std::vector<G4ThreeVector> pos;
136  for(auto asinglepos: GetAtomBase(anEl)->GetPos()){
137  pos.clear();
138  theUnitCell->FillAtomicPos(asinglepos,pos);
139  vecout.insert(std::end(vecout), std::begin(pos), std::end(pos));
140  }
141  return true;
142 }
G4bool FillAtomicPos(G4ThreeVector &pos, std::vector< G4ThreeVector > &vecout)
G4CrystalAtomBase * GetAtomBase(const G4Element *anElement)
static const G4double pos

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4CrystalExtension::GetAtomPos ( std::vector< G4ThreeVector > &  vecout)

Definition at line 146 of file G4CrystalExtension.cc.

146  {
147  std::vector<G4ThreeVector> pos;
148  vecout.clear();
149  for(auto anElement: *(fMaterial->GetElementVector())){
150  pos.clear();
151  GetAtomPos(anElement,pos);
152  vecout.insert(std::end(vecout), std::begin(pos), std::end(pos));
153  }
154  return true;
155 }
G4bool GetAtomPos(const G4Element *anEl, std::vector< G4ThreeVector > &vecout)
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
static const G4double pos

Here is the call graph for this function:

G4bool G4CrystalExtension::GetAtomPos ( G4int  anElIdx,
std::vector< G4ThreeVector > &  vecout 
)
inline

Definition at line 149 of file G4CrystalExtension.hh.

149  {
150  GetAtomPos(fMaterial->GetElement(anElIdx),vecout);
151  return true;
152  }
G4bool GetAtomPos(const G4Element *anEl, std::vector< G4ThreeVector > &vecout)
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:202

Here is the call graph for this function:

G4double G4CrystalExtension::GetCijkl ( G4int  i,
G4int  j,
G4int  k,
G4int  l 
) const
inline

Definition at line 109 of file G4CrystalExtension.hh.

109  {
110  return fElasticity[i][j][k][l];
111  }
G4double G4CrystalExtension::GetCpq ( G4int  p,
G4int  q 
) const
inline

Definition at line 117 of file G4CrystalExtension.hh.

117 { return fElReduced[p-1][q-1]; }
const char * p
Definition: xmltok.h:285
ReducedElasticity fElReduced
const Elasticity& G4CrystalExtension::GetElasticity ( ) const
inline

Definition at line 105 of file G4CrystalExtension.hh.

105 { return fElasticity; }
const ReducedElasticity& G4CrystalExtension::GetElReduced ( ) const
inline

Definition at line 106 of file G4CrystalExtension.hh.

106 { return fElReduced; }
ReducedElasticity fElReduced
G4Material* G4CrystalExtension::GetMaterial ( )
inline

Definition at line 76 of file G4CrystalExtension.hh.

76 {return fMaterial;};
G4CrystalUnitCell* G4CrystalExtension::GetUnitCell ( ) const
inline

Definition at line 89 of file G4CrystalExtension.hh.

90  {return theUnitCell;}

Here is the caller graph for this function:

void G4CrystalExtension::Print ( ) const
inlinevirtual

Implements G4VMaterialExtension.

Definition at line 71 of file G4CrystalExtension.hh.

71 {;};
void G4CrystalExtension::SetCpq ( G4int  p,
G4int  q,
G4double  value 
)

Definition at line 115 of file G4CrystalExtension.cc.

115  {
116  if (p>0 && p<7 && q>0 && q<7) fElReduced[p-1][q-1] = value;
117 }
const char * p
Definition: xmltok.h:285
const XML_Char int const XML_Char * value
Definition: expat.h:331
ReducedElasticity fElReduced
void G4CrystalExtension::SetElReduced ( const ReducedElasticity mat)

Definition at line 105 of file G4CrystalExtension.cc.

105  {
106  for (size_t i=0; i<6; i++) {
107  for (size_t j=0; j<6; j++) {
108  fElReduced[i][j] = mat[i][j];
109  }
110  }
111 }
ReducedElasticity fElReduced
void G4CrystalExtension::SetMaterial ( G4Material aMat)
inline

Definition at line 77 of file G4CrystalExtension.hh.

77 {fMaterial = aMat;};
void G4CrystalExtension::SetUnitCell ( G4CrystalUnitCell aUC)
inline

Definition at line 88 of file G4CrystalExtension.hh.

88 {theUnitCell=aUC;}

Member Data Documentation

Elasticity G4CrystalExtension::fElasticity
protected

Definition at line 101 of file G4CrystalExtension.hh.

ReducedElasticity G4CrystalExtension::fElReduced
protected

Definition at line 102 of file G4CrystalExtension.hh.


The documentation for this class was generated from the following files: