22 : m_lattice(lattice), m_position_variance(0.0)
25 mp_lattice_basis.reset(lattice_basis.
clone());
26 mp_lattice_basis->registerAbundance(
false);
27 registerChild(mp_lattice_basis.get());
28 registerChild(&m_lattice);
31 Crystal::~Crystal() =
default;
36 p_new->setPositionVariance(m_position_variance);
44 Lattice transformed_lattice = transformedLattice(p_rotation);
45 std::unique_ptr<IParticle> P_basis_clone{mp_lattice_basis->clone()};
47 P_basis_clone->rotate(*p_rotation);
48 P_basis_clone->translate(translation);
49 const std::unique_ptr<IFormFactor> P_basis_ff(P_basis_clone->createFormFactor());
50 return new FormFactorCrystal(transformed_lattice, *P_basis_ff, meso_crystal_form_factor,
56 std::vector<HomogeneousRegion> result;
57 double unit_cell_volume = m_lattice.
volume();
58 if (unit_cell_volume <= 0)
60 auto particles = mp_lattice_basis->decompose();
62 for (
auto p_particle : particles) {
63 auto sliced_particle = p_particle->createSlicedParticle(limits);
64 result.insert(result.end(), sliced_particle.m_regions.begin(),
65 sliced_particle.m_regions.end());
67 for (
auto& region : result)
68 region.m_volume /= unit_cell_volume;
82 return std::vector<const INode*>() << mp_lattice_basis << &m_lattice;
86 : m_lattice(lattice), m_position_variance(0.0)
89 mp_lattice_basis.reset(p_lattice_basis);
90 registerChild(mp_lattice_basis.get());
91 registerChild(&m_lattice);
Defines class ParticleComposition.
Defines class SlicedParticle.
A crystal structure with a ParticleComposition as a basis.
Crystal * clone() const override final
Returns a clone of this ISample object.
IFormFactor * createTotalFormFactor(const IFormFactor &meso_crystal_form_factor, const IRotation *p_rotation, const kvector_t &translation) const override final
Creates a total form factor for the mesocrystal with a specific shape and content The bulk content of...
std::vector< const INode * > getChildren() const override final
Returns a vector of children (const).
std::vector< HomogeneousRegion > homogeneousRegions() const override final
Creates region information with volumetric densities instead of absolute volume These densities need ...
Pure virtual base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
IParticle * clone() const override=0
Returns a clone of this ISample object.
Pure virtual interface for rotations.
virtual Transform3D getTransform3D() const =0
Returns transformation.
A lattice with three basis vectors.
Lattice createTransformedLattice(const Transform3D &transform) const
Creates transformed lattice.
double volume() const
Returns the volume of the unit cell.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.