NuTo
Numerics Tool
ParticleCreator.h
Go to the documentation of this file.
1 /*
2  * ParticleCreator.h
3  *
4  * Created on: 27 Feb 2014
5  * Author: ttitsche
6  */
7 
8 #pragma once
9 
10 
11 #include <vector>
13 
14 
15 namespace NuTo
16 {
17 class InputReader;
18 
20 {
21 public:
23  ParticleCreator(NuTo::Specimen rSpecimen, const double rShrinkage, const long rNumMaxTries = 10000000);
24 
36  Eigen::MatrixXd CreateSpheresInSpecimen(const double rRelParticleVolume, const Eigen::MatrixXd& rGradingCurve,
37  const double rRelativeDistance, const double rAbsoluteDistance,
38  const int rSeed, const Eigen::MatrixXd& rSpheresBoundary) const;
39 
42  Eigen::MatrixXd PerformTakePhase(const Eigen::MatrixXd& rGradingCurve, const Eigen::MatrixXd& rSpheresBoundary,
43  const double rRelParticleVolume) const;
44 
47  void PerformPlacePhase(Eigen::MatrixXd& rParticles, const double rRelativeDistance,
48  const double rAbsoluteDistance) const;
49 
50 private:
52  void InsertParticleIntoBox(const Eigen::MatrixXd& rParticles, const int rTheParticle,
53  std::vector<std::vector<int>>& rSubBox, const Eigen::Vector3i& rNSubBox,
54  const Eigen::Vector3d& rLSubBox) const;
55 
56  void CheckGradingCurve(const Eigen::MatrixXd& rGradingCurve) const;
57 
59  bool CollidesWithBoundary(const Eigen::Vector4d& rParticle, const double rRelativeDistance,
60  const double rAbsoluteDistance) const;
61 
63  const std::vector<double> GetSizeClasses(const Eigen::MatrixXd& rParticles) const;
64 
65  const std::vector<double> GetNumParticlesPerSizeClass(const Eigen::MatrixXd& rParticles,
66  const std::vector<double>& rSizes) const;
67  double GetVolume(double radius) const;
68 
69  NuTo::Specimen mSpecimen;
70  const double mShrinkage;
71  const long mNumMaxTries;
72 
73  double mVolume;
74 };
75 
76 } /* namespace NuTo */
class for Specimen
Definition: Specimen.h:16
Eigen::MatrixXd CreateSpheresInSpecimen(const double rRelParticleVolume, const Eigen::MatrixXd &rGradingCurve, const double rRelativeDistance, const double rAbsoluteDistance, const int rSeed, const Eigen::MatrixXd &rSpheresBoundary) const
creates randomly distributed, non-overlapping particles
Definition: ParticleCreator.cpp:24
Eigen::MatrixXd PerformTakePhase(const Eigen::MatrixXd &rGradingCurve, const Eigen::MatrixXd &rSpheresBoundary, const double rRelParticleVolume) const
performs the "take"-of the "take-and-place" algorithm
Definition: ParticleCreator.cpp:44
void PerformPlacePhase(Eigen::MatrixXd &rParticles, const double rRelativeDistance, const double rAbsoluteDistance) const
performs the "place"-of the "take-and-place" algorithm
Definition: ParticleCreator.cpp:143
ParticleCreator(NuTo::Specimen rSpecimen, const double rShrinkage, const long rNumMaxTries=10000000)
Definition: ParticleCreator.cpp:16
Definition: Exception.h:6
Definition: ParticleCreator.h:19