From a71efffe148567bfb0c40cdef2118a7fd2fb2c89 Mon Sep 17 00:00:00 2001 From: Iason Date: Thu, 14 Jan 2021 16:30:13 +0200 Subject: [PATCH] Changed 1e10 to 1e9 as ym --- beam.hpp | 2 +- beamformfinder.cpp | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/beam.hpp b/beam.hpp index 2410c81..9557074 100644 --- a/beam.hpp +++ b/beam.hpp @@ -37,7 +37,7 @@ struct ElementMaterial { : G(poissonsRatio), E(youngsModulus) { assert(poissonsRatio <= 0.5 && poissonsRatio >= -1); } - ElementMaterial() : G(0.3), E(200 * 1e10) {} + ElementMaterial() : G(0.3), E(200 * 1e9) {} }; #endif // BEAM_HPP diff --git a/beamformfinder.cpp b/beamformfinder.cpp index 1abd61b..5aa2332 100644 --- a/beamformfinder.cpp +++ b/beamformfinder.cpp @@ -24,7 +24,7 @@ void FormFinder::runUnitTests() { fixedVertices[0] = std::unordered_set{0, 1, 2, 3}; fixedVertices[beam.VN() - 1] = std::unordered_set{1, 2}; std::unordered_map nodalForces{ - {2, Vector6d({0, 1000, 1000, 0, 0, 0})}}; + {beam.VN() / 2, Vector6d({0, 1000, 1000, 0, 0, 0})}}; // Forced displacements std::unordered_map nodalForcedDisplacements; nodalForcedDisplacements.insert({beam.VN() - 1, Eigen::Vector3d(-0.2, 0, 0)}); @@ -34,7 +34,7 @@ void FormFinder::runUnitTests() { // SimulationJob::constructFixedVerticesSpanGrid(spanGridSize, // mesh.VN()), fixedVertices, nodalForces, nodalForcedDisplacements}; - beamSimulationJob.pMesh->setBeamMaterial(0.3, 200 * 1e10); + beamSimulationJob.pMesh->setBeamMaterial(0.3, 200 * 1e9); assert(CrossSectionType::name == CylindricalBeamDimensions::name); beamSimulationJob.pMesh->setBeamCrossSection(CrossSectionType{0.03, 0.026}); @@ -91,7 +91,7 @@ void FormFinder::runUnitTests() { fixedVertices, {}, nodalForcedDisplacements}; - shortSpanGridshellSimulationJob.pMesh->setBeamMaterial(0.3, 200 * 1e10); + shortSpanGridshellSimulationJob.pMesh->setBeamMaterial(0.3, 200 * 1e9); assert(typeid(CrossSectionType) == typeid(CylindricalBeamDimensions)); shortSpanGridshellSimulationJob.pMesh->setBeamCrossSection( CrossSectionType{0.03, 0.026}); @@ -169,7 +169,7 @@ void FormFinder::runUnitTests() { fixedVertices, {}, nodalForcedDisplacements}; - longSpanGridshell_simulationJob.pMesh->setBeamMaterial(0.3, 200 * 1e10); + longSpanGridshell_simulationJob.pMesh->setBeamMaterial(0.3, 200 * 1e9); if (typeid(CrossSectionType) != typeid(CylindricalBeamDimensions)) { std::cerr << "A cylindrical cross section is expected for running the " "paper examples." @@ -1371,11 +1371,9 @@ void FormFinder::applyForcedDisplacements( VectorType displacementVector(vertexDisplacement(0), vertexDisplacement(1), vertexDisplacement(2)); mesh->vert[vi].P() = node.initialLocation + displacementVector; - // node.displacements = Vector6d( - // {vertexDisplacement(0), vertexDisplacement(1), - // vertexDisplacement(2), - // node.displacements[3], node.displacements[4], - // node.displacements[5]}); + node.displacements = Vector6d( + {vertexDisplacement(0), vertexDisplacement(1), vertexDisplacement(2), + node.displacements[3], node.displacements[4], node.displacements[5]}); } if (mSettings.shouldDraw) { @@ -1920,7 +1918,7 @@ currentSimulationStep > maxDRMIterations*/ break; } // Residual forces norm convergence - if (mesh->previousTotalKineticEnergy >= mesh->currentTotalKineticEnergy + if (mesh->previousTotalKineticEnergy > mesh->currentTotalKineticEnergy /*|| mesh->previousTotalPotentialEnergykN > mesh->currentTotalPotentialEnergykN*/