Dear @KratosMultiphysics/structural-mechanics team,
During my own implementation of a TotalLagrangian element in my App I was validating my results with the ones from the Structural Mechanics element. The weir stuff arised with my test case...

If we apply a constant imposed displacement on the right tip the code iterates up to max iter in the following way:
::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.00216156
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00143944
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 51970.7; Expected ratio = 0.0001; Absolute norm = 0.00237485; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.0021622
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00161491
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 17.0123; Expected ratio = 0.0001; Absolute norm = 7.77394e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00191968
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00154017
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 17.4797; Expected ratio = 0.0001; Absolute norm = 7.98754e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00184589
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00108752
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 18.6197; Expected ratio = 0.0001; Absolute norm = 8.50846e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.0018969
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00143366
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 19.6171; Expected ratio = 0.0001; Absolute norm = 8.96425e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00165084
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00110516
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 16.976; Expected ratio = 0.0001; Absolute norm = 7.75736e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00205409
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00158861
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 16.615; Expected ratio = 0.0001; Absolute norm = 7.59241e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00201656
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00153824
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 17.3701; Expected ratio = 0.0001; Absolute norm = 7.93747e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00162133
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00121006
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 18.3869; Expected ratio = 0.0001; Absolute norm = 8.40209e-07; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00125658
ResidualBasedBlockBuilderAndSolver: System solve time: 0.000991276
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 20.0813; Expected ratio = 0.0001; Absolute norm = 9.17637e-07; Expected norm = 1e-09]
NR-Strategy: ATTENTION: max iterations ( 10 ) exceeded!
::[MechanicalSolver]:: : Solver did not converge for step 1
Which is weird. The cool thing is that the final solution is OK (even reaching the max iters).
On the other hand, if we impose a constant load on the right tip the code behaves as expected iterating only once in the 1st step and reaching the maximum in the 2nd step (I'm maintaining the load value and the total_residual cannot achieve the abs_min):
::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.00240922
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00161524
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.89167e-06; Expected ratio = 0.0001; Absolute norm = 3.50184e-06; Expected norm = 1e-09]
RESIDUAL CRITERION: Convergence is achieved
NR-Strategy: Convergence achieved after 1 / 10 iterations
VtkOutput: Modelpart "computing_domain" has both elements and conditions.
Giving precedence to elements and writing only elements!
System Construction Time: 0
::[KSM Simulation]:: : STEP: 2
::[KSM Simulation]:: : TIME: 1.1
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.00264084
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00162261
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.51908; Expected ratio = 0.0001; Absolute norm = 5.31958e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.0015777
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00152541
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.42338; Expected ratio = 0.0001; Absolute norm = 4.98445e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00152734
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00142564
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.61659; Expected ratio = 0.0001; Absolute norm = 5.66105e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.000844349
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00153568
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.88767; Expected ratio = 0.0001; Absolute norm = 6.61032e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00201656
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00118536
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.42003; Expected ratio = 0.0001; Absolute norm = 4.97271e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00159053
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00124311
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.46318; Expected ratio = 0.0001; Absolute norm = 5.12382e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00193892
ResidualBasedBlockBuilderAndSolver: System solve time: 0.000961763
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.31749; Expected ratio = 0.0001; Absolute norm = 4.61364e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00209387
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00110388
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.39952; Expected ratio = 0.0001; Absolute norm = 4.9009e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00175863
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00156455
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.29737; Expected ratio = 0.0001; Absolute norm = 4.54317e-06; Expected norm = 1e-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00143302
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00101822
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.6807; Expected ratio = 0.0001; Absolute norm = 5.88552e-06; Expected norm = 1e-09]
NR-Strategy: ATTENTION: max iterations ( 10 ) exceeded!
::[MechanicalSolver]:: : Solver did not converge for step 2
corresponding to time 1.1
Is this a normal behaviour or there's something bad in here?
Regards
By the way, this problem is not occurring with the SmallStrainElement
Huuuuum, can you attach the example?
The one with the imposed displ
haha_stuct.gid.zip
the one with the load
haha_stuct_v2.gid.zip
Hm strange
Did you also try the UL element?
Hm strange
Did you also try the UL element?
The Updated element behaves in the same way but the results are spurious... So it's worse
If I plot the norms from the residual_criteron we see the following at each iteration:
::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55
**** ITER 1 *****
ratio : 51970.7
mCurrentResidualNorm : 0.726705
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 51970.7; Expected ratio = 0.0001; Absolute norm = 0.00237485; Expected norm = 1e-09]
**** ITER 2 *****
SolvingStrategy: MESH MOVED
ratio : 17.0123
mCurrentResidualNorm : 0.000237883
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 17.0123; Expected ratio = 0.0001; Absolute norm = 7.77394e-07; Expected norm = 1e-09]
**** ITER 3 *****
SolvingStrategy: MESH MOVED
ratio : 17.4797
mCurrentResidualNorm : 0.000244419
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 17.4797; Expected ratio = 0.0001; Absolute norm = 7.98754e-07; Expected norm = 1e-09]
**** ITER 4 *****
SolvingStrategy: MESH MOVED
ratio : 18.6197
mCurrentResidualNorm : 0.000260359
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 18.6197; Expected ratio = 0.0001; Absolute norm = 8.50846e-07; Expected norm = 1e-09]
**** ITER 5 *****
SolvingStrategy: MESH MOVED
ratio : 19.6171
mCurrentResidualNorm : 0.000274306
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 19.6171; Expected ratio = 0.0001; Absolute norm = 8.96425e-07; Expected norm = 1e-09]
**** ITER 6 *****
SolvingStrategy: MESH MOVED
ratio : 16.976
mCurrentResidualNorm : 0.000237375
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 16.976; Expected ratio = 0.0001; Absolute norm = 7.75736e-07; Expected norm = 1e-09]
**** ITER 7 *****
SolvingStrategy: MESH MOVED
ratio : 16.615
mCurrentResidualNorm : 0.000232328
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 16.615; Expected ratio = 0.0001; Absolute norm = 7.59241e-07; Expected norm = 1e-09]
**** ITER 8 *****
SolvingStrategy: MESH MOVED
ratio : 17.3701
mCurrentResidualNorm : 0.000242887
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 17.3701; Expected ratio = 0.0001; Absolute norm = 7.93747e-07; Expected norm = 1e-09]
are u using a direct solver?
On Fri, Jun 7, 2019, 7:19 PM Alejandro Cornejo Velázquez <
[email protected]> wrote:
If I plot the norms from the residual_criteron we see the following at
each iteration:::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55* ITER 1 **
ratio : 51970.7
mCurrentResidualNorm : 0.726705
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 51970.7; Expected ratio = 0.0001; Absolute norm = 0.00237485; Expected norm = 1e-09]* ITER 2 **
SolvingStrategy: MESH MOVED
ratio : 17.0123
mCurrentResidualNorm : 0.000237883
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 17.0123; Expected ratio = 0.0001; Absolute norm = 7.77394e-07; Expected norm = 1e-09]* ITER 3 **
SolvingStrategy: MESH MOVED
ratio : 17.4797
mCurrentResidualNorm : 0.000244419
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 17.4797; Expected ratio = 0.0001; Absolute norm = 7.98754e-07; Expected norm = 1e-09]* ITER 4 **
SolvingStrategy: MESH MOVED
ratio : 18.6197
mCurrentResidualNorm : 0.000260359
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 18.6197; Expected ratio = 0.0001; Absolute norm = 8.50846e-07; Expected norm = 1e-09]* ITER 5 **
SolvingStrategy: MESH MOVED
ratio : 19.6171
mCurrentResidualNorm : 0.000274306
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 19.6171; Expected ratio = 0.0001; Absolute norm = 8.96425e-07; Expected norm = 1e-09]* ITER 6 **
SolvingStrategy: MESH MOVED
ratio : 16.976
mCurrentResidualNorm : 0.000237375
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 16.976; Expected ratio = 0.0001; Absolute norm = 7.75736e-07; Expected norm = 1e-09]* ITER 7 **
SolvingStrategy: MESH MOVED
ratio : 16.615
mCurrentResidualNorm : 0.000232328
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 16.615; Expected ratio = 0.0001; Absolute norm = 7.59241e-07; Expected norm = 1e-09]* ITER 8 **
SolvingStrategy: MESH MOVED
ratio : 17.3701
mCurrentResidualNorm : 0.000242887
mInitialResidualNorm : 1.3983e-05
RESIDUAL CRITERION: :: [ Obtained ratio = 17.3701; Expected ratio = 0.0001; Absolute norm = 7.93747e-07; Expected norm = 1e-09]—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/KratosMultiphysics/Kratos/issues/5052?email_source=notifications&email_token=AB5PWEPOBC6DHF3TPNGJSXLPZKKAPA5CNFSM4HVGR7QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXGOPNY#issuecomment-499967927,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB5PWEMHDVAGP3URPD4EEATPZKKAPANCNFSM4HVGR7QA
.
This is the json that I'm using:
{
"problem_data" : {
"problem_name" : "haha_stuct",
"parallel_type" : "OpenMP",
"echo_level" : 0,
"start_time" : 0.0,
"end_time" : 1.0
},
"solver_settings" : {
"solver_type" : "Static",
"model_part_name" : "Structure",
"domain_size" : 2,
"echo_level" : 1,
"analysis_type" : "non_linear",
"model_import_settings" : {
"input_type" : "mdpa",
"input_filename" : "haha_stuct"
},
"material_import_settings" : {
"materials_filename" : "StructuralMaterials.json"
},
"time_stepping" : {
"time_step" : 0.55
},
"line_search" : false,
"convergence_criterion" : "residual_criterion",
"displacement_relative_tolerance" : 0.0001,
"displacement_absolute_tolerance" : 1e-9,
"residual_relative_tolerance" : 0.0001,
"residual_absolute_tolerance" : 1e-9,
"max_iteration" : 10,
"problem_domain_sub_model_part_list" : ["Parts_Parts_Auto1"],
"processes_sub_model_part_list" : ["DISPLACEMENT_Displacement_Auto1","DISPLACEMENT_Displacement_Auto2"],
"rotation_dofs" : false
},
"processes" : {
"constraints_process_list" : [{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"Parameters" : {
"model_part_name" : "Structure.DISPLACEMENT_Displacement_Auto1",
"variable_name" : "DISPLACEMENT",
"constrained" : [true,true,true],
"value" : [0.0,0.0,0.0],
"interval" : [0.0,"End"]
}
},{
"python_module" : "assign_vector_variable_process",
"kratos_module" : "KratosMultiphysics",
"Parameters" : {
"model_part_name" : "Structure.DISPLACEMENT_Displacement_Auto2",
"variable_name" : "DISPLACEMENT",
"constrained" : [true,true,true],
"value" : [0.000001,0.0,0.0],
"interval" : [0.0,"End"]
}
}],
"loads_process_list" : [],
"list_other_processes" : []
},
"output_processes" : {
"gid_output" : [{
"python_module" : "gid_output_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "GiDOutputProcess",
"help" : "This process writes postprocessing files for GiD",
"Parameters" : {
"model_part_name" : "Structure.computing_domain",
"output_name" : "haha_stuct",
"postprocess_parameters" : {
"result_file_configuration" : {
"gidpost_flags" : {
"GiDPostMode" : "GiD_PostBinary",
"WriteDeformedMeshFlag" : "WriteDeformed",
"WriteConditionsFlag" : "WriteConditions",
"MultiFileFlag" : "SingleFile"
},
"file_label" : "step",
"output_control_type" : "step",
"output_frequency" : 1,
"body_output" : true,
"node_output" : false,
"skin_output" : false,
"plane_output" : [],
"nodal_results" : ["DISPLACEMENT","REACTION"],
"gauss_point_results" : ["GREEN_LAGRANGE_STRAIN_VECTOR"]
},
"point_data_configuration" : []
}
}
}],
"vtk_output" : [{
"python_module" : "vtk_output_process",
"kratos_module" : "KratosMultiphysics",
"process_name" : "VtkOutputProcess",
"help" : "This process writes postprocessing files for Paraview",
"Parameters" : {
"model_part_name" : "Structure.computing_domain",
"output_control_type" : "step",
"output_frequency" : 1,
"file_format" : "ascii",
"output_precision" : 7,
"output_sub_model_parts" : true,
"folder_name" : "vtk_output",
"save_output_files_in_folder" : true,
"nodal_solution_step_data_variables" : ["DISPLACEMENT","REACTION"],
"nodal_data_value_variables" : [],
"element_data_value_variables" : [],
"condition_data_value_variables" : []
}
}]
}
}
not specifying a lin solver automatically constructus a direct solver in StructuralMechanics
@AlejandroCornejo does it work with the displacement criteria?
not specifying a lin solver automatically constructus a direct solver in StructuralMechanics
@AlejandroCornejo does it work with the displacement criteria?
with displ criterion works perfectly. Must be a problem when computing the residual
thx for the info
yeah, updating again the res-criteria xDDDD
Again I think the problem is that we do not differentiate between the internal and external forces (and this is a problem in many cases)
Effectively, this is due to the External forces (at least haha_v2), I did a check and the changing the InitializeSolutionStep (not actual solution):
~~~cpp
void InitializeSolutionStep(
ModelPart& rModelPart,
DofsArrayType& rDofSet,
const TSystemMatrixType& rA,
const TSystemVectorType& rDx,
const TSystemVectorType& rb
) override
{
BaseType::InitializeSolutionStep(rModelPart, rDofSet, rA, rDx, rb);
// Filling mActiveDofs when MPC exist
if (rModelPart.NumberOfMasterSlaveConstraints() > 0) {
mActiveDofs.resize(rDofSet.size());
#pragma omp parallel for
for(int i=0; i<static_cast<int>(mActiveDofs.size()); ++i) {
mActiveDofs[i] = true;
}
#pragma omp parallel for
for (int i=0; i<static_cast<int>(rDofSet.size()); ++i) {
const auto it_dof = rDofSet.begin() + i;
if (it_dof->IsFixed()) {
mActiveDofs[it_dof->EquationId()] = false;
}
}
for (const auto& r_mpc : rModelPart.MasterSlaveConstraints()) {
for (const auto& r_dof : r_mpc.GetMasterDofsVector()) {
mActiveDofs[r_dof->EquationId()] = false;
}
for (const auto& r_dof : r_mpc.GetSlaveDofsVector()) {
mActiveDofs[r_dof->EquationId()] = false;
}
}
}
if (rModelPart.GetProcessInfo()[STEP] == 1) {
SizeType size_residual;
CalculateResidualNorm(rModelPart, mInitialResidualNorm, size_residual, rDofSet, rb);
}
}
~~~
It converges in one iteration:
~sh
::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.000661703
ResidualBasedBlockBuilderAndSolver: System solve time: 0.0148908
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.89167e-06; Expected ratio = 0.0001; Absolute norm = 3.50184e-06; Expected norm = 1e-09]
RESIDUAL CRITERION: Convergence is achieved
NR-Strategy: Convergence achieved after 1 / 10 iterations
VtkOutput: Modelpart "computing_domain" has both elements and conditions.
Giving precedence to elements and writing only elements!
System Construction Time: 1.744e-06
::[KSM Simulation]:: : STEP: 2
::[KSM Simulation]:: : TIME: 1.1
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.000644332
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00126007
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 2.87361e-06; Expected ratio = 0.0001; Absolute norm = 5.31958e-06; Expected norm = 1e-09]
RESIDUAL CRITERION: Convergence is achieved
NR-Strategy: Convergence achieved after 1 / 10 iterations
VtkOutput: Modelpart "computing_domain" has both elements and conditions.
Giving precedence to elements and writing only elements!
::[KSM Simulation]:: : Analysis -END-
BuilderAndSolver: Clear Function called
~
This is due to the fact that the mInitialResidualNorm includes internal forces too on the second step, so the initial residual is low on the second step. We need to separate internal and external forces @RiccardoRossi and @KratosMultiphysics/structural-mechanics . I know this is a pain in the a**, but it is important. We already have several problematic due to to this
still the residual norm should be zero at convergence and it is not. there
is smthg very wrong...
On Tue, Jun 11, 2019, 4:53 PM Vicente Mataix Ferrándiz <
[email protected]> wrote:
Effectively, this is due to the External forces (at least haha_v2), I did
a check and the changing the InitializeSolutionStep (not actual solution):void InitializeSolutionStep( ModelPart& rModelPart, DofsArrayType& rDofSet, const TSystemMatrixType& rA, const TSystemVectorType& rDx, const TSystemVectorType& rb ) override { BaseType::InitializeSolutionStep(rModelPart, rDofSet, rA, rDx, rb); // Filling mActiveDofs when MPC exist if (rModelPart.NumberOfMasterSlaveConstraints() > 0) { mActiveDofs.resize(rDofSet.size()); #pragma omp parallel for for(int i=0; i<static_cast<int>(mActiveDofs.size()); ++i) { mActiveDofs[i] = true; } #pragma omp parallel for for (int i=0; i<static_cast<int>(rDofSet.size()); ++i) { const auto it_dof = rDofSet.begin() + i; if (it_dof->IsFixed()) { mActiveDofs[it_dof->EquationId()] = false; } } for (const auto& r_mpc : rModelPart.MasterSlaveConstraints()) { for (const auto& r_dof : r_mpc.GetMasterDofsVector()) { mActiveDofs[r_dof->EquationId()] = false; } for (const auto& r_dof : r_mpc.GetSlaveDofsVector()) { mActiveDofs[r_dof->EquationId()] = false; } } } if (rModelPart.GetProcessInfo()[STEP] == 1) { SizeType size_residual; CalculateResidualNorm(rModelPart, mInitialResidualNorm, size_residual, rDofSet, rb); } }It converges in one iteration:
::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.000661703
ResidualBasedBlockBuilderAndSolver: System solve time: 0.0148908
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 1.89167e-06; Expected ratio = 0.0001; Absolute norm = 3.50184e-06; Expected norm = 1e-09]
RESIDUAL CRITERION: Convergence is achieved
NR-Strategy: Convergence achieved after 1 / 10 iterations
VtkOutput: Modelpart "computing_domain" has both elements and conditions.
Giving precedence to elements and writing only elements!
System Construction Time: 1.744e-06
::[KSM Simulation]:: : STEP: 2
::[KSM Simulation]:: : TIME: 1.1
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.000644332
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00126007
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 2.87361e-06; Expected ratio = 0.0001; Absolute norm = 5.31958e-06; Expected norm = 1e-09]
RESIDUAL CRITERION: Convergence is achieved
NR-Strategy: Convergence achieved after 1 / 10 iterations
VtkOutput: Modelpart "computing_domain" has both elements and conditions.
Giving precedence to elements and writing only elements!
::[KSM Simulation]:: : Analysis -END-
BuilderAndSolver: Clear Function calledThis is due to the fact that the mInitialResidualNorm includes internal
forces too on the second step, so the initial residual is low on the second
step. We need to separate internal and external forces @RiccardoRossi
https://github.com/RiccardoRossi and
@KratosMultiphysics/structural-mechanics
https://github.com/orgs/KratosMultiphysics/teams/structural-mechanics .
I know this is a pain in the a**, but it is important. We already have
several problematic due to to this—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/KratosMultiphysics/Kratos/issues/5052?email_source=notifications&email_token=AB5PWEPE437BLO2XMU725RTPZ636BA5CNFSM4HVGR7QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXNMXZY#issuecomment-500878311,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB5PWEMVYUDG2G3XPMWCFPDPZ636BANCNFSM4HVGR7QA
.
still the residual norm should be zero at convergence and it is not. there is smthg very wrong...
No, it is very small already, the initial residual has been undated taking into account the internal forces too
In the other side, I found the reason the first case (pure displacement) does not converge on TL, but it does in SD.
The nodes have set the variable displacement, but are not moved on the first iteration. This makes that for the SD there is stress (because uses the displacements directly) but not in the case of the TL, where F is computed, and depends of the Jacobian among others, which if the mesh is not moved corresponds with an identity F, corresponding with zero strain and zero stress.
One solution, that needs to be discussed is to move the mesh at the beginning of the InitializeSolutionStep to ensure that is properly initialized before compute the initial residuals and so on.
I will create a PR, where we can discuss further.
~sh
::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.000603239
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00592987
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 6.85214e-06; Expected ratio = 0.0001; Absolute norm = 0.00237485; Expected norm = 1e-09]
RESIDUAL CRITERION: Convergence is achieved
NR-Strategy: Convergence achieved after 1 / 2 iterations
::[KSM Simulation]:: : Analysis -END-
BuilderAndSolver: Clear Function called
~
Look #5069
definitely smthg to look into
On Tue, Jun 11, 2019, 7:39 PM Vicente Mataix Ferrándiz <
[email protected]> wrote:
In the other side, I found the reason the first case (pure displacement)
does not converge on TL, but it does in SD.The nodes have set the variable displacement, but are not moved on the
first iteration. This makes that for the SD there is stress (because uses
the displacements directly) but not in the case of the TL, where F is
computed, and depends of the Jacobian among others, which if the mesh is
not moved corresponds with an identity F, corresponding with zero strain
and zero stress.One solution, that needs to be discussed is to move the mesh at the
beginning of the InitializeSolutionStep to ensure that is properly
initialized before compute the initial residuals and so on.I will create a PR, where we can discuss further.
::[KSM Simulation]:: : STEP: 1
::[KSM Simulation]:: : TIME: 0.55
SolvingStrategy: MESH MOVED
ResidualBasedBlockBuilderAndSolver: Build time: 0.000603239
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00592987
SolvingStrategy: MESH MOVED
RESIDUAL CRITERION: :: [ Obtained ratio = 6.85214e-06; Expected ratio = 0.0001; Absolute norm = 0.00237485; Expected norm = 1e-09]
RESIDUAL CRITERION: Convergence is achieved
NR-Strategy: Convergence achieved after 1 / 2 iterations
::[KSM Simulation]:: : Analysis -END-
BuilderAndSolver: Clear Function called—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/KratosMultiphysics/Kratos/issues/5052?email_source=notifications&email_token=AB5PWENPGVHKAKKRFBYHBN3PZ7PLLA5CNFSM4HVGR7QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXN52EQ#issuecomment-500948242,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB5PWEPOTIP3PGJRC6LLADDPZ7PLLANCNFSM4HVGR7QA
.
definitely smthg to look into
The displacement problem is solved on #5069
Since there's a PR regarding this, I close the issue. THX
The PR only fices one of the issues, the other one requires a discussion about how the Internal/External forces should be considered (in my opinion). Please, @RiccardoRossi download the case of @AlejandroCornejo and test for yourself
Since there's a PR regarding this, I close the issue. THX
FYI you can automatically close an issue once the PR that fixes it is merged by adding "closes #issuenumer" at the end of the description.
What is the state of this issue??
I proposed a solution on #5069. @RiccardoRossi asked for a more consistent solution. This more consistent solution break 60% of structural tests. I propose to merge #5069 and apply changes suggested by @RiccardoRossi and fix the tests in a independent PR (many tests, very challengeful PR)
5069 is not correct so i would NOT merge it. Instead we should understand why a properly implemented convergence criteria breaks our tests, which should really not happen!!
True, but right now I cannot research the reasons
Hi all! I think that we have to overcome this problem... Just as a summary of he problematic, the TOtal Lagrangian elements have a "problem" of convergence that iterates achieving abs_norms about 1E-7 or 9E-7 whereas the Small Strain elements in 1 o 2 iterations reduce the abs_error to 1E-12 aprox.
Up to now, the only solution is to set the abs_tolerance to 1E-7 and compute but I thinbk that we are missing something...
@loumalouomega may have some concerns since he did a PR.
The MoveMesh() approach does not solve the problem, only mitigates the special cases where only BC were applied.
Regards,
@RiccardoRossi
Hi all! I think that we have to overcome this problem... Just as a summary of he problematic, the TOtal Lagrangian elements have a "problem" of convergence that iterates achieving abs_norms about 1E-7 or 9E-7 whereas the Small Strain elements in 1 o 2 iterations reduce the abs_error to 1E-12 aprox.
Up to now, the only solution is to set the abs_tolerance to 1E-7 and compute but I thinbk that we are missing something...
@loumalouomega may have some concerns since he did a PR.
The
MoveMesh()approach does not solve the problem, only mitigates the special cases where only BC were applied.Regards,
@RiccardoRossi
Does this happen on UL? (probably I already asked)
Hm strange
Did you also try the UL element?The Updated element behaves in the same way but the results are spurious... So it's worse
HERE :)
and #5069 does not fix the issue at all?, this is something for loads, not for imposed displacements
the #5069 solves that case with only BC, yes. But it is not enough for solving the whole problematic that I'm describing...
Can you share the problem?, when I ran the example you attached it worke, and it converged as expected