Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XUnitCell Class Reference

#include <XUnitCell.hh>

Public Member Functions

G4ThreeVector GetSize ()
 
G4ThreeVector GetAngle ()
 
XLogicalBaseGetBase (G4int)
 
void SetSize (G4ThreeVector)
 
void SetAngle (G4ThreeVector)
 
void SetBase (G4int, XLogicalBase *)
 
void AddBase (XLogicalBase *)
 
G4double ComputeVolume ()
 
G4double ComputeMillerOverSizeSquared (G4int, G4int, G4int)
 
G4double ComputeMillerPerSizeSquared (G4int, G4int, G4int)
 
G4double ComputeReciprocalVectorSquared (G4int, G4int, G4int)
 
G4double ComputeReciprocalVector (G4int, G4int, G4int)
 
G4double ComputeDirectVectorSquared (G4int, G4int, G4int)
 
G4double ComputeDirectVector (G4int, G4int, G4int)
 
G4double ComputeDirectPeriodSquared (G4int, G4int, G4int)
 
G4double ComputeDirectPeriod (G4int, G4int, G4int)
 
G4double ComputeAtomVolumeDensity ()
 
G4complex ComputeStructureFactor (G4int, G4int, G4int)
 
G4bool IsOrthogonal ()
 
G4bool IsCubic ()
 
 XUnitCell ()
 
 ~XUnitCell ()
 

Detailed Description

Definition at line 46 of file XUnitCell.hh.

Constructor & Destructor Documentation

XUnitCell::XUnitCell ( )

Definition at line 34 of file XUnitCell.cc.

34  {
35  fSize = G4ThreeVector(0. * CLHEP::angstrom,
36  0. * CLHEP::angstrom,
37  0. * CLHEP::angstrom);
38  fAngle = G4ThreeVector(0.5 * CLHEP::pi * CLHEP::radian,
39  0.5 * CLHEP::pi * CLHEP::radian,
40  0.5 * CLHEP::pi * CLHEP::radian);
41  fNumberOfBases = 0;
42 }
CLHEP::Hep3Vector G4ThreeVector
static constexpr double radian
static constexpr double pi
Definition: SystemOfUnits.h:54
static constexpr double angstrom
Definition: SystemOfUnits.h:82
XUnitCell::~XUnitCell ( )

Definition at line 46 of file XUnitCell.cc.

46  {
47 }

Member Function Documentation

void XUnitCell::AddBase ( XLogicalBase base)

Definition at line 100 of file XUnitCell.cc.

100  {
101  fNumberOfBases++;
102  //the new added basis will be in the last of the [0,fNumberOfBases-1] bases
103  fBase[fNumberOfBases-1] = base;
104 }
const XML_Char int const XML_Char int const XML_Char * base
Definition: expat.h:331
G4double XUnitCell::ComputeAtomVolumeDensity ( )

Definition at line 119 of file XUnitCell.cc.

119  {
120  G4double vAtomVolumeDensity = 0.;
121  for(G4int i=0;i< fNumberOfBases;i++){
122  vAtomVolumeDensity += (fBase[i]->GetElement()->GetZ()
123  *fBase[i]->GetLattice()->GetLatticeNumberOfAtoms());
124  }
125  vAtomVolumeDensity /= ComputeVolume();
126  return vAtomVolumeDensity;
127 }
G4Element * GetElement()
Definition: XLogicalBase.cc:56
G4double GetZ() const
Definition: G4Element.hh:131
int G4int
Definition: G4Types.hh:78
G4double ComputeVolume()
Definition: XUnitCell.cc:108
XLogicalAtomicLattice * GetLattice()
Definition: XLogicalBase.cc:50
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double XUnitCell::ComputeDirectPeriod ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 222 of file XUnitCell.cc.

222  {
223  return std::sqrt(ComputeDirectPeriodSquared(h,k,l));
224 }
G4double ComputeDirectPeriodSquared(G4int, G4int, G4int)
Definition: XUnitCell.cc:216

Here is the call graph for this function:

Here is the caller graph for this function:

G4double XUnitCell::ComputeDirectPeriodSquared ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 216 of file XUnitCell.cc.

216  {
217  return (1./ComputeMillerOverSizeSquared(h,k,l));
218 }
G4double ComputeMillerOverSizeSquared(G4int, G4int, G4int)
Definition: XUnitCell.cc:131

Here is the call graph for this function:

Here is the caller graph for this function:

G4double XUnitCell::ComputeDirectVector ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 210 of file XUnitCell.cc.

210  {
211  return std::sqrt(ComputeDirectVectorSquared(h,k,l));
212 }
G4double ComputeDirectVectorSquared(G4int, G4int, G4int)
Definition: XUnitCell.cc:191

Here is the call graph for this function:

G4double XUnitCell::ComputeDirectVectorSquared ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 191 of file XUnitCell.cc.

191  {
192  if(IsOrthogonal()){
193  return ComputeMillerPerSizeSquared(h,k,l);
194  }
195  else{
196  double vDirectVectorSquared = 0.0;
197  vDirectVectorSquared = ComputeMillerPerSizeSquared(h,k,l);
198  vDirectVectorSquared += 2. * h * k * fSize.y() *
199  fSize.z() * std::cos(fAngle.y()) ;
200  vDirectVectorSquared += 2. * l * h * fSize.x() *
201  fSize.z() * std::cos(fAngle.x()) ;
202  vDirectVectorSquared += 2. * l * l * fSize.x() *
203  fSize.y() * std::cos(fAngle.z()) ;
204  return vDirectVectorSquared;
205  }
206 }
double x() const
G4double ComputeMillerPerSizeSquared(G4int, G4int, G4int)
Definition: XUnitCell.cc:137
double z() const
G4bool IsOrthogonal()
Definition: XUnitCell.cc:229
double y() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double XUnitCell::ComputeMillerOverSizeSquared ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 131 of file XUnitCell.cc.

131  {
132  return std::pow(h/fSize.x(),2.) + std::pow(k/fSize.y(),2.) + std::pow(l/fSize.z(),2.);
133 }
double x() const
double z() const
double y() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double XUnitCell::ComputeMillerPerSizeSquared ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 137 of file XUnitCell.cc.

137  {
138  return std::pow(h*fSize.x(),2.) + std::pow(k*fSize.y(),2.) + std::pow(l*fSize.z(),2.);
139 }
double x() const
double z() const
double y() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double XUnitCell::ComputeReciprocalVector ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 185 of file XUnitCell.cc.

185  {
186  return std::sqrt(ComputeReciprocalVectorSquared(h,k,l));
187 }
G4double ComputeReciprocalVectorSquared(G4int, G4int, G4int)
Definition: XUnitCell.cc:143

Here is the call graph for this function:

G4double XUnitCell::ComputeReciprocalVectorSquared ( G4int  h,
G4int  k,
G4int  l 
)

Definition at line 143 of file XUnitCell.cc.

143  {
144  G4double vReciprocalVectorSquared = 0.0;
145 
146  if(IsOrthogonal()){
147  vReciprocalVectorSquared = ComputeMillerOverSizeSquared(h,k,l);
148  }
149  else{
150  G4double vTemp[6];
151  G4double vVolume = ComputeVolume();
152 
153  vTemp[0] = fSize.y() * fSize.z() * std::sin(fAngle.y());
154  vTemp[0] = std::pow(vTemp[0] * h,2.) / vVolume;
155 
156  vTemp[1] = fSize.x() * fSize.z() * std::sin(fAngle.x());
157  vTemp[1] = std::pow(vTemp[1] * k,2.) / vVolume;
158 
159  vTemp[2] = fSize.x() * fSize.y() * std::sin(fAngle.z());
160  vTemp[2] = std::pow(vTemp[2] * l,2.) / vVolume;
161 
162  vTemp[3] = fSize.x() * fSize.y() * std::pow(fSize.z(),2.) *
163  (std::cos(fAngle.x()) * std::cos(fAngle.y()) - std::cos(fAngle.z()));
164  vTemp[3] *= (2. * h * k);
165 
166  vTemp[4] = fSize.x() * std::pow(fSize.y(),2.) * fSize.z() *
167  (std::cos(fAngle.z()) * std::cos(fAngle.x()) - std::cos(fAngle.y()));
168  vTemp[4] *= (2. * l * h);
169 
170  vTemp[5] = std::pow(fSize.x(),2.) * fSize.y() * fSize.z() *
171  (std::cos(fAngle.y()) * std::cos(fAngle.z()) - std::cos(fAngle.x()));
172  vTemp[5] *= (2. * k * l);
173 
174  vReciprocalVectorSquared = (vTemp[0]+vTemp[1]+vTemp[2]) / vVolume;
175  vReciprocalVectorSquared += (vTemp[3]+vTemp[4]+vTemp[5]);
176  vReciprocalVectorSquared /= vVolume;
177  }
178 
179  vReciprocalVectorSquared *= (4. * CLHEP::pi * CLHEP::pi);
180  return vReciprocalVectorSquared;
181 }
double x() const
G4double ComputeVolume()
Definition: XUnitCell.cc:108
double z() const
G4double ComputeMillerOverSizeSquared(G4int, G4int, G4int)
Definition: XUnitCell.cc:131
G4bool IsOrthogonal()
Definition: XUnitCell.cc:229
double y() const
double G4double
Definition: G4Types.hh:76
static constexpr double pi
Definition: SystemOfUnits.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

G4complex XUnitCell::ComputeStructureFactor ( G4int  ,
G4int  ,
G4int   
)
G4double XUnitCell::ComputeVolume ( )

Definition at line 108 of file XUnitCell.cc.

108  {
109  if(IsOrthogonal()){
110  return ( fSize.x()*fSize.y()*fSize.z() );
111  }
112  else{
113  return (fSize.x()*fSize.y()*fSize.z()*std::cos(fAngle.x())*std::sin(fAngle.z()));
114  }
115 }
double x() const
double z() const
G4bool IsOrthogonal()
Definition: XUnitCell.cc:229
double y() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4ThreeVector XUnitCell::GetAngle ( )

Definition at line 57 of file XUnitCell.cc.

57  {
58  return fAngle;
59 }
XLogicalBase * XUnitCell::GetBase ( G4int  i)

Definition at line 63 of file XUnitCell.cc.

63  {
64  if(i<fNumberOfBases){
65  return fBase[i];
66  }
67  else{
68  G4cout << "XUnitCell::GetBase(G4int) Base "
69  << i << " does not exist" << std::endl;
70  return NULL;
71  }
72 }
G4GLOB_DLL std::ostream G4cout

Here is the caller graph for this function:

G4ThreeVector XUnitCell::GetSize ( )

Definition at line 51 of file XUnitCell.cc.

51  {
52  return fSize;
53 }

Here is the caller graph for this function:

G4bool XUnitCell::IsCubic ( )

Definition at line 239 of file XUnitCell.cc.

239  {
240  if(IsOrthogonal())
241  if(fSize.x() == fSize.y())
242  if(fSize.y() == fSize.z())
243  return true;
244  return false;
245 }
double x() const
double z() const
G4bool IsOrthogonal()
Definition: XUnitCell.cc:229
double y() const

Here is the call graph for this function:

G4bool XUnitCell::IsOrthogonal ( )

Definition at line 229 of file XUnitCell.cc.

229  {
230  if(fAngle.x() == CLHEP::pi / 2.)
231  if(fAngle.y() == CLHEP::pi / 2.)
232  if(fAngle.z() == CLHEP::pi / 2.)
233  return true;
234  return false;
235 }
double x() const
double z() const
double y() const
static constexpr double pi
Definition: SystemOfUnits.h:54

Here is the call graph for this function:

Here is the caller graph for this function:

void XUnitCell::SetAngle ( G4ThreeVector  vAngle)

Definition at line 82 of file XUnitCell.cc.

82  {
83  fAngle = vAngle;
84 }
void XUnitCell::SetBase ( G4int  i,
XLogicalBase base 
)

Definition at line 88 of file XUnitCell.cc.

88  {
89  if(i<fNumberOfBases){
90  fBase[i] = base;
91  }
92  else{
93  G4cout << "XUnitCell::SetBase Base(G4int,G4XLogicalBase) "
94  << i << " does not exist" << std::endl;
95  }
96 }
const XML_Char int const XML_Char int const XML_Char * base
Definition: expat.h:331
G4GLOB_DLL std::ostream G4cout
void XUnitCell::SetSize ( G4ThreeVector  vSize)

Definition at line 76 of file XUnitCell.cc.

76  {
77  fSize = vSize;
78 }

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