Warning, file /include/Geant4/G4CrystalExtension.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #ifndef G4CrystalExtension_HH
0041 #define G4CrystalExtension_HH 1
0042
0043 #include "G4AtomicBond.hh"
0044 #include "G4CrystalAtomBase.hh"
0045 #include "G4CrystalUnitCell.hh"
0046 #include "G4NistManager.hh"
0047 #include "G4VMaterialExtension.hh"
0048
0049 #include <vector>
0050
0051 class G4CrystalExtension : public G4VMaterialExtension
0052 {
0053 public:
0054
0055 using Elasticity = G4double[3][3][3][3];
0056 using ReducedElasticity = G4double[6][6];
0057
0058 public:
0059
0060 G4CrystalExtension(G4Material*, const G4String& name = "crystal");
0061
0062 ~G4CrystalExtension() override = default;
0063
0064 void Print() const override { ; };
0065
0066 G4Material* GetMaterial() { return fMaterial; };
0067 void SetMaterial(G4Material* aMat) { fMaterial = aMat; };
0068
0069 inline void SetUnitCell(G4CrystalUnitCell* aUC) { theUnitCell = aUC; }
0070 inline G4CrystalUnitCell* GetUnitCell() const { return theUnitCell; }
0071
0072 const Elasticity& GetElasticity() const { return fElasticity; }
0073 const ReducedElasticity& GetElReduced() const { return fElReduced; }
0074
0075 G4double GetCijkl(G4int i, G4int j, G4int k, G4int l) const { return fElasticity[i][j][k][l]; }
0076
0077
0078 void SetElReduced(const ReducedElasticity& mat);
0079
0080 void SetCpq(G4int p, G4int q, G4double value);
0081 G4double GetCpq(G4int p, G4int q) const { return fElReduced[p - 1][q - 1]; }
0082
0083 G4CrystalAtomBase* GetAtomBase(const G4Element* anElement);
0084 void AddAtomBase(const G4Element* anElement, G4CrystalAtomBase* aBase)
0085 {
0086 theCrystalAtomBaseMap.insert(std::pair<const G4Element*, G4CrystalAtomBase*>(anElement, aBase));
0087 }
0088
0089 G4CrystalAtomBase* GetAtomBase(G4int anElIdx)
0090 {
0091 return GetAtomBase(fMaterial->GetElement(anElIdx));
0092 }
0093
0094 void AddAtomBase(G4int anElIdx, G4CrystalAtomBase* aLattice)
0095 {
0096 AddAtomBase(fMaterial->GetElement(anElIdx), aLattice);
0097 }
0098
0099
0100
0101 G4bool GetAtomPos(const G4Element* anEl, std::vector<G4ThreeVector>& vecout);
0102 G4bool GetAtomPos(std::vector<G4ThreeVector>& vecout);
0103
0104 G4bool GetAtomPos(G4int anElIdx, std::vector<G4ThreeVector>& vecout)
0105 {
0106 GetAtomPos(fMaterial->GetElement(anElIdx), vecout);
0107 return true;
0108 }
0109
0110
0111
0112 G4complex ComputeStructureFactor(G4double kScatteringVector, G4int h, G4int k, G4int l);
0113 G4complex ComputeStructureFactorGeometrical(G4int h, G4int k, G4int l);
0114
0115 void AddAtomicBond(G4AtomicBond* aBond) { theAtomicBondVector.push_back(aBond); };
0116 G4AtomicBond* GetAtomicBond(G4int idx) { return theAtomicBondVector[idx]; };
0117 std::vector<G4AtomicBond*> GetAtomicBondVector() { return theAtomicBondVector; };
0118
0119 protected:
0120 Elasticity fElasticity;
0121 ReducedElasticity fElReduced;
0122
0123 private:
0124 G4Material* fMaterial;
0125
0126
0127
0128 G4CrystalUnitCell* theUnitCell{nullptr};
0129
0130
0131
0132 std::map<const G4Element*, G4CrystalAtomBase*> theCrystalAtomBaseMap;
0133
0134
0135
0136 std::vector<G4AtomicBond*> theAtomicBondVector;
0137 };
0138
0139 #endif