feat(cpp-object-oriented-modular-refactoring): step 21 - domain-mapper-modules
This commit is contained in:
@@ -18,8 +18,13 @@ add_library(
|
||||
elements/euler_beam_3d.cpp
|
||||
elements/mitc4_shell.cpp
|
||||
fem/dof_manager.cpp
|
||||
io/abaqus/domain_builder.cpp
|
||||
io/abaqus/domain_mapping_context.cpp
|
||||
io/abaqus/domain_mapper.cpp
|
||||
io/abaqus/input_reader.cpp
|
||||
io/abaqus/material_property_mapper.cpp
|
||||
io/abaqus/step_definition_mapper.cpp
|
||||
io/abaqus/topology_mapper.cpp
|
||||
io/hdf5/hdf5_results_writer.cpp
|
||||
loads/concentrated_nodal_load.cpp
|
||||
materials/isotropic_linear_elastic_material.cpp
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "io/abaqus/domain_builder.h"
|
||||
|
||||
#include "io/abaqus/domain_mapping_context.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
Result<Domain> DomainBuilder::Build(DomainMappingContext& context) const {
|
||||
return context.Commit();
|
||||
}
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef FESA_IO_ABAQUS_DOMAIN_BUILDER_H_
|
||||
#define FESA_IO_ABAQUS_DOMAIN_BUILDER_H_
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
#include "fesa/model/domain.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
class DomainMappingContext;
|
||||
|
||||
/// @brief Commits a complete validated mapping candidate atomically.
|
||||
class DomainBuilder {
|
||||
public:
|
||||
/// @brief Transfers the candidate to Domain only after every stage succeeds.
|
||||
Result<Domain> Build(DomainMappingContext& context) const;
|
||||
};
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
|
||||
#endif // FESA_IO_ABAQUS_DOMAIN_BUILDER_H_
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,79 @@
|
||||
#ifndef FESA_IO_ABAQUS_DOMAIN_MAPPING_CONTEXT_H_
|
||||
#define FESA_IO_ABAQUS_DOMAIN_MAPPING_CONTEXT_H_
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
#include "fesa/io/abaqus/input_syntax.h"
|
||||
#include "fesa/model/domain.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
class DomainBuilder;
|
||||
class MaterialPropertyMapper;
|
||||
class StepDefinitionMapper;
|
||||
class TopologyMapper;
|
||||
|
||||
/// @brief Summarizes syntax-derived candidates before Domain ownership begins.
|
||||
struct DomainMappingCandidateSummary {
|
||||
std::size_t part_count;
|
||||
std::size_t node_count;
|
||||
std::size_t element_count;
|
||||
std::size_t instance_count;
|
||||
std::size_t node_set_count;
|
||||
std::size_t element_set_count;
|
||||
std::size_t material_count;
|
||||
std::size_t beam_section_count;
|
||||
std::size_t shell_section_count;
|
||||
std::size_t model_boundary_count;
|
||||
std::size_t step_boundary_count;
|
||||
std::size_t step_load_count;
|
||||
bool has_static_step;
|
||||
};
|
||||
|
||||
/// @brief Owns uncommitted Abaqus mapping candidates shared by private stages.
|
||||
/// @note The ParsedInput reference must outlive this context and all stages.
|
||||
class DomainMappingContext {
|
||||
public:
|
||||
/// @brief Starts an empty mapping candidate for one parsed input.
|
||||
explicit DomainMappingContext(const ParsedInput& input);
|
||||
~DomainMappingContext();
|
||||
|
||||
DomainMappingContext(const DomainMappingContext&) = delete;
|
||||
DomainMappingContext& operator=(const DomainMappingContext&) = delete;
|
||||
DomainMappingContext(DomainMappingContext&&) = delete;
|
||||
DomainMappingContext& operator=(DomainMappingContext&&) = delete;
|
||||
|
||||
/// @brief Reports stable raw candidate counts for component verification.
|
||||
DomainMappingCandidateSummary CandidateSummary() const noexcept;
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
|
||||
friend class DomainBuilder;
|
||||
friend class MaterialPropertyMapper;
|
||||
friend class StepDefinitionMapper;
|
||||
friend class TopologyMapper;
|
||||
|
||||
/// @brief Parses syntax into uncommitted topology and semantic candidates.
|
||||
Status ParseSyntax();
|
||||
|
||||
/// @brief Validates and projects material and property candidates.
|
||||
Status FinalizeMaterialProperties();
|
||||
|
||||
/// @brief Expands identity instances and stable topology candidates.
|
||||
Status FinalizeTopology();
|
||||
|
||||
/// @brief Resolves the sole static step against finalized source targets.
|
||||
Status FinalizeStep();
|
||||
|
||||
/// @brief Atomically transfers a complete candidate into Domain ownership.
|
||||
Result<Domain> Commit();
|
||||
|
||||
std::unique_ptr<Impl> impl_;
|
||||
};
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
|
||||
#endif // FESA_IO_ABAQUS_DOMAIN_MAPPING_CONTEXT_H_
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "io/abaqus/material_property_mapper.h"
|
||||
|
||||
#include "io/abaqus/domain_mapping_context.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
Status MaterialPropertyMapper::Map(DomainMappingContext& context) const {
|
||||
return context.FinalizeMaterialProperties();
|
||||
}
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef FESA_IO_ABAQUS_MATERIAL_PROPERTY_MAPPER_H_
|
||||
#define FESA_IO_ABAQUS_MATERIAL_PROPERTY_MAPPER_H_
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
class DomainMappingContext;
|
||||
|
||||
/// @brief Validates current isotropic material and section candidates.
|
||||
class MaterialPropertyMapper {
|
||||
public:
|
||||
/// @brief Projects validated material and property records in source order.
|
||||
Status Map(DomainMappingContext& context) const;
|
||||
};
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
|
||||
#endif // FESA_IO_ABAQUS_MATERIAL_PROPERTY_MAPPER_H_
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "io/abaqus/step_definition_mapper.h"
|
||||
|
||||
#include "io/abaqus/domain_mapping_context.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
Status StepDefinitionMapper::Map(DomainMappingContext& context) const {
|
||||
return context.FinalizeStep();
|
||||
}
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef FESA_IO_ABAQUS_STEP_DEFINITION_MAPPER_H_
|
||||
#define FESA_IO_ABAQUS_STEP_DEFINITION_MAPPER_H_
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
class DomainMappingContext;
|
||||
|
||||
/// @brief Resolves the approved static step, loads, and boundaries.
|
||||
class StepDefinitionMapper {
|
||||
public:
|
||||
/// @brief Resolves source targets and finalizes the static-step candidate.
|
||||
Status Map(DomainMappingContext& context) const;
|
||||
};
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
|
||||
#endif // FESA_IO_ABAQUS_STEP_DEFINITION_MAPPER_H_
|
||||
@@ -0,0 +1,15 @@
|
||||
#include "io/abaqus/topology_mapper.h"
|
||||
|
||||
#include "io/abaqus/domain_mapping_context.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
Status TopologyMapper::Map(DomainMappingContext& context) const {
|
||||
return context.ParseSyntax();
|
||||
}
|
||||
|
||||
Status TopologyMapper::Finalize(DomainMappingContext& context) const {
|
||||
return context.FinalizeTopology();
|
||||
}
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef FESA_IO_ABAQUS_TOPOLOGY_MAPPER_H_
|
||||
#define FESA_IO_ABAQUS_TOPOLOGY_MAPPER_H_
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
|
||||
namespace fesa::abaqus_internal {
|
||||
|
||||
class DomainMappingContext;
|
||||
|
||||
/// @brief Maps and finalizes topology without constructing a public Domain.
|
||||
class TopologyMapper {
|
||||
public:
|
||||
/// @brief Parses ordered syntax into shared uncommitted candidates.
|
||||
Status Map(DomainMappingContext& context) const;
|
||||
|
||||
/// @brief Expands identity instances and stable set mappings.
|
||||
Status Finalize(DomainMappingContext& context) const;
|
||||
};
|
||||
|
||||
} // namespace fesa::abaqus_internal
|
||||
|
||||
#endif // FESA_IO_ABAQUS_TOPOLOGY_MAPPER_H_
|
||||
Reference in New Issue
Block a user