diff --git a/src/mirco_setparameters.cpp b/src/mirco_setparameters.cpp index 4beb8dc..ba664ad 100644 --- a/src/mirco_setparameters.cpp +++ b/src/mirco_setparameters.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -60,15 +61,16 @@ void MIRCO::SetParameters(double& E1, double& E2, double& LateralLength, double& // The following pressure based constants are calculated by solving a flat indentor problem using // the pressure based Green function described in Pohrt and Li (2014). // http://dx.doi.org/10.1134/s1029959914040109 - const std::vector shape_factors_pressure{0.961389237917602, 0.924715342432435, - 0.899837531880697, 0.884976751041942, 0.876753783192863, 0.872397956576882, 0.871958228537090, - 0.882669916668780}; + const std::map shape_factors_pressure{{1, 0.961389237917602}, {2, 0.924715342432435}, + {3, 0.899837531880697}, {4, 0.884976751041942}, {5, 0.876753783192863}, + {6, 0.872397956576882}, {7, 0.871958228537090}, {8, 0.882669916668780}}; // The following force based constants are taken from Table 1 of Bonari et al. (2020). // https://doi.org/10.1007/s00466-019-01791-3 - const std::vector shape_factors_force{0.778958541513360, 0.805513388666376, - 0.826126871395416, 0.841369158110513, 0.851733020725652, 0.858342234203154, 0.862368243479785, - 0.864741597831785}; + const std::map shape_factors_force{{1, 0.778958541513360}, {2, 0.805513388666376}, + {3, 0.826126871395416}, {4, 0.841369158110513}, {5, 0.851733020725652}, + {6, 0.858342234203154}, {7, 0.862368243479785}, {8, 0.864741597831785}}; + // Setting up the geometrical parameters. Teuchos::ParameterList& geoParams = @@ -83,11 +85,11 @@ void MIRCO::SetParameters(double& E1, double& E2, double& LateralLength, double& if (PressureGreenFunFlag) { - ShapeFactor = shape_factors_pressure[Resolution - 1]; + ShapeFactor = shape_factors_pressure.at(Resolution); } else { - ShapeFactor = shape_factors_force[Resolution - 1]; + ShapeFactor = shape_factors_force.at(Resolution); } ElasticComplianceCorrection = LateralLength * CompositeYoungs / ShapeFactor;