diff --git a/src/BodySphere.cpp b/src/BodySphere.cpp index ba73251..57898d0 100644 --- a/src/BodySphere.cpp +++ b/src/BodySphere.cpp @@ -42,9 +42,9 @@ void BodySphere::create(Mesh& mesh, Material* material) { // calculate the number of cells in each direction Vector3i nCellsBoundingBox; - nCellsBoundingBox.x() = std::ceil((maxPoint.x() - minPoint.x()) / cellDimension.x()); - nCellsBoundingBox.y() = std::ceil((maxPoint.y() - minPoint.y()) / cellDimension.y()); - nCellsBoundingBox.z() = std::ceil((maxPoint.z() - minPoint.z()) / cellDimension.z()); + nCellsBoundingBox.x() = static_cast( std::ceil((maxPoint.x() - minPoint.x()) / cellDimension.x())); + nCellsBoundingBox.y() = static_cast( std::ceil((maxPoint.y() - minPoint.y()) / cellDimension.y())); + nCellsBoundingBox.z() = static_cast( std::ceil((maxPoint.z() - minPoint.z()) / cellDimension.z())); // create the particles within the sphere for (int i = 0; i < nCellsBoundingBox.x(); ++i) { diff --git a/src/DynamicRelaxation.cpp b/src/DynamicRelaxation.cpp index 41c766f..4022cf8 100644 --- a/src/DynamicRelaxation.cpp +++ b/src/DynamicRelaxation.cpp @@ -25,7 +25,7 @@ double DynamicRelaxation::computeKineticEnergy(vector* bodies) vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for reduction(+:currentKineticEnergy) shared(particles) private(bodies, ibody) + #pragma omp parallel for reduction(+:currentKineticEnergy) shared(particles) for (int i = 0; i < particles->size(); ++i) { // verify active particle @@ -74,7 +74,7 @@ void DynamicRelaxation::setStaticSolution(vector* bodies, int loopCounter vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared(particles) private(bodies, ibody) + #pragma omp parallel for shared(particles) for (int i = 0; i < particles->size(); ++i) { // verify active particle diff --git a/src/Integration.cpp b/src/Integration.cpp index 120935b..8b0f3c5 100644 --- a/src/Integration.cpp +++ b/src/Integration.cpp @@ -13,7 +13,7 @@ void Integration::nodalMomentum(Mesh* mesh, double dt) { vector* nodes = mesh->getNodes(); // for each node - #pragma omp parallel for shared(nodes, dt) private(mesh) + #pragma omp parallel for shared(nodes, dt) for (int i = 0; i < nodes->size(); ++i) { if (!nodes->at(i)->getActive()){ continue; } diff --git a/src/Output.cpp b/src/Output.cpp index b1e4f42..3d53b35 100644 --- a/src/Output.cpp +++ b/src/Output.cpp @@ -594,7 +594,6 @@ namespace Output{ std::cout << " Time : " << std::setw(8) << std::scientific << std::setprecision(4) << ModelSetup::getTime() << "s" << std::endl; std::cout << "Time step : " << std::setw(8) << std::scientific << std::setprecision(4) << ModelSetup::getTimeStep() << "s" << std::endl; std::cout << "Particles : " << Particle::getTotalParticles() << std::endl; - std::cout << " Threads : " << ModelSetup::getThreads() << std::endl; std::cout << " Results : " << ModelSetup::getResultNum() << std::endl; } diff --git a/src/SolverExplicitUSL.cpp b/src/SolverExplicitUSL.cpp index 2385ba4..338db88 100644 --- a/src/SolverExplicitUSL.cpp +++ b/src/SolverExplicitUSL.cpp @@ -23,7 +23,6 @@ SolverExplicitUSL::SolverExplicitUSL() : Solver() {} void SolverExplicitUSL::Solve() { - // initialize simulation variables double time = ModelSetup::getTime(); double dt = ModelSetup::getTimeStep(); @@ -116,4 +115,4 @@ void SolverExplicitUSL::Solve() // write results series Output::writeResultsSeries(); -} +} \ No newline at end of file diff --git a/src/Update.cpp b/src/Update.cpp index 1d33aa5..2d94d77 100644 --- a/src/Update.cpp +++ b/src/Update.cpp @@ -15,7 +15,7 @@ void Update::nodalVelocity(Mesh* mesh) { vector* gNodes = mesh->getNodes(); // for each node - #pragma omp parallel for shared(gNodes) private(mesh) + #pragma omp parallel for shared(gNodes) for (int i = 0; i < gNodes->size(); ++i) { if(!gNodes->at(i)->getActive()){ continue; } @@ -31,7 +31,7 @@ void Update::nodalTotalForce(Mesh* mesh) { vector* gNodes = mesh->getNodes(); // for each node - #pragma omp parallel for shared (gNodes) private(mesh) + #pragma omp parallel for shared (gNodes) for (int i = 0; i < gNodes->size(); ++i) { if(!gNodes->at(i)->getActive()){ continue; } @@ -50,7 +50,7 @@ void Update::resetNodalValues(Mesh* mesh) { vector* gNodes = mesh->getNodes(); // for each node - #pragma omp parallel for shared (gNodes) private(mesh) + #pragma omp parallel for shared (gNodes) for (int i = 0; i < gNodes->size(); ++i) { if(!gNodes->at(i)->getActive()){ continue; } @@ -69,7 +69,7 @@ void Update::particleDensity(vector* bodies) { vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared (particles) private(bodies, ibody) + #pragma omp parallel for shared (particles) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute @@ -90,7 +90,7 @@ void Update::particlePorosity(vector* bodies) { vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared (particles) private(bodies, ibody) + #pragma omp parallel for shared (particles) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute @@ -111,7 +111,7 @@ void Update::particleStress(vector* bodies) { vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared (particles) private(bodies, ibody) + #pragma omp parallel for shared (particles) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute @@ -132,7 +132,7 @@ void Update::particlePressure(vector* bodies, double dt) { vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared (particles) private(bodies, ibody) + #pragma omp parallel for shared (particles) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute @@ -158,7 +158,7 @@ void Update::particleVelocity(Mesh* mesh, vector* bodies, double dt) { vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared (particles, nodes, dt) private(mesh, bodies, ibody) + #pragma omp parallel for shared (particles, nodes, dt) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute @@ -207,7 +207,7 @@ void Update::particleVelocityFluid(Mesh* mesh, vector* bodies, double dt) vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared (particles, nodes, dt) private(mesh, bodies, ibody) + #pragma omp parallel for shared (particles, nodes, dt) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute @@ -256,7 +256,7 @@ void Update::particlePosition(Mesh* mesh, vector* bodies, double dt) { vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared(particles, nodes, dt) private(ibody, bodies, mesh) + #pragma omp parallel for shared(particles, nodes, dt) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute @@ -628,7 +628,7 @@ void Update::contributionNodes(Mesh* mesh, vector* bodies) { vector* particles = bodies->at(ibody)->getParticles(); // for each particle - #pragma omp parallel for shared(particles, mesh) private(bodies, ibody) + #pragma omp parallel for shared(particles, mesh) for (int i = 0; i < particles->size(); ++i) { // only active particle can contribute