feat: map fixed-step HHT shell dynamics input
This commit is contained in:
@@ -69,6 +69,43 @@ StepDefinition::StepDefinition(FrequencyStepDefinition definition)
|
||||
}
|
||||
}
|
||||
|
||||
StepDefinition::StepDefinition(DynamicStepDefinition definition)
|
||||
: name_{definition.source_step_name_raw},
|
||||
procedure_kind_{StaticProcedureKind::kNonlinearFullNewton},
|
||||
nlgeom_{true},
|
||||
initial_increment_{definition.initial_increment},
|
||||
time_period_{definition.time_period},
|
||||
minimum_increment_{definition.initial_increment},
|
||||
maximum_increment_{definition.initial_increment},
|
||||
location_{definition.step_location},
|
||||
dynamic_{std::move(definition)} {
|
||||
for (const auto& boundary : dynamic_->boundaries) {
|
||||
for (int source_dof = boundary.first_dof; source_dof <= boundary.last_dof;
|
||||
++source_dof) {
|
||||
const std::size_t source_order = boundary_conditions_.size();
|
||||
auto owned = std::make_unique<PrescribedDisplacementBoundaryCondition>(
|
||||
SourceTargetQuery{SourceEntityKind::kNode, "", boundary.target},
|
||||
static_cast<DofComponent>(source_dof - 1), boundary.value,
|
||||
source_order, boundary.location);
|
||||
boundary_conditions_view_.push_back(std::cref(*owned));
|
||||
prescribed_displacements_view_.Add(*owned);
|
||||
boundary_conditions_.push_back(std::move(owned));
|
||||
}
|
||||
}
|
||||
loads_.reserve(dynamic_->loads.size());
|
||||
loads_view_.reserve(dynamic_->loads.size());
|
||||
for (std::size_t source_order = 0U; source_order < dynamic_->loads.size();
|
||||
++source_order) {
|
||||
auto& load = dynamic_->loads[source_order];
|
||||
auto owned = std::make_unique<ConcentratedNodalLoad>(
|
||||
SourceTargetQuery{SourceEntityKind::kNode, "", load.target}, load.dof,
|
||||
load.magnitude, source_order, std::move(load.location));
|
||||
loads_view_.push_back(std::cref(*owned));
|
||||
concentrated_loads_view_.Add(*owned);
|
||||
loads_.push_back(std::move(owned));
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& StepDefinition::Name() const noexcept { return name_; }
|
||||
|
||||
const BoundaryConditionView& StepDefinition::BoundaryConditions()
|
||||
@@ -98,17 +135,24 @@ StaticProcedureKind StepDefinition::ProcedureKind() const noexcept {
|
||||
}
|
||||
|
||||
bool StepDefinition::IsNonlinearStatic() const noexcept {
|
||||
return procedure_kind_ == StaticProcedureKind::kNonlinearFullNewton;
|
||||
return !dynamic_ &&
|
||||
procedure_kind_ == StaticProcedureKind::kNonlinearFullNewton;
|
||||
}
|
||||
|
||||
bool StepDefinition::IsFrequency() const noexcept {
|
||||
return frequency_.has_value();
|
||||
}
|
||||
|
||||
bool StepDefinition::IsDynamic() const noexcept { return dynamic_.has_value(); }
|
||||
|
||||
const FrequencyStepDefinition* StepDefinition::Frequency() const noexcept {
|
||||
return frequency_ ? &*frequency_ : nullptr;
|
||||
}
|
||||
|
||||
const DynamicStepDefinition* StepDefinition::Dynamic() const noexcept {
|
||||
return dynamic_ ? &*dynamic_ : nullptr;
|
||||
}
|
||||
|
||||
bool StepDefinition::UsesNonlinearGeometry() const noexcept { return nlgeom_; }
|
||||
|
||||
double StepDefinition::InitialIncrement() const noexcept {
|
||||
@@ -207,6 +251,10 @@ const FrequencyStepDefinition* Domain::Frequency() const noexcept {
|
||||
return steps_view_.Size() == 1U ? steps_view_[0U].Frequency() : nullptr;
|
||||
}
|
||||
|
||||
const DynamicStepDefinition* Domain::Dynamic() const noexcept {
|
||||
return steps_view_.Size() == 1U ? steps_view_[0U].Dynamic() : nullptr;
|
||||
}
|
||||
|
||||
const std::vector<Diagnostic>& Domain::Warnings() const noexcept {
|
||||
return definition_.warnings;
|
||||
}
|
||||
@@ -270,7 +318,8 @@ Domain::Domain(ModelDefinition definition)
|
||||
definition_.shell_elements.clear();
|
||||
|
||||
step_definitions_.reserve(definition_.steps.size() +
|
||||
(definition_.frequency_step ? 1U : 0U));
|
||||
(definition_.frequency_step ? 1U : 0U) +
|
||||
(definition_.dynamic_step ? 1U : 0U));
|
||||
for (auto& step : definition_.steps) {
|
||||
auto owned =
|
||||
std::unique_ptr<StepDefinition>(new StepDefinition(std::move(step)));
|
||||
@@ -284,6 +333,12 @@ Domain::Domain(ModelDefinition definition)
|
||||
steps_view_.Add(*owned);
|
||||
step_definitions_.push_back(std::move(owned));
|
||||
}
|
||||
if (definition_.dynamic_step) {
|
||||
auto owned = std::unique_ptr<StepDefinition>(
|
||||
new StepDefinition(std::move(*definition_.dynamic_step)));
|
||||
steps_view_.Add(*owned);
|
||||
step_definitions_.push_back(std::move(owned));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
|
||||
Reference in New Issue
Block a user