feat(cpp-object-oriented-modular-refactoring): step 19 - boundary-condition-policy
This commit is contained in:
@@ -101,7 +101,8 @@ AnalysisModel::AnalysisModel(const Domain& domain) : domain_{&domain} {
|
||||
}
|
||||
}
|
||||
|
||||
for (std::size_t index = 0U; index < Step().Boundaries().size(); ++index) {
|
||||
for (std::size_t index = 0U; index < Step().BoundaryConditions().size();
|
||||
++index) {
|
||||
active_boundary_conditions_.push_back(static_cast<EntityIndex>(index));
|
||||
}
|
||||
for (std::size_t index = 0U; index < Step().Loads().size(); ++index) {
|
||||
|
||||
@@ -109,7 +109,8 @@ Status LinearStaticAnalysis::AssembleAndPartitionStiffness() {
|
||||
full_stiffness_ =
|
||||
std::make_unique<SparseMatrix>(std::move(stiffness.Value()));
|
||||
|
||||
auto partitioned = EssentialConstraints::Partition(*full_stiffness_, *dofs_);
|
||||
auto partitioned =
|
||||
EssentialConstraintPolicy{}.Partition(*full_stiffness_, *dofs_);
|
||||
if (!partitioned.HasValue()) {
|
||||
return partitioned.GetStatus();
|
||||
}
|
||||
@@ -120,7 +121,7 @@ Status LinearStaticAnalysis::AssembleAndPartitionStiffness() {
|
||||
|
||||
Status LinearStaticAnalysis::Factorize() {
|
||||
// This call intentionally precedes all load assembly in Analysis::Run.
|
||||
return linear_solver_.Factorize(partitioned_stiffness_->kff);
|
||||
return linear_solver_.Factorize(partitioned_stiffness_->k_ff);
|
||||
}
|
||||
|
||||
Status LinearStaticAnalysis::AssembleLoadsAndEffectiveRhs() {
|
||||
@@ -131,7 +132,7 @@ Status LinearStaticAnalysis::AssembleLoadsAndEffectiveRhs() {
|
||||
state_->ExternalForce() = std::move(full_load.Value());
|
||||
|
||||
auto rhs = LoadAssembler::EffectiveFreeRhs(state_->ExternalForce(),
|
||||
partitioned_stiffness_->kfc,
|
||||
partitioned_stiffness_->k_fc,
|
||||
dofs_->PrescribedValues(), *dofs_);
|
||||
if (!rhs.HasValue()) {
|
||||
return rhs.GetStatus();
|
||||
@@ -148,7 +149,7 @@ Status LinearStaticAnalysis::SubstituteAndReconstruct() {
|
||||
return solve_status;
|
||||
}
|
||||
|
||||
state_->Displacement() = EssentialConstraints::ReconstructFull(
|
||||
state_->Displacement() = EssentialConstraintPolicy{}.ReconstructFull(
|
||||
free_displacement, dofs_->PrescribedValues(), *dofs_);
|
||||
return Status::Ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user