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