Commit 2d309240 authored by GILLES Sebastien's avatar GILLES Sebastien

#1303 Update non linear membrane operator with new values: now the expected...

#1303 Update non linear membrane operator with new values: now the expected results are way more precise and the thickness is an arbitrary value rather than just 1. Values with pretension have also been written but aren't yet checked.
parent e759a348
......@@ -60,23 +60,49 @@ namespace MoReFEM::TestNS::NonLinearMembraneOperatorNS
// The values below have been computed independantly in Matlab by Dominique Chapelle.
expected_results_type<IsMatrixOrVector::matrix> ret;
FillMatrix fill_matrix(1.e9, ret);
FillMatrix fill_matrix(1.e10, ret);
if (is_pretension == pretension::no)
{
fill_matrix.AddRow({ 3.1217, -2.8516, -0.2701, -0.5325, 0.4134, 0.1191, -0.3028, 0.2113, 0.0914 });
fill_matrix.AddRow({ -2.8516, 3.0204, -0.1688, 0.4339, -0.3198, -0.1141, 0.2183, -0.1612, -0.0571 });
fill_matrix.AddRow({ -0.2701, -0.1688, 0.4389, 0.0986, -0.0936, -0.0050, 0.0844, -0.0502, -0.0343 });
fill_matrix.AddRow({ -0.5325, 0.4339, 0.0986, 8.0441, -7.4416, -0.6025, 2.2840, -2.0490, -0.2350 });
fill_matrix.AddRow({ 0.4134, -0.3198, -0.0936, -7.4416, 8.0378, -0.5961, -2.0270, 2.0660, -0.0390 });
fill_matrix.AddRow({ 0.1191, -0.1141, -0.0050, -0.6025, -0.5961, 1.1986, -0.2571, -0.0170, 0.2740 });
fill_matrix.AddRow({ -0.3028, 0.2183, 0.0844, 2.2840, -2.0270, -0.2571, 4.1101, -3.7093, -0.4008 });
fill_matrix.AddRow({ 0.2113, -0.1612, -0.0502, -2.0490, 2.0660, -0.0170, -3.7093, 3.8471, -0.1378 });
fill_matrix.AddRow({ 0.0914, -0.0571, -0.0343, -0.2350, -0.0390, 0.2740, -0.4008, -0.1378, 0.5385 });
fill_matrix.AddRow({ 1.322827726106691, -1.208373780858154, -0.114453945248537, -0.225666852725472,
0.175183327027966, 0.050483525697505, -0.128292178434872, 0.089556017116076, 0.038736161318796 });
fill_matrix.AddRow({ -1.208373780858154, 1.279892021580330, -0.071518240722176, 0.183879623586336,
-0.135513798722450, -0.048365824863886, 0.092512935042351, -0.068300996237284, -0.024211938805067 });
fill_matrix.AddRow({ -0.114453945248537, -0.071518240722176, 0.185972185970713, 0.041787229139135,
-0.039669528305516, -0.002117700833619, 0.035779243392521, -0.021255020878792, -0.014524222513729 });
fill_matrix.AddRow({ -0.225666852725472, 0.183879623586336, 0.041787229139135, 3.408682812520989,
-3.153385499509070, -0.255297313011918, 0.967863611537033, -0.868275409254392, -0.099588202282641 });
fill_matrix.AddRow({ 0.175183327027966, -0.135513798722450, -0.039669528305516, -3.153385499509070,
3.406001782573789, -0.252616283064719, -0.858938048391076, 0.875461739270461, -0.016523690879386 });
fill_matrix.AddRow({ 0.050483525697505, -0.048365824863886, -0.002117700833619, -0.255297313011918,
-0.252616283064719, 0.507913596076638, -0.108925563145957, -0.007186330016070, 0.116111893162027 });
fill_matrix.AddRow({ -0.128292178434872, 0.092512935042351, 0.035779243392521, 0.967863611537033,
-0.858938048391076, -0.108925563145957, 1.741649648938485, -1.571831792261287, -0.169817856677199 });
fill_matrix.AddRow({ 0.089556017116076, -0.068300996237284, -0.021255020878792, -0.868275409254392,
0.875461739270461, -0.007186330016070, -1.571831792261287, 1.630205008542017, -0.058373216280731 });
fill_matrix.AddRow({ 0.038736161318796, -0.024211938805067, -0.014524222513729, -0.099588202282641,
-0.016523690879386, 0.116111893162027, -0.169817856677199, -0.058373216280731, 0.228191072957930 });
}
else
{
fill_matrix.AddRow({ 1.683147665196165, -1.464625146663350, -0.218522518532815, -0.225666852725472,
0.175183327027966, 0.050483525697505, -0.128292178434872, 0.089556017116076, 0.038736161318796 });
fill_matrix.AddRow({ -1.464625146663350, 1.536143387385526, -0.071518240722176, 0.183879623586336,
-0.135513798722450, -0.048365824863886, 0.092512935042351 -0.068300996237284 -0.024211938805067 });
fill_matrix.AddRow({ -0.218522518532815, -0.071518240722176, 0.290040759254991, 0.041787229139135,
-0.039669528305516, -0.002117700833619, 0.092512935042351, -0.068300996237284, -0.024211938805067 });
fill_matrix.AddRow({ -0.225666852725472, 0.183879623586336, 0.041787229139135, 3.769002751610463,
-3.409636865314267, -0.359365886296197, 0.967863611537033, -0.868275409254392 -0.099588202282641 });
fill_matrix.AddRow({ 0.175183327027966, -0.135513798722450 -0.039669528305516 -3.409636865314267,
3.662253148378986, -0.252616283064719, -0.858938048391076, 0.875461739270461, -0.016523690879386 });
fill_matrix.AddRow({ 0.050483525697505, -0.048365824863886, -0.002117700833619, -0.359365886296197,
-0.252616283064719, 0.611982169360916, -0.108925563145957, -0.007186330016070, 0.116111893162027 });
fill_matrix.AddRow({ -0.128292178434872, 0.092512935042351, 0.035779243392521, 0.967863611537033,
-0.858938048391076, -0.108925563145957, 2.101969588027960, -1.828083158066483, -0.273886429961477 });
fill_matrix.AddRow({ 0.089556017116076, -0.068300996237284, -0.021255020878792, -0.868275409254392,
0.875461739270461, -0.007186330016070, -1.828083158066483, 1.886456374347214, -0.058373216280731 });
fill_matrix.AddRow({ 0.038736161318796, -0.024211938805067, -0.014524222513729, -0.099588202282641,
-0.016523690879386, 0.116111893162027, -0.273886429961477, -0.058373216280731, 0.332259646242208 });
}
ConvertLocal2Global(ret);
......@@ -94,23 +120,34 @@ namespace MoReFEM::TestNS::NonLinearMembraneOperatorNS
{
ret =
{
0.3342,
-0.2507,
-0.0835,
-3.7759,
4.2108,
-0.4349,
-1.6428,
1.7009,
-0.0582,
0.141635307789950,
-0.106231526876560,
-0.035403780913390,
-1.600020566269832,
1.784325243232761,
-0.184304676962930,
-0.696115804469422,
0.720769508888880,
-0.024653704419458
};
}
else
{
ret =
{
0.193277587691539,
-0.131856663457079,
-0.061420924234460,
-1.911219907130632,
2.140514641701985,
-0.229294734571352,
-0.857379108160713,
0.869395301055894,
-0.012016192895181
};
}
ApplyFactorToVector(1.e11, ret);
ApplyFactorToVector(1.e12, ret);
ConvertLocal2Global(ret);
......@@ -159,9 +196,7 @@ namespace MoReFEM::TestNS::NonLinearMembraneOperatorNS
for (auto loc2glob : loc2glob_array)
{
const auto& original_row = matrix[loc2glob];
assert(original_row.size() == 9ul);
reordered_row.clear();
for (auto loc2glob_col : loc2glob_array)
......
......@@ -34,9 +34,9 @@ namespace MoReFEM
using ::MoReFEM::Internal::assemble_into_vector;
double thickness_value = 1.; // 4.2375
const double thickness_value = 4.2375;
double pretension_value = 17.984152;
const double pretension_value = 17.984152;
} // namespace anonymous
......@@ -135,17 +135,17 @@ namespace MoReFEM
stiffness_operator.Assemble(std::make_tuple(std::ref(mat), std::ref(vec)),
previous_iteration);
/* BOOST_CHECK_NO_THROW */(CheckMatrix(god_of_dof,
matrix_tangent_stiffness,
GetExpectedMatrixP1P1(is_pretension),
__FILE__, __LINE__,
1.e6));
/* BOOST_CHECK_NO_THROW */(CheckVector(god_of_dof,
vector_stiffness_residual,
GetExpectedVectorP1P1(is_pretension),
__FILE__, __LINE__,
1.e7));
CheckMatrix(god_of_dof,
matrix_tangent_stiffness,
GetExpectedMatrixP1P1(is_pretension),
__FILE__, __LINE__,
1.);
CheckVector(god_of_dof,
vector_stiffness_residual,
GetExpectedVectorP1P1(is_pretension),
__FILE__, __LINE__,
1.);
}
else if (do_assemble_into_matrix == assemble_into_matrix::yes
&& do_assemble_into_vector == assemble_into_vector::no)
......@@ -153,11 +153,11 @@ namespace MoReFEM
stiffness_operator.Assemble(std::make_tuple(std::ref(mat)),
previous_iteration);
/* BOOST_CHECK_NO_THROW */(CheckMatrix(god_of_dof,
matrix_tangent_stiffness,
GetExpectedMatrixP1P1(is_pretension),
__FILE__, __LINE__,
1.e6));
CheckMatrix(god_of_dof,
matrix_tangent_stiffness,
GetExpectedMatrixP1P1(is_pretension),
__FILE__, __LINE__,
1.);
}
else if (do_assemble_into_matrix == assemble_into_matrix::no
&& do_assemble_into_vector == assemble_into_vector::yes)
......@@ -165,14 +165,12 @@ namespace MoReFEM
stiffness_operator.Assemble(std::make_tuple(std::ref(vec)),
previous_iteration);
/* BOOST_CHECK_NO_THROW */(CheckVector(god_of_dof,
vector_stiffness_residual,
GetExpectedVectorP1P1(is_pretension),
__FILE__, __LINE__,
1.e7));
CheckVector(god_of_dof,
vector_stiffness_residual,
GetExpectedVectorP1P1(is_pretension),
__FILE__, __LINE__,
1.);
}
}
......
......@@ -60,7 +60,8 @@ namespace MoReFEM
if (Nexpected_program_wise_row != static_cast<std::size_t>(Nrow))
{
std::ostringstream oconv;
oconv << "Mismatch between expected and obtained matrix format: a matrix with " << Nexpected_program_wise_row
oconv << "Mismatch between expected and obtained matrix format: a matrix with "
<< Nexpected_program_wise_row
<< " program-wise rows was expected but the obtained matrix got " << Nrow << '.';
throw Exception(oconv.str(), invoking_file, invoking_line);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment