Removed resetting of dt when guessing the solution with the linear model

This commit is contained in:
iasonmanolas 2021-07-16 14:15:47 +03:00
parent 8391646d56
commit 28db0fa63e
1 changed files with 10 additions and 10 deletions

View File

@ -805,9 +805,9 @@ void DRMSimulationModel::updateResidualForcesOnTheFly(
pMesh->EN(), std::vector<std::pair<int, Vector6d>>(4, {-1, Vector6d()}));
// omp_lock_t writelock;
// omp_init_lock(&writelock);
#ifdef ENABLE_OPENMP
#pragma omp parallel for schedule(static) num_threads(5)
#endif
//#ifdef ENABLE_OPENMP
//#pragma omp parallel for schedule(static) num_threads(5)
//#endif
for (int ei = 0; ei < pMesh->EN(); ei++) {
const EdgeType &e = pMesh->edge[ei];
const SimulationMesh::VertexType &ev_j = *e.cV(0);
@ -1005,8 +1005,8 @@ void DRMSimulationModel::updateResidualForcesOnTheFly(
Node::Forces &force = pMesh->nodes[vi].force;
const Vector6d &nodeResidualForce = force.residual;
sumOfResidualForces = sumOfResidualForces + nodeResidualForce;
const double residualForceNorm = nodeResidualForce.norm();
// const double residualForceNorm = nodeResidualForce.getTranslation().norm();
// const double residualForceNorm = nodeResidualForce.norm();
const double residualForceNorm = nodeResidualForce.getTranslation().norm();
const bool shouldTrigger = std::isnan(residualForceNorm);
totalResidualForcesNorm += residualForceNorm;
#ifdef POLYSCOPE_DEFINED
@ -1192,10 +1192,10 @@ void DRMSimulationModel::updateNodalMasses()
if (shouldTemporarilyDampForces && mCurrentSimulationStep < untilStep) {
gamma *= 1e6 * (1 - static_cast<double>(mCurrentSimulationStep) / untilStep);
}
if (mCurrentSimulationStep == static_cast<size_t>(1.2 * untilStep)
&& shouldTemporarilyDampForces) {
Dt = mSettings.Dtini;
}
// if (mCurrentSimulationStep == static_cast<size_t>(1.4 * untilStep)
// && shouldTemporarilyDampForces) {
// Dt = mSettings.Dtini;
// }
for (VertexType &v : pMesh->vert) {
const size_t vi = pMesh->getIndex(v);
double translationalSumSk = 0;
@ -2354,7 +2354,7 @@ mesh->currentTotalPotentialEnergykN*/
// || fullfillsMovingAverageDerivativeNormTerminationCriterion
|| fullfillsAverageResidualForcesNormTerminationCriterion
|| fullfillsResidualForcesNormTerminationCriterion;
if (shouldTerminate) {
if (shouldTerminate && mCurrentSimulationStep > 100) {
if (mSettings.beVerbose /*&& !mSettings.isDebugMode*/) {
std::cout << "Simulation converged." << std::endl;
printCurrentState();