55 particleHandler.copyAndAddObject(p0);
62 int main(
int argc,
char *argv[])
68 problem.setName(
"Tutorial1");
69 problem.setSystemDimensions(3);
70 problem.setGravity(
Vec3D(0.0,0.0,0.0));
74 problem.setTimeMax(2.0);
82 species->setStiffness(258.5);
83 species->setDissipation(0.0);
87 problem.setSaveCount(10);
92 std::cout << problem.dataFile.getCounter() << std::endl;
96 problem.setXBallsAdditionalArguments(
"-solidf -v0");
100 problem.setTimeStep(.005/50.0);
101 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
void setSpecies(const ParticleSpecies *species)
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
49 particleHandler.copyAndAddObject(p0);
54 int main(
int argc,
char *argv[])
60 problem.setName(
"Tutorial2");
61 problem.setSystemDimensions(3);
62 problem.setGravity(
Vec3D(0.0,0.0,-9.81));
66 problem.setTimeMax(1.5);
73 species->setStiffness(258.5);
74 species->setDissipation(0.0);
77 problem.setSaveCount(10);
83 problem.setXBallsAdditionalArguments(
"-solidf -v0");
85 problem.setTimeStep(.005/50.0);
86 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
void setSpecies(const ParticleSpecies *species)
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
53 particleHandler.copyAndAddObject(p0);
59 wallHandler.copyAndAddObject(w0);
66 int main(
int argc,
char *argv[])
72 problem.setName(
"Tutorial3");
73 problem.setSystemDimensions(3);
74 problem.setGravity(
Vec3D(0.0,0.0,-9.81));
78 problem.setTimeMax(5.0);
85 species->setStiffness(258.5);
86 species->setDissipation(0.0);
89 problem.setSaveCount(10);
95 problem.setXBallsAdditionalArguments(
"-solidf -v0");
97 problem.setTimeStep(0.005/50.0);
98 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
void setSpecies(const ParticleSpecies *species)
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin...
This is a class defining walls.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setSpecies(const ParticleSpecies *species)
Define the species of this wall.
50 particleHandler.copyAndAddObject(p0);
55 wallHandler.copyAndAddObject(w0);
60 int main(
int argc,
char *argv[])
66 problem.setName(
"Tutorial4");
67 problem.setSystemDimensions(3);
68 problem.setGravity(
Vec3D(0.0,0.0,-9.81));
72 problem.setTimeMax(5.0);
79 species->setStiffness(259.0159);
80 species->setDissipation(0.0334);
83 problem.setSaveCount(10);
89 problem.setXBallsAdditionalArguments(
"-solidf -v0");
91 problem.setTimeStep(0.005/50.0);
92 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
void setSpecies(const ParticleSpecies *species)
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin...
This is a class defining walls.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setSpecies(const ParticleSpecies *species)
Define the species of this wall.
53 particleHandler.copyAndAddObject(p0);
58 particleHandler.copyAndAddObject(p0);
65 int main(
int argc,
char *argv[])
71 problem.setName(
"Tutorial5");
72 problem.setSystemDimensions(3);
73 problem.setGravity(
Vec3D(0.0,0.0,0.0));
75 problem.setYMax(0.25);
77 problem.setTimeMax(2.0);
84 species->setStiffness(258.5);
85 species->setDissipation(0.0);
88 problem.setSaveCount(10);
94 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s .85");
96 problem.setTimeStep(.005/50.0);
97 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
void setSpecies(const ParticleSpecies *species)
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
53 particleHandler.copyAndAddObject(p0);
58 particleHandler.copyAndAddObject(p0);
63 boundaryHandler.copyAndAddObject(b0);
70 int main(
int argc,
char *argv[])
76 problem.setName(
"Tutorial6");
77 problem.setSystemDimensions(3);
78 problem.setGravity(
Vec3D(0.0,0.0,0.0));
82 problem.setTimeMax(10.0);
89 species->setStiffness(200000);
90 species->setDissipation(0.2);
93 problem.setSaveCount(100);
99 problem.setXBallsAdditionalArguments(
"-solidf -v0");
101 problem.setTimeStep(0.005/50.0);
102 problem.solve(argc, argv);
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a periodic wall.
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
void setSpecies(const ParticleSpecies *species)
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Defines a pair of periodic walls. Inherits from BaseBoundary.
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
53 particleHandler.copyAndAddObject(p0);
60 wallHandler.copyAndAddObject(w0);
63 wallHandler.copyAndAddObject(w0);
66 wallHandler.copyAndAddObject(w0);
69 wallHandler.copyAndAddObject(w0);
76 int main(
int argc,
char *argv[])
81 problem.setName(
"Tutorial7");
82 problem.setSystemDimensions(2);
83 problem.setGravity(
Vec3D(0.0,0.0,0.0));
87 problem.setTimeMax(1.0);
94 species->setStiffness(258.5);
95 species->setDissipation(0.0);
98 problem.setSaveCount(10);
105 problem.setParticlesWriteVTK(
true);
107 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s .85");
109 problem.setTimeStep(0.005/50.0);
110 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
void setSpecies(const ParticleSpecies *species)
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
This is a class defining walls.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setSpecies(const ParticleSpecies *species)
Define the species of this wall.
54 particleHandler.copyAndAddObject(p0);
61 wallHandler.copyAndAddObject(w0);
64 wallHandler.copyAndAddObject(w0);
67 wallHandler.copyAndAddObject(w0);
70 wallHandler.copyAndAddObject(w0);
79 wallHandler.copyAndAddObject(w1);
86 int main(
int argc,
char *argv[])
92 problem.setName(
"Tutorial8");
93 problem.setSystemDimensions(2);
94 problem.setGravity(
Vec3D(0.0,0.0,0.0));
97 problem.setTimeMax(5.0);
104 species->setStiffness(258.5);
105 species->setDissipation(0.0);
108 problem.setSaveCount(10);
114 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s .85");
116 problem.setTimeStep(.005/50.0);
117 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
void setSpecies(const ParticleSpecies *species)
void addObject(Vec3D normal, Vec3D point)
Adds a wall to the set of infinite walls, given an outward normal vector s.t. normal*x=normal*point.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
void setDensity(Mdouble density)
Allows density_ to be changed.
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
This is a class defining walls.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setSpecies(const ParticleSpecies *species)
Define the species of this wall.
54 particleHandler.copyAndAddObject(p0);
61 particleHandler.copyAndAddObject(p0);
68 particleHandler.copyAndAddObject(p0);
76 wallHandler.copyAndAddObject(w0);
85 int main(
int argc,
char *argv[])
93 problem.setName(
"Tutorial9");
94 problem.setSystemDimensions(3);
95 problem.setGravity(
Vec3D(
sin(angle),0.0,-
cos(angle))*9.81);
98 problem.setZMax(0.05);
99 problem.setTimeMax(0.5);
104 auto species01 = problem.speciesHandler.getMixedObject(species0, species1);
105 auto species02 = problem.speciesHandler.getMixedObject(species0, species2);
110 species0->setDensity(2500.0);
111 species0->setStiffness(259.018);
112 species0->setSlidingStiffness(2.0/7.0*species0->getStiffness());
113 species0->setRollingStiffness(2.0/5.0*species0->getStiffness());
114 species0->setDissipation(0.0334);
115 species0->setSlidingFrictionCoefficient(0.0);
116 species0->setRollingFrictionCoefficient(0.0);
118 species1->setDensity(2500.0);
119 species1->setStiffness(259.018);
120 species1->setDissipation(0.0334);
121 species1->setSlidingStiffness(2.0/7.0*species1->getStiffness());
122 species1->setRollingStiffness(2.0/5.0*species1->getStiffness());
123 species1->setSlidingFrictionCoefficient(0.5);
124 species1->setRollingFrictionCoefficient(0.0);
126 species01->setStiffness(259.018);
127 species01->setDissipation(0.0334);
128 species01->setSlidingStiffness(2.0/7.0*species01->getStiffness());
129 species01->setRollingStiffness(2.0/5.0*species01->getStiffness());
130 species01->setSlidingFrictionCoefficient(0.5);
131 species01->setRollingFrictionCoefficient(0.0);
133 species2->setDensity(2500.0);
134 species2->setStiffness(258.5);
135 species2->setDissipation(0.0);
136 species2->setSlidingStiffness(2.0/7.0*species2->getStiffness());
137 species2->setRollingStiffness(2.0/5.0*species2->getStiffness());
138 species2->setSlidingFrictionCoefficient(0.5);
139 species2->setRollingFrictionCoefficient(0.5);
141 species02->setStiffness(259.018);
142 species02->setDissipation(0.0334);
143 species02->setSlidingStiffness(2.0/7.0*species02->getStiffness());
144 species02->setRollingStiffness(2.0/5.0*species02->getStiffness());
145 species02->setSlidingFrictionCoefficient(0.5);
146 species02->setRollingFrictionCoefficient(0.5);
148 problem.setSaveCount(10);
154 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s 8 -p 10 -rottheta .2 -noborder 4 -cube -o 100 -w 600 -h 300");
156 problem.setTimeStep(0.005/50.0);
157 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void setSpecies(const ParticleSpecies *species)
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
file will not be created/read
This adds on the hierarchical grid code for 3D problems.
all data will be written into/ read from a single file called name_
Mdouble getRadius() const
Returns the particle's radius_.
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin...
This is a class defining walls.
int main(int argc, char **argv)
Implementation of a 3D vector (by Vitaliy).
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
void setSpecies(const ParticleSpecies *species)
Define the species of this wall.
{
private:
{
const double particleRadius = 0.2;
const double tc = 0.05;
const double restitutionCoefficient = 0.8;
species.setCollisionTimeAndRestitutionCoefficient(tc, restitutionCoefficient, particleMass);
speciesHandler.copyAndAddObject(species);
wallHandler.copyAndAddObject(w);
wallHandler.copyAndAddObject(w);
wallHandler.copyAndAddObject(w);
wallHandler.copyAndAddObject(w);
wallHandler.copyAndAddObject(w);
rightWall.
setSpecies(speciesHandler.getObject(0));
wallHandler.copyAndAddObject(rightWall);
coil = wallHandler.copyAndAddObject(
Coil());
coil->setSpecies(speciesHandler.getObject(0));
coil->set(
Vec3D(0, 0, 0), 1.0, 1.0 - particleRadius, 2.0, -1.0, 0.5 * particleRadius);
particleHandler.clear();
const unsigned int Nx =
static_cast<unsigned int> (std::floor((
getXMax() -
getXMin()) / (2.1 * particleRadius)));
const unsigned int Ny =
static_cast<unsigned int> (std::floor((
getYMax() -
getYMin()) / (2.1 * particleRadius)));
const unsigned int Nz =
static_cast<unsigned int> (std::floor((
getZMax() -
getZMin()) / (2.1 * particleRadius)));
for (unsigned int i = 0; i < Nx; i++)
{
for (unsigned int j = 0; j < Ny; j++)
{
for (unsigned int k = 0; k < Nz; k++)
{
if (!coil->getDistanceAndNormal(p0, distance, normal))
{
particleHandler.copyAndAddObject(p0);
}
else
{
}
}
}
}
}
{
{
}
}
public:
};
{
CoilSelfTest problem;
problem.setName("CoilSelfTest");
problem.setSystemDimensions(3);
problem.setTimeStep(0.02 * 0.05);
problem.setTimeMax(0.5);
problem.getTimeStep()));
problem.solve();
}