Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:34

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 
0026 /// \file materials/include/G4LatticeLogical.hh
0027 /// \brief Definition of the G4LatticeLogical class
0028 //
0029 // 20131114  Add verbosity for diagnostic output
0030 // 20131115  Expose maximum array dimensions for use by LatticeReader
0031 
0032 #ifndef G4LatticeLogical_h
0033 #define G4LatticeLogical_h
0034 
0035 #include "G4ThreeVector.hh"
0036 #include "globals.hh"
0037 
0038 #include <iosfwd>
0039 
0040 class G4LatticeLogical
0041 {
0042  public:
0043   enum
0044   {
0045     MAXRES = 322
0046   };  // Maximum map resolution (bins)
0047 
0048  public:
0049   G4LatticeLogical();
0050   virtual ~G4LatticeLogical() = default;
0051 
0052   void SetVerboseLevel(G4int vb) { verboseLevel = vb; }
0053 
0054   G4bool LoadMap(G4int, G4int, G4int, G4String);
0055   G4bool Load_NMap(G4int, G4int, G4int, G4String);
0056 
0057   // Get group velocity magnitude for input polarization and wavevector
0058   virtual G4double MapKtoV(G4int, const G4ThreeVector&) const;
0059 
0060   // Get group velocity direction (unit vector) for input polarization and K
0061   virtual G4ThreeVector MapKtoVDir(G4int, const G4ThreeVector&) const;
0062 
0063   // Dump structure in format compatible with reading back
0064   void Dump(std::ostream& os) const;
0065   void DumpMap(std::ostream& os, G4int pol, const G4String& name) const;
0066   void Dump_NMap(std::ostream& os, G4int pol, const G4String& name) const;
0067 
0068   void SetDynamicalConstants(G4double Beta, G4double Gamma, G4double Lambda, G4double Mu)
0069   {
0070     fBeta = Beta;
0071     fGamma = Gamma;
0072     fLambda = Lambda;
0073     fMu = Mu;
0074   }
0075 
0076   void SetScatteringConstant(G4double b) { fB = b; }
0077   void SetAnhDecConstant(G4double a) { fA = a; }
0078   void SetLDOS(G4double LDOS) { fLDOS = LDOS; }
0079   void SetSTDOS(G4double STDOS) { fSTDOS = STDOS; }
0080   void SetFTDOS(G4double FTDOS) { fFTDOS = FTDOS; }
0081 
0082   G4double GetBeta() const { return fBeta; }
0083   G4double GetGamma() const { return fGamma; }
0084   G4double GetLambda() const { return fLambda; }
0085   G4double GetMu() const { return fMu; }
0086   G4double GetScatteringConstant() const { return fB; }
0087   G4double GetAnhDecConstant() const { return fA; }
0088   G4double GetLDOS() const { return fLDOS; }
0089   G4double GetSTDOS() const { return fSTDOS; }
0090   G4double GetFTDOS() const { return fFTDOS; }
0091 
0092  private:
0093   G4int verboseLevel{0};  // Enable diagnostic output
0094 
0095   G4double fMap[3][MAXRES][MAXRES];  // map for group velocity scalars
0096   G4ThreeVector fN_map[3][MAXRES][MAXRES];  // map for direction vectors
0097 
0098   G4int fVresTheta{0};  // velocity  map theta resolution (inclination)
0099   G4int fVresPhi{0};  // velocity  map phi resolution  (azimuth)
0100   G4int fDresTheta{0};  // direction map theta resn
0101   G4int fDresPhi{0};  // direction map phi resn
0102 
0103   G4double fA{0};  // Scaling constant for Anh.Dec. mean free path
0104   G4double fB{0};  // Scaling constant for Iso.Scat. mean free path
0105   G4double fLDOS{0};  // Density of states for L-phonons
0106   G4double fSTDOS{0};  // Density of states for ST-phonons
0107   G4double fFTDOS{0};  // Density of states for FT-phonons
0108   G4double fBeta{0}, fGamma{0}, fLambda{0}, fMu{0};  // dynamical constants for material
0109 };
0110 
0111 // Write lattice structure to output stream
0112 inline std::ostream& operator<<(std::ostream& os, const G4LatticeLogical& lattice)
0113 {
0114   lattice.Dump(os);
0115   return os;
0116 }
0117 
0118 #endif