Skip to content

Commit f6276ff

Browse files
committed
Allow setting fiber orientation with mesh data
1 parent 7b3564a commit f6276ff

File tree

53 files changed

+51919
-11648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+51919
-11648
lines changed

src/global_legacy_module/4C_global_legacy_module_validmaterials.cpp

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "4C_io_input_spec_builders.hpp"
1515
#include "4C_io_input_spec_validators.hpp"
1616
#include "4C_mat_electrode.hpp"
17+
#include "4C_mat_fiber_interpolation.hpp"
1718
#include "4C_mat_fluidporo_singlephase.hpp"
1819
#include "4C_mat_micromaterial.hpp"
1920
#include "4C_mat_muscle_combo.hpp"
@@ -3913,26 +3914,30 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
39133914
/*----------------------------------------------------------------------*/
39143915
// Mixture constituent for ElastHyper toolbox with a damage process and a membrane constituent
39153916
{
3916-
known_materials[Core::Materials::mix_elasthyper_elastin_membrane] =
3917-
group("MIX_Constituent_ElastHyper_ElastinMembrane",
3918-
{
3919-
parameter<int>("NUMMAT", {.description = "number of summands"}),
3920-
parameter<std::vector<int>>(
3921-
"MATIDS", {.description = "list material IDs of the membrane summands",
3922-
.size = from_parameter<int>("NUMMAT")}),
3923-
parameter<int>("MEMBRANENUMMAT", {.description = "number of summands"}),
3924-
parameter<std::vector<int>>(
3925-
"MEMBRANEMATIDS", {.description = "list material IDs of the membrane summands",
3926-
.size = from_parameter<int>("MEMBRANENUMMAT")}),
3927-
parameter<int>(
3928-
"PRESTRESS_STRATEGY", {.description = "Material id of the prestress strategy "
3929-
"(optional, by default no prestretch)",
3930-
.default_value = 0}),
3931-
parameter<int>("DAMAGE_FUNCT",
3932-
{.description = "Reference to the function that is a gain for the "
3933-
"increase/decrease of the reference mass density."}),
3934-
},
3935-
{.description = "ElastHyper toolbox with damage and 2D membrane material"});
3917+
known_materials[Core::Materials::mix_elasthyper_elastin_membrane] = group(
3918+
"MIX_Constituent_ElastHyper_ElastinMembrane",
3919+
{
3920+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
3921+
"MEMBRANE_NORMAL",
3922+
{.description =
3923+
"A unit vector field pointing in the direction of the membrane normal."}),
3924+
parameter<int>("NUMMAT", {.description = "number of summands"}),
3925+
parameter<std::vector<int>>(
3926+
"MATIDS", {.description = "list material IDs of the membrane summands",
3927+
.size = from_parameter<int>("NUMMAT")}),
3928+
parameter<int>("MEMBRANENUMMAT", {.description = "number of summands"}),
3929+
parameter<std::vector<int>>(
3930+
"MEMBRANEMATIDS", {.description = "list material IDs of the membrane summands",
3931+
.size = from_parameter<int>("MEMBRANENUMMAT")}),
3932+
parameter<int>(
3933+
"PRESTRESS_STRATEGY", {.description = "Material id of the prestress strategy "
3934+
"(optional, by default no prestretch)",
3935+
.default_value = 0}),
3936+
parameter<int>("DAMAGE_FUNCT",
3937+
{.description = "Reference to the function that is a gain for the "
3938+
"increase/decrease of the reference mass density."}),
3939+
},
3940+
{.description = "ElastHyper toolbox with damage and 2D membrane material"});
39363941
}
39373942

39383943
/*----------------------------------------------------------------------*/
@@ -3958,12 +3963,9 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
39583963
known_materials[Core::Materials::mix_growth_strategy_anisotropic] =
39593964
group("MIX_GrowthStrategy_Anisotropic",
39603965
{
3961-
parameter<int>(
3962-
"INIT", {.description = "initialization modus for growth direction alignment",
3963-
.default_value = 1}),
3964-
parameter<int>("FIBER_ID", {.description = "Id of the fiber to point the growth "
3965-
"direction (1 for first fiber, default)",
3966-
.default_value = 1}),
3966+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
3967+
"GROWTH_DIRECTION",
3968+
{.description = "A unit vector field pointing in the direction of growth."}),
39673969
},
39683970
{.description = "anisotropic growth"});
39693971
}
@@ -4020,6 +4022,13 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
40204022
parameter<double>("CIRCUMFERENTIAL_PRESTRETCH",
40214023
{.description = "Prestretch in circumferential direction"}),
40224024
parameter<double>("PRESSURE", {.description = "Pressure in the inner of the cylinder"}),
4025+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
4026+
"RADIAL", {.description = "A unit vector field pointing in radial direction."}),
4027+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
4028+
"AXIAL", {.description = "A unit vector field pointing in axial direction."}),
4029+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
4030+
"CIRCUMFERENTIAL",
4031+
{.description = "A unit vector field pointing in circumferential direction."}),
40234032
},
40244033
{.description = "Simple prestress strategy for a cylinder"});
40254034
}
@@ -4046,7 +4055,9 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
40464055
known_materials[Core::Materials::mix_full_constrained_mixture_fiber] = group(
40474056
"MIX_Constituent_FullConstrainedMixtureFiber",
40484057
{
4049-
parameter<int>("FIBER_ID", {.description = "Id of the fiber"}),
4058+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
4059+
"ORIENTATION", {.description = "A unit vector field pointing in the direction of "
4060+
"the fiber in the reference configuration."}),
40504061
parameter<int>("FIBER_MATERIAL_ID", {.description = "Id of fiber material"}),
40514062
parameter<bool>("ENABLE_GROWTH",
40524063
{.description = "Switch for the growth (default true)", .default_value = true}),
@@ -4061,9 +4072,6 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
40614072
{.description =
40624073
"Id of the time function to scale the deposition stretch (Default: 0=None)",
40634074
.default_value = 0}),
4064-
parameter<int>("INIT",
4065-
{.description =
4066-
"Initialization mode for fibers (1=element fibers, 3=nodal fibers)"}),
40674075
parameter<std::string>("ADAPTIVE_HISTORY_STRATEGY",
40684076
{.description = "Strategy for adaptive history integration (none, model_equation, "
40694077
"higher_order)",
@@ -4081,7 +4089,9 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
40814089
known_materials[Core::Materials::mix_remodelfiber_expl] = group(
40824090
"MIX_Constituent_ExplicitRemodelFiber",
40834091
{
4084-
parameter<int>("FIBER_ID", {.description = "Id of the fiber", .default_value = 1}),
4092+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
4093+
"ORIENTATION", {.description = "A unit vector field pointing in the direction of "
4094+
"the fiber in the reference configuration."}),
40854095
parameter<int>("FIBER_MATERIAL_ID", {.description = "Id of fiber material"}),
40864096
parameter<bool>("ENABLE_GROWTH",
40874097
{.description = "Switch for the growth (default true)", .default_value = true}),
@@ -4099,9 +4109,6 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
40994109
parameter<bool>("INELASTIC_GROWTH",
41004110
{.description = "Mixture rule has inelastic growth (default false)",
41014111
.default_value = false}),
4102-
parameter<int>("INIT",
4103-
{.description =
4104-
"Initialization mode for fibers (1=element fibers, 2=nodal fibers)"}),
41054112
parameter<double>("GAMMA",
41064113
{.description = "Angle of fiber alignment in degree (default = 0.0 degrees)",
41074114
.default_value = 0.0}),
@@ -4115,7 +4122,9 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
41154122
known_materials[Core::Materials::mix_remodelfiber_impl] = group(
41164123
"MIX_Constituent_ImplicitRemodelFiber",
41174124
{
4118-
parameter<int>("FIBER_ID", {.description = "Id of the fiber"}),
4125+
interpolated_input_field<Core::LinAlg::Tensor<double, 3>, Mat::FiberInterpolation>(
4126+
"ORIENTATION", {.description = "A unit vector field pointing in the direction of "
4127+
"the fiber in the reference configuration."}),
41194128
parameter<int>("FIBER_MATERIAL_ID", {.description = "Id of fiber material"}),
41204129
parameter<bool>("ENABLE_GROWTH",
41214130
{.description = "Switch for the growth (default true)", .default_value = true}),
@@ -4130,9 +4139,6 @@ std::unordered_map<Core::Materials::MaterialType, Core::IO::InputSpec> Global::v
41304139
{.description =
41314140
"Id of the time function to scale the deposition stretch (Default: 0=None)",
41324141
.default_value = 0}),
4133-
parameter<int>("INIT",
4134-
{.description =
4135-
"Initialization mode for fibers (1=element fibers, 2=nodal fibers)"}),
41364142
},
41374143
{.description = "A 1D constituent that remodels"});
41384144
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// This file is part of 4C multiphysics licensed under the
2+
// GNU Lesser General Public License v3.0 or later.
3+
//
4+
// See the LICENSE.md file in the top-level for license information.
5+
//
6+
// SPDX-License-Identifier: LGPL-3.0-or-later
7+
8+
#ifndef FOUR_C_MAT_FIBER_INTERPOLATION_HPP
9+
#define FOUR_C_MAT_FIBER_INTERPOLATION_HPP
10+
11+
#include "4C_config.hpp"
12+
13+
#include "4C_linalg_tensor.hpp"
14+
15+
#include <numeric>
16+
#include <ranges>
17+
18+
19+
FOUR_C_NAMESPACE_OPEN
20+
21+
namespace Mat
22+
{
23+
/**
24+
* A simple interpolation strategy for unit-vector fields (e.g., fibers)
25+
*/
26+
struct FiberInterpolation
27+
{
28+
Core::LinAlg::Tensor<double, 3> operator()(const std::ranges::sized_range auto& weights,
29+
const std::ranges::sized_range auto& fibers) const
30+
{
31+
// Do default interpolation
32+
Core::LinAlg::Tensor<double, 3> interpolated_fiber = std::inner_product(weights.begin(),
33+
weights.end(), fibers.begin(), Core::LinAlg::Tensor<double, 3>{{0.0, 0.0, 0.0}});
34+
35+
// normalize vector
36+
return interpolated_fiber / Core::LinAlg::norm2(interpolated_fiber);
37+
}
38+
};
39+
40+
} // namespace Mat
41+
42+
FOUR_C_NAMESPACE_CLOSE
43+
44+
#endif

0 commit comments

Comments
 (0)