Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "4C_config.hpp"

#include "4C_linalg_utlis_quaternion_interpolation.hpp"
#include "4C_linalg_utils_quaternion_interpolation.hpp"

#include "4C_linalg_fixedsizematrix.hpp"
#include "4C_linalg_utils_scalar_interpolation.hpp"
Expand Down Expand Up @@ -563,4 +563,4 @@ void Core::LinAlg::GeneralizedSphericalLinearInterpolator<loc_dim>::right_orthon
template class Core::LinAlg::GeneralizedSphericalLinearInterpolator<1>;
template class Core::LinAlg::GeneralizedSphericalLinearInterpolator<2>;
template class Core::LinAlg::GeneralizedSphericalLinearInterpolator<3>;
FOUR_C_NAMESPACE_CLOSE
FOUR_C_NAMESPACE_CLOSE
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#ifndef FOUR_C_LINALG_UTLIS_QUATERNION_INTERPOLATION_HPP
#define FOUR_C_LINALG_UTLIS_QUATERNION_INTERPOLATION_HPP
#ifndef FOUR_C_LINALG_UTILS_QUATERNION_INTERPOLATION_HPP
#define FOUR_C_LINALG_UTILS_QUATERNION_INTERPOLATION_HPP

#include "4C_config.hpp"

Expand Down Expand Up @@ -220,4 +220,4 @@ namespace Core

FOUR_C_NAMESPACE_CLOSE

#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ template <unsigned int loc_dim, unsigned int poly_order, unsigned int num_coeffi
std::vector<double> Core::LinAlg::ScalarInterpolator<loc_dim, poly_order,
num_coefficients>::logarithmic_weighted_average(const std::vector<std::vector<double>>&
scalar_data,
const std::vector<double>& weights)
const std::vector<double>& weights) const
{
const size_t field_size = scalar_data[0].size();
std::vector<double> log_sum(field_size, 0.0);
Expand Down Expand Up @@ -336,7 +336,7 @@ std::vector<double>
Core::LinAlg::ScalarInterpolator<loc_dim, poly_order, num_coefficients>::moving_least_square(
const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights)
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights) const
{
const size_t field_size = scalar_data[0].size();
std::vector<double> interp_scalar(field_size, 0.0);
Expand Down Expand Up @@ -409,7 +409,7 @@ std::vector<double> Core::LinAlg::ScalarInterpolator<loc_dim, poly_order,
num_coefficients>::logarithmic_moving_least_squares(const std::vector<std::vector<double>>&
scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights)
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights) const
{
std::vector<double> interp_scalar(scalar_data[0].size(), 0.0);

Expand Down Expand Up @@ -450,7 +450,7 @@ std::vector<double>
Core::LinAlg::ScalarInterpolator<loc_dim, poly_order, num_coefficients>::get_interpolated_scalar(
const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc)
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc) const
{
// Check for size consistency
if (scalar_data.empty()) FOUR_C_THROW("Scalar data vector is empty.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ namespace Core::LinAlg
*/
std::vector<double> get_interpolated_scalar(const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc);
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc) const;

private:
/**
Expand All @@ -179,7 +179,8 @@ namespace Core::LinAlg
*/
std::vector<double> moving_least_square(const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights);
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc,
const std::vector<double>& weights) const;

/**
* @brief Computes the logarithmic interpolation of scalar data using the provided weights.
Expand All @@ -193,7 +194,8 @@ namespace Core::LinAlg
* @return A vector of doubles representing the logarithmic interpolation results.
*/
std::vector<double> logarithmic_weighted_average(
const std::vector<std::vector<double>>& scalar_data, const std::vector<double>& weights);
const std::vector<std::vector<double>>& scalar_data,
const std::vector<double>& weights) const;

/**
* @brief Computes the log moving least squares interpolation for scalar data.
Expand All @@ -213,7 +215,8 @@ namespace Core::LinAlg
std::vector<double> logarithmic_moving_least_squares(
const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights);
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc,
const std::vector<double>& weights) const;

const ScalarInterpolationType scalar_interp_type_;
const ScalarInterpolationWeightingFunction weight_func_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

#include <gtest/gtest.h>

#include "4C_linalg_utils_quaternion_interpolation.hpp"

#include "4C_linalg_fixedsizematrix.hpp"
#include "4C_linalg_utils_scalar_interpolation.hpp"
#include "4C_linalg_utlis_quaternion_interpolation.hpp"
#include "4C_unittest_utils_assertions_test.hpp"
#include "4C_utils_exceptions.hpp"

Expand Down Expand Up @@ -391,4 +392,4 @@ TEST(QuaternionInterpolationTest, SlerpWeighted_AnalyticalCheck)
ASSERT_NEAR(result(3, 0), w_expected, 1e-12); // w
}

FOUR_C_NAMESPACE_CLOSE
FOUR_C_NAMESPACE_CLOSE
191 changes: 190 additions & 1 deletion src/global_legacy_module/4C_global_legacy_module_validmaterials.cpp
Comment thread
dragos-ana marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,8 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
{
using namespace Core::IO::InputSpecBuilders::Validators;
namespace ViscoplastUtils = Mat::InelasticDefgradTransvIsotropElastViscoplastUtils;

namespace AEI =
Mat::InelasticDefgradTransvIsotropElastViscoplastUtils::AdaptiveEstimateInterpolation;
known_materials[Core::Materials::mfi_transv_isotrop_elast_viscoplast] = group(
"MAT_InelasticDefgradTransvIsotropElastViscoplast",
{parameter<int>(
Expand Down Expand Up @@ -3039,6 +3040,194 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
max_plastic_strain_deriv_incr)})},
{.description = "Settings for registering errors within the procedures used for "
"constitutive update",
.required = false}),
group<AEI::AEIParams>("ADAPTIVE_ESTIMATE_INTERPOLATION",
{
parameter<bool>("USE_ADAPTIVE_ESTIMATE_INTERPOLATION",
{.description = "use adaptive estimate interpolation?",
.default_value = true,
.store =
in_struct(&AEI::AEIParams::use_adaptive_estimate_interpolation)}),
parameter<double>("ELASTIC_PREDICTOR_ZERO_COMPONENT_THRESHOLD",
{.description = "components of the elastic predictor (specifically: the "
"respective elastic deformation gradient) smaller than "
"this threshold are set to 0.0 to avoid "
"unnecessary, numerical rotations",
.default_value = 1.0e-13,
.validator = positive<double>(),
.store = in_struct(
&AEI::AEIParams::elastic_predictor_zero_component_threshold)}),
group<AEI::PlasticPredictorConstructionParams>("PLASTIC_PREDICTOR_CONSTRUCTION",
{
parameter<AEI::PrelimPlasticPredictor::ElasticStretchEigenvalType>(
"ELASTIC_STRETCH_EIGENVAL_TYPE",
{.description = "elastic stretch eigenvalue specification for the "
"preliminary plastic predictor",
.default_value = AEI::PrelimPlasticPredictor::
ElasticStretchEigenvalType::scale_unit,
.store = in_struct(&AEI::PlasticPredictorConstructionParams::
elastic_stretch_eigenval_type)}),
parameter<AEI::PrelimPlasticPredictor::ElasticStretchEigenvectType>(
"ELASTIC_STRETCH_EIGENVECT_TYPE",
{.description = "elastic stretch eigenvector specification for the "
"preliminary plastic predictor",
.default_value = AEI::PrelimPlasticPredictor::
ElasticStretchEigenvectType::from_elastic_predictor,
.store = in_struct(&AEI::PlasticPredictorConstructionParams::
elastic_stretch_eigenvect_type)}),
parameter<AEI::PrelimPlasticPredictor::ElasticRotationType>(
"ELASTIC_ROTATION_TYPE",
{.description = "elastic rotation specification for the "
"preliminary plastic predictor",
.default_value = AEI::PrelimPlasticPredictor::
ElasticRotationType::from_elastic_predictor,
.store = in_struct(&AEI::PlasticPredictorConstructionParams::
elastic_rotation_type)}),
Comment thread
rjoussen marked this conversation as resolved.
parameter<int>("MAX_ITER",
{.description = "maximum number of construction iterations $ "
"i_{\\text{C,max}} $",
Comment thread
dragos-ana marked this conversation as resolved.
.default_value = 50,
.validator = positive<int>(),
.store = in_struct(
&AEI::PlasticPredictorConstructionParams::max_iter)}),
parameter<double>("RELATIVE_UNDERSTRESS_TOL",
{.description = "relative understress tolerance $ \\kappa_{S} $ "
"used to determine the plastic predictor according "
"to $ 1 \\ge \\overline{\\sigma}^{(\\text{P})} / S "
"\\ge 1 - \\kappa_{S} $ ",
.default_value = 1.0e-6,
.validator = in_range(excl(0.), 1.0),
.store = in_struct(&AEI::PlasticPredictorConstructionParams::
relative_understress_tol)}),
parameter<double>("INTERVAL_SCANNING_PARAM",
{.description =
"interval scanning parameter $s$ for updating the "
"construction parameter $\\tau \\gets \\tau_{\\text{E}} + "
"s \\, \\left( \\tau_{\\hat{\\text{P}}} - "
"\\tau_{\\text{E}} \\right)$ (bisection: $ s = 1/2 $)",
.default_value = 0.5,
.validator = in_range(excl(0.), excl(1.)),
.store = in_struct(&AEI::PlasticPredictorConstructionParams::
interval_scanning_param)}),
},
{
.description = "Parameters used for the iterative construction of the "
"plastic predictor",
.required = false,
.store = in_struct(&AEI::AEIParams::plastic_predictor_construction),
}),
group<AEI::EstimateInterpolationParams>("ESTIMATE_INTERPOLATION",
{
parameter<AEI::StartingPointType>("STARTING_POINT_TYPE",
{.description = "starting point type",
Comment thread
rjoussen marked this conversation as resolved.
.default_value = AEI::StartingPointType::equiv_stress_history,
.store = in_struct(
&AEI::EstimateInterpolationParams::starting_point_type)}),
parameter<double>("USER_SET_STARTING_POINT",
{
.description =
"specified starting point: for the constant starting point "
"strategy, this value is set at the beginning of each "
"local "
"integration; for the history-based starting point "
"strategy, "
"this value is used only for the first time step",
.default_value = 0.5,
.validator = in_range<double>(0.0, 1.0),
.store = in_struct(
&AEI::EstimateInterpolationParams::user_set_starting_point),
}),
parameter<int>("MAX_ITER",
{
.description = "maximum number of estimate interpolation "
"iterations "
"$i_{\\text{EI,max}}$",
.default_value = 50,
.validator = positive<int>(),
.store = in_struct(&AEI::EstimateInterpolationParams::max_iter),
}),
parameter<double>("INTERVAL_SCANNING_PARAM",
Comment thread
c-p-schmidt marked this conversation as resolved.
{
.description =
"interval scanning parameter $s$ for updating the "
"interpolation parameter $\\xi \\gets \\xi_{\\text{E}} + s "
"\\, \\left( \\xi_{\\text{P}} - \\xi_{\\text{E}} \\right) "
"(bisection: = $ s = 1/2 $)",
.default_value = 0.5,
.validator = in_range(excl(0.), excl(1.)),
.store = in_struct(
&AEI::EstimateInterpolationParams::interval_scanning_param),
}),
Comment thread
dragos-ana marked this conversation as resolved.
},
{.description =
"Parameters used for the estimate interpolation between predictors",
.required = false,
.store = in_struct(&AEI::AEIParams::estimate_interpolation)}),
group<AEI::HardeningParams>("HARDENING_MANAGEMENT",
{
parameter<AEI::HardeningManagementMethod>("METHOD",
{
.description = "method to be used for handling hardening "
"variables "
"within the "
"adaptive estimate interpolation algorithm",
.default_value = AEI::HardeningManagementMethod::
integrate_via_evolution_equations,
.store = in_struct(&AEI::HardeningParams::method),

}),
parameter<int>("MAX_ITER_INTEGRATION",
{
.description =
"maximum number of iterations for the integration of the "
"hardening variables via the evolution equations",
.default_value = 50,
.validator = positive<int>(),
.store = in_struct(&AEI::HardeningParams::max_iter_integration),
}),
parameter<double>("TOL_INTEGRATION",
{
.description = "tolerance for the integration of the hardening "
"variables via the evolution equations",
.default_value = 1.0e-8,
.validator = positive<double>(),
.store = in_struct(&AEI::HardeningParams::tol_integration),
}),

},
{.description = "Parameters used for the management of hardening variables "
"during interpolation",
.required = false,
.store = in_struct(&AEI::AEIParams::hardening)}),
group<AEI::ReestimationParams>("REESTIMATION",
{
parameter<int>("MAX_NUM_REESTIMATIONS",
{.description = "maximum number of adaptive re-estimations allowed",
.default_value = 10,
.validator = positive_or_zero<int>(),
.store = in_struct(
&AEI::ReestimationParams::max_num_reestimations)}),
parameter<double>("INTERVAL_SCANNING_PARAM",
{.description =
"interval scanning parameter $s$ for determining "
"the intermediate parameter $ \\xi_{\\mathrm{I}} "
"\\gets \\xi_{\\mathrm{E}} + s \\, \\left( \\xi - "
"\\xi_{\\mathrm{E}}\\right) $ (bisection: $ s = 1/2 $)",
.default_value = 0.5,
Comment thread
dragos-ana marked this conversation as resolved.
.validator = in_range(excl(0.), excl(1.)),
.store = in_struct(
&AEI::ReestimationParams::interval_scanning_param)}),
},
{.description = "Parameters used for the re-estimation procedures",
.required = false,
.store = in_struct(&AEI::AEIParams::reestimation)}),

},
{.description = "Parameters used in the Adaptive Estimate Interpolation for Local "
"Newton--Raphson estimates, as presented "
"in Ana, Schmidt, Wall: Adaptive Estimate Interpolation: "
"Accelerating Local Newton--Raphson Schemes in Computational "
"Plasticity / Viscoplasticity, Preprint",
.required = false})},
{.description = "Versatile transversely isotropic (or isotropic) viscoplasticity model for "
"finite deformations with isotropic hardening, using user-defined "
Expand Down
Loading
Loading