Reject duplicate Solid procedures and unsupported static restart
This commit is contained in:
@@ -2387,6 +2387,16 @@ class DomainMappingContext::Impl {
|
||||
}
|
||||
|
||||
void ParseStepBlock(const KeywordBlock& block) {
|
||||
if (model_element_family_ == ElementFamily::kSolid &&
|
||||
(block.canonical_name == "STATIC" ||
|
||||
block.canonical_name == "FREQUENCY" ||
|
||||
block.canonical_name == "DYNAMIC") &&
|
||||
(step_.has_static || step_.frequency || step_.dynamic)) {
|
||||
InputFailure("unsupported-analysis-procedure", block.location,
|
||||
block.canonical_name, step_.name_raw,
|
||||
"Solid steps accept exactly one procedure.");
|
||||
return;
|
||||
}
|
||||
if (model_element_family_ == ElementFamily::kThermalShell &&
|
||||
(block.canonical_name == "STATIC" ||
|
||||
block.canonical_name == "FREQUENCY" ||
|
||||
@@ -2525,17 +2535,16 @@ class DomainMappingContext::Impl {
|
||||
}
|
||||
step_no_op_seen_ = true;
|
||||
if (step_.frequency || step_.has_heat_transfer ||
|
||||
(step_.dynamic && model_element_family_ == ElementFamily::kSolid)) {
|
||||
model_element_family_ == ElementFamily::kSolid) {
|
||||
const auto* write = Parameter(block, "WRITE");
|
||||
const auto* frequency = Parameter(block, "FREQUENCY");
|
||||
if (!ValidateParameters(block, {"WRITE", "FREQUENCY"}) ||
|
||||
write == nullptr || write->value || frequency == nullptr ||
|
||||
!frequency->value || *frequency->value != "0") {
|
||||
if (!failure_) {
|
||||
InputFailure("unsupported-keyword", block.location,
|
||||
block.canonical_name, "",
|
||||
"Dynamic and frequency RESTART accept only WRITE, "
|
||||
"FREQUENCY=0.");
|
||||
InputFailure(
|
||||
"unsupported-keyword", block.location, block.canonical_name, "",
|
||||
"Supported RESTART no-op requires WRITE, FREQUENCY=0.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2900,8 +2909,13 @@ class DomainMappingContext::Impl {
|
||||
if (model_element_family_ == ElementFamily::kSolid &&
|
||||
Parameter(block, "DIRECT")) {
|
||||
if (step_.perturbation_explicit || step_.has_static || step_.frequency ||
|
||||
!ValidateParameters(block, {"DIRECT"}))
|
||||
step_.dynamic) {
|
||||
InputFailure("unsupported-analysis-procedure", block.location,
|
||||
block.canonical_name, step_.name_raw,
|
||||
"STATIC DIRECT requires one non-perturbation procedure.");
|
||||
return;
|
||||
}
|
||||
if (!ValidateParameters(block, {"DIRECT"})) return;
|
||||
const auto* direct = Parameter(block, "DIRECT");
|
||||
if (direct->value || block.data.size() != 1U ||
|
||||
(block.data[0].fields.size() < 2U ||
|
||||
|
||||
Reference in New Issue
Block a user