1 #ifndef SM_CrystalStructure_H
2 #define SM_CrystalStructure_H
8 #include "SM_Constants.h"
11 #include "functions_array.h"
38 tUCInt mCoordinationNumber;
43 tReal mAtomVolumeWeight;
49 std::array<tReal,SM_Constants::DIM> mUnitCellSize;
57 mCoordinationNumber=0;
62 for(
auto& Sk:mUnitCellSize) Sk=1;
111 mem+= mUnitCellSize.size()*
sizeof(tReal);
123 virtual CORE_UniquePointer<SM_CrystalStructure>
newInstance()
const=0;
156 mCoordinationNumber=n;
170 return mCoordinationNumber;
189 for(
auto& Sk:mUnitCellSize) {
201 for(
const auto& Sk:mUnitCellSize) mUnitVolume*=Sk;
209 d=(d>as.size())?as.size():d;
212 for(tUCInt i=0;i<d;i++) {
228 d=(d>as.size())?as.size():d;
231 tReal *iHs=mUnitCellSize.data();
233 for(
const auto& v:as) {
250 return mUnitCellSize;
267 return mAtomVolumeWeight*mUnitVolume;
272 return mAtomVolumeWeight;
279 mAtomVolumeWeight=weight;
295 std::stringstream ret;
297 ret<<
"Name : "<<
getName()<<
"\n";
298 ret<<
"Unit Cell Size (A):"<<functions_array::toString(mUnitCellSize)<<
"\n";
299 ret<<
"Unit Cell Volume (A^3):"<<mUnitVolume<<
"\n";
300 ret<<
"Coordination number:"<<((int)mCoordinationNumber)<<
"\n";
301 ret<<
"Atoms number:"<<((int)mAtomsNumber)<<
"\n";
302 ret<<
"Atom volume weight:"<<mAtomVolumeWeight<<
"\n";
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
virtual tString toString() const
return the string representation of the object node
Definition: CORE_Object.h:333
static constexpr tDimension DIM
space dimension
Definition: SM_Constants.h:80
This class decribe a crystal structure.
Definition: SM_CrystalStructure.h:30
const std::array< tReal, SM_Constants::DIM > & getUnitCellSize() const
get unit cell size
Definition: SM_CrystalStructure.h:249
void setUnitCellSize(const std::array< tReal, SM_Constants::DIM > &as)
set unit cell size
Definition: SM_CrystalStructure.h:197
void setUnitCellSize(std::initializer_list< tReal > &&as)
set unit cell size
Definition: SM_CrystalStructure.h:225
tReal getAtomVolume() const
get atom volume in angstrom^3
Definition: SM_CrystalStructure.h:266
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_CrystalStructure.h:97
void setAtomsNumber(const tUCInt &n)
set the atoms number per unit cell
Definition: SM_CrystalStructure.h:161
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_CrystalStructure.h:109
virtual tString toString() const override
turn the class into a string representation
Definition: SM_CrystalStructure.h:294
const tReal & getAtomVolumeWeight() const
get atom volume weight with no unit
Definition: SM_CrystalStructure.h:271
void setName(const tString &name)
set the name of the structure (in constructor)
Definition: SM_CrystalStructure.h:146
void setUnitCellSize(const std::vector< tReal > &as)
set unit cell size
Definition: SM_CrystalStructure.h:206
const tUCInt & getAtomsNumber() const
get the atoms number
Definition: SM_CrystalStructure.h:175
const tReal & getUnitVolume() const
get unit volume
Definition: SM_CrystalStructure.h:256
virtual void copy(const SM_CrystalStructure &s)
copy the structure
Definition: SM_CrystalStructure.h:132
const tString & getName() const
get the name of the structure (in constructor)
Definition: SM_CrystalStructure.h:140
void setUnitCellSize(const tReal &a)
set unit cell size
Definition: SM_CrystalStructure.h:187
virtual ~SM_CrystalStructure(void)
destroy
Definition: SM_CrystalStructure.h:71
void setAtomVolumeWeight(const tReal &weight)
set atom volume weight in angstrom
Definition: SM_CrystalStructure.h:278
virtual CORE_UniquePointer< SM_CrystalStructure > newInstance() const =0
create new instance of the network
const tUCInt & getCoordinationNumber() const
get the coodination number
Definition: SM_CrystalStructure.h:169
void setCoordinationNumber(const tUCInt &n)
set the coordination number
Definition: SM_CrystalStructure.h:155
SM_CrystalStructure(void)
create a network class
Definition: SM_CrystalStructure.h:56
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:36