54 particleHandler.copyAndAddObject(p0);
61 int main(
int argc,
char *argv[])
67 problem.setName(
"Tutorial1");
68 problem.setSystemDimensions(3);
69 problem.setGravity(
Vec3D(0.0,0.0,0.0));
73 problem.setTimeMax(2.0);
80 species->setDensity(2500.0);
81 species->setStiffness(258.5);
82 species->setDissipation(0.0);
86 problem.setSaveCount(10);
91 std::cout << problem.dataFile.getCounter() << std::endl;
95 problem.setXBallsAdditionalArguments(
"-solidf -v0");
99 problem.setTimeStep(.005/50.0);
100 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 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_
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 ...
48 particleHandler.copyAndAddObject(p0);
53 int main(
int argc,
char *argv[])
59 problem.setName(
"Tutorial2");
60 problem.setSystemDimensions(3);
61 problem.setGravity(
Vec3D(0.0,0.0,-9.81));
65 problem.setTimeMax(1.5);
71 species->setDensity(2500.0);
72 species->setStiffness(258.5);
73 species->setDissipation(0.0);
76 problem.setSaveCount(10);
82 problem.setXBallsAdditionalArguments(
"-solidf -v0");
84 problem.setTimeStep(.005/50.0);
85 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 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_
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 ...
52 particleHandler.copyAndAddObject(p0);
57 wallHandler.copyAndAddObject(w0);
64 int main(
int argc,
char *argv[])
70 problem.setName(
"Tutorial3");
71 problem.setSystemDimensions(3);
72 problem.setGravity(
Vec3D(0.0,0.0,-9.81));
76 problem.setTimeMax(5.0);
82 species->setDensity(2500.0);
83 species->setStiffness(258.5);
84 species->setDissipation(0.0);
87 problem.setSaveCount(10);
93 problem.setXBallsAdditionalArguments(
"-solidf -v0");
95 problem.setTimeStep(0.005/50.0);
96 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 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_
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 ...
49 particleHandler.copyAndAddObject(p0);
53 wallHandler.copyAndAddObject(w0);
58 int main(
int argc,
char *argv[])
64 problem.setName(
"Tutorial4");
65 problem.setSystemDimensions(3);
66 problem.setGravity(
Vec3D(0.0,0.0,-9.81));
70 problem.setTimeMax(5.0);
76 species->setDensity(2500.0);
77 species->setStiffness(259.0159);
78 species->setDissipation(0.0334);
81 problem.setSaveCount(10);
87 problem.setXBallsAdditionalArguments(
"-solidf -v0");
89 problem.setTimeStep(0.005/50.0);
90 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 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_
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 ...
52 particleHandler.copyAndAddObject(p0);
57 particleHandler.copyAndAddObject(p0);
64 int main(
int argc,
char *argv[])
70 problem.setName(
"Tutorial5");
71 problem.setSystemDimensions(3);
72 problem.setGravity(
Vec3D(0.0,0.0,0.0));
74 problem.setYMax(0.25);
76 problem.setTimeMax(2.0);
82 species->setDensity(2500.0);
83 species->setStiffness(258.5);
84 species->setDissipation(0.0);
87 problem.setSaveCount(10);
93 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s .85");
95 problem.setTimeStep(.005/50.0);
96 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 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_
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 ...
52 particleHandler.copyAndAddObject(p0);
57 particleHandler.copyAndAddObject(p0);
62 boundaryHandler.copyAndAddObject(b0);
69 int main(
int argc,
char *argv[])
75 problem.setName(
"Tutorial6");
76 problem.setSystemDimensions(3);
77 problem.setGravity(
Vec3D(0.0,0.0,0.0));
79 problem.setYMax(0.25);
81 problem.setTimeMax(5.0);
87 species->setDensity(2500.0);
88 species->setStiffness(258.5);
89 species->setDissipation(0.0);
92 problem.setSaveCount(10);
98 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s .85");
100 problem.setTimeStep(0.005/50.0);
101 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 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_
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 ...
52 particleHandler.copyAndAddObject(p0);
58 wallHandler.copyAndAddObject(w0);
61 wallHandler.copyAndAddObject(w0);
64 wallHandler.copyAndAddObject(w0);
67 wallHandler.copyAndAddObject(w0);
74 int main(
int argc,
char *argv[])
79 problem.setName(
"Tutorial7");
80 problem.setSystemDimensions(2);
81 problem.setGravity(
Vec3D(0.0,0.0,0.0));
84 problem.setTimeMax(5.0);
90 species->setDensity(2500.0);
91 species->setStiffness(258.5);
92 species->setDissipation(0.0);
95 problem.setSaveCount(10);
101 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s .85");
103 problem.setTimeStep(0.005/50.0);
104 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 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_
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 ...
53 particleHandler.copyAndAddObject(p0);
59 wallHandler.copyAndAddObject(w0);
62 wallHandler.copyAndAddObject(w0);
65 wallHandler.copyAndAddObject(w0);
68 wallHandler.copyAndAddObject(w0);
77 wallHandler.copyAndAddObject(w1);
84 int main(
int argc,
char *argv[])
90 problem.setName(
"Tutorial8");
91 problem.setSystemDimensions(2);
92 problem.setGravity(
Vec3D(0.0,0.0,0.0));
95 problem.setTimeMax(5.0);
101 species->setDensity(2500.0);
102 species->setStiffness(258.5);
103 species->setDissipation(0.0);
106 problem.setSaveCount(10);
112 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s .85");
114 problem.setTimeStep(.005/50.0);
115 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 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_
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 ...
54 particleHandler.copyAndAddObject(p0);
60 particleHandler.copyAndAddObject(p0);
66 particleHandler.copyAndAddObject(p0);
73 wallHandler.copyAndAddObject(w0);
82 int main(
int argc,
char *argv[])
90 problem.setName(
"Tutorial9");
91 problem.setSystemDimensions(3);
92 problem.setGravity(
Vec3D(sin(angle),0.0,-cos(angle))*9.81);
95 problem.setZMax(0.05);
96 problem.setTimeMax(0.5);
101 auto species01 = problem.speciesHandler.getMixedObject(species0, species1);
102 auto species02 = problem.speciesHandler.getMixedObject(species0, species2);
107 species0->setDensity(2500.0);
108 species0->setStiffness(259.018);
109 species0->setSlidingStiffness(2.0/7.0*species0->getStiffness());
110 species0->setRollingStiffness(2.0/5.0*species0->getStiffness());
111 species0->setDissipation(0.0334);
112 species0->setSlidingFrictionCoefficient(0.0);
113 species0->setRollingFrictionCoefficient(0.0);
115 species1->setDensity(2500.0);
116 species1->setStiffness(259.018);
117 species1->setDissipation(0.0334);
118 species1->setSlidingStiffness(2.0/7.0*species1->getStiffness());
119 species1->setRollingStiffness(2.0/5.0*species1->getStiffness());
120 species1->setSlidingFrictionCoefficient(0.5);
121 species1->setRollingFrictionCoefficient(0.0);
123 species01->setStiffness(259.018);
124 species01->setDissipation(0.0334);
125 species01->setSlidingStiffness(2.0/7.0*species01->getStiffness());
126 species01->setRollingStiffness(2.0/5.0*species01->getStiffness());
127 species01->setSlidingFrictionCoefficient(0.5);
128 species01->setRollingFrictionCoefficient(0.0);
130 species2->setDensity(2500.0);
131 species2->setStiffness(258.5);
132 species2->setDissipation(0.0);
133 species2->setSlidingStiffness(2.0/7.0*species2->getStiffness());
134 species2->setRollingStiffness(2.0/5.0*species2->getStiffness());
135 species2->setSlidingFrictionCoefficient(0.5);
136 species2->setRollingFrictionCoefficient(0.5);
138 species02->setStiffness(259.018);
139 species02->setDissipation(0.0334);
140 species02->setSlidingStiffness(2.0/7.0*species02->getStiffness());
141 species02->setRollingStiffness(2.0/5.0*species02->getStiffness());
142 species02->setSlidingFrictionCoefficient(0.5);
143 species02->setRollingFrictionCoefficient(0.5);
145 problem.setSaveCount(10);
151 problem.setXBallsAdditionalArguments(
"-solidf -v0 -s 8 -p 10 -rottheta .2 -noborder 4 -cube -o 100 -w 600 -h 300");
153 problem.setTimeStep(0.005/50.0);
154 problem.solve(argc, argv);
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
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_
MERCURY_DEPRECATED void setIndSpecies(unsigned int indSpecies)
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 ...
private:
particleRadius = 0.2;
species->setDensity(1000);
species->setCollisionTimeAndRestitutionCoefficient(0.05, 0.8, pow(particleRadius, 3) *
constants::pi * 4.0 / 3.0 * 1000);
coil = wallHandler.copyAndAddObject(
Coil());
coil->set(
Vec3D(0, 0, 0), 1.0, 1.0 - particleRadius, 2.0, -1.0, 0.5 * particleRadius);
particleHandler.clear();
int Nx =
static_cast<int> (std::floor((
getXMax() -
getXMin()) / (2.1 * particleRadius)));
int Ny =
static_cast<int> (std::floor((
getYMax() -
getYMin()) / (2.1 * particleRadius)));
int Nz =
static_cast<int> (std::floor((
getZMax() -
getZMin()) / (2.1 * particleRadius)));
for (int i = 0; i < Nx; i++)
for (int j = 0; j < Ny; j++)
for (int k = 0; k < Nz; k++) {
if (!coil->getDistanceAndNormal(p0, distance, normal)) {
particleHandler.copyAndAddObject(p0);
} else {
}
}
}
}
public:
double particleRadius;
};
CoilSelfTest problem;
problem.setName("CoilSelfTest");
problem.setSystemDimensions(3);
problem.setTimeStep(0.02 * 0.05);
problem.setTimeMax(2.0);
problem.solve();
}