Compare commits
52 Commits
4b75b72968
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 5855604318 | |||
| 6bc7cc3ada | |||
| 8c448ffe45 | |||
| ca0268ea5b | |||
| 675379779f | |||
| b68f6ee143 | |||
| 02e2994c5b | |||
| 4f96719663 | |||
| 2df90b95f8 | |||
| 98c13c2ec2 | |||
| 51939fba5b | |||
| f23deb0ade | |||
| fb67007527 | |||
| 4d04f3dbbe | |||
| 9d37465d92 | |||
| e0a6a6fa70 | |||
| 218cfa9d50 | |||
| 5fe57cb145 | |||
| 5618636f0d | |||
| 7d52247d6c | |||
| ac8d24a2cf | |||
| 6ad9f3cd47 | |||
| 6ee51a8502 | |||
| 127286cf2b | |||
| dc6baed8ed | |||
| 6c2e1f3ab1 | |||
| b9bb439766 | |||
| 40a7e6c3af | |||
| 6ac474f19b | |||
| cbb621bb28 | |||
| af886f3f90 | |||
| 9269847c83 | |||
| eec4fe1f49 | |||
| 94c83a39c5 | |||
| af076c39a3 | |||
| a1fed69c47 | |||
| 8cd2d5b2ae | |||
| e6bc708be3 | |||
| 3eeab2fbe4 | |||
| 3588aa2bb6 | |||
| 91041f28c9 | |||
| 2b83b1128f | |||
| 18361e4eb2 | |||
| e31ef999bd | |||
| 93496c0157 | |||
| fe90528115 | |||
| 493219d3c2 | |||
| 11672df2c4 | |||
| d6306383a9 | |||
| 76a0c8ecde | |||
| f8af2c1485 | |||
| 5b7de91988 |
@@ -60,7 +60,7 @@
|
||||
- 전단강성이 생략되면 \(A_{sy}=A_{sz}=5A/6\)과 `SCF=0`을 Phase 1 기본값으로
|
||||
적용한다.
|
||||
- reference 비교는 metadata 없이 요청된 물리량과 CSV 경로를 명시한다. 현재
|
||||
캔틸레버 샘플은 변위와 반력을 비교하며 요소 내력과 도심 응력 비교 루틴은
|
||||
캔틸레버 샘플은 변위, 반력 및 요소 단면력을 비교하며 도심 응력 비교 루틴은
|
||||
synthetic CSV로 검증한다.
|
||||
- 새 MSVC 빌드 경고를 추가하지 않는다.
|
||||
- 변경은 요청 범위에 한정하고 Conventional Commits 형식의 메시지를 사용한다.
|
||||
|
||||
+38
-1
@@ -26,6 +26,10 @@ include(CTest)
|
||||
include(cmake/FesaDependencies.cmake)
|
||||
|
||||
add_library(fesa_core STATIC
|
||||
src/fesa/analysis/linear_static_analysis.cpp
|
||||
src/fesa/analysis/run_solver.cpp
|
||||
src/fesa/assembly/contribution.cpp
|
||||
src/fesa/assembly/parallel_assembler.cpp
|
||||
src/fesa/assembly/serial_assembler.cpp
|
||||
src/fesa/constraints/essential_bc.cpp
|
||||
src/fesa/core/version.cpp
|
||||
@@ -34,11 +38,17 @@ add_library(fesa_core STATIC
|
||||
src/fesa/fem/dof_manager.cpp
|
||||
src/fesa/fem/gauss_rule.cpp
|
||||
src/fesa/fem/line2_shape.cpp
|
||||
src/fesa/io/abaqus/active_input.cpp
|
||||
src/fesa/io/abaqus/parser.cpp
|
||||
src/fesa/io/abaqus/semantic_mapper.cpp
|
||||
src/fesa/io/abaqus/set_resolver.cpp
|
||||
src/fesa/io/hdf5/writer.cpp
|
||||
src/fesa/model/domain.cpp
|
||||
src/fesa/model/domain_builder.cpp
|
||||
src/fesa/results/result_database.cpp
|
||||
src/fesa/solvers/linear/pardiso_linear_solver.cpp
|
||||
src/fesa/validation/comparison.cpp
|
||||
src/fesa/validation/reference_csv.cpp
|
||||
)
|
||||
|
||||
target_include_directories(fesa_core
|
||||
@@ -48,7 +58,7 @@ target_include_directories(fesa_core
|
||||
|
||||
target_compile_features(fesa_core PUBLIC cxx_std_20)
|
||||
target_compile_options(fesa_core PRIVATE /W4 /permissive- /EHsc)
|
||||
target_link_libraries(fesa_core PRIVATE MKL::MKL)
|
||||
target_link_libraries(fesa_core PRIVATE MKL::MKL TBB::tbb HDF5::HDF5)
|
||||
|
||||
add_executable(fesa
|
||||
src/fesa/cli/main.cpp
|
||||
@@ -58,6 +68,33 @@ target_link_libraries(fesa PRIVATE fesa_core)
|
||||
target_compile_features(fesa PRIVATE cxx_std_20)
|
||||
target_compile_options(fesa PRIVATE /W4 /permissive- /EHsc)
|
||||
|
||||
add_executable(fesa-reference-compare
|
||||
src/fesa/validation/reference_compare_main.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(fesa-reference-compare PRIVATE fesa_core)
|
||||
target_compile_features(fesa-reference-compare PRIVATE cxx_std_20)
|
||||
target_compile_options(
|
||||
fesa-reference-compare PRIVATE /W4 /permissive- /EHsc
|
||||
)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_executable(fesa_assembly_benchmark
|
||||
tests/performance/assembly_benchmark.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(fesa_assembly_benchmark PRIVATE fesa_core)
|
||||
target_compile_features(fesa_assembly_benchmark PRIVATE cxx_std_20)
|
||||
target_compile_options(
|
||||
fesa_assembly_benchmark PRIVATE /W4 /permissive- /EHsc
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET fesa_assembly_benchmark
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"$<TARGET_FILE:TBB::tbb>"
|
||||
"$<TARGET_FILE_DIR:fesa_assembly_benchmark>"
|
||||
)
|
||||
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
# FESA Phase 1 Abaqus Input Subset
|
||||
|
||||
## 1. Status and scope
|
||||
|
||||
This document is the normative input contract for the FESA Phase 1 Abaqus
|
||||
adapter. FESA accepts only the keywords, parameters, scopes, and data forms
|
||||
defined here. It does not implement general Abaqus input syntax, and it never
|
||||
silently ignores an unknown keyword or option.
|
||||
|
||||
Two mutually exclusive organizations are supported:
|
||||
|
||||
- a flat/orphan mesh whose mesh and set records are in global scope; or
|
||||
- one or more `*PART` definitions followed by exactly one `*ASSEMBLY` that
|
||||
contains exactly one untransformed `*INSTANCE` of the active Part.
|
||||
|
||||
Only the active Part is normalized into `Domain`. Names and external labels are
|
||||
input identity; generated nonnegative FESA IDs and dense indices are separate.
|
||||
FESA performs no unit conversion.
|
||||
|
||||
`tests/fixtures/abaqus/contract.tsv` is the executable valid/invalid fixture
|
||||
matrix for this document. Its expected diagnostic code and line are part of
|
||||
the contract. A diagnostic for a bad data row points to that row; a keyword,
|
||||
parameter, or scope error points to the keyword row.
|
||||
|
||||
## 2. Common lexical rules
|
||||
|
||||
- Input is UTF-8. A UTF-8 BOM is accepted only at the start of the file.
|
||||
- Blank lines and lines whose first non-whitespace characters are `**` are
|
||||
ignored. A comment or blank line does not end the current keyword record.
|
||||
- Keyword names, parameter names, flag parameters, and the enumerated values
|
||||
named below are ASCII case-insensitive. Entity names are trimmed and then
|
||||
matched exactly.
|
||||
- Fields are comma-separated and surrounding ASCII whitespace is ignored.
|
||||
- External node and element labels are positive signed 64-bit integers. DOF
|
||||
numbers are integers 1 through 6. Real fields must be finite.
|
||||
- A flag parameter has no `=` value. A valued parameter must have one nonempty
|
||||
value. Duplicate parameters are `abaqus.syntax.duplicate_parameter`.
|
||||
- Parameters not listed for a keyword are
|
||||
`abaqus.syntax.unsupported_parameter`. Unknown keywords, including
|
||||
`*INCLUDE`, are `abaqus.unsupported_keyword`.
|
||||
- A non-comment data line without an open data-bearing keyword is
|
||||
`abaqus.syntax.data_without_keyword`.
|
||||
|
||||
## 3. Scope and ordering
|
||||
|
||||
The parser maintains `global`, `part`, `assembly`, `instance`, and `step`
|
||||
scope. `*STEP` is a global child scope: model-data records already opened in
|
||||
global scope remain model data, while `*STATIC`, `*CLOAD`, `*RESTART`, and
|
||||
`*OUTPUT` belong to the open Step.
|
||||
|
||||
The accepted ordering is:
|
||||
|
||||
```text
|
||||
optional *HEADING and *PREPRINT
|
||||
flat mesh, or one or more *PART blocks and one *ASSEMBLY block
|
||||
global materials
|
||||
optional global model-data *BOUNDARY
|
||||
one *STEP
|
||||
one *STATIC
|
||||
optional *BOUNDARY and *CLOAD
|
||||
optional no-op *RESTART and *OUTPUT
|
||||
*END STEP
|
||||
```
|
||||
|
||||
References are resolved after the complete deck is parsed. A material may
|
||||
therefore follow the Part that uses it, and a nested set may refer to a set
|
||||
declared later in the same scope.
|
||||
|
||||
## 4. Mesh and hierarchy keywords
|
||||
|
||||
### 4.1 `*NODE`
|
||||
|
||||
- Scope: flat global or Part; not Assembly, Instance, or Step.
|
||||
- Parameters: none.
|
||||
- Data: one or more `label, x, y, z` rows, with exactly four nonempty fields.
|
||||
- Semantics: labels are unique in their mesh scope. Reuse in an inactive Part
|
||||
is allowed because it is a different Part scope.
|
||||
- Diagnostics: `abaqus.syntax.invalid_node_scope`,
|
||||
`abaqus.semantic.invalid_node_data`, `abaqus.semantic.duplicate_node_label`.
|
||||
|
||||
### 4.2 `*ELEMENT`
|
||||
|
||||
- Scope: flat global or Part.
|
||||
- Parameters: required `TYPE=B31`; optional `ELSET=<name>`; no others.
|
||||
- Data: one or more `element_label, node_1_label, node_2_label` rows.
|
||||
- Semantics: element labels are unique in their mesh scope. Both nodes must
|
||||
exist in that scope. `ELSET=` adds every row to the named element set and
|
||||
merges with an explicit set of the same name using sorted-unique membership.
|
||||
- Diagnostics: `abaqus.syntax.invalid_element_scope`,
|
||||
`abaqus.semantic.unsupported_element`,
|
||||
`abaqus.semantic.invalid_element_data`,
|
||||
`abaqus.semantic.duplicate_element_label`,
|
||||
`abaqus.semantic.missing_node`.
|
||||
|
||||
### 4.3 Part delimiters
|
||||
|
||||
`*PART` is global-only, requires exactly `NAME=<name>`, and accepts no data.
|
||||
Part names are unique. `*END PART` accepts no parameters or data and closes the
|
||||
open Part. Nesting or a mismatched delimiter is invalid.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_part_scope`,
|
||||
`abaqus.syntax.unexpected_end_part`, `abaqus.syntax.unclosed_part`, and
|
||||
`abaqus.semantic.duplicate_part`.
|
||||
|
||||
### 4.4 Assembly delimiters
|
||||
|
||||
`*ASSEMBLY` is global-only, requires exactly `NAME=<name>`, and accepts no
|
||||
data. Phase 1 accepts exactly one Assembly. `*END ASSEMBLY` has no parameters
|
||||
or data and closes the open Assembly.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_assembly_scope`,
|
||||
`abaqus.syntax.multiple_assemblies`,
|
||||
`abaqus.syntax.unexpected_end_assembly`, and
|
||||
`abaqus.syntax.unclosed_assembly`.
|
||||
|
||||
### 4.5 Instance delimiters
|
||||
|
||||
`*INSTANCE` is Assembly-only and requires exactly `NAME=<name>, PART=<name>`.
|
||||
Phase 1 accepts exactly one Instance. No translation or rotation data and no
|
||||
keyword record are allowed inside it. `*END INSTANCE` has no parameters or
|
||||
data.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_instance_scope`,
|
||||
`abaqus.syntax.instance_local_keyword`,
|
||||
`abaqus.syntax.unexpected_end_instance`,
|
||||
`abaqus.syntax.unclosed_instance`, `abaqus.semantic.instance_count`,
|
||||
`abaqus.semantic.instance_transform`, and `abaqus.semantic.missing_part`.
|
||||
A transform diagnostic points to the first transform data row.
|
||||
|
||||
Flat `*NODE`/`*ELEMENT` records combined with any Part/Assembly organization
|
||||
are `abaqus.semantic.mixed_mesh_organization`.
|
||||
|
||||
## 5. Sets
|
||||
|
||||
`*NSET` and `*ELSET` are allowed in flat global, Part, or Assembly scope.
|
||||
|
||||
- Required parameter: respectively `NSET=<name>` or `ELSET=<name>`.
|
||||
- Optional flag: `GENERATE`.
|
||||
- Assembly scope additionally requires `INSTANCE=<active-instance-name>`.
|
||||
`INSTANCE=` is forbidden in flat global and Part scope.
|
||||
- Explicit data consists of comma-separated positive labels and/or names of
|
||||
sets of the same kind and scope. Empty trailing fields are ignored.
|
||||
- `GENERATE` data consists of exactly one `start, end, increment` row. All
|
||||
values are positive integers, `start <= end`, and `(end-start)` is divisible
|
||||
by `increment`.
|
||||
- Repeated declarations of the same set merge. Nested references are resolved
|
||||
independent of declaration order, cycles are rejected, and final membership
|
||||
is deterministic sorted-unique.
|
||||
- An Assembly set lifts active-Part local labels through its named Instance.
|
||||
It cannot reference an inactive or unknown Instance.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_set_scope`,
|
||||
`abaqus.semantic.invalid_generate`, `abaqus.semantic.set_cycle`,
|
||||
`abaqus.semantic.missing_set_member`, and
|
||||
`abaqus.semantic.wrong_instance`.
|
||||
|
||||
## 6. Material and Beam section
|
||||
|
||||
### 6.1 `*MATERIAL` and `*ELASTIC`
|
||||
|
||||
`*MATERIAL` is global-only, requires exactly `NAME=<name>`, and has no data.
|
||||
Material names are unique. Its `*ELASTIC` child is global model data, has no
|
||||
parameters, and has exactly one `young_modulus, poisson_ratio` row. Young's
|
||||
modulus is finite and positive; Poisson's ratio is finite and satisfies
|
||||
`-1 < nu < 0.5`. Temperature and field dependencies are not supported.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_material_scope`,
|
||||
`abaqus.semantic.duplicate_material`,
|
||||
`abaqus.semantic.elastic_without_material`,
|
||||
`abaqus.semantic.missing_elastic`, and
|
||||
`abaqus.semantic.invalid_elastic_data`.
|
||||
|
||||
### 6.2 `*BEAM GENERAL SECTION`
|
||||
|
||||
- Scope: flat global or Part.
|
||||
- Parameters: required `SECTION=GENERAL`, `ELSET=<name>`, and
|
||||
`MATERIAL=<name>`; no others.
|
||||
- First data row: exactly `A, I_y, I_yz, I_z, J`. `A`, `I_y`, `I_z`, and `J`
|
||||
are finite and positive; `I_yz` must be finite and exactly zero for Phase 1.
|
||||
- Second data row: exactly three finite components of the local section-axis
|
||||
reference direction. Model validation rejects a zero direction or one
|
||||
parallel to an assigned element axis.
|
||||
- The material and set may be declared later, but must resolve. Every active
|
||||
B31 element has exactly one section assignment.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_section_scope`,
|
||||
`abaqus.semantic.unsupported_section`,
|
||||
`abaqus.semantic.invalid_section_data`,
|
||||
`abaqus.semantic.missing_material`,
|
||||
`abaqus.semantic.missing_element_set`,
|
||||
`abaqus.semantic.missing_section`, and
|
||||
`abaqus.semantic.duplicate_section_assignment`.
|
||||
|
||||
### 6.3 `*TRANSVERSE SHEAR STIFFNESS`
|
||||
|
||||
This optional record is in the same flat-global or Part scope as, and must
|
||||
immediately follow, the affected `*BEAM GENERAL SECTION`. It has no parameters
|
||||
and exactly one `K23, K13, SCF` data row. `K23` and `K13` are finite and
|
||||
positive. Phase 1 accepts only numeric `SCF=0`; omitted/default `0.25`, nonzero
|
||||
values, and the Abaqus `SCF` label are unsupported.
|
||||
|
||||
For isotropic `G=E/[2(1+nu)]`, FESA stores
|
||||
`A_sy=K23/G` and `A_sz=K13/G` with source `input`. If this keyword is absent,
|
||||
the semantic mapper stores `A_sy=A_sz=5A/6`, `SCF=0`, with source
|
||||
`phase1_default`.
|
||||
|
||||
The data order follows the Abaqus 2024
|
||||
[*TRANSVERSE SHEAR STIFFNESS* reference](https://docs.software.vt.edu/abaqusv2024/English/SIMACAEKEYRefMap/simakey-r-transverseshearstiffness.htm);
|
||||
the restriction to numeric zero SCF and the effective-area mapping are FESA
|
||||
Phase 1 decisions.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_transverse_shear_scope`,
|
||||
`abaqus.semantic.orphan_transverse_shear`,
|
||||
`abaqus.semantic.invalid_transverse_shear_data`, and
|
||||
`abaqus.semantic.nonzero_scf`.
|
||||
|
||||
## 7. Linear static step, BC, and load
|
||||
|
||||
### 7.1 `*BOUNDARY`
|
||||
|
||||
`*BOUNDARY` is allowed as global model data before the Step or inside the sole
|
||||
Step. It has no parameters. Each row is
|
||||
`node-or-nset, first_dof[, last_dof[, value]]`. `last_dof` defaults to
|
||||
`first_dof`; value defaults to zero. The inclusive DOF range is 1 through 6.
|
||||
Repeated identical prescriptions are deduplicated; differing values for one
|
||||
node/DOF are rejected.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_boundary_scope`,
|
||||
`abaqus.semantic.invalid_boundary_data`,
|
||||
`abaqus.semantic.invalid_dof`, `abaqus.semantic.invalid_dof_range`,
|
||||
`abaqus.semantic.missing_node_target`, and
|
||||
`abaqus.semantic.conflicting_boundary`.
|
||||
|
||||
### 7.2 `*CLOAD`
|
||||
|
||||
`*CLOAD` is Step-only and has no parameters. Each row is exactly
|
||||
`node-or-nset, dof, magnitude`; DOF is 1 through 6 and magnitude is finite.
|
||||
Loads on the same node/DOF are summed in input order after target resolution.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_cload_scope`,
|
||||
`abaqus.semantic.invalid_cload_data`, `abaqus.semantic.invalid_dof`, and
|
||||
`abaqus.semantic.missing_node_target`.
|
||||
|
||||
### 7.3 `*STEP`, `*STATIC`, and `*END STEP`
|
||||
|
||||
`*STEP` is global-only. Optional parameters are `NAME=<name>` and
|
||||
`NLGEOM=NO`; omitted name becomes `Step-1`. Exactly one Step is required.
|
||||
`NLGEOM=YES` and every other option are unsupported.
|
||||
|
||||
Exactly one `*STATIC` occurs inside the Step. It has no parameters and accepts
|
||||
either no data row or one row of one through four finite positive values
|
||||
`initial_increment[, time_period[, minimum_increment[, maximum_increment]]]`.
|
||||
The values are accepted as load-step metadata; Phase 1 performs one linear
|
||||
solve.
|
||||
|
||||
`*END STEP` has no parameters or data and closes the Step.
|
||||
|
||||
Diagnostics are `abaqus.syntax.invalid_step_scope`,
|
||||
`abaqus.syntax.unexpected_end_step`, `abaqus.syntax.unclosed_step`,
|
||||
`abaqus.semantic.step_count`, `abaqus.semantic.unsupported_step_option`,
|
||||
`abaqus.semantic.missing_static`, and
|
||||
`abaqus.semantic.invalid_static_data`.
|
||||
|
||||
## 8. Recognized no-op directives
|
||||
|
||||
These records are deliberately recognized and do not create Domain entities:
|
||||
|
||||
- `*HEADING`: global-only, no parameters, zero or more text data rows.
|
||||
- `*PREPRINT`: global-only, optional `ECHO`, `MODEL`, `HISTORY`, and `CONTACT`
|
||||
parameters, each with value `YES` or `NO`; no data.
|
||||
- `*RESTART`: Step-only, optional `WRITE` flag and optional nonnegative integer
|
||||
`FREQUENCY`; no data.
|
||||
- `*OUTPUT`: Step-only, exactly one `FIELD` or `HISTORY` flag and optional
|
||||
`VARIABLE=PRESELECT`; no data.
|
||||
|
||||
Diagnostics are the common unsupported-parameter diagnostic plus
|
||||
`abaqus.syntax.invalid_heading_scope`,
|
||||
`abaqus.syntax.invalid_preprint_scope`,
|
||||
`abaqus.syntax.invalid_restart_scope`, and
|
||||
`abaqus.syntax.invalid_output_scope`. There is no general no-op or
|
||||
ignore-unknown path.
|
||||
|
||||
## 9. Fixture matrix contract
|
||||
|
||||
The tab-separated manifest columns are:
|
||||
|
||||
```text
|
||||
case_id, outcome, fixture, expected_stage, expected_code, expected_line,
|
||||
node_count, element_count, node_set_count, element_set_count,
|
||||
prescribed_dof_count, nodal_load_count, shear_source, shear_area_y,
|
||||
shear_area_z, checked_node_set, checked_element_set
|
||||
```
|
||||
|
||||
For a valid case, the public `parse_deck()` and `map_deck_to_domain()` path must
|
||||
produce a Domain matching every populated expected field. Set checks use
|
||||
`name:local-label,...`. For an invalid case, that same public path must fail
|
||||
and contain the exact stage, code, and source line in the manifest. Partial
|
||||
decks and test-only semantic construction are not accepted.
|
||||
+43
-2
@@ -164,7 +164,7 @@ HDF5 파일에 저장하고 root에 schema version을 기록한다.
|
||||
|
||||
## ADR-010: 검증 계층별 허용오차
|
||||
|
||||
**상태:** Accepted
|
||||
**상태:** Accepted for threshold tests; cross-formulation correlation superseded by ADR-017
|
||||
|
||||
**상황:** 모든 물리량에 하나의 상대오차를 적용하면 영에 가까운 값이나 서로 다른
|
||||
규모의 결과를 올바르게 판정할 수 없다.
|
||||
@@ -177,6 +177,8 @@ HDF5 파일에 저장하고 root에 schema version을 기록한다.
|
||||
- 영에 가까운 값과 큰 값 모두 의미 있게 비교할 수 있다.
|
||||
- 모델별 예외 tolerance에는 문서화된 수치 근거가 필요하다.
|
||||
- 단일 tolerance보다 comparison request와 helper가 복잡해진다.
|
||||
- Abaqus와 FESA의 정식화가 다른 상관성 비교에는 ADR-017의 component별 RMSE와
|
||||
Relative L2 계약을 적용한다.
|
||||
|
||||
## ADR-011: 일관 단위계와 결과 좌표계
|
||||
|
||||
@@ -257,7 +259,7 @@ flat `Domain`으로 정규화한다. 외부 entity는 `(instance name, part-loca
|
||||
|
||||
## ADR-015: 명시적 물리량 선택 기반 CSV 검증
|
||||
|
||||
**상태:** Accepted
|
||||
**상태:** Superseded by ADR-017
|
||||
|
||||
**상황:** 현재 캔틸레버 reference에는 변위와 반력만 있고 per-model metadata는
|
||||
요구하지 않는다. 요소 내력과 응력 비교 기능은 해당 CSV가 추가되기 전에 구현해야
|
||||
@@ -297,3 +299,42 @@ toolset을 명시한다. CMake, CMake Presets, CTest 및 GoogleTest/GoogleMock
|
||||
보장 대상이 아니다.
|
||||
- 컴파일러 갱신에 따른 경고와 표준 라이브러리 동작은 전체 Debug/Release 검증에서
|
||||
다시 확인해야 한다.
|
||||
|
||||
## ADR-017: FESA 정식화 적합성과 Abaqus 결과 상관성의 이중 gate
|
||||
|
||||
**상태:** Accepted
|
||||
|
||||
**상황:** FESA의 2절점 Timoshenko Beam은 선택적 감차적분과 `SCF=0`을 사용하고
|
||||
Abaqus B31의 slenderness compensation을 구현하지 않는다. 따라서 `SCF=0.25`인
|
||||
Abaqus 결과에 기본 상대오차 \(10^{-5}\)를 적용하면 FESA 정식화 결함과 의도된
|
||||
정식화 차이를 구분할 수 없다. 현재 캔틸레버 reference에는 변위, 반력 및 요소
|
||||
단면력 CSV가 있다.
|
||||
|
||||
**결정:**
|
||||
|
||||
- FESA 정식화 적합성 gate는 해석해, 에너지, 강체 mode, 평형 및 엄격한 tolerance로
|
||||
FESA 자체 정식화를 검증한다.
|
||||
- Abaqus 결과 상관성 gate는 원본 Abaqus 입력과 CSV를 변경하지 않는다. FESA는
|
||||
동일한 기하·재료·하중과 명시적 전단강성을 사용하되 `SCF=0`인 별도 입력을
|
||||
production parser와 solver로 해석한다.
|
||||
- 상관성 gate는 요청된 모든 entity와 component가 유일하게 매칭되고 유한한
|
||||
component별 RMSE 및 Relative L2가 생성되면 evaluable이다. 서로 다른 정식화에
|
||||
기본 상대오차 \(10^{-5}\) pass/fail을 적용하지 않는다.
|
||||
- Relative L2의 reference norm이 영에 가까우면 해당 component의 characteristic
|
||||
absolute scale norm을 분모 하한으로 사용한다.
|
||||
- 병진과 회전, 힘과 모멘트처럼 단위가 다른 component를 하나의 RMSE 또는 norm에
|
||||
혼합하지 않는다.
|
||||
- Abaqus의 \((\mathbf t,\mathbf n_1,\mathbf n_2)\)와 FESA의
|
||||
\((\mathbf e_x,\mathbf e_y,\mathbf e_z)\)를 각각 일치시킨 모델에서 Abaqus
|
||||
`SF1,SF2,SF3,SM1,SM2,SM3`은 FESA \(N,V_y,V_z,T,M_y,M_z\) 순서로
|
||||
`SF1,SF3,SF2,SM3,SM1,SM2`를 사용한다.
|
||||
- 현재 캔틸레버 상관성 요청은 변위, 반력 및 요소 단면력을 명시한다. 요청하지 않은
|
||||
응력은 통과로 보고하지 않는다.
|
||||
|
||||
**결과와 트레이드오프:**
|
||||
|
||||
- FESA 구현 회귀와 상용 solver와의 모델 상관성을 서로 오인하지 않는다.
|
||||
- Abaqus 원본과 FESA 투영 입력을 함께 관리해야 하며 formulation 차이를
|
||||
`docs/VALIDATION.md`에 기록해야 한다.
|
||||
- 첫 상관성 보고서는 metric을 제시하지만 관측값에 맞춘 acceptance envelope를
|
||||
만들지 않는다. 후속 envelope에는 해석적 또는 mesh study 근거가 필요하다.
|
||||
|
||||
@@ -429,16 +429,17 @@ kernel을 추가한다.
|
||||
- `tests/reference`: CSV 골든 결과와 FESA HDF5 결과 비교
|
||||
- `reference/<model-id>`: Abaqus 입력과 현재 사용할 수 있는 결과 CSV
|
||||
|
||||
reference comparison request가 비교할 물리량과 CSV 경로, 상대 tolerance 및
|
||||
물리량별 절대 scale을 명시한다. 요청한 CSV가 없으면 실패하며 요청하지 않은 결과를
|
||||
통과로 표시하지 않는다. 현재 캔틸레버는 변위와 반력만 요청하고, 요소 내력과
|
||||
단면 도심 응력 adapter는 synthetic CSV로 검증한다.
|
||||
reference comparison request가 비교할 물리량과 CSV 경로 및 물리량별 절대 scale을
|
||||
명시한다. 요청한 CSV가 없으면 실패하며 요청하지 않은 결과를 통과로 표시하지
|
||||
않는다. 현재 캔틸레버는 변위, 반력 및 요소 단면력을 요청하고, 단면 도심 응력
|
||||
adapter는 synthetic CSV로 검증한다.
|
||||
|
||||
요소 내력 CSV의 `(Instance, Element Label, Node Label)` 위치에서
|
||||
`SF1,SF2,SF3,SM1,SM2,SM3`을 \(N,V_y,V_z,T,M_y,M_z\)로 매핑한다. 응력 CSV의
|
||||
`SF1,SF3,SF2,SM3,SM1,SM2`를 \(N,V_y,V_z,T,M_y,M_z\)로 매핑한다. 응력 CSV의
|
||||
같은 위치에 있는 `Sxx`는 단면 도심값 \(N/A\)와 비교한다. 단일 Instance에서는
|
||||
Instance 열 생략을 허용하되 comparison request가 제공한 Instance 이름으로
|
||||
보완한다.
|
||||
보완한다. Abaqus와 FESA의 정식화가 다른 상관성 비교는 component별 RMSE와
|
||||
Relative L2를 보고하며 관측값으로 만든 pass/fail tolerance를 적용하지 않는다.
|
||||
|
||||
reference helper는 반드시 public parser와 analysis 경로로 FESA 결과를 생성한다.
|
||||
테스트 전용 경로로 Domain이나 matrix를 직접 주입해 전체 파이프라인 결함을 숨기지
|
||||
|
||||
+249
-393
@@ -1,155 +1,234 @@
|
||||
# FESA Session Handoff
|
||||
|
||||
## 1. 문서 목적
|
||||
## 1. 목적과 기준 문서
|
||||
|
||||
이 문서는 `equation-and-linear-solve` 완료 후 새 세션에서
|
||||
`results-and-pipeline` Phase를 바로 시작하기 위한 인수인계 기록이다.
|
||||
요구사항과 설계의 기준은 이 문서가 아니라 다음 파일이다.
|
||||
이 문서는 `beam-reference-qualification` 완료 후 새 세션에서 마지막 Phase 1 단계인
|
||||
`internal-release`를 시작하기 위한 인수인계 기록이다. 과거 phase의 구현 역사를
|
||||
반복하기보다 현재 기준선, 검증 결과, 남은 작업과 실행 순서를 제공한다.
|
||||
|
||||
- `/AGENTS.md`
|
||||
- `/docs/PRD.md`
|
||||
- `/docs/ARCHITECTURE.md`
|
||||
- `/docs/ADR.md`
|
||||
- `/docs/HARNESS.md`
|
||||
- `/docs/HDF5_SCHEMA.md` — 다음 Phase Step 1에서 writer보다 먼저 생성할 문서
|
||||
- `/docs/superpowers/plans/2026-07-29-fesa-phase-1.md`
|
||||
- `/phases/results-and-pipeline/index.json`
|
||||
- `/phases/results-and-pipeline/step0.md`부터 `step3.md`
|
||||
다음 문서를 우선 기준으로 사용한다.
|
||||
|
||||
내용이 충돌하면 `AGENTS.md`, 제품·아키텍처 문서와 `phases/`의 현재 상태를
|
||||
우선한다. 이 문서는 현재 구현과 실행환경에서 특히 놓치기 쉬운 계약을 보충한다.
|
||||
- `AGENTS.md`
|
||||
- `docs/PRD.md`
|
||||
- `docs/ARCHITECTURE.md`
|
||||
- `docs/ADR.md`
|
||||
- `docs/HARNESS.md`
|
||||
- `docs/HDF5_SCHEMA.md`
|
||||
- `docs/ABAQUS_INPUT_SUBSET.md`
|
||||
- `docs/formulation/timoshenko-beam-3d.md`
|
||||
- `docs/VALIDATION.md`
|
||||
- `phases/internal-release/index.json`
|
||||
- `phases/internal-release/step0.md`부터 `step4.md`
|
||||
|
||||
## 2. 현재 저장소 상태
|
||||
내용이 충돌하면 `AGENTS.md`, PRD/ADR/아키텍처, 완료된 phase metadata와 실제
|
||||
테스트를 우선한다. 특히 `internal-release`의 기존 Step 0과 Step 4에 남아 있는
|
||||
reference 범위 설명은 4절의 최신 계약으로 바로잡은 뒤 release evidence에 사용한다.
|
||||
|
||||
2026-07-31 확인 기준:
|
||||
## 2. Git과 Phase 상태
|
||||
|
||||
- 현재 브랜치: `dev`
|
||||
- 현재 `dev` HEAD:
|
||||
`a02024929ca62c714335dd9811eea6eab816af38`
|
||||
- `origin/dev`, `origin/HEAD`:
|
||||
`d39340217421006c33bb7c61a0111d320cbaab2e`
|
||||
- 로컬 `dev`는 `origin/dev`보다 9 commit 앞서고 0 commit 뒤처져 있다.
|
||||
- 완료 Phase:
|
||||
- `solver-bootstrap`
|
||||
- `domain-and-input-skeleton`
|
||||
- `fem-and-beam-kernel`
|
||||
- `equation-and-linear-solve`
|
||||
- 다음 Phase: `results-and-pipeline`
|
||||
- 다음 Step: `0 - result-database`
|
||||
- `results-and-pipeline`의 Step 0~3은 모두 `pending`이다.
|
||||
- `equation-and-linear-solve`는 `dev`에 fast-forward 병합되었고 로컬
|
||||
`feat-equation-and-linear-solve` 브랜치는 삭제되었다.
|
||||
- 원격 push는 수행하지 않았다.
|
||||
2026-08-03 기준 구현 상태는 다음과 같다.
|
||||
|
||||
이 문서를 갱신하기 직전 작업 트리는 clean이었다. 현재
|
||||
`docs/HANDOFF.md` 변경은 사용자가 별도로 요청하지 않는 한 커밋하지 않는다.
|
||||
새 세션에서 Harness를 실행하기 전에 이 변경을 먼저 커밋하거나 별도로 정리해야
|
||||
한다. 그렇지 않으면 executor의 feature branch와 Step commit에 인수인계 문서가
|
||||
섞일 수 있다.
|
||||
- 기준 브랜치: `dev`
|
||||
- 이 문서 갱신 직전 구현 HEAD: `6bc7cc3adadded6f1a2a0ed45449b2264c0f7a4e`
|
||||
- `feat-beam-reference-qualification`은 `dev`에 fast-forward 병합된 뒤 로컬에서
|
||||
삭제됐다.
|
||||
- `internal-release`를 제외한 `phases/index.json`의 모든 phase가 `completed`다.
|
||||
- 다음 Phase: `internal-release`
|
||||
- 다음 Step: Step 0 `release-checklist`
|
||||
- Step 0부터 Step 4까지 모두 `pending`이다.
|
||||
- 이 문서의 갱신은 구현 기준선 다음의 docs-only commit이다.
|
||||
|
||||
로컬 `dev`의 미push 9 commit을 보존한다. 원격에 맞추기 위한 reset, 강제 checkout,
|
||||
rebase 또는 force push를 수행하지 않는다.
|
||||
새 세션에서는 기록된 hash를 강제로 맞추지 말고 로컬과 원격의 실제 상태를 먼저
|
||||
확인한다. 이 HANDOFF commit이 push된 뒤에는 `dev`와 `origin/dev`가 같은 commit을
|
||||
가리켜야 한다.
|
||||
|
||||
## 3. 완료된 `equation-and-linear-solve`
|
||||
```powershell
|
||||
git switch dev
|
||||
git status --short --branch
|
||||
git rev-parse HEAD
|
||||
git rev-parse origin/dev
|
||||
git rev-list --left-right --count origin/dev...dev
|
||||
```
|
||||
|
||||
Phase metadata는 `/phases/equation-and-linear-solve/index.json`에 기록되어 있으며
|
||||
Step 0~2가 모두 `completed`다.
|
||||
reset, rebase 또는 force push로 차이를 숨기지 않는다. 예상하지 못한 변경이 있으면
|
||||
소유자를 확인하고 보존한다.
|
||||
|
||||
주요 commit:
|
||||
## 3. 완료된 Phase 1 기준선
|
||||
|
||||
- `8342774` — deterministic serial symmetric CSR assembly
|
||||
- `1bf277c` — essential BC elimination과 reaction recovery
|
||||
- `e216660` — MKL PARDISO linear solver adapter
|
||||
- `2dd17be` — Phase 완료 metadata
|
||||
- `741fc9e` — 독립 review 지적과 HANDOFF 계약 수정
|
||||
- `a020249` — 완료된 Step 계약 문서 정합화
|
||||
현재 production 경로는 다음 기능을 제공한다.
|
||||
|
||||
독립 재검토 결과 남은 Critical, Important, Minor 항목 없이 merge-ready 판정을
|
||||
받았으며, 아래 계약이 테스트로 고정되어 있다.
|
||||
- Abaqus `.inp` 제한 부분집합의 flat/orphan mesh 또는 좌표변환이 없는 단일
|
||||
Part/Assembly/Instance 모델 파싱과 semantic validation
|
||||
- 2절점 3D Isoparametric Timoshenko Beam, 등방성 선형 탄성, 일반 단면,
|
||||
`*BOUNDARY`, `*CLOAD`, 단일 선형 정적 Step
|
||||
- MSVC v145, Intel oneAPI MKL PARDISO와 TBB를 사용하는 Windows x64 해석 경로
|
||||
- canonical contribution ordering에 기반한 결정론적 병렬 요소 평가와 조립
|
||||
- 원래 full equation에서 변위, 반력과 평형을 복구하는 선형 정적 해석
|
||||
- 두 요소 끝의 section strain, section force, centroid/recovery-point `Sxx` 회복
|
||||
- node/element provenance, component와 좌표계 metadata를 포함한 완전한
|
||||
`ResultDatabase`
|
||||
- 입력 원본 없이 model, analysis와 결과를 재구성할 수 있는 HDF5 schema `2.0.0`
|
||||
- 변위, 반력, 요소 단면력용 Abaqus CSV adapter와 component별 상관성 보고 CLI
|
||||
|
||||
### 3.1 Symmetric CSR과 serial assembly
|
||||
결과 계약과 Beam reference phase의 세부 완료 기록은 다음 파일에 있다.
|
||||
|
||||
관련 파일:
|
||||
- `phases/result-contract-completion/index.json`
|
||||
- `phases/beam-reference-qualification/index.json`
|
||||
- `docs/HDF5_SCHEMA.md`
|
||||
- `docs/VALIDATION.md`
|
||||
|
||||
- `/include/fesa/assembly/symmetric_csr.hpp`
|
||||
- `/include/fesa/assembly/equation_system.hpp`
|
||||
- `/include/fesa/assembly/serial_assembler.hpp`
|
||||
- `/src/fesa/assembly/serial_assembler.cpp`
|
||||
- `/tests/unit/assembly/serial_assembler_test.cpp`
|
||||
`internal-release`에서는 위 solver 계약을 다시 설계하지 않는다. 설치, clean consumer,
|
||||
scale measurement와 release evidence에 필요한 최소 변경만 수행한다.
|
||||
|
||||
핵심 계약:
|
||||
## 4. 검증 상태와 남은 제한
|
||||
|
||||
- `SymmetricCsr`는 0-based upper triangle만 저장한다.
|
||||
- 각 row의 column index는 strictly increasing이다.
|
||||
- 연결되지 않은 절점의 자유도를 포함해 모든 row가 diagonal entry를 갖는다.
|
||||
contribution이 없으면 값은 0이다. 따라서 이후 solver가 구조 오류가 아니라
|
||||
singular equation system으로 진단할 수 있다.
|
||||
- sparsity pattern 생성과 numeric merge는 분리되어 있다.
|
||||
- numeric contribution은
|
||||
`(row,column,element-origin,local-order)` 순서로 정렬·합산한다.
|
||||
- 비결합적인 `1 + 1 + 1e16` 규모의 테스트가 element origin 순서를 bit pattern으로
|
||||
고정한다. Domain storage order로 합산하도록 바꾸면 안 된다.
|
||||
- Beam kernel failure를 0 stiffness로 대체하지 않고 assembly 오류로 전달한다.
|
||||
- `EquationSystem`은 원래 full `stiffness`와 `force`를 소유하며 constraint 처리 전
|
||||
상태로 보존한다.
|
||||
### 4.1 이중 검증 gate
|
||||
|
||||
이 serial assembler는 후속 `deterministic-parallel-assembly` Phase의 oracle이다.
|
||||
이번 다음 Phase에서 TBB assembly를 선행 구현하지 않는다.
|
||||
`docs/VALIDATION.md`가 검증 결과의 단일 상세 보고서다.
|
||||
|
||||
### 3.2 `DofManager`와 essential BC
|
||||
- Gate A — FESA 정식화 적합성: **PASS**
|
||||
- Gate B — Abaqus 결과 상관성: **EVALUABLE**
|
||||
|
||||
관련 파일:
|
||||
Gate A는 해석해, strain energy, 강체 mode, 회전 불변성, 평형과 결정성을 엄격한
|
||||
tolerance로 검증한다. Gate B는 Abaqus B31과 FESA 정식화의 차이를 인정하고
|
||||
component별 RMSE와 Relative L2를 보고한다. Gate B의 `EVALUABLE`은 모든 요청
|
||||
entity/component가 유일하게 매칭되고 metric이 유한하다는 뜻이며, 임의의 상관성
|
||||
pass/fail threshold를 통과했다는 뜻은 아니다.
|
||||
|
||||
- `/include/fesa/fem/dof_manager.hpp`
|
||||
- `/include/fesa/constraints/essential_bc.hpp`
|
||||
- `/src/fesa/constraints/essential_bc.cpp`
|
||||
- `/tests/unit/constraints/essential_bc_test.cpp`
|
||||
현재 cantilever reference의 주요 Relative L2는 다음과 같다.
|
||||
|
||||
핵심 계약:
|
||||
| 결과 | Component | Relative L2 |
|
||||
|---|---|---:|
|
||||
| displacement | `Uz` | `0.0022349969291714038` |
|
||||
| displacement | `Ry` | `0.0000010416581667076092` |
|
||||
| reaction | `RFz` | `4.4393520322089023e-13` |
|
||||
| reaction | `RMy` | `2.591919334788851e-13` |
|
||||
| internal force | `Vz` | `2.7107472798172426e-13` |
|
||||
| internal force | `My` | `0.082541022764834646` |
|
||||
|
||||
- `DofManager`가 full DOF, free equation mapping과 prescribed value를 단독 소유한다.
|
||||
- full index 기반 `equation(std::size_t)`와
|
||||
`prescribed_value(std::size_t)` query가 추가되어 있다.
|
||||
- `eliminate_essential_bcs(const EquationSystem&, const DofManager&)`에는 별도
|
||||
prescribed 목록을 전달하지 않는다.
|
||||
- `ReducedSystem`은 reduced `stiffness`와 `force`만 소유한다. free/full mapping이나
|
||||
prescribed full vector를 중복 저장하지 않는다.
|
||||
- full solution은 `DofManager::reconstruct_full()`로 복원한다.
|
||||
- 0과 비영 prescribed value의 RHS shift, all-constrained order 0 system, 원본 system
|
||||
불변성이 검증되어 있다.
|
||||
- 반력은 reduced system이 아니라 원래 full system의 `r=Ku-f`에서 계산한다.
|
||||
- 입력뿐 아니라 RHS shift와 reaction 산술 결과가 NaN/Inf가 되는 경우도 성공
|
||||
결과로 반환하지 않는다.
|
||||
18개 전체 component의 count, RMSE와 Relative L2는 `docs/VALIDATION.md`를 사용한다.
|
||||
|
||||
`Domain::step().prescribed_dofs`를 다시 순회해 별도 constraint 상태를 만들지 않는다.
|
||||
### 4.2 Reference 모델과 축 매핑
|
||||
|
||||
### 3.3 MKL PARDISO adapter
|
||||
- Abaqus provenance는 `reference/cantilever beam/cantilever beam.inp`와 세 CSV다.
|
||||
- Abaqus 원본 모델의 `SCF=0.25`는 보존한다.
|
||||
- FESA projection은 `reference/cantilever beam/cantilever beam fesa.inp`이며 다른
|
||||
의미 입력을 유지하고 `SCF=0`을 사용한다.
|
||||
- FESA에 Abaqus SCF 보정이나 결과 맞춤 계수를 추가하지 않는다.
|
||||
|
||||
관련 파일:
|
||||
요소력 CSV는 다음 순서로 매핑한다.
|
||||
|
||||
- `/include/fesa/solvers/linear/linear_solver.hpp`
|
||||
- `/include/fesa/solvers/linear/pardiso_linear_solver.hpp`
|
||||
- `/src/fesa/solvers/linear/pardiso_linear_solver.cpp`
|
||||
- `/tests/unit/solvers/linear/pardiso_linear_solver_test.cpp`
|
||||
| FESA | Abaqus CSV |
|
||||
|---|---|
|
||||
| `N` | `SF1` |
|
||||
| `Vy` | `SF3` |
|
||||
| `Vz` | `SF2` |
|
||||
| `T` | `SM3` |
|
||||
| `My` | `SM1` |
|
||||
| `Mz` | `SM2` |
|
||||
|
||||
핵심 계약:
|
||||
### 4.3 아직 완료되지 않은 검증
|
||||
|
||||
- public `LinearSolver` 계약에는 MKL 타입이 노출되지 않는다.
|
||||
- `PardisoLinearSolver`는 noncopyable이다.
|
||||
- MKL LP64 `MKL_INT == std::int32_t`, `mtype=2`, `iparm[26]=1` matrix checker,
|
||||
`iparm[34]=1` 0-based indexing을 사용한다.
|
||||
- analysis, factorization, solve와 release phase를 adapter 내부에서 관리한다.
|
||||
- release는 destructor fallback 외에 명시적으로 호출되어 release error도
|
||||
`DiagnosticStage::solver`의 `solver.release_failed`로 변환된다.
|
||||
- matrix/RHS validation, singular diagnostic, repeated solve와 adapter 밖의 독립
|
||||
상대잔차 계산이 검증되어 있다.
|
||||
- order 0 reduced system은 constraint 계층에서는 유효하지만 PARDISO 입력으로는
|
||||
거부된다. analysis orchestration이 all-constrained case를 별도로 처리해야 한다.
|
||||
- 실제 Abaqus 결과로 검증된 물리량은 변위, 반력과 요소 단면력이다.
|
||||
- Abaqus 도심 응력 CSV는 제공되지 않았다. `StressCsv`는 synthetic fixture로 schema와
|
||||
entity mapping만 검증했으며 응력은 **not yet Abaqus-qualified**다.
|
||||
- synthetic internal-force fixture도 adapter 단위 검증에 계속 사용하지만, 요소
|
||||
단면력 자체는 별도의 실제 Abaqus golden CSV와 상관성 비교가 완료됐다.
|
||||
- 내부 배포용 Release build, install tree, clean consumer smoke test와 약 100,000 DOF
|
||||
측정은 아직 실행되지 않았다. 증거 없이 완료 표시하지 않는다.
|
||||
|
||||
## 4. 검증된 baseline과 개발환경
|
||||
### 4.4 `internal-release` Step 문서의 계약 불일치
|
||||
|
||||
새 PowerShell 세션에서 configure 또는 Harness 실행 전에 다음 환경 변수를 설정한다.
|
||||
절대경로를 tracked CMake 파일이나 Preset에 넣지 않는다.
|
||||
`phases/internal-release/step0.md`와 `step4.md`에는 beam reference phase 이전의 문구가
|
||||
남아 있다.
|
||||
|
||||
- “현재 Abaqus displacement/reaction comparison”은 변위·반력·요소 단면력
|
||||
correlation으로 갱신해야 한다.
|
||||
- “내력·응력은 synthetic coverage”라는 묶음 표현은 요소 단면력과 응력을 분리해야
|
||||
한다. 요소 단면력은 real golden correlation과 synthetic adapter coverage가 모두
|
||||
있고, 응력만 synthetic adapter coverage다.
|
||||
|
||||
새 세션은 Harness 실행 전에 이 두 Step 문서와 관련 checklist 문구를 현재
|
||||
`docs/PRD.md` 8절 및 `docs/VALIDATION.md`와 일치시켜야 한다. 이 정렬은 검증 범위의
|
||||
확장이 아니라 이미 완료된 증거를 정확히 기술하는 작업이다.
|
||||
|
||||
## 5. 다음 Phase: `internal-release`
|
||||
|
||||
Phase metadata는 `phases/internal-release/index.json`에 있다. Step은 순서대로 실행한다.
|
||||
|
||||
### Step 0 — `release-checklist`
|
||||
|
||||
- `docs/BUILDING.md`, `docs/INPUT_FORMAT.md`, `docs/RELEASE_CHECKLIST.md`를 작성한다.
|
||||
- PRD 8절의 각 내부 배포 기준에 고유 checklist ID를 부여한다.
|
||||
- 실제 target, preset, example과 evidence command를 CMake에서 재확인한다.
|
||||
- 미실행 Release/install/benchmark 항목을 완료 표시하지 않는다.
|
||||
- 4.4절의 stale reference 문구를 먼저 바로잡는다.
|
||||
|
||||
### Step 1 — `cmake-install-package`
|
||||
|
||||
- `cmake --install`로 내부 배포용 install tree를 만든다.
|
||||
- CLI, `fesa_core`, public headers, CMake package config, example, schema/input/validation
|
||||
문서와 runtime DLL inventory를 포함한다.
|
||||
- install config에 absolute build path가 남는 실패 검사를 먼저 작성한다.
|
||||
- installer, registry write, 외부 dependency 다운로드와 public ABI 약속은 범위 밖이다.
|
||||
|
||||
### Step 2 — `install-tree-smoke-test`
|
||||
|
||||
- source/build tree를 참조하지 않는 consumer configure/link test를 만든다.
|
||||
- 설치된 CLI의 `--version`, example solve와 생성 HDF5 open을 검증한다.
|
||||
- 개발 PATH의 `fesa.exe`나 source include fallback으로 결함을 숨기지 않는다.
|
||||
|
||||
### Step 3 — `phase1-scale-benchmark`
|
||||
|
||||
- 약 100,000 DOF Beam chain에서 generation/parsing, assembly, PARDISO solve,
|
||||
recovery와 HDF5 write 시간을 분리해 측정한다.
|
||||
- 재현 가능한 Windows memory metric, thread/solver 설정과 실제 DOF 수를 기록한다.
|
||||
- finite result, 평형과 정상 종료는 검사하되 임의 시간·speedup 기준은 만들지 않는다.
|
||||
|
||||
### Step 4 — `release-evidence-gate`
|
||||
|
||||
- Debug와 Release configure/build/test를 새로 실행한다.
|
||||
- test count가 0이 아닌지 확인한다.
|
||||
- Harness pytest, reference, determinism, HDF5 inspection, install-tree smoke test와 scale
|
||||
benchmark 증거를 checklist ID에 연결한다.
|
||||
- 모든 수용 조건에 현재 실행 증거가 있을 때만 Step과 Phase를 `completed`로 바꾼다.
|
||||
- 실패나 미실행 항목이 있으면 정확한 blocker를 남기고 release 완료를 선언하지 않는다.
|
||||
|
||||
## 6. 유지해야 할 경계
|
||||
|
||||
- C++20, Visual Studio 2026 MSVC v145와 Windows x64 기준을 유지한다.
|
||||
- `core`, `model`, `fem`, `elements`에 Abaqus, MKL, TBB 또는 HDF5 API를 노출하지
|
||||
않는다.
|
||||
- solver semantic model과 result contract에 installer 또는 serialization 전용 타입을
|
||||
추가하지 않는다.
|
||||
- dependency는 개발 환경에 사전 설치된 버전을 사용하며 package 중 다운로드하지
|
||||
않는다.
|
||||
- install tree는 source/build tree의 절대경로에 의존하지 않아야 한다.
|
||||
- Debug와 Release artifact/runtime을 혼합하지 않는다.
|
||||
- FESA는 단위 변환을 수행하지 않는다.
|
||||
- performance 수치를 correctness gate로 바꾸지 않는다.
|
||||
- stress를 Abaqus-qualified로 표현하지 않는다.
|
||||
- 테스트를 disable하거나 제외해 release evidence를 만들지 않는다.
|
||||
- 사용자가 명시적으로 요청하지 않은 phase 실행에서는 `--push`를 사용하지 않는다.
|
||||
|
||||
## 7. 검증 기준선과 개발환경
|
||||
|
||||
### 7.1 마지막 확인 결과
|
||||
|
||||
2026-08-03의 beam reference qualification 완료 및 `dev` 병합 후 다음을 확인했다.
|
||||
|
||||
- `cmake --build --preset windows-debug`: 성공, 새 MSVC warning 없음
|
||||
- `ctest --preset windows-debug --output-on-failure`: 68/68 통과
|
||||
- `uv run --with pytest python -m pytest -v -rs`: 20/20 통과
|
||||
- thread `{1,2,16}`에서 10회 반복한 조립/해석 결과: bitwise 동일
|
||||
|
||||
이 수치는 새 세션이 유지해야 할 Debug baseline이다. Release와 install-tree 결과로
|
||||
확대 해석하지 않는다.
|
||||
|
||||
### 7.2 Package 설정
|
||||
|
||||
새 PowerShell 세션에서 configure 전에 현재 설치 위치를 확인한다. tracked preset이나
|
||||
CMake 파일에 사용자별 절대경로를 넣지 않는다.
|
||||
|
||||
```powershell
|
||||
$env:MKL_DIR = "C:\Program Files (x86)\Intel\oneAPI\2026.1\lib\cmake\mkl"
|
||||
@@ -163,306 +242,83 @@ Test-Path "$env:HDF5_DIR\hdf5-config.cmake"
|
||||
Test-Path "$env:GTest_DIR\GTestConfig.cmake"
|
||||
```
|
||||
|
||||
2026-07-31 현재 네 package 경로가 모두 존재한다. 현재 `dev` HEAD에서 다음
|
||||
baseline을 검증했다.
|
||||
|
||||
- MSBuild 18.8.2, MSVC v145 Debug build 성공
|
||||
- build 출력에 새 warning 없음
|
||||
- CTest 29개 중 29개 성공
|
||||
- Harness pytest 20개 중 20개 성공
|
||||
- pytest가 실제로 20개를 수집했으므로 0-test 성공이 아님
|
||||
|
||||
검증 명령:
|
||||
네 경로가 모두 유효한 같은 셸에서 preset을 실행한다. cache가 없거나 package 위치가
|
||||
변경됐을 때만 `--fresh` configure를 사용한다.
|
||||
|
||||
```powershell
|
||||
cmake --fresh --preset windows-debug
|
||||
cmake --build --preset windows-debug
|
||||
ctest --preset windows-debug --output-on-failure
|
||||
uv run --with pytest python -m pytest -v -rs
|
||||
```
|
||||
|
||||
CMake cache가 없거나 package 경로가 바뀐 경우에만 같은 환경 변수 세션에서 먼저
|
||||
다음을 실행한다.
|
||||
Release evidence는 `internal-release` Step에서 새로 생성한다.
|
||||
|
||||
```powershell
|
||||
cmake --fresh --preset windows-debug
|
||||
cmake --preset windows-release
|
||||
cmake --build --preset windows-release
|
||||
ctest --preset windows-release --output-on-failure
|
||||
```
|
||||
|
||||
HDF5 command-line tool은 현재 PATH에 없지만 다음 파일은 존재한다.
|
||||
## 8. Harness 주의사항
|
||||
|
||||
```text
|
||||
C:\Program Files\HDF_Group\HDF5\2.1.1\bin\h5ls.exe
|
||||
```
|
||||
|
||||
`h5ls.exe`는 HDF5 DLL 외에 Intel `libmmd.dll`도 요구한다. HDF5 `bin`만 PATH에
|
||||
추가하면 Windows exit `0xC0000135`로 실패하므로 Step 1과 Step 3 Acceptance
|
||||
Criteria에서는 HDF5와 oneAPI `bin`을 모두 현재 세션 PATH에 추가한다. 시스템
|
||||
PATH를 영구 변경하지 않는다.
|
||||
표준 실행 명령은 다음과 같다.
|
||||
|
||||
```powershell
|
||||
$env:PATH = @(
|
||||
"C:\Program Files\HDF_Group\HDF5\2.1.1\bin",
|
||||
"C:\Program Files (x86)\Intel\oneAPI\2026.1\bin",
|
||||
$env:PATH
|
||||
) -join ";"
|
||||
h5ls --version
|
||||
python scripts/execute.py internal-release
|
||||
```
|
||||
|
||||
2026-07-31 현재 이 설정에서 `h5ls: Version 2.1.1`과 exit code 0을 확인했다.
|
||||
이전 beam reference phase에서 Harness child가 WindowsApps PowerShell을 시작하지 못해
|
||||
`CreateProcessAsUserW` 오류가 반복됐다. 동일 저장소와 preset에서 직접 실행한 수용
|
||||
명령은 성공했고, `stepN-output.json`에는 child 환경 blocker와 직접 실행 증거를
|
||||
구분해 기록했다.
|
||||
|
||||
## 5. 다음 Phase 목표와 Step 순서
|
||||
새 세션에서는 다음 원칙을 지킨다.
|
||||
|
||||
`results-and-pipeline`의 독립 deliverable은 nodal result semantic model과 최소 HDF5
|
||||
schema를 만들고, 이미 구현된 parser부터 linear solve까지 production 경로를
|
||||
조율해 `fesa solve ... --output ...` 수직 슬라이스를 완성하는 것이다.
|
||||
1. 먼저 표준 Harness 실행을 시도한다.
|
||||
2. 같은 child shell 오류가 발생하면 중복 executor를 시작하지 말고 남은 process를
|
||||
확인한다.
|
||||
3. 직접 실행한 명령과 Harness 실행 결과를 혼동하지 않고 metadata에 사실대로 적는다.
|
||||
4. 사용자 profile이나 drive root를 `--codex-add-dir`로 허용하지 않는다.
|
||||
5. global Codex 설정을 임시 변경했다면 원래 값을 기록하고 종료 즉시 복원·재확인한다.
|
||||
6. 사용자가 push를 명시하지 않은 phase 실행에는 `--push`를 추가하지 않는다.
|
||||
|
||||
이 milestone은 입력-해석-출력 경로가 연결되었다는 뜻일 뿐 Beam의 수치 자격 완료나
|
||||
Phase 1 내부 배포 완료를 의미하지 않는다. 요소 결과 회복, 완전한 자기완결 HDF5,
|
||||
Abaqus reference qualification은 뒤의 별도 Phase에 남아 있다.
|
||||
## 9. 새 세션 시작 순서
|
||||
|
||||
### Step 0 — `result-database`
|
||||
|
||||
- `/include/fesa/results/`와 `/src/fesa/results/`에 HDF5와 독립적인 최소 semantic
|
||||
result model을 만든다.
|
||||
- 현재 Step 계약의 실체는 `ResultDatabase -> ResultStep -> ResultFrame ->
|
||||
NodalFrame`이다.
|
||||
- 이 Phase에는 전역 좌표계 nodal displacement/rotation과 reaction/moment만 담는다.
|
||||
- node ID와 6-component field의 size 일치, duplicate node, duplicate step/frame,
|
||||
nonfinite 값을 실패 테스트로 먼저 고정한다.
|
||||
- aggregate를 그대로 공개하면서 invalid state를 나중에 검사할지, 검증된 factory를
|
||||
둘지 구현 전에 하나로 정한다. 현재 Step의 “invalid result model을 거부” 조건을
|
||||
실제 호출 가능한 API로 표현해야 한다.
|
||||
- element result, field/history 범용 hierarchy, velocity, acceleration, temperature를
|
||||
미리 만들지 않는다.
|
||||
|
||||
### Step 1 — `minimal-hdf5-schema`
|
||||
|
||||
- writer code보다 먼저 `/docs/HDF5_SCHEMA.md`에 schema `1.0.0`의 정확한 계약을
|
||||
작성한다.
|
||||
- 최소 writer/reader adapter는 `/include/fesa/io/hdf5/`와
|
||||
`/src/fesa/io/hdf5/`에 둔다.
|
||||
- schema/version, node origin `(part,instance,local label)`, dense ID map, 좌표,
|
||||
connectivity, 적용 전단강성과 input/default source, nodal displacement/reaction을
|
||||
round trip한다.
|
||||
- public reader와 `h5ls`로 writer 산출물을 다시 연다. production writer 내부 상태나
|
||||
test-only parser로 검증하지 않는다.
|
||||
- 모든 `hid_t`와 HDF5 resource는 move-only RAII wrapper 내부에 둔다.
|
||||
- 모든 HDF5 실패를 `DiagnosticStage::results`의 diagnostic 또는 adapter 경계에서
|
||||
포착되는 오류로 변환한다.
|
||||
- reference CSV와 아직 존재하지 않는 결과를 위한 빈 group을 추가하지 않는다.
|
||||
|
||||
### Step 2 — `linear-static-analysis`
|
||||
|
||||
- `/include/fesa/analysis/`와 `/src/fesa/analysis/`에 orchestration만 구현한다.
|
||||
- 이미 검증된 `Domain`을 입력받으며 parser, CLI, HDF5를 호출하지 않는다.
|
||||
- 실행 순서는 `DofManager -> serial assembly -> essential BC -> PARDISO -> full
|
||||
reconstruction -> reaction -> nodal ResultDatabase`다.
|
||||
- free equation 수가 0이면 PARDISO를 호출하지 않고 prescribed full vector와 원래
|
||||
평형식으로 결과를 만든다.
|
||||
- nodal result의 ID 순서와 full vector의 6-DOF block 순서가 반드시 일치해야 한다.
|
||||
`DofManager` numbering이 internal `NodeId` 정렬 기반이므로 Domain storage order를
|
||||
묵시적으로 사용하지 않는다.
|
||||
- hand-check 가능한 한 요소 Domain으로 displacement, reaction, solver residual과
|
||||
`Ku-f-r` 평형을 실패 테스트로 먼저 고정한다.
|
||||
- 수치 kernel, constraint 또는 solver 로직을 analysis에 복제하지 않는다.
|
||||
|
||||
### Step 3 — `cli-pipeline-integration`
|
||||
|
||||
- `run_solver(const AnalysisRequest&)`가 parser, semantic mapper, Domain, analysis와
|
||||
HDF5 writer를 application 경계에서 조율한다.
|
||||
- 현재 parser API는 `parse_deck(path)`, semantic mapping API는
|
||||
`map_deck_to_domain(deck)`이다.
|
||||
- CLI 계약은 다음 두 가지다.
|
||||
|
||||
```text
|
||||
fesa solve <model.inp> --output <results.h5>
|
||||
fesa --version
|
||||
```
|
||||
|
||||
- `/tests/fixtures/abaqus/minimal_cantilever.inp`는 이미 존재한다.
|
||||
- `MinimalCantileverPipeline`은 `run_solver` 또는 CLI와 public HDF5 reader만 사용한다.
|
||||
- 성공 시 node ID, finite displacement, reaction/equilibrium diagnostic과 schema path를
|
||||
검증한다.
|
||||
- parse, semantic, equation, solver 또는 results 실패는 원래 diagnostic stage와
|
||||
source 정보를 보존하고 CLI nonzero exit로 전달한다.
|
||||
- hierarchical fixture의 아직 미지원 keyword를 Step 3에서 우회 처리하지 않는다.
|
||||
전체 Abaqus subset은 다음 `abaqus-subset-completion` Phase의 책임이다.
|
||||
|
||||
## 6. 구현 전에 명시적으로 정렬할 설계점
|
||||
|
||||
아래 항목은 범위를 늘리라는 의미가 아니다. 현재 Step 문서와 최종 PRD 사이의
|
||||
모호함을 구현 전에 드러내고 가장 단순한 일관된 계약을 선택하기 위한 확인 목록이다.
|
||||
|
||||
1. **Result model 유효성 API**
|
||||
- Step 0은 invalid model을 거부하라고 하지만 제시된 타입은 public aggregate다.
|
||||
- raw aggregate + 별도 validation과 validated factory 중 하나를 선택하고 테스트가
|
||||
production validation 경로를 통과하게 한다.
|
||||
|
||||
2. **HDF5 reader의 model metadata 반환 범위**
|
||||
- Step 1의 `Hdf5ReadResult` 초안은 `ResultDatabase`만 반환하지만 round-trip 조건은
|
||||
node origin, 좌표, connectivity, shear source까지 재검증하라고 한다.
|
||||
- 이 metadata를 `ResultDatabase`에 억지로 넣지 말고, reader inspection model을
|
||||
최소로 추가하거나 read result 계약을 정렬한다. `Domain`을 HDF5 API 타입으로
|
||||
오염시키지 않는다.
|
||||
|
||||
3. **schema `1.0.0`의 최소/최종 범위**
|
||||
- 이번 Phase는 nodal vertical slice만 구현하고 `result-contract-completion`이
|
||||
element 결과와 완전한 자기완결 계약을 뒤에서 채운다.
|
||||
- 빈 미래 hierarchy는 만들지 않되, `/docs/HDF5_SCHEMA.md`에 이번 최소 required
|
||||
dataset과 이후 additive compatibility 규칙을 분명히 구분한다.
|
||||
|
||||
4. **deterministic nodal ordering**
|
||||
- `DofManager` full vector는 sorted internal `NodeId` 순서다.
|
||||
- `NodalFrame::node_ids`와 6-component displacement/reaction 배열을 같은 순서로
|
||||
만드는 최소 query 또는 정렬 로직을 한 곳에서만 소유한다.
|
||||
|
||||
5. **all-constrained analysis**
|
||||
- reduced order 0은 constraint 성공이고 PARDISO invalid input이다.
|
||||
- Step 2가 solver 호출을 생략하는 명시적 branch를 갖고 prescribed displacement와
|
||||
full reaction을 계산한다.
|
||||
|
||||
6. **analysis와 application 경계**
|
||||
- Step 2 `LinearStaticAnalysis`는 Domain-to-ResultDatabase만 담당한다.
|
||||
- Step 3 `run_solver`가 parser와 HDF5를 담당한다. ARCHITECTURE의 포괄적 lifecycle
|
||||
설명을 이유로 HDF5 API를 analysis에 직접 넣지 않는다.
|
||||
|
||||
## 7. 아키텍처와 범위 경계
|
||||
|
||||
- `results`는 HDF5 API에 의존하지 않는 semantic model이다.
|
||||
- `io/hdf5`만 HDF5 C API, schema version과 resource lifetime을 안다.
|
||||
- `analysis`는 기존 production 모듈을 조율하지만 수치 kernel과 외부 API를
|
||||
재구현하지 않는다.
|
||||
- `run_solver`와 CLI는 application 경계다. CLI parsing을 `fesa_core`의 analysis
|
||||
객체에 넣지 않는다.
|
||||
- `core`, `model`, `fem`, `elements`는 HDF5 API에 의존하지 않는다.
|
||||
- 외부 ID와 internal dense index mapping을 혼동하지 않는다.
|
||||
- HDF5 파일에 단위 변환을 추가하지 않는다. FESA 입력과 결과는 일관 단위계를
|
||||
전제로 한다.
|
||||
- element section result, point stress, reference CSV, TBB parallel assembly,
|
||||
다중 Step/Instance와 미지원 Abaqus keyword를 선행 구현하지 않는다.
|
||||
- 성공 경로에 fake stiffness, fake result 또는 test-only solver를 사용하지 않는다.
|
||||
|
||||
## 8. Child sandbox의 MSBuild 실행 조건
|
||||
|
||||
이전 두 Harness Phase에서 child sandbox를 조사한 결과:
|
||||
|
||||
- 앱 설치 경로의 `codex-cli 0.146.0`은 matching `codex-resources`를 찾지 못했다.
|
||||
- 완전한 standalone 배포는 다음 위치에 있으며 현재 `codex.exe`와
|
||||
`codex-resources`가 모두 존재한다.
|
||||
`C:\Users\baram\.codex\packages\standalone\releases\0.146.0-x86_64-pc-windows-msvc`
|
||||
- WindowsApps 경유 PowerShell에서는 child command가 실패했고 Windows PowerShell
|
||||
5.1에서는 정상 동작했다.
|
||||
- `[windows] sandbox = "elevated"`에서는 MSBuild FileTracker가 access denied로
|
||||
실패했다.
|
||||
- standalone Codex, WindowsApps가 제거된 PATH와
|
||||
`[windows] sandbox = "unelevated"` 조합에서는 child MSBuild가 성공했다.
|
||||
|
||||
현재 `C:\Users\baram\.codex\config.toml`은 원래 값인
|
||||
`[windows] sandbox = "elevated"`로 복원되어 있다. 다음 Harness 실행에서도 같은
|
||||
문제가 재현되면 사용자가 이전에 승인한 임시 전환 방식에 따라 다음 순서를 사용한다.
|
||||
|
||||
1. 다른 Codex 작업에 미칠 영향을 확인하고 global config 원래 값을 기록한다.
|
||||
2. Harness 실행 동안만 `[windows] sandbox = "unelevated"`로 바꾼다.
|
||||
3. 현재 PowerShell 세션의 PATH 앞에 standalone `bin`과 Windows PowerShell 5.1을
|
||||
둔다. 모든 `WindowsApps` entry를 제거해야 하며 alias 디렉터리 하나만 제거하면
|
||||
direct package 경로가 남을 수 있다.
|
||||
1. `AGENTS.md`와 이 문서를 읽는다.
|
||||
2. `docs/PRD.md` 8절, `docs/VALIDATION.md`, `phases/internal-release/index.json`과
|
||||
Step 0~4를 읽는다.
|
||||
3. Git 상태와 `dev == origin/dev`를 확인한다.
|
||||
4. 4.4절의 Step 0/4 reference 범위 문구를 최신 계약에 맞춘다.
|
||||
5. Debug baseline을 새로 실행한다.
|
||||
6. Step 0의 release 문서와 checklist 요구조건을 먼저 테스트 가능한 형태로 고정한다.
|
||||
7. 다음 명령으로 Phase를 실행한다.
|
||||
|
||||
```powershell
|
||||
$codexReleaseBin = "C:\Users\baram\.codex\packages\standalone\releases\0.146.0-x86_64-pc-windows-msvc\bin"
|
||||
$windowsPowerShell = "$env:SystemRoot\System32\WindowsPowerShell\v1.0"
|
||||
$filteredPath = $env:PATH -split ";" | Where-Object {
|
||||
$_ -and
|
||||
$_ -ne $codexReleaseBin -and
|
||||
$_ -ne $windowsPowerShell -and
|
||||
$_ -notmatch "WindowsApps" -and
|
||||
$_ -notmatch "\\OpenAI\\Codex\\bin$"
|
||||
}
|
||||
$env:PATH = (@($codexReleaseBin, $windowsPowerShell) + $filteredPath) -join ";"
|
||||
|
||||
(Get-Command codex).Source
|
||||
(Get-Command powershell).Source
|
||||
python scripts/execute.py internal-release
|
||||
```
|
||||
|
||||
4. package 환경 변수와 baseline을 확인한 뒤 같은 세션에서 Harness를 실행한다.
|
||||
5. 성공·실패와 무관하게 `finally`에 해당하는 정리 단계에서 global config를 즉시
|
||||
`[windows] sandbox = "elevated"`로 복원하고 실제 값을 다시 읽어 확인한다.
|
||||
각 Step에서는 실패하는 검사 또는 미충족 evidence를 먼저 확인하고, 최소 변경으로
|
||||
수용 조건을 만족시킨 뒤 focused test와 전체 test를 실행한다. Step output과 phase
|
||||
metadata는 실제 명령 결과를 그대로 반영한다.
|
||||
|
||||
사용자 profile 전체나 드라이브 루트를 `--codex-add-dir`로 허용하지 않는다. 설치
|
||||
버전이나 경로가 달라졌다면 위 절대경로를 맹목적으로 사용하지 말고 실제 standalone
|
||||
release와 `codex-resources` 존재를 먼저 확인한다.
|
||||
## 10. `internal-release` 완료 조건
|
||||
|
||||
이전 Harness는 모든 Step과 phase commit을 완료한 뒤 stderr reader의 CP949/UTF-8
|
||||
decode 예외를 출력한 적이 있다. exit code, phase metadata와 Git commit이 정상이면
|
||||
그 메시지만으로 제품 실패로 단정하지 않는다.
|
||||
- `phases/internal-release/index.json`의 Step 0~4가 모두 `completed`
|
||||
- `phases/index.json`의 `internal-release`가 `completed`
|
||||
- PRD 8절의 모든 기준이 고유 checklist ID와 실제 증거에 연결됨
|
||||
- Debug/Release build에 새 MSVC warning이 없음
|
||||
- Debug/Release CTest와 Harness pytest가 0개가 아닌 상태로 모두 통과
|
||||
- `cmake --install` 결과에 요구 binary/library/header/document/example/runtime
|
||||
inventory가 포함됨
|
||||
- source/build tree를 숨긴 install consumer와 CLI/HDF5 smoke test 통과
|
||||
- 약 100,000 DOF benchmark의 correctness, stage time, memory와 환경 기록 완료
|
||||
- Gate A PASS와 Gate B EVALUABLE의 의미 및 Abaqus stress 제한을 release 문서가
|
||||
정확히 유지함
|
||||
- 실패하거나 미실행인 증거가 없는 경우에만 내부 배포 완료 선언
|
||||
|
||||
## 9. 새 세션 시작 절차
|
||||
새 세션의 권장 첫 요청은 다음과 같다.
|
||||
|
||||
먼저 이 문서와 다음 Phase 파일을 모두 읽는다.
|
||||
|
||||
```text
|
||||
/phases/results-and-pipeline/index.json
|
||||
/phases/results-and-pipeline/step0.md
|
||||
/phases/results-and-pipeline/step1.md
|
||||
/phases/results-and-pipeline/step2.md
|
||||
/phases/results-and-pipeline/step3.md
|
||||
```
|
||||
|
||||
그 다음 저장소 상태를 재검증한다.
|
||||
|
||||
```powershell
|
||||
git switch dev
|
||||
git status --short --branch
|
||||
git rev-parse HEAD
|
||||
git rev-parse origin/dev
|
||||
git rev-list --left-right --count origin/dev...dev
|
||||
```
|
||||
|
||||
`docs/HANDOFF.md` 변경이 남아 있으면 먼저 사용자의 의도대로 커밋하거나 정리한다.
|
||||
4절의 package 환경 변수를 설정하고 baseline을 실행한다. 필요하면 8절의 child
|
||||
sandbox 조건을 적용한 뒤 다음을 실행한다.
|
||||
|
||||
```powershell
|
||||
python scripts/execute.py results-and-pipeline
|
||||
```
|
||||
|
||||
executor는 `feat-results-and-pipeline` 브랜치를 생성하거나 checkout하고 Step 상태와
|
||||
output metadata를 기록한다. 사용자가 명시적으로 요청하지 않은 한 `--push`를
|
||||
사용하지 않는다.
|
||||
|
||||
각 Step은 다음 순서를 지킨다.
|
||||
|
||||
1. Step 파일의 필수 문서와 선행 구현을 모두 읽는다.
|
||||
2. 성공 기준과 semantic/schema/lifecycle invariant를 명시한다.
|
||||
3. 모호한 계약은 6절을 기준으로 구현 전에 정렬한다.
|
||||
4. 실패 테스트를 먼저 작성하고 예상한 이유로 실패함을 확인한다.
|
||||
5. 테스트를 통과시키는 최소 production code만 구현한다.
|
||||
6. focused test, 전체 CTest와 Harness pytest를 실행한다.
|
||||
7. Step summary와 output metadata가 실제 결과와 일치하는지 확인한다.
|
||||
8. Phase 종료 전 전체 diff를 아키텍처, schema, diagnostic과 resource lifetime
|
||||
기준으로 review한다.
|
||||
|
||||
## 10. 다음 Phase 완료 조건
|
||||
|
||||
- `/phases/results-and-pipeline/index.json`의 Step 0~3이 모두 `completed`
|
||||
- `/phases/index.json`에서 `results-and-pipeline`이 `completed`
|
||||
- invalid nodal result model과 finite-data invariant 테스트 통과
|
||||
- `/docs/HDF5_SCHEMA.md`가 writer보다 먼저 작성되고 실제 산출물과 일치
|
||||
- public HDF5 reader round trip과 `h5ls` schema inspection 통과
|
||||
- 모든 HDF5 handle이 adapter 내부 RAII wrapper에서 해제됨
|
||||
- one-element linear static displacement, reaction, residual과 equilibrium 검증 통과
|
||||
- all-constrained analysis가 PARDISO 없이 성공
|
||||
- `fesa solve tests\fixtures\abaqus\minimal_cantilever.inp --output ...` 성공
|
||||
- CLI 실패 입력이 nonzero exit와 원래 stage/source diagnostic을 반환
|
||||
- focused test와 전체 CTest 통과
|
||||
- Harness pytest가 0개가 아닌 상태로 전체 통과
|
||||
- 새 MSVC warning 없음
|
||||
- HDF5 API가 `io/hdf5` 밖의 public semantic contract로 노출되지 않음
|
||||
- element result, full Abaqus subset, TBB assembly, reference 비교를 선행 구현하지 않음
|
||||
- 이 결과를 Beam 수치 자격 완료나 Phase 1 내부 배포 완료로 표시하지 않음
|
||||
- review의 Critical/Important 항목 해결
|
||||
- 사용자 선택 전 원격 push나 `dev` 병합을 수행하지 않음
|
||||
|
||||
새 세션의 권장 첫 요청:
|
||||
|
||||
> `docs/HANDOFF.md`와 `phases/results-and-pipeline/step0.md`부터 `step3.md`를 읽고
|
||||
> 현재 baseline, HDF5 도구 경로와 child sandbox의 MSBuild 실행 조건을 확인한 뒤
|
||||
> `results-and-pipeline` Phase를 시작해주세요.
|
||||
> `docs/HANDOFF.md`와 `internal-release`의 index/step0~4를 읽고 현재 `dev`
|
||||
> baseline과 beam reference 검증 범위를 확인해주세요. Step 0과 Step 4의 stale
|
||||
> reference 문구를 PRD/VALIDATION에 맞춘 뒤 `internal-release` Phase를 시작해주세요.
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
# FESA HDF5 Schema 2.0.0
|
||||
|
||||
## 1. Scope and version compatibility
|
||||
|
||||
Schema `2.0.0` is the self-contained Phase 1 result contract. One file contains
|
||||
the active normalized model, its single linear-static analysis definition and
|
||||
solver settings, and every nodal and Beam result needed without the source
|
||||
`.inp` file. FESA performs no unit conversion.
|
||||
|
||||
Schema `1.0.0` was the earlier minimal vertical slice. Version `2.0.0` changes
|
||||
the required model and result objects, so it is a new major version rather than
|
||||
an in-place change to `1.0.0`. The current writer and reader accept exactly
|
||||
`2.0.0`; every other version fails with `hdf5.unsupported_schema`. A future
|
||||
reader may explicitly add support for compatible minor versions, but must not
|
||||
infer compatibility from a version prefix.
|
||||
|
||||
## 2. Common rules
|
||||
|
||||
- Root attributes are variable-length UTF-8 strings:
|
||||
`schema_version="2.0.0"`, `fesa_version`, and
|
||||
`unit_policy="consistent_input_units_no_conversion"`, `input_source`, and
|
||||
`input_fingerprint`. `input_source` is the UTF-8 path supplied to the solve
|
||||
request. `input_fingerprint` is `fnv1a64:` followed by the 16 lowercase
|
||||
hexadecimal digits of FNV-1a 64 over the original input bytes; it is a
|
||||
reproducibility identifier, not a cryptographic integrity guarantee.
|
||||
- Integer datasets use the stated little-endian fixed-width type. Floating
|
||||
datasets use IEEE 754 little-endian `float64`. Strings are variable-length
|
||||
UTF-8.
|
||||
- `dense_index` is a contiguous 0-based row index. Semantic `internal_id`
|
||||
values are nonnegative and are not assumed to be dense or ordered.
|
||||
- Flat/orphan mesh `part_name` and `instance_name` values are empty strings.
|
||||
- Ragged arrays use an offset dataset of length `row_count + 1`. Offsets start
|
||||
at zero, are nondecreasing, and the final offset equals the flattened row
|
||||
count. Input order is preserved.
|
||||
- Numeric field datasets carry UTF-8 `coordinate_system` and `components`
|
||||
attributes where listed. `components` is a comma-separated ordered list.
|
||||
- Step and frame group names are contiguous decimal indices beginning at zero.
|
||||
Phase 1 requires exactly one analysis step and one result step with the same
|
||||
name, and exactly one result frame in that step.
|
||||
|
||||
## 3. Required objects
|
||||
|
||||
### 3.1 Model
|
||||
|
||||
Let `N`, `E`, `M`, `S`, `NS`, and `ES` be the node, Beam element, material,
|
||||
section, node-set, and element-set counts. Let `P` be the total number of
|
||||
section recovery points, `NM` the total node-set membership count, and `EM` the
|
||||
total element-set membership count.
|
||||
|
||||
| Path | Type | Rank and shape | Attributes / meaning |
|
||||
|---|---|---|---|
|
||||
| `/model/nodes/dense_index` | `uint64` | 1, `[N]` | contiguous row index |
|
||||
| `/model/nodes/internal_id` | `int64` | 1, `[N]` | `NodeId` |
|
||||
| `/model/nodes/part_name` | UTF-8 | 1, `[N]` | entity provenance |
|
||||
| `/model/nodes/instance_name` | UTF-8 | 1, `[N]` | entity provenance |
|
||||
| `/model/nodes/local_label` | `int64` | 1, `[N]` | external local label |
|
||||
| `/model/nodes/coordinates` | `float64` | 2, `[N,3]` | `coordinate_system="global"`, `components="X,Y,Z"` |
|
||||
| `/model/elements/dense_index` | `uint64` | 1, `[E]` | contiguous row index |
|
||||
| `/model/elements/internal_id` | `int64` | 1, `[E]` | `ElementId` |
|
||||
| `/model/elements/part_name` | UTF-8 | 1, `[E]` | entity provenance |
|
||||
| `/model/elements/instance_name` | UTF-8 | 1, `[E]` | entity provenance |
|
||||
| `/model/elements/local_label` | `int64` | 1, `[E]` | external local label |
|
||||
| `/model/elements/connectivity` | `uint64` | 2, `[E,2]` | node `dense_index`, ordered end `-1,+1` |
|
||||
| `/model/elements/material_id` | `int64` | 1, `[E]` | references material `internal_id` |
|
||||
| `/model/elements/section_id` | `int64` | 1, `[E]` | references section `internal_id` |
|
||||
| `/model/materials/internal_id` | `int64` | 1, `[M]` | `MaterialId` |
|
||||
| `/model/materials/name` | UTF-8 | 1, `[M]` | material name |
|
||||
| `/model/materials/young_modulus` | `float64` | 1, `[M]` | finite, positive |
|
||||
| `/model/materials/poisson_ratio` | `float64` | 1, `[M]` | finite, `-1 < nu < 0.5` |
|
||||
| `/model/sections/internal_id` | `int64` | 1, `[S]` | `SectionId` |
|
||||
| `/model/sections/name` | UTF-8 | 1, `[S]` | section name |
|
||||
| `/model/sections/area` | `float64` | 1, `[S]` | `A` |
|
||||
| `/model/sections/moment_y` | `float64` | 1, `[S]` | `Iy` |
|
||||
| `/model/sections/moment_z` | `float64` | 1, `[S]` | `Iz` |
|
||||
| `/model/sections/torsion_constant` | `float64` | 1, `[S]` | `J` |
|
||||
| `/model/sections/shear_area_y` | `float64` | 1, `[S]` | applied `Asy` |
|
||||
| `/model/sections/shear_area_z` | `float64` | 1, `[S]` | applied `Asz` |
|
||||
| `/model/sections/shear_source` | `uint8` | 1, `[S]` | `0=input`, `1=phase1_default` |
|
||||
| `/model/sections/orientation` | `float64` | 2, `[S,3]` | `coordinate_system="global"`, `components="X,Y,Z"` |
|
||||
| `/model/sections/recovery_point_offsets` | `uint64` | 1, `[S+1]` | offsets into `recovery_points` |
|
||||
| `/model/sections/recovery_points` | `float64` | 2, `[P,2]` | `coordinate_system="element_local"`, `components="y,z"` |
|
||||
| `/model/sets/node/names` | UTF-8 | 1, `[NS]` | exact node-set names |
|
||||
| `/model/sets/node/member_offsets` | `uint64` | 1, `[NS+1]` | offsets into `members` |
|
||||
| `/model/sets/node/members` | `int64` | 1, `[NM]` | `NodeId`, input set/member order |
|
||||
| `/model/sets/element/names` | UTF-8 | 1, `[ES]` | exact element-set names |
|
||||
| `/model/sets/element/member_offsets` | `uint64` | 1, `[ES+1]` | offsets into `members` |
|
||||
| `/model/sets/element/members` | `int64` | 1, `[EM]` | `ElementId`, input set/member order |
|
||||
|
||||
### 3.2 Analysis
|
||||
|
||||
`/analysis/steps/0` has UTF-8 attribute `name`. Let `B` be the prescribed-DOF
|
||||
count and `L` the nodal-load count.
|
||||
|
||||
| Path | Type | Rank and shape | Attributes / meaning |
|
||||
|---|---|---|---|
|
||||
| `/analysis/steps/0/boundary_conditions/node_ids` | `int64` | 1, `[B]` | target `NodeId` |
|
||||
| `/analysis/steps/0/boundary_conditions/dofs` | `uint8` | 1, `[B]` | Abaqus/FESA DOF number 1 through 6 |
|
||||
| `/analysis/steps/0/boundary_conditions/values` | `float64` | 1, `[B]` | prescribed value |
|
||||
| `/analysis/steps/0/nodal_loads/node_ids` | `int64` | 1, `[L]` | target `NodeId` |
|
||||
| `/analysis/steps/0/nodal_loads/values` | `float64` | 2, `[L,6]` | `coordinate_system="global"`, `components="Fx,Fy,Fz,Mx,My,Mz"` |
|
||||
|
||||
`/analysis/solver_settings` has the exact UTF-8 attributes used by the Phase 1
|
||||
pipeline: `backend="mkl_pardiso"`,
|
||||
`matrix_storage="symmetric_upper_csr"`,
|
||||
`matrix_type="symmetric_positive_definite"`,
|
||||
`constraint_method="essential_dof_elimination"`, and
|
||||
`assembly="deterministic_serial"`. No unused future settings are stored.
|
||||
|
||||
### 3.3 Results
|
||||
|
||||
`/results/steps/0` has UTF-8 attribute `name`; frame group `0` has scalar
|
||||
`float64` attribute `step_time`. Let `RN`, `RE`, `RP`, and `D` be the nodal
|
||||
result, Beam result, flattened Beam recovery-point, and diagnostic counts.
|
||||
|
||||
| Path below `/results/steps/0/frames/0` | Type | Rank and shape | Attributes / meaning |
|
||||
|---|---|---|---|
|
||||
| `nodal/node_ids` | `int64` | 1, `[RN]` | `NodeId`; provenance is joined from `/model/nodes` |
|
||||
| `nodal/displacement` | `float64` | 2, `[RN,6]` | `coordinate_system="global"`, `components="Ux,Uy,Uz,Rx,Ry,Rz"` |
|
||||
| `nodal/reaction` | `float64` | 2, `[RN,6]` | `coordinate_system="global"`, `components="RFx,RFy,RFz,RMx,RMy,RMz"` |
|
||||
| `element/beam/element_ids` | `int64` | 1, `[RE]` | `ElementId` |
|
||||
| `element/beam/part_name` | UTF-8 | 1, `[RE]` | result provenance |
|
||||
| `element/beam/instance_name` | UTF-8 | 1, `[RE]` | result provenance |
|
||||
| `element/beam/local_label` | `int64` | 1, `[RE]` | result provenance |
|
||||
| `element/beam/local_frame` | `float64` | 3, `[RE,3,3]` | `coordinate_system="global"`, `components="ex,ey,ez"`; last dimension is `X,Y,Z` |
|
||||
| `element/beam/end_node_ids` | `int64` | 2, `[RE,2]` | ordered ends `-1,+1` |
|
||||
| `element/beam/xi` | `float64` | 2, `[RE,2]` | `components="end_minus,end_plus"` |
|
||||
| `element/beam/section_strain` | `float64` | 3, `[RE,2,6]` | `coordinate_system="element_local"`, `components="epsilon,gamma_y,gamma_z,kappa_x,kappa_y,kappa_z"` |
|
||||
| `element/beam/section_force` | `float64` | 3, `[RE,2,6]` | `coordinate_system="element_local"`, `components="N,Vy,Vz,T,My,Mz"` |
|
||||
| `element/beam/centroid_sigma_xx` | `float64` | 2, `[RE,2]` | `coordinate_system="element_local"`, `components="end_minus,end_plus"`, `quantity="sigma_xx"` |
|
||||
| `element/beam/recovery_point_offsets` | `uint64` | 1, `[RE+1]` | offsets into recovery-point rows |
|
||||
| `element/beam/recovery_point_sigma_xx` | `float64` | 2, `[RP,2]` | `coordinate_system="element_local"`, `components="end_minus,end_plus"`, `quantity="sigma_xx"`; point order comes from the referenced section |
|
||||
| `diagnostics/stage` | `uint8` | 1, `[D]` | enum table below |
|
||||
| `diagnostics/severity` | `uint8` | 1, `[D]` | `0=warning`, `1=error` |
|
||||
| `diagnostics/code` | UTF-8 | 1, `[D]` | exact diagnostic code |
|
||||
| `diagnostics/message` | UTF-8 | 1, `[D]` | exact diagnostic message |
|
||||
| `diagnostics/has_source` | `uint8` | 1, `[D]` | `0=no source`, `1=source present` |
|
||||
| `diagnostics/source_file` | UTF-8 | 1, `[D]` | empty when source is absent |
|
||||
| `diagnostics/source_line` | `uint64` | 1, `[D]` | zero when source is absent |
|
||||
| `diagnostics/source_column` | `uint64` | 1, `[D]` | zero when source is absent |
|
||||
|
||||
Diagnostic stage encoding follows the declaration order:
|
||||
|
||||
| Value | Stage |
|
||||
|---:|---|
|
||||
| 0 | `io` |
|
||||
| 1 | `syntax` |
|
||||
| 2 | `semantic` |
|
||||
| 3 | `model` |
|
||||
| 4 | `equation` |
|
||||
| 5 | `solver` |
|
||||
| 6 | `results` |
|
||||
| 7 | `validation` |
|
||||
|
||||
## 4. Writer and reader contract
|
||||
|
||||
- The writer validates `ResultDatabase`, exact schema version, model/result ID
|
||||
and provenance joins, Beam connectivity, recovery-point counts, and the
|
||||
single-step name before creating the file.
|
||||
- Required-object creation, write, flush, and close failures become
|
||||
`DiagnosticStage::results` errors. A failed write is never reported as
|
||||
success.
|
||||
- The reader validates the exact version, required datatypes, ranks, shapes,
|
||||
offsets, finite values, uniqueness, references, field metadata, and result
|
||||
contracts. It does not return a partial database or partial snapshots.
|
||||
- The public reader returns adapter-owned, read-only metadata, model, and
|
||||
analysis snapshots plus the semantic `ResultDatabase`. No HDF5 object or
|
||||
handle escapes the adapter, and the snapshots contain enough information to
|
||||
reconstruct the Phase 1 model and run definition without the source deck.
|
||||
+40
-13
@@ -163,8 +163,8 @@ HDF5 결과는 다음 정보를 함께 갖는 자기완결형 파일이어야
|
||||
- 여러 재료·단면과 중첩 집합
|
||||
4. Reference 테스트
|
||||
- Abaqus/Standard 2024 B31 결과
|
||||
- 현재 캔틸레버의 변위와 반력
|
||||
- 요소 내력 및 요소 절점 단면 도심 응력 비교 계약의 synthetic CSV 검증
|
||||
- 현재 캔틸레버의 변위, 반력 및 요소 단면력
|
||||
- 요소 절점 단면 도심 응력 비교 계약의 synthetic CSV 검증
|
||||
|
||||
### 5.2 골든 데이터
|
||||
|
||||
@@ -174,8 +174,15 @@ Abaqus는 CI나 Harness에서 자동 실행하지 않는다. 별도 Abaqus 2024
|
||||
|
||||
비교 실행은 물리량과 해당 CSV 경로를 명시한다. 요청한 파일이 없으면 실패하고,
|
||||
요청하지 않은 물리량은 통과로 보고하지 않는다. 현재 `reference/cantilever beam`
|
||||
샘플은 변위와 반력만 비교한다. 요소 내력과 응력 CSV가 추가되기 전까지 해당
|
||||
reader와 비교 kernel은 synthetic CSV로 검증한다.
|
||||
샘플은 변위, 반력 및 요소 단면력을 비교한다. 요소 응력 CSV가 추가되기 전까지
|
||||
해당 reader와 비교 kernel은 synthetic CSV로 검증한다.
|
||||
|
||||
FESA 정식화 적합성과 Abaqus 결과 상관성은 별도 gate로 운영한다. FESA 적합성
|
||||
gate는 `SCF=0`, 선택적 감차적분 및 문서화된 FESA 정식화를 해석해와 physics
|
||||
invariant로 엄격히 검증한다. Abaqus 상관성 gate는 `SCF=0.25`를 포함할 수 있는
|
||||
원본 Abaqus 모델과 CSV를 보존하고, 동일한 기하·재료·하중에 `SCF=0`을 적용한
|
||||
별도 FESA 입력을 production pipeline으로 해석해 결과 차이를 정량화한다. 상관성
|
||||
gate는 서로 다른 정식화의 수치 일치를 주장하지 않는다.
|
||||
|
||||
CSV 식별 및 값 열:
|
||||
|
||||
@@ -185,17 +192,35 @@ CSV 식별 및 값 열:
|
||||
`SF-SF1..SF-SF3`, `SM-SM1..SM-SM3`
|
||||
- 요소 응력: `Part Instance Name`, `Element Label`, `Node Label`, `Sxx`
|
||||
|
||||
단일 Instance에서는 `Part Instance Name` 열을 생략할 수 있다. 내력은
|
||||
`SF1,SF2,SF3,SM1,SM2,SM3`을 각각 \(N,V_y,V_z,T,M_y,M_z\)로 비교한다.
|
||||
응력은 요소 절점의 단면 도심값 \(\sigma_{xx}=N/A\)를 비교한다.
|
||||
단일 Instance에서는 `Part Instance Name` 열을 생략할 수 있다. Abaqus Beam의
|
||||
단면축 \((\mathbf n_1,\mathbf n_2)\)를 FESA의 \((\mathbf e_y,\mathbf e_z)\)와
|
||||
일치시킨 입력에서 요소 내력은 Abaqus CSV 순서를
|
||||
`SF1,SF3,SF2,SM3,SM1,SM2`로 재배열해 FESA의
|
||||
\(N,V_y,V_z,T,M_y,M_z\)와 비교한다. 응력은 요소 절점의 단면 도심값
|
||||
\(\sigma_{xx}=N/A\)를 비교한다.
|
||||
|
||||
### 5.3 허용오차
|
||||
|
||||
- 단위·정식화 테스트는 정규화된 엄격한 tolerance를 사용한다.
|
||||
- Abaqus 비교 기본 상대오차는 \(10^{-5}\)로 한다.
|
||||
- 영에 가까운 결과는 특성 길이, 하중 및 응력에 기반한 절대오차를 함께 사용한다.
|
||||
- formulation 또는 output 위치 차이로 별도 tolerance가 필요하면 comparison
|
||||
test 설정과 `docs/VALIDATION.md`에 근거를 기록한다.
|
||||
- FESA 단위·정식화 적합성 gate는 정규화된 엄격한 tolerance를 사용한다.
|
||||
- 정식화가 일치하는 reference 비교의 기본 상대오차는 \(10^{-5}\)로 한다.
|
||||
- Abaqus B31과 FESA Beam의 정식화가 다른 상관성 gate는 component별 RMSE와
|
||||
Relative L2를 보고한다. 물리량과 component가 다른 값을 하나의 norm으로
|
||||
혼합하지 않는다.
|
||||
- component \(c\)의 값 쌍을 \((F_{ic},A_{ic})\), characteristic absolute scale을
|
||||
\(s_c\)라 하면
|
||||
|
||||
\[
|
||||
\operatorname{RMSE}_c=
|
||||
\sqrt{\frac{1}{n}\sum_i(F_{ic}-A_{ic})^2},\qquad
|
||||
\operatorname{RelativeL2}_c=
|
||||
\frac{\sqrt{\sum_i(F_{ic}-A_{ic})^2}}
|
||||
{\max\left(\sqrt{\sum_iA_{ic}^2},\sqrt{n}s_c\right)}.
|
||||
\]
|
||||
|
||||
- Abaqus 상관성 gate의 성공은 요청된 모든 entity/component가 매칭되고 유한한
|
||||
metric이 생성됨을 뜻한다. 관측된 단일 샘플에 맞춘 임의 pass/fail tolerance는
|
||||
두지 않는다. 이후 acceptance envelope를 추가하려면 해석적 또는 mesh study
|
||||
근거와 함께 `docs/VALIDATION.md`에 사전 기록한다.
|
||||
|
||||
## 6. 개발 워크플로우
|
||||
|
||||
@@ -235,6 +260,8 @@ CSV 식별 및 값 열:
|
||||
- 테스트 0개 수집이 아님을 확인
|
||||
- 전체 입력-해석-출력 통합 테스트 통과
|
||||
- physics sanity와 평형 잔차 기준 통과
|
||||
- 현재 Abaqus 2024 변위·반력 골든 결과의 tolerance 통과
|
||||
- FESA Beam 정식화 적합성 gate의 엄격한 tolerance 통과
|
||||
- 현재 Abaqus 2024 변위·반력·요소 단면력과의 component별 RMSE 및 Relative L2
|
||||
상관성 보고서 생성
|
||||
- 요소 내력·도심 응력 CSV adapter와 비교 kernel의 synthetic 검증 통과
|
||||
- HDF5 schema, 입력 부분집합, 정식화 및 검증 보고서 제공
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
# FESA Phase 1 검증 보고서
|
||||
|
||||
## 1. 검증 기준과 실행 증거
|
||||
|
||||
이 보고서는 2026-08-03에 `feat-beam-reference-qualification`에서 새 Debug 빌드와
|
||||
테스트를 실행해 수집한 결과다. FESA Beam 검증은 다음 두 gate를 독립적으로
|
||||
운영한다.
|
||||
|
||||
- Gate A — FESA 정식화 적합성: FESA가 채택한 선택적 감차적분 Timoshenko
|
||||
정식화를 해석해, 에너지, 강체 mode와 평형으로 검증한다.
|
||||
- Gate B — Abaqus 결과 상관성: Abaqus B31과 FESA의 정식화 차이를 인정하고
|
||||
요청된 결과의 component별 RMSE와 Relative L2를 보고한다.
|
||||
|
||||
실행 결과는 다음과 같다.
|
||||
|
||||
| 명령 | 결과 |
|
||||
|------|------|
|
||||
| `cmake --build --preset windows-debug` | MSVC v145 Debug x64 빌드 성공, 새 경고 없음 |
|
||||
| `ctest --preset windows-debug --output-on-failure` | 68/68 통과 |
|
||||
| `uv run --with pytest python -m pytest -v -rs` | 20/20 통과 |
|
||||
| `fesa solve` 후 `fesa-reference-compare` | 42개 요청 위치와 18개 component metric 생성, exit code 0 |
|
||||
|
||||
Harness child의 관리형 WindowsApps PowerShell은 `CreateProcessAsUserW` 오류로 명령을
|
||||
시작하지 못했다. 위 명령은 동일 저장소와 preset에서 현재 세션이 직접 실행했으며,
|
||||
executor 환경 문제를 테스트 성공으로 간주하지 않았다.
|
||||
|
||||
## 2. Gate A — FESA 정식화 적합성
|
||||
|
||||
### 2.1 요소 정식화와 회복
|
||||
|
||||
`tests/unit/elements/beam3d2_test.cpp`의 다음 검증이 모두 통과했다.
|
||||
|
||||
| 검증 | 증거 | 판정 기준 |
|
||||
|------|------|-----------|
|
||||
| 행렬 유한성·대칭성 | `Beam3D2.ProducesFiniteSymmetricLocalAndGlobalStiffness` | local/global 12×12 전 항 유한, 대칭 항 bitwise equality |
|
||||
| 강체 mode | `RigidBody.SixIndependentModesHaveZeroStrainEnergy` | 3개 병진과 3개 회전 mode의 energy가 roundoff bound 이내 |
|
||||
| 축·비틀림 | `Timoshenko.ReproducesAnalyticalAxialSubmatrix`, `ReproducesAnalyticalTorsionalSubmatrix` | 해석 stiffness 대비 `512*epsilon` 상대 규모 |
|
||||
| 굽힘 y/z | `Timoshenko.ReproducesConstantCurvatureEnergyAboutLocalY/LocalZ` | 해석 strain energy 대비 `512*epsilon` 상대 규모 |
|
||||
| 전단 y/z | `Timoshenko.ReproducesConstantShearEnergyInLocalY/LocalZ` | 해석 strain energy 대비 `512*epsilon` 상대 규모 |
|
||||
| 세장비 | `Timoshenko.AvoidsShearLockingAcrossSlendernessSweep` | `L/h={2,10,100,1000}`, `4096*epsilon*(L/h)^2` 상대 규모 |
|
||||
| 회전 불변성 | `Beam3D2.PreservesGlobalEnergyUnderRigidCoordinateRotation` | 회전 전후 global energy가 `4096*epsilon` 상대 규모 이내 |
|
||||
| 단면력 회복 | `BeamRecovery.*`, `SectionForce.*` | 축력, 비틀림, 전단, My, Mz와 biaxial 부호를 양 끝에서 검증 |
|
||||
|
||||
### 2.2 Physics sanity와 결정성
|
||||
|
||||
| 검증 | 증거 | 결과 |
|
||||
|------|------|------|
|
||||
| full-system 평형 | `StaticEquilibrium.ReturnedFieldsSatisfyOriginalFullEquation` | `Ku-f-r` 각 DOF가 `1e-12` 이내 |
|
||||
| 비영 지정 DOF | `ConstraintElimination.ShiftsNonzeroPrescribedValueAndPreservesOriginalSystem` 및 `LinearStaticAnalysis.SolvesAllConstrainedSystemWithoutPardiso` | reduced RHS 이동, full displacement와 reaction 검증 |
|
||||
| 반력 | `Reaction.UsesOriginalFullEquilibriumEquation` | 원래 full equation에서 회복 |
|
||||
| production pipeline | `MinimalCantileverPipeline.WritesReadableFiniteEquilibratedResults` | parser→solver→HDF5 결과 유한, 전역 반력 평형 `1e-12` 이내 |
|
||||
| reference 평형 | `CantileverReference.CorrelatesAllAvailableAbaqusResults` | 절대 `1e-12`와 적용 하중 대비 상대 `2e-13` 중 큰 허용치 이내 |
|
||||
| 병렬 결정성 | `ThreadCountDeterminism.AssemblyAndLinearStateAreBitwiseStable` | thread `{1,2,16}`에서 10회 반복, matrix/displacement/reaction bitwise 동일 |
|
||||
|
||||
Gate A disposition은 **PASS**다.
|
||||
|
||||
## 3. Gate B — Abaqus 2024 결과 상관성
|
||||
|
||||
### 3.1 모델과 비교 계약
|
||||
|
||||
- Abaqus provenance: `reference/cantilever beam/cantilever beam.inp`와 변위, 반력,
|
||||
요소 단면력 CSV. 원본 모델의 `SCF=0.25`는 유지한다.
|
||||
- FESA projection: `reference/cantilever beam/cantilever beam fesa.inp`. 기하, 재료,
|
||||
단면, 명시적 전단강성, 경계조건과 하중은 같고 `SCF=0`만 적용한다.
|
||||
- entity join: nodal 결과 11개씩은 `(Instance, Node Label)`, 요소 단면력 20개는
|
||||
`(Instance, Element Label, End Node Label)`로 매칭한다.
|
||||
- absolute scale: displacement `1e-10`, reaction `1e-8`, internal force `1e-8`.
|
||||
- 서로 단위가 다른 component는 하나의 norm으로 합치지 않는다.
|
||||
|
||||
요소력 축 순서는 다음과 같다.
|
||||
|
||||
| FESA | Abaqus CSV |
|
||||
|------|------------|
|
||||
| `N` | `SF1` |
|
||||
| `Vy` | `SF3` |
|
||||
| `Vz` | `SF2` |
|
||||
| `T` | `SM3` |
|
||||
| `My` | `SM1` |
|
||||
| `Mz` | `SM2` |
|
||||
|
||||
component \(c\)의 표본 수를 \(n\), 오차를 \(e_i=a_i-r_i\), absolute scale을
|
||||
\(s_i\)라 하면 다음을 사용한다.
|
||||
|
||||
\[
|
||||
\operatorname{RMSE}_c=\sqrt{\frac{1}{n}\sum_i e_i^2}
|
||||
\]
|
||||
|
||||
\[
|
||||
\operatorname{RelativeL2}_c=
|
||||
\frac{\sqrt{\sum_i e_i^2}}
|
||||
{\max\left(\sqrt{\sum_i r_i^2},\sqrt{\sum_i s_i^2}\right)}
|
||||
\]
|
||||
|
||||
### 3.2 수집된 correlation metric
|
||||
|
||||
| 물리량 | component | count | RMSE | Relative L2 |
|
||||
|--------|-----------|------:|-----:|------------:|
|
||||
| displacement | Ux | 11 | 0 | 0 |
|
||||
| displacement | Uy | 11 | 0 | 0 |
|
||||
| displacement | Uz | 11 | 2.1970445023044601e-05 | 2.2349969291714038e-03 |
|
||||
| displacement | Rx | 11 | 0 | 0 |
|
||||
| displacement | Ry | 11 | 2.1672945177750166e-09 | 1.0416581667076092e-06 |
|
||||
| displacement | Rz | 11 | 0 | 0 |
|
||||
| reaction | RFx | 11 | 0 | 0 |
|
||||
| reaction | RFy | 11 | 0 | 0 |
|
||||
| reaction | RFz | 11 | 1.3385150002853335e-07 | 4.4393520322089023e-13 |
|
||||
| reaction | RMx | 11 | 0 | 0 |
|
||||
| reaction | RMy | 11 | 7.8149308366928907e-07 | 2.591919334788851e-13 |
|
||||
| reaction | RMz | 11 | 0 | 0 |
|
||||
| internal force | N | 20 | 0 | 0 |
|
||||
| internal force | Vy | 20 | 0 | 0 |
|
||||
| internal force | Vz | 20 | 2.7107472798172421e-07 | 2.7107472798172426e-13 |
|
||||
| internal force | T | 20 | 0 | 0 |
|
||||
| internal force | My | 20 | 474341.64902538335 | 0.082541022764834646 |
|
||||
| internal force | Mz | 20 | 0 | 0 |
|
||||
|
||||
모든 요청 entity/component가 유일하게 매칭됐고 metric이 유한하므로 Gate B
|
||||
disposition은 **EVALUABLE**이다. 이는 Abaqus B31과 FESA의 정식화가 동일하거나
|
||||
임의 정확도 threshold를 통과했다는 뜻이 아니다. 현재 가장 큰 Relative L2는
|
||||
`My=0.082541022764834646`, 다음은 `Uz=0.0022349969291714038`이다. pass/fail
|
||||
envelope는 mesh 또는 해석적 연구 근거 없이 이 관측값에 맞춰 설정하지 않는다.
|
||||
|
||||
## 4. 검증 범위와 제한
|
||||
|
||||
- Abaqus 단면 도심 응력 CSV는 제공되지 않았다. `StressCsv`는 synthetic CSV schema와
|
||||
`(Instance, Element, End Node)` 매핑만 검증하며, 응력은 **not yet
|
||||
Abaqus-qualified**다.
|
||||
- Gate B는 solver 간 correlation이며 Gate A의 해석적 정확도 검증을 대체하지 않는다.
|
||||
- Abaqus golden 갱신에는 Abaqus 2024 환경과 수동 provenance 검토가 필요하다.
|
||||
- FESA는 단위 변환을 수행하지 않으므로 입력과 CSV가 일관 단위계를 사용해야 한다.
|
||||
|
||||
현재 이중 gate 결론은 **Gate A PASS / Gate B EVALUABLE**이다.
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/model/domain.hpp>
|
||||
#include <fesa/results/result_database.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct AnalysisRunResult final {
|
||||
bool succeeded;
|
||||
std::optional<ResultDatabase> results;
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
};
|
||||
|
||||
class LinearStaticAnalysis final {
|
||||
public:
|
||||
[[nodiscard]] AnalysisRunResult run(const Domain& domain) const;
|
||||
};
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include <fesa/analysis/linear_static_analysis.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct AnalysisRequest final {
|
||||
std::filesystem::path input_path;
|
||||
std::filesystem::path output_path;
|
||||
};
|
||||
|
||||
[[nodiscard]] AnalysisRunResult run_solver(
|
||||
const AnalysisRequest& request);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <fesa/assembly/equation_system.hpp>
|
||||
#include <fesa/fem/dof_manager.hpp>
|
||||
#include <fesa/model/domain.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct AssemblyOptions final {
|
||||
std::size_t max_threads;
|
||||
std::size_t grain_size;
|
||||
};
|
||||
|
||||
[[nodiscard]] EquationSystem assemble_parallel(
|
||||
const Domain& domain,
|
||||
const DofManager& dofs,
|
||||
AssemblyOptions options);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/assembly/symmetric_csr.hpp>
|
||||
#include <fesa/model/ids.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct MatrixContribution final {
|
||||
std::size_t row;
|
||||
std::size_t column;
|
||||
ElementId element;
|
||||
std::uint16_t local_order;
|
||||
double value;
|
||||
};
|
||||
|
||||
[[nodiscard]] std::vector<MatrixContribution> canonicalize_contributions(
|
||||
std::span<const MatrixContribution> contributions);
|
||||
|
||||
[[nodiscard]] SymmetricCsr merge_contributions(
|
||||
std::size_t order,
|
||||
std::span<const MatrixContribution> canonical);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -2,22 +2,34 @@
|
||||
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/core/vec3.hpp>
|
||||
#include <fesa/fem/beam_frame.hpp>
|
||||
#include <fesa/model/beam_section.hpp>
|
||||
#include <fesa/model/ids.hpp>
|
||||
#include <fesa/model/material.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct Beam3D2Input final {
|
||||
std::array<Vec3, 2> coordinates;
|
||||
std::array<NodeId, 2> node_ids;
|
||||
IsotropicElastic material;
|
||||
BeamSection section;
|
||||
};
|
||||
|
||||
struct BeamSectionResult final {
|
||||
double xi;
|
||||
NodeId end_node;
|
||||
std::array<double, 6> section_strain;
|
||||
std::array<double, 6> section_force;
|
||||
double centroid_sigma_xx;
|
||||
std::vector<double> sigma_xx;
|
||||
};
|
||||
|
||||
struct Beam3D2Contribution final {
|
||||
Matrix12 local_stiffness;
|
||||
Matrix12 global_stiffness;
|
||||
@@ -32,4 +44,9 @@ struct BeamKernelResult final {
|
||||
[[nodiscard]] BeamKernelResult compute_beam3d2(
|
||||
const Beam3D2Input& input);
|
||||
|
||||
[[nodiscard]] std::vector<BeamSectionResult> recover_beam3d2(
|
||||
const Beam3D2Input& input,
|
||||
std::span<const double, 12> element_displacement,
|
||||
std::span<const std::array<double, 2>> recovery_points);
|
||||
|
||||
} // namespace fesa
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/io/abaqus/deck_record.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct ActiveInputView final {
|
||||
bool flat = true;
|
||||
std::string part_name;
|
||||
std::string instance_name;
|
||||
std::span<const DeckRecord> part_records;
|
||||
std::span<const DeckRecord> assembly_records;
|
||||
};
|
||||
|
||||
struct ActiveInputResult final {
|
||||
std::optional<ActiveInputView> input;
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
};
|
||||
|
||||
[[nodiscard]] ActiveInputResult select_active_input(const ParsedDeck& deck);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -15,6 +15,7 @@ struct DeckRecord final {
|
||||
std::map<std::string, std::string, std::less<>> parameters;
|
||||
std::vector<std::vector<std::string>> data;
|
||||
SourceLocation source;
|
||||
std::vector<SourceLocation> data_sources;
|
||||
};
|
||||
|
||||
struct ParsedPart final {
|
||||
@@ -27,6 +28,7 @@ struct ParsedInstance final {
|
||||
std::string name;
|
||||
std::string part_name;
|
||||
std::vector<std::vector<std::string>> transform_data;
|
||||
std::vector<SourceLocation> transform_sources;
|
||||
SourceLocation source;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
@@ -12,6 +13,7 @@ namespace fesa {
|
||||
struct ParseDeckResult final {
|
||||
std::optional<ParsedDeck> deck;
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
std::string input_fingerprint;
|
||||
};
|
||||
|
||||
[[nodiscard]] ParseDeckResult parse_deck(
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/io/abaqus/deck_record.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
enum class ResolvedSetScope { global, part, assembly };
|
||||
|
||||
enum class ResolvedSetKind { node, element };
|
||||
|
||||
struct ResolvedSet final {
|
||||
std::string scope_name;
|
||||
std::string set_name;
|
||||
std::vector<std::int64_t> sorted_unique_labels;
|
||||
ResolvedSetScope scope = ResolvedSetScope::global;
|
||||
ResolvedSetKind kind = ResolvedSetKind::node;
|
||||
};
|
||||
|
||||
struct SetResolutionResult final {
|
||||
std::vector<ResolvedSet> sets;
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
};
|
||||
|
||||
[[nodiscard]] SetResolutionResult resolve_sets(const ParsedDeck& deck);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,102 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/core/vec3.hpp>
|
||||
#include <fesa/model/beam_section.hpp>
|
||||
#include <fesa/model/domain.hpp>
|
||||
#include <fesa/model/entity_origin.hpp>
|
||||
#include <fesa/model/ids.hpp>
|
||||
#include <fesa/results/result_database.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct Hdf5NodeSnapshot final {
|
||||
std::uint64_t dense_index;
|
||||
NodeId id;
|
||||
EntityOrigin origin;
|
||||
Vec3 coordinates;
|
||||
};
|
||||
|
||||
struct Hdf5ElementSnapshot final {
|
||||
std::uint64_t dense_index;
|
||||
ElementId id;
|
||||
EntityOrigin origin;
|
||||
std::array<std::uint64_t, 2> connectivity;
|
||||
MaterialId material;
|
||||
SectionId section;
|
||||
};
|
||||
|
||||
struct Hdf5SectionSnapshot final {
|
||||
SectionId id;
|
||||
std::string name;
|
||||
double area;
|
||||
double iy;
|
||||
double iz;
|
||||
double torsion_j;
|
||||
double shear_area_y;
|
||||
double shear_area_z;
|
||||
ShearPropertySource shear_source;
|
||||
Vec3 orientation;
|
||||
std::vector<std::array<double, 2>> recovery_points;
|
||||
};
|
||||
|
||||
struct Hdf5ModelSnapshot final {
|
||||
std::vector<Hdf5NodeSnapshot> nodes;
|
||||
std::vector<Hdf5ElementSnapshot> elements;
|
||||
std::vector<IsotropicElastic> materials;
|
||||
std::vector<Hdf5SectionSnapshot> sections;
|
||||
std::vector<NodeSet> node_sets;
|
||||
std::vector<ElementSet> element_sets;
|
||||
};
|
||||
|
||||
struct Hdf5MetadataSnapshot final {
|
||||
std::string schema_version;
|
||||
std::string fesa_version;
|
||||
std::string unit_policy;
|
||||
std::string input_source;
|
||||
std::string input_fingerprint;
|
||||
};
|
||||
|
||||
struct Hdf5InputIdentity final {
|
||||
std::string source;
|
||||
std::string fingerprint;
|
||||
};
|
||||
|
||||
struct Hdf5SolverSettingsSnapshot final {
|
||||
std::string backend;
|
||||
std::string matrix_storage;
|
||||
std::string matrix_type;
|
||||
std::string constraint_method;
|
||||
std::string assembly;
|
||||
};
|
||||
|
||||
struct Hdf5AnalysisSnapshot final {
|
||||
StepDefinition step;
|
||||
Hdf5SolverSettingsSnapshot solver;
|
||||
};
|
||||
|
||||
struct Hdf5ReadResult final {
|
||||
std::optional<ResultDatabase> database;
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
std::optional<Hdf5ModelSnapshot> model;
|
||||
std::optional<Hdf5MetadataSnapshot> metadata;
|
||||
std::optional<Hdf5AnalysisSnapshot> analysis;
|
||||
};
|
||||
|
||||
[[nodiscard]] std::vector<Diagnostic> write_hdf5(
|
||||
const std::filesystem::path& path,
|
||||
const Domain& domain,
|
||||
const ResultDatabase& database,
|
||||
const Hdf5InputIdentity& input_identity);
|
||||
|
||||
[[nodiscard]] Hdf5ReadResult read_hdf5_results(
|
||||
const std::filesystem::path& path);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,77 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/core/status.hpp>
|
||||
#include <fesa/elements/beam/beam3d2.hpp>
|
||||
#include <fesa/model/entity_origin.hpp>
|
||||
#include <fesa/model/ids.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
enum class FieldCoordinateSystem { global, element_local };
|
||||
|
||||
struct NodalFrame final {
|
||||
inline static constexpr FieldCoordinateSystem coordinate_system =
|
||||
FieldCoordinateSystem::global;
|
||||
inline static constexpr std::array<std::string_view, 6>
|
||||
displacement_components{
|
||||
"Ux", "Uy", "Uz", "Rx", "Ry", "Rz"};
|
||||
inline static constexpr std::array<std::string_view, 6>
|
||||
reaction_components{
|
||||
"RFx", "RFy", "RFz", "RMx", "RMy", "RMz"};
|
||||
|
||||
std::vector<NodeId> node_ids;
|
||||
std::vector<EntityOrigin> origins;
|
||||
std::vector<std::array<double, 6>> displacement;
|
||||
std::vector<std::array<double, 6>> reaction;
|
||||
};
|
||||
|
||||
struct BeamElementFrame final {
|
||||
inline static constexpr FieldCoordinateSystem coordinate_system =
|
||||
FieldCoordinateSystem::element_local;
|
||||
inline static constexpr std::array<std::string_view, 6>
|
||||
section_strain_components{
|
||||
"epsilon", "gamma_y", "gamma_z", "kappa_x", "kappa_y",
|
||||
"kappa_z"};
|
||||
inline static constexpr std::array<std::string_view, 6>
|
||||
section_force_components{
|
||||
"N", "Vy", "Vz", "T", "My", "Mz"};
|
||||
inline static constexpr std::string_view axial_stress_component =
|
||||
"sigma_xx";
|
||||
|
||||
ElementId element;
|
||||
EntityOrigin origin;
|
||||
BeamFrame local_frame;
|
||||
std::array<BeamSectionResult, 2> end_results;
|
||||
};
|
||||
|
||||
struct ElementFrame final {
|
||||
std::vector<BeamElementFrame> beams;
|
||||
};
|
||||
|
||||
struct ResultFrame final {
|
||||
double step_time;
|
||||
NodalFrame nodal;
|
||||
ElementFrame element;
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
};
|
||||
|
||||
struct ResultStep final {
|
||||
std::string name;
|
||||
std::vector<ResultFrame> frames;
|
||||
};
|
||||
|
||||
struct ResultDatabase final {
|
||||
std::string schema_version;
|
||||
std::vector<ResultStep> steps;
|
||||
};
|
||||
|
||||
[[nodiscard]] Status validate_result_database(
|
||||
const ResultDatabase& database);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,79 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/results/result_database.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
enum class ReferenceQuantity {
|
||||
displacement,
|
||||
reaction,
|
||||
internal_force,
|
||||
centroid_stress
|
||||
};
|
||||
|
||||
struct Tolerance final {
|
||||
double relative;
|
||||
double absolute_scale;
|
||||
};
|
||||
|
||||
struct ResultPosition final {
|
||||
std::string instance_name;
|
||||
std::int64_t entity_label;
|
||||
std::optional<std::int64_t> end_node_label;
|
||||
};
|
||||
|
||||
struct ComparisonSample final {
|
||||
ReferenceQuantity quantity;
|
||||
ResultPosition position;
|
||||
std::vector<double> reference;
|
||||
std::vector<double> actual;
|
||||
Tolerance tolerance;
|
||||
};
|
||||
|
||||
struct ComparisonReport final {
|
||||
bool passed;
|
||||
double maximum_normalized_error;
|
||||
std::vector<Diagnostic> failures;
|
||||
};
|
||||
|
||||
struct ComponentCorrelationMetric final {
|
||||
ReferenceQuantity quantity;
|
||||
std::size_t component_index;
|
||||
std::size_t value_count;
|
||||
double root_mean_square_error;
|
||||
double relative_l2_error;
|
||||
};
|
||||
|
||||
struct CorrelationReport final {
|
||||
bool evaluable;
|
||||
std::vector<ComponentCorrelationMetric> metrics;
|
||||
std::vector<Diagnostic> failures;
|
||||
};
|
||||
|
||||
struct ComparisonSampleMatch final {
|
||||
std::optional<ComparisonSample> sample;
|
||||
std::vector<Diagnostic> failures;
|
||||
};
|
||||
|
||||
[[nodiscard]] ComparisonSampleMatch make_comparison_sample(
|
||||
const ResultFrame& frame,
|
||||
ReferenceQuantity quantity,
|
||||
const ResultPosition& position,
|
||||
std::span<const double> reference,
|
||||
Tolerance tolerance);
|
||||
|
||||
[[nodiscard]] ComparisonReport compare_samples(
|
||||
std::span<const ComparisonSample> samples);
|
||||
|
||||
[[nodiscard]] CorrelationReport correlate_samples(
|
||||
std::span<const ComparisonSample> samples);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
#include <fesa/validation/comparison.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct ReferenceRow final {
|
||||
ReferenceQuantity quantity;
|
||||
ResultPosition position;
|
||||
std::vector<double> values;
|
||||
};
|
||||
|
||||
struct ReferenceCsvReadResult final {
|
||||
std::vector<ReferenceRow> rows;
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
};
|
||||
|
||||
[[nodiscard]] ReferenceCsvReadResult read_reference_csv(
|
||||
ReferenceQuantity quantity,
|
||||
const std::filesystem::path& path,
|
||||
std::string_view single_instance_name);
|
||||
|
||||
} // namespace fesa
|
||||
@@ -5,27 +5,44 @@
|
||||
{
|
||||
"step": 0,
|
||||
"name": "abaqus-input-contract",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Defined the normative Phase 1 Abaqus subset and expanded the public parser/mapper fixture matrix to 74 cases covering strict scopes, parameter forms, data ownership, exact mesh rows and references in active and inactive Parts, duplicate Parts, Assembly-only hierarchical targets, and source-accurate diagnostics.",
|
||||
"started_at": "2026-08-01T02:16:39+0900",
|
||||
"completed_at": "2026-08-01T02:24:23+0900"
|
||||
},
|
||||
{
|
||||
"step": 1,
|
||||
"name": "part-and-assembly-set-resolution",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added deterministic scope- and kind-aware Part/Assembly set resolution with explicit, generated, nested, forward, duplicate, empty, cycle, missing-member, and active-Instance validation.",
|
||||
"started_at": "2026-08-01T02:24:24+0900",
|
||||
"completed_at": "2026-08-01T02:37:05+0900"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"name": "single-instance-semantic-validation",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added ActiveInputView selection and semantic validation for exclusive flat or single untransformed Instance input, preserving source diagnostics and excluding inactive Parts.",
|
||||
"started_at": "2026-08-01T02:37:05+0900",
|
||||
"completed_at": "2026-08-01T02:44:01+0900"
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"name": "material-section-and-shear-defaults",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added complete-deck global material and active-ELSET Beam section mapping with exact property diagnostics, explicit shear-area conversion, and preserved Phase 1 default shear source.",
|
||||
"started_at": "2026-08-01T02:44:01+0900",
|
||||
"completed_at": "2026-08-01T02:59:40+0900"
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"name": "step-bc-load-and-noop-directives",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Completed single static Step mapping with deterministic BC canonicalization, accumulated nodal loads, explicit no-op directives, exact source diagnostics, and supplied cantilever normalization.",
|
||||
"started_at": "2026-08-01T02:59:40+0900",
|
||||
"completed_at": "2026-08-01T03:23:25+0900"
|
||||
}
|
||||
]
|
||||
],
|
||||
"created_at": "2026-08-01T01:59:08+0900",
|
||||
"completed_at": "2026-08-01T03:23:25+0900"
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,22 +5,35 @@
|
||||
{
|
||||
"step": 0,
|
||||
"name": "comparison-metric-and-entity-matching",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added CSV-independent normalized comparison metrics and diagnostics with ResultFrame origin and Beam end-node matching.",
|
||||
"started_at": "2026-08-02T02:42:01+0900",
|
||||
"completed_at": "2026-08-02T03:22:08+0900"
|
||||
},
|
||||
{
|
||||
"step": 1,
|
||||
"name": "reference-csv-adapters",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added strict four-schema Abaqus reference CSV adapters with canonical row mapping, synthetic internal-force/stress fixtures, and validation diagnostics.",
|
||||
"started_at": "2026-08-02T03:22:08+0900",
|
||||
"completed_at": "2026-08-02T03:33:06+0900"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"name": "cantilever-reference-comparison",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added the SCF=0 FESA cantilever projection, production HDF5/CSV correlation CLI, component-wise RMSE and Relative L2, Abaqus-to-FESA beam-force axis mapping, and displacement/reaction/internal-force reference coverage.",
|
||||
"started_at": "2026-08-02T03:33:07+0900",
|
||||
"completed_at": "2026-08-03T01:45:42+0900"
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"name": "qualification-report",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Recorded docs/VALIDATION.md with Gate A PASS, Gate B EVALUABLE, 68/68 CTest and 20/20 Harness pytest evidence, all 18 correlation metrics, determinism coverage, and the remaining Abaqus stress qualification gap.",
|
||||
"started_at": "2026-08-03T01:45:43+0900",
|
||||
"completed_at": "2026-08-03T01:48:16+0900"
|
||||
}
|
||||
]
|
||||
],
|
||||
"created_at": "2026-08-02T02:42:01+0900"
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"step": 2,
|
||||
"name": "cantilever-reference-comparison",
|
||||
"exitCode": 0,
|
||||
"stdout": "Harness child verification was blocked by the managed WindowsApps PowerShell sandbox. The same acceptance contract was completed directly: CMake Debug build passed; CTest passed 68/68; Harness pytest passed 20/20; the fresh solver and reference-comparison CLI produced finite component metrics for 11 displacement rows, 11 reaction rows, and 20 internal-force rows.",
|
||||
"stderr": ""
|
||||
}
|
||||
@@ -6,45 +6,73 @@
|
||||
- `/docs/PRD.md`
|
||||
- `/docs/ARCHITECTURE.md`
|
||||
- `/docs/ADR.md`
|
||||
- `/docs/formulation/timoshenko-beam-3d.md`
|
||||
- `/reference/cantilever beam/cantilever beam.inp`
|
||||
- `/reference/cantilever beam/cantilever beam displacements.csv`
|
||||
- `/reference/cantilever beam/cantilever beam reactions.csv`
|
||||
- `/reference/cantilever beam/cantilever beam elemental forces.csv`
|
||||
- `/include/fesa/analysis/run_solver.hpp`
|
||||
- `/include/fesa/io/hdf5/reader.hpp`
|
||||
- `/include/fesa/io/hdf5/writer.hpp`
|
||||
- `/include/fesa/validation/comparison.hpp`
|
||||
- `/include/fesa/validation/reference_csv.hpp`
|
||||
|
||||
## 작업
|
||||
|
||||
제공된 계층형 캔틸레버를 production pipeline으로 해석하고 현재 존재하는 변위와
|
||||
반력만 Abaqus 2024 결과와 비교한다.
|
||||
FESA 정식화 적합성과 Abaqus 결과 상관성을 별도 gate로 검증한다.
|
||||
|
||||
- `tests/reference/cantilever_reference_test.cpp`와 reference compare CLI를 먼저
|
||||
작성한다.
|
||||
- comparison request는 Instance `Part-1-1`, relative tolerance `1e-5`,
|
||||
displacement absolute scale `1e-10`, reaction absolute scale `1e-8`을 명시한다.
|
||||
- HDF5 결과와 CSV를 public adapter로 읽어 `(Instance,Node Label)`로 join한다.
|
||||
- 요청하지 않은 internal force/stress 파일을 검색하거나 pass로 보고하지 않는다.
|
||||
- equilibrium과 finite result도 함께 assertion한다.
|
||||
- Gate A는 기존 해석해, energy, rigid mode 및 equilibrium 테스트를 그대로 엄격히
|
||||
통과시킨다. `SCF=0.25`를 kernel에 추가하거나 production parser가 무시하게 하지
|
||||
않는다.
|
||||
- 원본 `cantilever beam.inp`와 세 CSV는 Abaqus provenance로 보존한다. 동일한
|
||||
기하·재료·하중과 전단강성을 사용하되 `SCF=0`인
|
||||
`reference/cantilever beam/cantilever beam fesa.inp`를 추가해 production
|
||||
pipeline으로 해석한다.
|
||||
- `tests/unit/validation/comparison_test.cpp`에 component별 RMSE와 Relative L2의
|
||||
실패 테스트를 먼저 추가한다. `include/fesa/validation/comparison.hpp`에는
|
||||
`ComponentCorrelationMetric`과 `CorrelationReport`,
|
||||
`correlate_samples(std::span<const ComparisonSample>)`를 공개한다.
|
||||
- Relative L2는 reference L2 norm과 component별 absolute-scale norm 중 큰 값을
|
||||
분모로 사용한다. 서로 다른 component를 하나의 norm으로 합치지 않는다.
|
||||
- `tests/unit/validation/reference_csv_test.cpp`의 internal-force fixture 기대값을
|
||||
Abaqus `SF1,SF3,SF2,SM3,SM1,SM2`에서 FESA
|
||||
`N,Vy,Vz,T,My,Mz` 순서로 재배열하도록 먼저 변경하고 RED를 확인한다.
|
||||
- `tests/reference/cantilever_reference_test.cpp`와 reference compare CLI는 Instance
|
||||
`PART-1_1-1`, 변위, 반력 및 요소 단면력 CSV 경로와 각 물리량의 absolute scale을
|
||||
명시한다.
|
||||
- HDF5 결과와 CSV를 public adapter로 읽어 nodal 결과는
|
||||
`(Instance,Node Label)`, 요소 단면력은
|
||||
`(Instance,Element Label,End Node Label)`로 join한다.
|
||||
- correlation CLI는 요청된 결과가 모두 매칭되고 metric이 유한할 때 성공하며
|
||||
component별 `count`, `rmse`, `relative_l2`를 출력한다. 관측값을 이용한 임의
|
||||
pass/fail tolerance를 적용하지 않는다.
|
||||
- equilibrium과 finite result도 함께 assertion한다. 요청하지 않은 stress 파일을
|
||||
검색하거나 pass로 보고하지 않는다.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
```powershell
|
||||
cmake --build --preset windows-debug
|
||||
ctest --preset windows-debug -R "CorrelationMetric|ReferenceCsv|InternalForceCsv" --output-on-failure
|
||||
ctest --preset windows-debug -R CantileverReference --output-on-failure
|
||||
.\out\build\windows-debug\Debug\fesa.exe solve "reference\cantilever beam\cantilever beam.inp" --output out\cantilever-beam.h5
|
||||
.\out\build\windows-debug\Debug\fesa-reference-compare.exe --results out\cantilever-beam.h5 --instance Part-1-1 --displacements "reference\cantilever beam\cantilever beam displacements.csv" --reactions "reference\cantilever beam\cantilever beam reactions.csv" --relative-tolerance 1e-5 --displacement-absolute-scale 1e-10 --reaction-absolute-scale 1e-8
|
||||
.\out\build\windows-debug\Debug\fesa.exe solve "reference\cantilever beam\cantilever beam fesa.inp" --output out\cantilever-beam.h5
|
||||
.\out\build\windows-debug\Debug\fesa-reference-compare.exe --results out\cantilever-beam.h5 --instance PART-1_1-1 --displacements "reference\cantilever beam\cantilever beam displacements.csv" --reactions "reference\cantilever beam\cantilever beam reactions.csv" --internal-forces "reference\cantilever beam\cantilever beam elemental forces.csv" --displacement-absolute-scale 1e-10 --reaction-absolute-scale 1e-8 --internal-force-absolute-scale 1e-8
|
||||
ctest --preset windows-debug --output-on-failure
|
||||
```
|
||||
|
||||
## 검증 절차
|
||||
|
||||
1. reference test가 실제 오차를 보고하며 실패하는 것을 확인한다.
|
||||
2. discrepancy마다 가장 작은 analytical test를 추가한 뒤 근거 있는 kernel만 수정한다.
|
||||
3. tolerance를 넓혀 결함을 숨기지 않는다.
|
||||
4. 전체 테스트와 최대 정규화 오차를 index summary에 기록한다.
|
||||
1. RMSE, Relative L2 및 요소력 축 재배열 테스트가 각각 의도한 이유로 실패하는
|
||||
RED를 확인한다.
|
||||
2. 최소 comparison metric과 CSV adapter 변경으로 GREEN을 만든다.
|
||||
3. reference test가 production solve/HDF5/CSV/correlation 경로를 실행하고 세
|
||||
물리량의 component metric을 출력하는지 확인한다.
|
||||
4. 전체 테스트와 component별 metric 요약을 index summary에 기록한다.
|
||||
|
||||
## 금지사항
|
||||
|
||||
- reference `.inp` 또는 CSV를 수정하지 마라. 이유: 원본 golden을 보존해야 한다.
|
||||
- 미제공 내력/응력 Abaqus 검증을 통과했다고 주장하지 마라. 이유: 증거가 없다.
|
||||
- 원본 Abaqus `.inp` 또는 CSV를 수정하지 마라. 이유: 원본 golden과 formulation
|
||||
provenance를 보존해야 한다.
|
||||
- Abaqus `SCF=0.25`를 FESA가 구현하거나 무시하지 마라. 이유: 승인된 FESA
|
||||
정식화와 입력 계약을 바꾼다.
|
||||
- 미제공 응력 Abaqus 검증을 통과했다고 주장하지 마라. 이유: 증거가 없다.
|
||||
- test-only parser/solver 경로를 만들지 마라. 이유: production pipeline 검증이다.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"step": 3,
|
||||
"name": "qualification-report",
|
||||
"exitCode": 0,
|
||||
"stdout": "Created docs/VALIDATION.md from fresh evidence. CMake Debug build passed, CTest passed 68/68, Harness pytest passed 20/20, and the focused Beam3D2/ThreadCountDeterminism/Reference tests passed 4/4. The report records Gate A PASS, Gate B EVALUABLE, all 18 finite correlation metrics, and Abaqus stress as not yet qualified.",
|
||||
"stderr": ""
|
||||
}
|
||||
@@ -20,9 +20,10 @@
|
||||
rotated frame, slenderness sweep
|
||||
- physics: equilibrium, symmetry, reaction, nonzero prescribed DOF
|
||||
- determinism: tested thread counts와 repeated runs
|
||||
- Abaqus: 현재 cantilever displacement/reaction의 tolerance와 maximum error
|
||||
- contract-only: synthetic internal-force/stress CSV schema와 component mapping
|
||||
- 미제공 Abaqus internal-force/stress는 `not yet Abaqus-qualified`라고 명시한다.
|
||||
- Abaqus correlation: 현재 cantilever displacement/reaction/internal-force의
|
||||
component별 RMSE와 Relative L2
|
||||
- contract-only: synthetic stress CSV schema와 component mapping
|
||||
- 미제공 Abaqus stress는 `not yet Abaqus-qualified`라고 명시한다.
|
||||
|
||||
보고서 수치를 새 test output에서 수집하며 수동 추정값을 쓰지 않는다.
|
||||
|
||||
@@ -34,18 +35,18 @@ ctest --preset windows-debug --output-on-failure
|
||||
ctest --preset windows-debug -R "Reference|Beam3D2|Determinism" --output-on-failure
|
||||
```
|
||||
|
||||
모든 실행이 통과하고 보고서의 test 이름, tolerance, 최대오차와 disposition이 실제
|
||||
출력과 일치해야 한다.
|
||||
모든 실행이 통과하고 보고서의 test 이름, component별 RMSE·Relative L2와
|
||||
disposition이 실제 출력과 일치해야 한다.
|
||||
|
||||
## 검증 절차
|
||||
|
||||
1. 전체 suite를 새로 실행한다.
|
||||
2. 결과를 benchmark/quantity별 표에 기록한다.
|
||||
3. synthetic coverage와 Abaqus-backed qualification을 명확히 분리한다.
|
||||
3. FESA 정식화 gate, Abaqus correlation 및 synthetic coverage를 명확히 분리한다.
|
||||
4. index summary에 보고서 경로와 test counts를 기록한다.
|
||||
|
||||
## 금지사항
|
||||
|
||||
- 실행하지 않은 결과를 보고서에 쓰지 마라. 이유: 검증 증거가 아니다.
|
||||
- Abaqus 내력/응력 qualification을 추론하지 마라. 이유: CSV가 아직 없다.
|
||||
- Abaqus 응력 qualification을 추론하지 마라. 이유: CSV가 아직 없다.
|
||||
- 실패 테스트를 제외하거나 disable하지 마라. 이유: release gate를 약화한다.
|
||||
|
||||
@@ -5,17 +5,28 @@
|
||||
{
|
||||
"step": 0,
|
||||
"name": "canonical-contribution-order",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added canonical MatrixContribution ordering and deterministic upper-triangle CSR merge with bitwise permutation, cancellation, signed-zero, and serial-oracle coverage.",
|
||||
"started_at": "2026-08-01T22:17:55+0900",
|
||||
"completed_at": "2026-08-01T23:06:21+0900"
|
||||
},
|
||||
{
|
||||
"step": 1,
|
||||
"name": "tbb-element-evaluation",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added AssemblyOptions and oneTBB Beam element evaluation with element-local contributions, canonical serial merge, explicit execution limits, and bitwise serial parity tests.",
|
||||
"started_at": "2026-08-01T23:06:22+0900",
|
||||
"completed_at": "2026-08-01T23:21:27+0900"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"name": "thread-count-determinism",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added 10-run bitwise CSR, RHS, displacement, and reaction checks at 1, 2, and 16 threads plus a production serial/parallel assembly benchmark.",
|
||||
"started_at": "2026-08-01T23:21:27+0900",
|
||||
"completed_at": "2026-08-01T23:36:17+0900"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"created_at": "2026-08-01T22:17:55+0900",
|
||||
"completed_at": "2026-08-01T23:36:18+0900"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+11
-6
@@ -22,27 +22,32 @@
|
||||
},
|
||||
{
|
||||
"dir": "results-and-pipeline",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"completed_at": "2026-08-01T01:11:01+0900"
|
||||
},
|
||||
{
|
||||
"dir": "abaqus-subset-completion",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"completed_at": "2026-08-01T03:23:25+0900"
|
||||
},
|
||||
{
|
||||
"dir": "deterministic-parallel-assembly",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"completed_at": "2026-08-01T23:36:18+0900"
|
||||
},
|
||||
{
|
||||
"dir": "result-contract-completion",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"completed_at": "2026-08-02T01:51:25+0900"
|
||||
},
|
||||
{
|
||||
"dir": "beam-reference-qualification",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"completed_at": "2026-08-03T01:48:16+0900"
|
||||
},
|
||||
{
|
||||
"dir": "internal-release",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,17 +5,28 @@
|
||||
{
|
||||
"step": 0,
|
||||
"name": "beam-element-end-recovery",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added actual Beam node IDs and signed two-end strain, resultant, centroid/recovery-point stress recovery using the stiffness frame and reduced-shear convention, with hand-calculated tests.",
|
||||
"started_at": "2026-08-02T00:27:47+0900",
|
||||
"completed_at": "2026-08-02T01:14:40+0900"
|
||||
},
|
||||
{
|
||||
"step": 1,
|
||||
"name": "complete-result-contract",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Added nodal and Beam element provenance, explicit field metadata and validation, and production element-end recovery orchestration in LinearStaticAnalysis.",
|
||||
"started_at": "2026-08-02T01:14:43+0900",
|
||||
"completed_at": "2026-08-02T01:28:37+0900"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"name": "self-contained-hdf5",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"summary": "Defined schema 2.0.0 and completed self-contained HDF5 model, analysis, nodal/Beam result, diagnostic writer/reader round trips with strict metadata and version validation.",
|
||||
"started_at": "2026-08-02T01:28:37+0900",
|
||||
"completed_at": "2026-08-02T01:51:24+0900"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"created_at": "2026-08-02T00:27:47+0900",
|
||||
"completed_at": "2026-08-02T01:51:25+0900"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,22 +5,36 @@
|
||||
{
|
||||
"step": 0,
|
||||
"name": "result-database",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"started_at": "2026-08-01T00:01:45+0900",
|
||||
"summary": "Added HDF5-independent nodal result aggregates and results-stage validation for sizes, duplicate nodes/steps/frames, and finite values with focused tests.",
|
||||
"completed_at": "2026-08-01T00:14:53+0900"
|
||||
},
|
||||
{
|
||||
"step": 1,
|
||||
"name": "minimal-hdf5-schema",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"started_at": "2026-08-01T00:14:54+0900",
|
||||
"summary": "Documented HDF5 schema 1.0.0 and added a move-only RAII writer/public reader round trip for model identity, connectivity, shear provenance, and nodal results.",
|
||||
"completed_at": "2026-08-01T00:51:34+0900"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"name": "linear-static-analysis",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"started_at": "2026-08-01T00:51:34+0900",
|
||||
"summary": "Added LinearStaticAnalysis orchestration through serial assembly, BC elimination, PARDISO with an all-constrained bypass, reaction recovery, and deterministic nodal results with equilibrium tests.",
|
||||
"completed_at": "2026-08-01T01:01:15+0900"
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"name": "cli-pipeline-integration",
|
||||
"status": "pending"
|
||||
"status": "completed",
|
||||
"started_at": "2026-08-01T01:01:16+0900",
|
||||
"summary": "Added public run_solver orchestration and the solve CLI with source-preserving diagnostics, plus end-to-end HDF5 pipeline tests.",
|
||||
"completed_at": "2026-08-01T01:11:00+0900"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"created_at": "2026-08-01T00:01:45+0900",
|
||||
"completed_at": "2026-08-01T01:11:01+0900"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,12 +1,12 @@
|
||||
Node Label, U-U1, U-U2, U-U3, UR-UR1, UR-UR2, UR-UR3
|
||||
1,0,0,-1.00E-32,0,1.00E-31,0
|
||||
2,0,0,-2.87E-06,0,5.43E-06,0
|
||||
3,0,0,-1.09E-05,0,1.03E-05,0
|
||||
4,0,0,-2.35E-05,0,1.46E-05,0
|
||||
5,0,0,-4.00E-05,0,1.83E-05,0
|
||||
6,0,0,-6.01E-05,0,2.14E-05,0
|
||||
7,0,0,-8.29E-05,0,2.40E-05,0
|
||||
8,0,0,-1.08E-04,0,2.60E-05,0
|
||||
9,0,0,-1.35E-04,0,2.74E-05,0
|
||||
10,0,0,-1.63E-04,0,2.83E-05,0
|
||||
11,0,0,-1.92E-04,0,2.86E-05,0
|
||||
Part Instance Name, Node Label, U-U1, U-U2, U-U3, UR-UR1, UR-UR2, UR-UR3
|
||||
PART-1_1-1,1,0.000000E+00,0.000000E+00,-1.000000E-30,0.000000E+00,1.000000E-29,0.000000E+00
|
||||
PART-1_1-1,2,0.000000E+00,0.000000E+00,-2.900000E-04,0.000000E+00,5.428570E-04,0.000000E+00
|
||||
PART-1_1-1,3,0.000000E+00,0.000000E+00,-1.094290E-03,0.000000E+00,1.028570E-03,0.000000E+00
|
||||
PART-1_1-1,4,0.000000E+00,0.000000E+00,-2.355720E-03,0.000000E+00,1.457140E-03,0.000000E+00
|
||||
PART-1_1-1,5,0.000000E+00,0.000000E+00,-4.017140E-03,0.000000E+00,1.828570E-03,0.000000E+00
|
||||
PART-1_1-1,6,0.000000E+00,0.000000E+00,-6.021430E-03,0.000000E+00,2.142860E-03,0.000000E+00
|
||||
PART-1_1-1,7,0.000000E+00,0.000000E+00,-8.311430E-03,0.000000E+00,2.400000E-03,0.000000E+00
|
||||
PART-1_1-1,8,0.000000E+00,0.000000E+00,-1.083000E-02,0.000000E+00,2.600000E-03,0.000000E+00
|
||||
PART-1_1-1,9,0.000000E+00,0.000000E+00,-1.352000E-02,0.000000E+00,2.742860E-03,0.000000E+00
|
||||
PART-1_1-1,10,0.000000E+00,0.000000E+00,-1.632430E-02,0.000000E+00,2.828570E-03,0.000000E+00
|
||||
PART-1_1-1,11,0.000000E+00,0.000000E+00,-1.918570E-02,0.000000E+00,2.857140E-03,0.000000E+00
|
||||
|
||||
|
@@ -0,0 +1,21 @@
|
||||
Part Instance Name, Element Label, Node Label, SF-SF1, SF-SF2, SF-SF3, SM-SM1, SM-SM2, SM-SM3,,,,,
|
||||
PART-1_1-1,1,1,0.000000E+00,-1.000000E+06,0.000000E+00,9.500000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,1,2,0.000000E+00,-1.000000E+06,0.000000E+00,9.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,2,2,0.000000E+00,-1.000000E+06,0.000000E+00,9.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,2,3,0.000000E+00,-1.000000E+06,0.000000E+00,8.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,3,3,0.000000E+00,-1.000000E+06,0.000000E+00,8.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,3,4,0.000000E+00,-1.000000E+06,0.000000E+00,7.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,4,4,0.000000E+00,-1.000000E+06,0.000000E+00,7.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,4,5,0.000000E+00,-1.000000E+06,0.000000E+00,6.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,5,5,0.000000E+00,-1.000000E+06,0.000000E+00,6.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,5,6,0.000000E+00,-1.000000E+06,0.000000E+00,5.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,6,6,0.000000E+00,-1.000000E+06,0.000000E+00,5.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,6,7,0.000000E+00,-1.000000E+06,0.000000E+00,4.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,7,7,0.000000E+00,-1.000000E+06,0.000000E+00,4.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,7,8,0.000000E+00,-1.000000E+06,0.000000E+00,3.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,8,8,0.000000E+00,-1.000000E+06,0.000000E+00,3.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,8,9,0.000000E+00,-1.000000E+06,0.000000E+00,2.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,9,9,0.000000E+00,-1.000000E+06,0.000000E+00,2.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,9,10,0.000000E+00,-1.000000E+06,0.000000E+00,1.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,10,10,0.000000E+00,-1.000000E+06,0.000000E+00,1.000000E+06,0.000000E+00,0.000000E+00,,,,,
|
||||
PART-1_1-1,10,11,0.000000E+00,-1.000000E+06,0.000000E+00,5.000000E+05,0.000000E+00,0.000000E+00,,,,,
|
||||
|
+5
-46
@@ -1,10 +1,8 @@
|
||||
*Heading
|
||||
** Job name: Job-1 Model name: Model-1
|
||||
** Generated by: Abaqus/CAE Learning Edition 2024
|
||||
** FESA projection of the Abaqus 2024 cantilever reference model.
|
||||
** Geometry, material, section, boundary conditions, and load are unchanged.
|
||||
** SCF is set to zero because FESA does not use Abaqus slenderness compensation.
|
||||
*Preprint, echo=NO, model=NO, history=NO, contact=NO
|
||||
**
|
||||
** PARTS
|
||||
**
|
||||
*Part, name=PART-1_1
|
||||
*Node
|
||||
1, 0., 0., 0.
|
||||
@@ -31,37 +29,23 @@
|
||||
10, 10, 11
|
||||
*Elset, elset=Set-1, generate
|
||||
1, 10, 1
|
||||
*Elset, elset=Set-2, generate
|
||||
1, 10, 1
|
||||
** Section: Section-1 Profile: Profile-1
|
||||
*Beam General Section, elset=Set-1, material=Material-1, section=GENERAL
|
||||
1., 0.0833333, 0., 0.0833333, 0.140833
|
||||
0.,1.,0.
|
||||
*Transverse Shear Stiffness
|
||||
6.73077e+10, 6.73077e+10, 0.
|
||||
*End Part
|
||||
**
|
||||
**
|
||||
** ASSEMBLY
|
||||
**
|
||||
*Assembly, name=Assembly
|
||||
**
|
||||
*Instance, name=PART-1_1-1, part=PART-1_1
|
||||
*End Instance
|
||||
**
|
||||
*Nset, nset=Set-3, instance=PART-1_1-1
|
||||
1,
|
||||
*Nset, nset=Set-4, instance=PART-1_1-1
|
||||
11,
|
||||
*End Assembly
|
||||
**
|
||||
** MATERIALS
|
||||
**
|
||||
*Material, name=Material-1
|
||||
*Elastic
|
||||
2.1e+11, 0.3
|
||||
**
|
||||
** BOUNDARY CONDITIONS
|
||||
**
|
||||
** Name: BC-1 Type: Displacement/Rotation
|
||||
*Boundary
|
||||
Set-3, 1, 1
|
||||
Set-3, 2, 2
|
||||
@@ -69,34 +53,9 @@ Set-3, 3, 3
|
||||
Set-3, 4, 4
|
||||
Set-3, 5, 5
|
||||
Set-3, 6, 6
|
||||
** ----------------------------------------------------------------
|
||||
**
|
||||
** STEP: Step-1
|
||||
**
|
||||
*Step, name=Step-1, nlgeom=NO
|
||||
*Static
|
||||
1., 1., 1e-05, 1.
|
||||
**
|
||||
** LOADS
|
||||
**
|
||||
** Name: Load-1 Type: Concentrated force
|
||||
*Cload
|
||||
Set-4, 3, -1e+06
|
||||
**
|
||||
** OUTPUT REQUESTS
|
||||
**
|
||||
*Restart, write, frequency=0
|
||||
**
|
||||
** FIELD OUTPUT: F-Output-1
|
||||
**
|
||||
*Output, field
|
||||
*Node Output
|
||||
CF, RF, TF, U
|
||||
*Element Output, directions=YES
|
||||
LE, NFORC, NFORCSO, PE, PEEQ, PEMAG, S, SF
|
||||
*Contact Output, variable=PRESELECT
|
||||
**
|
||||
** HISTORY OUTPUT: H-Output-1
|
||||
**
|
||||
*Output, history, variable=PRESELECT
|
||||
*End Step
|
||||
@@ -1,12 +1,12 @@
|
||||
Node Label, RF-RF1, RF-RF2, RF-RF3, RM-RM1, RM-RM2, RM-RM3
|
||||
1,0,0,1.00E+04,0,-1.00E+05,0
|
||||
2,0,0,0,0,0,0
|
||||
3,0,0,0,0,0,0
|
||||
4,0,0,0,0,0,0
|
||||
5,0,0,0,0,0,0
|
||||
6,0,0,0,0,0,0
|
||||
7,0,0,0,0,0,0
|
||||
8,0,0,0,0,0,0
|
||||
9,0,0,0,0,0,0
|
||||
10,0,0,0,0,0,0
|
||||
11,0,0,0,0,0,0
|
||||
Part Instance Name, Node Label, RF-RF1, RF-RF2, RF-RF3, RM-RM1, RM-RM2, RM-RM3
|
||||
PART-1_1-1,1,0.000000E+00,0.000000E+00,1.000000E+06,0.000000E+00,-1.000000E+07,0.000000E+00
|
||||
PART-1_1-1,2,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,3,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,4,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,5,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,6,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,7,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,8,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,9,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,10,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
PART-1_1-1,11,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00,0.000000E+00
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
**
|
||||
** PARTS
|
||||
**
|
||||
*Part, name=Part-1
|
||||
*Part, name=PART-1_1
|
||||
*Node
|
||||
1, 0., 0., 0.
|
||||
2, 1., 0., 0.
|
||||
@@ -29,18 +29,16 @@
|
||||
8, 8, 9
|
||||
9, 9, 10
|
||||
10, 10, 11
|
||||
*Nset, nset=Set-1, generate
|
||||
1, 11, 1
|
||||
*Elset, elset=Set-1, generate
|
||||
1, 10, 1
|
||||
*Nset, nset=Set-2, generate
|
||||
1, 11, 1
|
||||
*Elset, elset=Set-2, generate
|
||||
1, 10, 1
|
||||
** Section: Section-1 Profile: Profile-1
|
||||
*Beam General Section, elset=Set-1, material=Material-1, section=GENERAL
|
||||
1., 0.0833333, 0., 0.0833333, 0.140833
|
||||
0.,1.,0.
|
||||
*Transverse Shear Stiffness
|
||||
6.73077e+10, 6.73077e+10, 0.25
|
||||
*End Part
|
||||
**
|
||||
**
|
||||
@@ -48,13 +46,13 @@
|
||||
**
|
||||
*Assembly, name=Assembly
|
||||
**
|
||||
*Instance, name=Part-1-1, part=Part-1
|
||||
*Instance, name=PART-1_1-1, part=PART-1_1
|
||||
*End Instance
|
||||
**
|
||||
*Nset, nset=Set-1, instance=Part-1-1
|
||||
11,
|
||||
*Nset, nset=Set-2, instance=Part-1-1
|
||||
*Nset, nset=Set-3, instance=PART-1_1-1
|
||||
1,
|
||||
*Nset, nset=Set-4, instance=PART-1_1-1
|
||||
11,
|
||||
*End Assembly
|
||||
**
|
||||
** MATERIALS
|
||||
@@ -62,6 +60,17 @@
|
||||
*Material, name=Material-1
|
||||
*Elastic
|
||||
2.1e+11, 0.3
|
||||
**
|
||||
** BOUNDARY CONDITIONS
|
||||
**
|
||||
** Name: BC-1 Type: Displacement/Rotation
|
||||
*Boundary
|
||||
Set-3, 1, 1
|
||||
Set-3, 2, 2
|
||||
Set-3, 3, 3
|
||||
Set-3, 4, 4
|
||||
Set-3, 5, 5
|
||||
Set-3, 6, 6
|
||||
** ----------------------------------------------------------------
|
||||
**
|
||||
** STEP: Step-1
|
||||
@@ -70,22 +79,11 @@
|
||||
*Static
|
||||
1., 1., 1e-05, 1.
|
||||
**
|
||||
** BOUNDARY CONDITIONS
|
||||
**
|
||||
** Name: BC-1 Type: Displacement/Rotation
|
||||
*Boundary
|
||||
Set-2, 1, 1
|
||||
Set-2, 2, 2
|
||||
Set-2, 3, 3
|
||||
Set-2, 4, 4
|
||||
Set-2, 5, 5
|
||||
Set-2, 6, 6
|
||||
**
|
||||
** LOADS
|
||||
**
|
||||
** Name: Load-1 Type: Concentrated force
|
||||
*Cload
|
||||
Set-1, 3, -10000.
|
||||
Set-4, 3, -1e+06
|
||||
**
|
||||
** OUTPUT REQUESTS
|
||||
**
|
||||
@@ -93,7 +91,12 @@ Set-1, 3, -10000.
|
||||
**
|
||||
** FIELD OUTPUT: F-Output-1
|
||||
**
|
||||
*Output, field, variable=PRESELECT
|
||||
*Output, field
|
||||
*Node Output
|
||||
CF, RF, TF, U
|
||||
*Element Output, directions=YES
|
||||
LE, NFORC, NFORCSO, PE, PEEQ, PEMAG, S, SF
|
||||
*Contact Output, variable=PRESELECT
|
||||
**
|
||||
** HISTORY OUTPUT: H-Output-1
|
||||
**
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
#include <fesa/analysis/linear_static_analysis.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/assembly/equation_system.hpp>
|
||||
#include <fesa/assembly/serial_assembler.hpp>
|
||||
#include <fesa/constraints/essential_bc.hpp>
|
||||
#include <fesa/elements/beam/beam3d2.hpp>
|
||||
#include <fesa/fem/dof_manager.hpp>
|
||||
#include <fesa/solvers/linear/pardiso_linear_solver.hpp>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
AnalysisRunResult failure(std::vector<Diagnostic> diagnostics) {
|
||||
return {false, std::nullopt, std::move(diagnostics)};
|
||||
}
|
||||
|
||||
AnalysisRunResult equation_failure(
|
||||
std::string code,
|
||||
std::string message) {
|
||||
return failure({{
|
||||
DiagnosticStage::equation,
|
||||
Severity::error,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
std::nullopt,
|
||||
}});
|
||||
}
|
||||
|
||||
AnalysisRunResult results_failure(
|
||||
std::string code,
|
||||
std::string message) {
|
||||
return failure({{
|
||||
DiagnosticStage::results,
|
||||
Severity::error,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
std::nullopt,
|
||||
}});
|
||||
}
|
||||
|
||||
NodalFrame build_nodal_frame(
|
||||
const Domain& domain,
|
||||
const DofManager& dofs,
|
||||
const std::vector<double>& displacement,
|
||||
const std::vector<double>& reaction) {
|
||||
std::vector<NodeId> node_ids;
|
||||
node_ids.reserve(domain.nodes().size());
|
||||
for (const Node& node : domain.nodes()) {
|
||||
node_ids.push_back(node.id);
|
||||
}
|
||||
std::ranges::sort(node_ids);
|
||||
|
||||
NodalFrame nodal;
|
||||
nodal.node_ids = std::move(node_ids);
|
||||
nodal.origins.reserve(nodal.node_ids.size());
|
||||
nodal.displacement.reserve(nodal.node_ids.size());
|
||||
nodal.reaction.reserve(nodal.node_ids.size());
|
||||
for (const NodeId node_id : nodal.node_ids) {
|
||||
nodal.origins.push_back(domain.node(node_id).origin);
|
||||
std::array<double, 6> node_displacement{};
|
||||
std::array<double, 6> node_reaction{};
|
||||
for (std::size_t component = 0; component < 6; ++component) {
|
||||
const std::size_t full_dof = dofs.full_dof({
|
||||
node_id,
|
||||
static_cast<NodeDof>(component),
|
||||
});
|
||||
node_displacement[component] = displacement[full_dof];
|
||||
node_reaction[component] = reaction[full_dof];
|
||||
}
|
||||
nodal.displacement.push_back(node_displacement);
|
||||
nodal.reaction.push_back(node_reaction);
|
||||
}
|
||||
return nodal;
|
||||
}
|
||||
|
||||
ElementFrame build_element_frame(
|
||||
const Domain& domain,
|
||||
const DofManager& dofs,
|
||||
const std::vector<double>& displacement) {
|
||||
std::vector<const BeamElement*> elements;
|
||||
elements.reserve(domain.beam_elements().size());
|
||||
for (const BeamElement& element : domain.beam_elements()) {
|
||||
elements.push_back(&element);
|
||||
}
|
||||
std::ranges::sort(
|
||||
elements,
|
||||
{},
|
||||
[](const BeamElement* element) {
|
||||
return element->id.value();
|
||||
});
|
||||
|
||||
ElementFrame frame;
|
||||
frame.beams.reserve(elements.size());
|
||||
for (const BeamElement* element : elements) {
|
||||
const Beam3D2Input input{
|
||||
{
|
||||
domain.node(element->nodes[0]).position,
|
||||
domain.node(element->nodes[1]).position,
|
||||
},
|
||||
element->nodes,
|
||||
domain.material(element->material),
|
||||
domain.section(element->section),
|
||||
};
|
||||
const BeamKernelResult kernel = compute_beam3d2(input);
|
||||
if (!kernel.contribution.has_value()) {
|
||||
const std::string message = kernel.diagnostics.empty()
|
||||
? "Beam recovery requires a valid element input."
|
||||
: kernel.diagnostics.front().message;
|
||||
throw std::runtime_error{message};
|
||||
}
|
||||
|
||||
std::array<double, 12> element_displacement{};
|
||||
const std::array<std::size_t, 12> full_dofs =
|
||||
dofs.element_full_dofs(*element);
|
||||
for (std::size_t local = 0; local < full_dofs.size(); ++local) {
|
||||
element_displacement[local] = displacement[full_dofs[local]];
|
||||
}
|
||||
std::vector<BeamSectionResult> recovered = recover_beam3d2(
|
||||
input,
|
||||
element_displacement,
|
||||
input.section.recovery_points);
|
||||
if (recovered.size() != 2U) {
|
||||
throw std::logic_error{
|
||||
"Beam recovery must return exactly two end results."};
|
||||
}
|
||||
|
||||
frame.beams.push_back({
|
||||
element->id,
|
||||
element->origin,
|
||||
kernel.contribution->frame,
|
||||
{
|
||||
std::move(recovered[0]),
|
||||
std::move(recovered[1]),
|
||||
},
|
||||
});
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
AnalysisRunResult LinearStaticAnalysis::run(const Domain& domain) const {
|
||||
const DofManager dofs = DofManager::build(domain);
|
||||
|
||||
std::optional<EquationSystem> original;
|
||||
try {
|
||||
original = assemble_serial(domain, dofs);
|
||||
} catch (const std::exception& error) {
|
||||
return equation_failure(
|
||||
"equation.assembly_failed", error.what());
|
||||
}
|
||||
|
||||
ConstraintResult constrained =
|
||||
eliminate_essential_bcs(*original, dofs);
|
||||
if (!constrained.reduced_system.has_value()) {
|
||||
return failure(std::move(constrained.diagnostics));
|
||||
}
|
||||
|
||||
std::vector<double> reduced_solution;
|
||||
if (dofs.free_equation_count() != 0) {
|
||||
PardisoLinearSolver solver;
|
||||
LinearSolveResult solved = solver.solve(
|
||||
constrained.reduced_system->stiffness,
|
||||
constrained.reduced_system->force);
|
||||
if (!solved.diagnostics.empty()) {
|
||||
return failure(std::move(solved.diagnostics));
|
||||
}
|
||||
reduced_solution = std::move(solved.solution);
|
||||
}
|
||||
|
||||
std::vector<double> displacement;
|
||||
try {
|
||||
displacement = dofs.reconstruct_full(reduced_solution);
|
||||
} catch (const std::exception& error) {
|
||||
return equation_failure(
|
||||
"equation.solution_reconstruction_failed", error.what());
|
||||
}
|
||||
|
||||
std::vector<double> reaction;
|
||||
try {
|
||||
reaction = recover_reaction(*original, displacement);
|
||||
} catch (const std::exception& error) {
|
||||
return equation_failure(
|
||||
"equation.reaction_recovery_failed", error.what());
|
||||
}
|
||||
|
||||
ElementFrame element;
|
||||
try {
|
||||
element = build_element_frame(domain, dofs, displacement);
|
||||
} catch (const std::exception& error) {
|
||||
return results_failure(
|
||||
"results.element_recovery_failed", error.what());
|
||||
}
|
||||
|
||||
ResultDatabase database{
|
||||
"2.0.0",
|
||||
{{
|
||||
domain.step().name,
|
||||
{{
|
||||
1.0,
|
||||
build_nodal_frame(
|
||||
domain, dofs, displacement, reaction),
|
||||
std::move(element),
|
||||
{},
|
||||
}},
|
||||
}},
|
||||
};
|
||||
Status status = validate_result_database(database);
|
||||
if (!status.succeeded) {
|
||||
return failure(std::move(status.diagnostics));
|
||||
}
|
||||
|
||||
return {true, std::move(database), {}};
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,51 @@
|
||||
#include <fesa/analysis/run_solver.hpp>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <fesa/io/abaqus/parser.hpp>
|
||||
#include <fesa/io/abaqus/semantic_mapper.hpp>
|
||||
#include <fesa/io/hdf5/writer.hpp>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
std::string path_utf8(const std::filesystem::path& path) {
|
||||
const std::u8string value = path.u8string();
|
||||
return {reinterpret_cast<const char*>(value.data()), value.size()};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
AnalysisRunResult run_solver(const AnalysisRequest& request) {
|
||||
ParseDeckResult parsed = parse_deck(request.input_path);
|
||||
if (!parsed.deck.has_value()) {
|
||||
return {false, std::nullopt, std::move(parsed.diagnostics)};
|
||||
}
|
||||
|
||||
DomainBuildResult mapped = map_deck_to_domain(*parsed.deck);
|
||||
if (!mapped.domain.has_value()) {
|
||||
return {false, std::nullopt, std::move(mapped.diagnostics)};
|
||||
}
|
||||
|
||||
const Hdf5InputIdentity identity{
|
||||
path_utf8(request.input_path),
|
||||
parsed.input_fingerprint,
|
||||
};
|
||||
|
||||
AnalysisRunResult run = LinearStaticAnalysis{}.run(*mapped.domain);
|
||||
if (!run.succeeded || !run.results.has_value()) {
|
||||
return run;
|
||||
}
|
||||
|
||||
std::vector<Diagnostic> write_diagnostics = write_hdf5(
|
||||
request.output_path, *mapped.domain, *run.results, identity);
|
||||
if (!write_diagnostics.empty()) {
|
||||
return {false, std::nullopt, std::move(write_diagnostics)};
|
||||
}
|
||||
|
||||
return run;
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,132 @@
|
||||
#include <fesa/assembly/contribution.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
std::int32_t csr_index(const std::size_t value) {
|
||||
if (value >
|
||||
static_cast<std::size_t>(
|
||||
std::numeric_limits<std::int32_t>::max())) {
|
||||
throw std::overflow_error{
|
||||
"Symmetric CSR exceeds the 32-bit index range."};
|
||||
}
|
||||
return static_cast<std::int32_t>(value);
|
||||
}
|
||||
|
||||
bool contribution_less(
|
||||
const MatrixContribution& left,
|
||||
const MatrixContribution& right) {
|
||||
return std::tuple{
|
||||
left.row,
|
||||
left.column,
|
||||
left.element,
|
||||
left.local_order} <
|
||||
std::tuple{
|
||||
right.row,
|
||||
right.column,
|
||||
right.element,
|
||||
right.local_order};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
std::vector<MatrixContribution> canonicalize_contributions(
|
||||
const std::span<const MatrixContribution> contributions) {
|
||||
std::vector<MatrixContribution> canonical{
|
||||
contributions.begin(), contributions.end()};
|
||||
std::ranges::sort(canonical, contribution_less);
|
||||
return canonical;
|
||||
}
|
||||
|
||||
SymmetricCsr merge_contributions(
|
||||
const std::size_t order,
|
||||
const std::span<const MatrixContribution> canonical) {
|
||||
if (!std::ranges::is_sorted(canonical, contribution_less)) {
|
||||
throw std::invalid_argument{
|
||||
"Matrix contributions are not in canonical order."};
|
||||
}
|
||||
|
||||
using Coordinate = std::pair<std::size_t, std::size_t>;
|
||||
std::vector<Coordinate> coordinates;
|
||||
coordinates.reserve(order + canonical.size());
|
||||
for (std::size_t row = 0; row < order; ++row) {
|
||||
coordinates.emplace_back(row, row);
|
||||
}
|
||||
for (const MatrixContribution& contribution : canonical) {
|
||||
if (contribution.row > contribution.column ||
|
||||
contribution.column >= order) {
|
||||
throw std::invalid_argument{
|
||||
"Matrix contribution is outside the upper triangle."};
|
||||
}
|
||||
coordinates.emplace_back(
|
||||
contribution.row, contribution.column);
|
||||
}
|
||||
|
||||
std::ranges::sort(coordinates);
|
||||
coordinates.erase(
|
||||
std::ranges::unique(coordinates).begin(),
|
||||
coordinates.end());
|
||||
|
||||
SymmetricCsr matrix{
|
||||
order,
|
||||
std::vector<std::int32_t>(order + 1, 0),
|
||||
{},
|
||||
{},
|
||||
};
|
||||
matrix.column_indices.reserve(coordinates.size());
|
||||
for (const auto [row, column] : coordinates) {
|
||||
++matrix.row_offsets[row + 1];
|
||||
matrix.column_indices.push_back(csr_index(column));
|
||||
}
|
||||
for (std::size_t row = 0; row < order; ++row) {
|
||||
const std::size_t offset =
|
||||
static_cast<std::size_t>(matrix.row_offsets[row]) +
|
||||
static_cast<std::size_t>(matrix.row_offsets[row + 1]);
|
||||
matrix.row_offsets[row + 1] = csr_index(offset);
|
||||
}
|
||||
matrix.values.resize(matrix.column_indices.size(), 0.0);
|
||||
|
||||
std::size_t contribution_index = 0;
|
||||
while (contribution_index < canonical.size()) {
|
||||
const MatrixContribution& first =
|
||||
canonical[contribution_index];
|
||||
double value = 0.0;
|
||||
do {
|
||||
value += canonical[contribution_index].value;
|
||||
++contribution_index;
|
||||
} while (
|
||||
contribution_index < canonical.size() &&
|
||||
canonical[contribution_index].row == first.row &&
|
||||
canonical[contribution_index].column == first.column);
|
||||
|
||||
const auto row_begin =
|
||||
matrix.column_indices.begin() + matrix.row_offsets[first.row];
|
||||
const auto row_end =
|
||||
matrix.column_indices.begin() +
|
||||
matrix.row_offsets[first.row + 1];
|
||||
const auto entry = std::lower_bound(
|
||||
row_begin,
|
||||
row_end,
|
||||
csr_index(first.column));
|
||||
if (entry == row_end || *entry != csr_index(first.column)) {
|
||||
throw std::logic_error{
|
||||
"Numeric contribution is absent from the CSR pattern."};
|
||||
}
|
||||
matrix.values[static_cast<std::size_t>(
|
||||
std::distance(matrix.column_indices.begin(), entry))] = value;
|
||||
}
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,209 @@
|
||||
#include <fesa/assembly/assembler.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <numeric>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/assembly/contribution.hpp>
|
||||
#include <fesa/elements/beam/beam3d2.hpp>
|
||||
|
||||
#include <oneapi/tbb/blocked_range.h>
|
||||
#include <oneapi/tbb/parallel_for.h>
|
||||
#include <oneapi/tbb/task_arena.h>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
struct ElementEvaluation final {
|
||||
std::vector<MatrixContribution> contributions;
|
||||
std::optional<std::string> error;
|
||||
};
|
||||
|
||||
auto origin_key(const EntityOrigin& origin) {
|
||||
return std::tie(
|
||||
origin.instance_name,
|
||||
origin.local_label,
|
||||
origin.part_name);
|
||||
}
|
||||
|
||||
std::string kernel_error_message(
|
||||
const BeamElement& element,
|
||||
const BeamKernelResult& result) {
|
||||
std::string message =
|
||||
"Beam element " + std::to_string(element.origin.local_label) +
|
||||
" kernel failed";
|
||||
for (const Diagnostic& diagnostic : result.diagnostics) {
|
||||
message += ": " + diagnostic.code + " - " + diagnostic.message;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
std::vector<std::size_t> canonical_element_order(const Domain& domain) {
|
||||
std::vector<std::size_t> order(domain.beam_elements().size());
|
||||
std::iota(order.begin(), order.end(), std::size_t{0});
|
||||
std::ranges::sort(
|
||||
order,
|
||||
[&domain](const std::size_t left, const std::size_t right) {
|
||||
return origin_key(domain.beam_elements()[left].origin) <
|
||||
origin_key(domain.beam_elements()[right].origin);
|
||||
});
|
||||
return order;
|
||||
}
|
||||
|
||||
std::vector<ElementId> canonical_contribution_element_ids(
|
||||
const std::vector<std::size_t>& order) {
|
||||
// Domain ElementIds are not ordered by input identity. These tie-break
|
||||
// IDs encode the existing serial assembler's element-origin order.
|
||||
std::vector<ElementId> ids(order.size(), ElementId{0});
|
||||
for (std::size_t rank = 0; rank < order.size(); ++rank) {
|
||||
ids[order[rank]] = ElementId{static_cast<std::int64_t>(rank)};
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
ElementEvaluation evaluate_element(
|
||||
const Domain& domain,
|
||||
const DofManager& dofs,
|
||||
const BeamElement& element,
|
||||
const ElementId canonical_id) {
|
||||
const BeamKernelResult result = compute_beam3d2({
|
||||
{
|
||||
domain.node(element.nodes[0]).position,
|
||||
domain.node(element.nodes[1]).position,
|
||||
},
|
||||
element.nodes,
|
||||
domain.material(element.material),
|
||||
domain.section(element.section),
|
||||
});
|
||||
if (!result.contribution.has_value()) {
|
||||
return {{}, kernel_error_message(element, result)};
|
||||
}
|
||||
|
||||
ElementEvaluation evaluation;
|
||||
evaluation.contributions.reserve(78);
|
||||
const std::array<std::size_t, 12> full_dofs =
|
||||
dofs.element_full_dofs(element);
|
||||
for (std::size_t local_row = 0; local_row < full_dofs.size();
|
||||
++local_row) {
|
||||
for (std::size_t local_column = local_row;
|
||||
local_column < full_dofs.size();
|
||||
++local_column) {
|
||||
evaluation.contributions.push_back({
|
||||
std::min(
|
||||
full_dofs[local_row],
|
||||
full_dofs[local_column]),
|
||||
std::max(
|
||||
full_dofs[local_row],
|
||||
full_dofs[local_column]),
|
||||
canonical_id,
|
||||
static_cast<std::uint16_t>(
|
||||
local_row * full_dofs.size() + local_column),
|
||||
result.contribution
|
||||
->global_stiffness[local_row][local_column],
|
||||
});
|
||||
}
|
||||
}
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
std::vector<double> assemble_force(
|
||||
const Domain& domain,
|
||||
const DofManager& dofs) {
|
||||
std::vector<double> force(dofs.full_dof_count(), 0.0);
|
||||
for (const NodalLoad& load : domain.step().nodal_loads) {
|
||||
for (std::size_t component = 0; component < load.values.size();
|
||||
++component) {
|
||||
const auto dof = static_cast<NodeDof>(component);
|
||||
force[dofs.full_dof({load.node, dof})] +=
|
||||
load.values[component];
|
||||
}
|
||||
}
|
||||
return force;
|
||||
}
|
||||
|
||||
void validate_options(const AssemblyOptions options) {
|
||||
if (options.max_threads == 0) {
|
||||
throw std::invalid_argument{
|
||||
"Assembly max_threads must be greater than zero."};
|
||||
}
|
||||
if (options.max_threads >
|
||||
static_cast<std::size_t>(std::numeric_limits<int>::max())) {
|
||||
throw std::invalid_argument{
|
||||
"Assembly max_threads exceeds the TBB task arena range."};
|
||||
}
|
||||
if (options.grain_size == 0) {
|
||||
throw std::invalid_argument{
|
||||
"Assembly grain_size must be greater than zero."};
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
EquationSystem assemble_parallel(
|
||||
const Domain& domain,
|
||||
const DofManager& dofs,
|
||||
const AssemblyOptions options) {
|
||||
validate_options(options);
|
||||
|
||||
const std::vector<std::size_t> element_order =
|
||||
canonical_element_order(domain);
|
||||
const std::vector<ElementId> element_ids =
|
||||
canonical_contribution_element_ids(element_order);
|
||||
std::vector<ElementEvaluation> evaluations(
|
||||
domain.beam_elements().size());
|
||||
|
||||
oneapi::tbb::task_arena arena{
|
||||
static_cast<int>(options.max_threads)};
|
||||
arena.execute([&] {
|
||||
oneapi::tbb::parallel_for(
|
||||
oneapi::tbb::blocked_range<std::size_t>{
|
||||
0,
|
||||
evaluations.size(),
|
||||
options.grain_size,
|
||||
},
|
||||
[&](const oneapi::tbb::blocked_range<std::size_t>& range) {
|
||||
for (std::size_t index = range.begin();
|
||||
index != range.end();
|
||||
++index) {
|
||||
ElementEvaluation local = evaluate_element(
|
||||
domain,
|
||||
dofs,
|
||||
domain.beam_elements()[index],
|
||||
element_ids[index]);
|
||||
evaluations[index] = std::move(local);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
std::vector<MatrixContribution> contributions;
|
||||
contributions.reserve(domain.beam_elements().size() * 78);
|
||||
for (const std::size_t element_index : element_order) {
|
||||
ElementEvaluation& evaluation = evaluations[element_index];
|
||||
if (evaluation.error.has_value()) {
|
||||
throw std::runtime_error{std::move(*evaluation.error)};
|
||||
}
|
||||
contributions.insert(
|
||||
contributions.end(),
|
||||
std::make_move_iterator(evaluation.contributions.begin()),
|
||||
std::make_move_iterator(evaluation.contributions.end()));
|
||||
}
|
||||
|
||||
const std::vector<MatrixContribution> canonical =
|
||||
canonicalize_contributions(contributions);
|
||||
return {
|
||||
merge_contributions(dofs.full_dof_count(), canonical),
|
||||
assemble_force(domain, dofs),
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
@@ -128,6 +128,7 @@ std::vector<NumericContribution> collect_numeric_contributions(
|
||||
domain.node(element.nodes[0]).position,
|
||||
domain.node(element.nodes[1]).position,
|
||||
},
|
||||
element.nodes,
|
||||
domain.material(element.material),
|
||||
domain.section(element.section),
|
||||
});
|
||||
|
||||
+62
-1
@@ -1,14 +1,75 @@
|
||||
#include <fesa/analysis/run_solver.hpp>
|
||||
#include <fesa/core/version.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace {
|
||||
|
||||
std::string_view stage_name(const fesa::DiagnosticStage stage) {
|
||||
switch (stage) {
|
||||
case fesa::DiagnosticStage::io:
|
||||
return "io";
|
||||
case fesa::DiagnosticStage::syntax:
|
||||
return "syntax";
|
||||
case fesa::DiagnosticStage::semantic:
|
||||
return "semantic";
|
||||
case fesa::DiagnosticStage::model:
|
||||
return "model";
|
||||
case fesa::DiagnosticStage::equation:
|
||||
return "equation";
|
||||
case fesa::DiagnosticStage::solver:
|
||||
return "solver";
|
||||
case fesa::DiagnosticStage::results:
|
||||
return "results";
|
||||
case fesa::DiagnosticStage::validation:
|
||||
return "validation";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
void print_diagnostic(const fesa::Diagnostic& diagnostic) {
|
||||
std::cerr << stage_name(diagnostic.stage) << " [" << diagnostic.code
|
||||
<< "]";
|
||||
if (diagnostic.source.has_value()) {
|
||||
const fesa::SourceLocation& source = *diagnostic.source;
|
||||
std::cerr << ' ' << source.file.string() << ':' << source.line << ':'
|
||||
<< source.column;
|
||||
}
|
||||
std::cerr << ": " << diagnostic.message << '\n';
|
||||
}
|
||||
|
||||
void print_usage() {
|
||||
std::cerr << "Usage:\n"
|
||||
<< " fesa solve <model.inp> --output <results.h5>\n"
|
||||
<< " fesa --version\n";
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc == 2 && std::string_view{argv[1]} == "--version") {
|
||||
std::cout << fesa::version() << '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::cerr << "Usage: fesa --version\n";
|
||||
if (argc == 5 && std::string_view{argv[1]} == "solve" &&
|
||||
std::string_view{argv[3]} == "--output") {
|
||||
const fesa::AnalysisRunResult result = fesa::run_solver({
|
||||
std::filesystem::path{argv[2]},
|
||||
std::filesystem::path{argv[4]},
|
||||
});
|
||||
if (result.succeeded) {
|
||||
return 0;
|
||||
}
|
||||
for (const fesa::Diagnostic& diagnostic : result.diagnostics) {
|
||||
print_diagnostic(diagnostic);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
print_usage();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/fem/gauss_rule.hpp>
|
||||
#include <fesa/fem/line2_shape.hpp>
|
||||
@@ -32,6 +34,20 @@ bool is_positive_finite(const double value) {
|
||||
return std::isfinite(value) && value > 0.0;
|
||||
}
|
||||
|
||||
std::array<double, 6> constitutive_values(
|
||||
const Beam3D2Input& input) {
|
||||
const double shear_modulus =
|
||||
input.material.young / (2.0 * (1.0 + input.material.poisson));
|
||||
return {
|
||||
input.material.young * input.section.area,
|
||||
shear_modulus * input.section.shear_area_y,
|
||||
shear_modulus * input.section.shear_area_z,
|
||||
shear_modulus * input.section.torsion_j,
|
||||
input.material.young * input.section.iy,
|
||||
input.material.young * input.section.iz,
|
||||
};
|
||||
}
|
||||
|
||||
std::optional<BeamKernelResult> validate_properties(
|
||||
const Beam3D2Input& input) {
|
||||
if (!std::isfinite(input.material.young) ||
|
||||
@@ -149,6 +165,34 @@ Matrix12 transform_stiffness(
|
||||
return global;
|
||||
}
|
||||
|
||||
std::array<double, 12> transform_displacement(
|
||||
const Matrix12& transformation,
|
||||
const std::span<const double, 12> global_displacement) {
|
||||
std::array<double, 12> local_displacement{};
|
||||
for (std::size_t row = 0; row < transformation.size(); ++row) {
|
||||
for (std::size_t column = 0;
|
||||
column < transformation[row].size();
|
||||
++column) {
|
||||
local_displacement[row] +=
|
||||
transformation[row][column] * global_displacement[column];
|
||||
}
|
||||
}
|
||||
return local_displacement;
|
||||
}
|
||||
|
||||
std::array<double, 6> evaluate_strain(
|
||||
const StrainMatrix& strain_matrix,
|
||||
const std::array<double, 12>& local_displacement) {
|
||||
std::array<double, 6> strain{};
|
||||
for (std::size_t component = 0; component < strain.size(); ++component) {
|
||||
for (std::size_t dof = 0; dof < local_displacement.size(); ++dof) {
|
||||
strain[component] +=
|
||||
strain_matrix[component][dof] * local_displacement[dof];
|
||||
}
|
||||
}
|
||||
return strain;
|
||||
}
|
||||
|
||||
bool is_finite(const Matrix12& matrix) {
|
||||
for (const auto& row : matrix) {
|
||||
for (const double value : row) {
|
||||
@@ -189,16 +233,8 @@ BeamKernelResult compute_beam3d2(const Beam3D2Input& input) {
|
||||
"Beam kernel requires a representable positive Jacobian.");
|
||||
}
|
||||
|
||||
const double shear_modulus =
|
||||
input.material.young / (2.0 * (1.0 + input.material.poisson));
|
||||
const std::array<double, 6> constitutive{
|
||||
input.material.young * input.section.area,
|
||||
shear_modulus * input.section.shear_area_y,
|
||||
shear_modulus * input.section.shear_area_z,
|
||||
shear_modulus * input.section.torsion_j,
|
||||
input.material.young * input.section.iy,
|
||||
input.material.young * input.section.iz,
|
||||
};
|
||||
const std::array<double, 6> constitutive =
|
||||
constitutive_values(input);
|
||||
for (const double value : constitutive) {
|
||||
if (!is_positive_finite(value)) {
|
||||
return error_result(
|
||||
@@ -241,4 +277,73 @@ BeamKernelResult compute_beam3d2(const Beam3D2Input& input) {
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<BeamSectionResult> recover_beam3d2(
|
||||
const Beam3D2Input& input,
|
||||
const std::span<const double, 12> element_displacement,
|
||||
const std::span<const std::array<double, 2>> recovery_points) {
|
||||
const BeamKernelResult kernel = compute_beam3d2(input);
|
||||
if (!kernel.contribution.has_value()) {
|
||||
const std::string message = kernel.diagnostics.empty()
|
||||
? "Beam recovery requires a valid Beam3D2 input."
|
||||
: kernel.diagnostics.front().message;
|
||||
throw std::invalid_argument{message};
|
||||
}
|
||||
|
||||
const Vec3 axis{
|
||||
input.coordinates[1].x - input.coordinates[0].x,
|
||||
input.coordinates[1].y - input.coordinates[0].y,
|
||||
input.coordinates[1].z - input.coordinates[0].z,
|
||||
};
|
||||
const double jacobian = std::hypot(axis.x, axis.y, axis.z) / 2.0;
|
||||
const Matrix12 transformation =
|
||||
beam_transformation(kernel.contribution->frame);
|
||||
const std::array<double, 12> local_displacement =
|
||||
transform_displacement(transformation, element_displacement);
|
||||
const std::array<double, 6> center_strain = evaluate_strain(
|
||||
strain_matrix(0.0, jacobian),
|
||||
local_displacement);
|
||||
const std::array<double, 6> constitutive =
|
||||
constitutive_values(input);
|
||||
|
||||
std::vector<BeamSectionResult> results;
|
||||
results.reserve(input.node_ids.size());
|
||||
for (std::size_t end = 0; end < input.node_ids.size(); ++end) {
|
||||
const double xi = end == 0 ? -1.0 : 1.0;
|
||||
std::array<double, 6> section_strain = evaluate_strain(
|
||||
strain_matrix(xi, jacobian),
|
||||
local_displacement);
|
||||
section_strain[1] = center_strain[1];
|
||||
section_strain[2] = center_strain[2];
|
||||
|
||||
std::array<double, 6> section_force{};
|
||||
for (std::size_t component = 0;
|
||||
component < section_force.size();
|
||||
++component) {
|
||||
section_force[component] =
|
||||
constitutive[component] * section_strain[component];
|
||||
}
|
||||
|
||||
std::vector<double> sigma_xx;
|
||||
sigma_xx.reserve(recovery_points.size());
|
||||
for (const auto& point : recovery_points) {
|
||||
const double y = point[0];
|
||||
const double z = point[1];
|
||||
sigma_xx.push_back(
|
||||
input.material.young *
|
||||
(section_strain[0] + z * section_strain[4] -
|
||||
y * section_strain[5]));
|
||||
}
|
||||
|
||||
results.push_back({
|
||||
xi,
|
||||
input.node_ids[end],
|
||||
section_strain,
|
||||
section_force,
|
||||
section_force[0] / input.section.area,
|
||||
std::move(sigma_xx),
|
||||
});
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
#include <fesa/io/abaqus/active_input.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
const std::string* parameter(
|
||||
const DeckRecord& record,
|
||||
const std::string_view name) {
|
||||
const auto found = record.parameters.find(name);
|
||||
return found == record.parameters.end() ? nullptr : &found->second;
|
||||
}
|
||||
|
||||
bool is_flat_model_record(const DeckRecord& record) {
|
||||
return record.keyword == "NODE" || record.keyword == "ELEMENT" ||
|
||||
record.keyword == "NSET" || record.keyword == "ELSET" ||
|
||||
record.keyword == "BEAM GENERAL SECTION" ||
|
||||
record.keyword == "TRANSVERSE SHEAR STIFFNESS";
|
||||
}
|
||||
|
||||
ActiveInputResult failure(
|
||||
std::string code,
|
||||
std::string message,
|
||||
const SourceLocation& source) {
|
||||
return {
|
||||
std::nullopt,
|
||||
{{
|
||||
DiagnosticStage::semantic,
|
||||
Severity::error,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
source,
|
||||
}},
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ActiveInputResult select_active_input(const ParsedDeck& deck) {
|
||||
const bool hierarchical =
|
||||
!deck.parts.empty() || deck.assembly.has_value();
|
||||
if (!hierarchical) {
|
||||
return {
|
||||
ActiveInputView{
|
||||
true,
|
||||
{},
|
||||
{},
|
||||
deck.global_records,
|
||||
{},
|
||||
},
|
||||
{},
|
||||
};
|
||||
}
|
||||
|
||||
const auto flat_record =
|
||||
std::ranges::find_if(deck.global_records, is_flat_model_record);
|
||||
if (flat_record != deck.global_records.end()) {
|
||||
return failure(
|
||||
"abaqus.semantic.mixed_mesh_organization",
|
||||
"Flat model records cannot be mixed with Part/Assembly input.",
|
||||
flat_record->source);
|
||||
}
|
||||
|
||||
std::set<std::string, std::less<>> part_names;
|
||||
for (const ParsedPart& part : deck.parts) {
|
||||
if (!part_names.insert(part.name).second) {
|
||||
return failure(
|
||||
"abaqus.semantic.duplicate_part",
|
||||
"Part name '" + part.name + "' is defined more than once.",
|
||||
part.source);
|
||||
}
|
||||
}
|
||||
|
||||
if (!deck.assembly.has_value()) {
|
||||
const SourceLocation source =
|
||||
deck.parts.empty() ? SourceLocation{} : deck.parts.front().source;
|
||||
return failure(
|
||||
"abaqus.semantic.assembly_count",
|
||||
"Hierarchical Phase 1 input requires exactly one Assembly.",
|
||||
source);
|
||||
}
|
||||
|
||||
const ParsedAssembly& assembly = *deck.assembly;
|
||||
if (assembly.instances.size() != 1U) {
|
||||
const SourceLocation& source = assembly.instances.size() > 1U
|
||||
? assembly.instances[1].source
|
||||
: assembly.source;
|
||||
return failure(
|
||||
"abaqus.semantic.instance_count",
|
||||
"Phase 1 requires exactly one Instance.",
|
||||
source);
|
||||
}
|
||||
|
||||
const ParsedInstance& instance = assembly.instances.front();
|
||||
if (!instance.transform_data.empty()) {
|
||||
const SourceLocation& source = instance.transform_sources.empty()
|
||||
? instance.source
|
||||
: instance.transform_sources.front();
|
||||
return failure(
|
||||
"abaqus.semantic.instance_transform",
|
||||
"Instance translation and rotation data are unsupported.",
|
||||
source);
|
||||
}
|
||||
|
||||
const auto part =
|
||||
std::ranges::find(deck.parts, instance.part_name, &ParsedPart::name);
|
||||
if (part == deck.parts.end()) {
|
||||
return failure(
|
||||
"abaqus.semantic.missing_part",
|
||||
"Instance '" + instance.name + "' references missing Part '" +
|
||||
instance.part_name + "'.",
|
||||
instance.source);
|
||||
}
|
||||
|
||||
for (const DeckRecord& record : assembly.records) {
|
||||
if (record.keyword != "NSET" && record.keyword != "ELSET") {
|
||||
continue;
|
||||
}
|
||||
const std::string* record_instance = parameter(record, "INSTANCE");
|
||||
if (record_instance == nullptr || *record_instance != instance.name) {
|
||||
const std::string* name = parameter(
|
||||
record, record.keyword == "NSET" ? "NSET" : "ELSET");
|
||||
return failure(
|
||||
"abaqus.semantic.wrong_instance",
|
||||
"Assembly set '" +
|
||||
(name == nullptr ? std::string{} : *name) +
|
||||
"' must reference the active Instance.",
|
||||
record.source);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
ActiveInputView{
|
||||
false,
|
||||
part->name,
|
||||
instance.name,
|
||||
part->records,
|
||||
assembly.records,
|
||||
},
|
||||
{},
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
@@ -2,9 +2,16 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <charconv>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
@@ -13,14 +20,19 @@
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
enum class Scope { global, part, assembly, instance };
|
||||
enum class Scope { global, part, assembly, instance, step };
|
||||
|
||||
struct KeywordLine final {
|
||||
std::string keyword;
|
||||
std::map<std::string, std::string, std::less<>> parameters;
|
||||
std::set<std::string, std::less<>> flag_parameters;
|
||||
SourceLocation source;
|
||||
};
|
||||
|
||||
const std::string* parameter(
|
||||
const KeywordLine& keyword,
|
||||
std::string_view name);
|
||||
|
||||
std::string_view trim(const std::string_view value) {
|
||||
constexpr std::string_view whitespace{" \t\f\v\r\n"};
|
||||
const std::size_t first = value.find_first_not_of(whitespace);
|
||||
@@ -41,6 +53,20 @@ std::string uppercase_ascii(std::string value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
std::string input_fingerprint(const std::string_view bytes) {
|
||||
std::uint64_t fingerprint = 14695981039346656037ULL;
|
||||
for (const char byte : bytes) {
|
||||
fingerprint ^=
|
||||
static_cast<std::uint8_t>(static_cast<unsigned char>(byte));
|
||||
fingerprint *= 1099511628211ULL;
|
||||
}
|
||||
|
||||
std::ostringstream encoded;
|
||||
encoded << "fnv1a64:" << std::hex << std::setfill('0')
|
||||
<< std::setw(16) << fingerprint;
|
||||
return encoded.str();
|
||||
}
|
||||
|
||||
std::vector<std::string> split_fields(const std::string_view value) {
|
||||
std::vector<std::string> fields;
|
||||
std::size_t first = 0;
|
||||
@@ -93,17 +119,202 @@ bool is_supported_record(const std::string_view keyword) {
|
||||
std::string_view{"ELASTIC"},
|
||||
std::string_view{"ELEMENT"},
|
||||
std::string_view{"ELSET"},
|
||||
std::string_view{"END STEP"},
|
||||
std::string_view{"HEADING"},
|
||||
std::string_view{"MATERIAL"},
|
||||
std::string_view{"NODE"},
|
||||
std::string_view{"NSET"},
|
||||
std::string_view{"OUTPUT"},
|
||||
std::string_view{"PREPRINT"},
|
||||
std::string_view{"RESTART"},
|
||||
std::string_view{"STATIC"},
|
||||
std::string_view{"STEP"},
|
||||
std::string_view{"TRANSVERSE SHEAR STIFFNESS"},
|
||||
};
|
||||
return std::ranges::find(supported, keyword) != supported.end();
|
||||
}
|
||||
|
||||
bool is_known_keyword(const std::string_view keyword) {
|
||||
constexpr std::array scope_keywords{
|
||||
std::string_view{"ASSEMBLY"},
|
||||
std::string_view{"END ASSEMBLY"},
|
||||
std::string_view{"END INSTANCE"},
|
||||
std::string_view{"END PART"},
|
||||
std::string_view{"INSTANCE"},
|
||||
std::string_view{"PART"},
|
||||
};
|
||||
return is_supported_record(keyword) ||
|
||||
std::ranges::find(scope_keywords, keyword) != scope_keywords.end();
|
||||
}
|
||||
|
||||
ParseDeckResult invalid_record_scope(const KeywordLine& keyword) {
|
||||
std::string code = "abaqus.syntax.invalid_step_scope";
|
||||
if (keyword.keyword == "NODE") {
|
||||
code = "abaqus.syntax.invalid_node_scope";
|
||||
} else if (keyword.keyword == "ELEMENT") {
|
||||
code = "abaqus.syntax.invalid_element_scope";
|
||||
} else if (keyword.keyword == "NSET" || keyword.keyword == "ELSET") {
|
||||
code = "abaqus.syntax.invalid_set_scope";
|
||||
} else if (keyword.keyword == "MATERIAL" ||
|
||||
keyword.keyword == "ELASTIC") {
|
||||
code = "abaqus.syntax.invalid_material_scope";
|
||||
} else if (keyword.keyword == "BEAM GENERAL SECTION") {
|
||||
code = "abaqus.syntax.invalid_section_scope";
|
||||
} else if (keyword.keyword == "TRANSVERSE SHEAR STIFFNESS") {
|
||||
code = "abaqus.syntax.invalid_transverse_shear_scope";
|
||||
} else if (keyword.keyword == "BOUNDARY") {
|
||||
code = "abaqus.syntax.invalid_boundary_scope";
|
||||
} else if (keyword.keyword == "CLOAD") {
|
||||
code = "abaqus.syntax.invalid_cload_scope";
|
||||
} else if (keyword.keyword == "HEADING") {
|
||||
code = "abaqus.syntax.invalid_heading_scope";
|
||||
} else if (keyword.keyword == "PREPRINT") {
|
||||
code = "abaqus.syntax.invalid_preprint_scope";
|
||||
} else if (keyword.keyword == "RESTART") {
|
||||
code = "abaqus.syntax.invalid_restart_scope";
|
||||
} else if (keyword.keyword == "OUTPUT") {
|
||||
code = "abaqus.syntax.invalid_output_scope";
|
||||
} else if (keyword.keyword == "PART") {
|
||||
code = "abaqus.syntax.invalid_part_scope";
|
||||
} else if (keyword.keyword == "ASSEMBLY") {
|
||||
code = "abaqus.syntax.invalid_assembly_scope";
|
||||
} else if (keyword.keyword == "INSTANCE") {
|
||||
code = "abaqus.syntax.invalid_instance_scope";
|
||||
}
|
||||
return syntax_failure(
|
||||
std::move(code),
|
||||
"*" + keyword.keyword + " is invalid in the current input scope.",
|
||||
keyword.source);
|
||||
}
|
||||
|
||||
bool is_allowed_parameter(
|
||||
const std::string_view name,
|
||||
const std::initializer_list<std::string_view> allowed) {
|
||||
return std::ranges::find(allowed, name) != allowed.end();
|
||||
}
|
||||
|
||||
std::optional<ParseDeckResult> validate_parameter_names(
|
||||
const KeywordLine& keyword,
|
||||
const std::initializer_list<std::string_view> allowed) {
|
||||
for (const auto& [name, value] : keyword.parameters) {
|
||||
static_cast<void>(value);
|
||||
if (!is_allowed_parameter(name, allowed)) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.unsupported_parameter",
|
||||
"Unsupported parameter '" + name + "' on *" +
|
||||
keyword.keyword + ".",
|
||||
keyword.source);
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<ParseDeckResult> unsupported_parameter_value(
|
||||
const KeywordLine& keyword,
|
||||
std::string_view name);
|
||||
|
||||
std::optional<ParseDeckResult> validate_parameter_schema(
|
||||
const KeywordLine& keyword,
|
||||
const std::initializer_list<std::string_view> valued,
|
||||
const std::initializer_list<std::string_view> flags = {}) {
|
||||
for (const auto& [name, value] : keyword.parameters) {
|
||||
if (is_allowed_parameter(name, valued)) {
|
||||
if (keyword.flag_parameters.contains(name) || value.empty()) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.invalid_parameter",
|
||||
"Parameter '" + name + "' on *" + keyword.keyword +
|
||||
" requires a nonempty value.",
|
||||
keyword.source);
|
||||
}
|
||||
} else if (is_allowed_parameter(name, flags)) {
|
||||
if (!keyword.flag_parameters.contains(name)) {
|
||||
return unsupported_parameter_value(keyword, name);
|
||||
}
|
||||
} else {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.unsupported_parameter",
|
||||
"Unsupported parameter '" + name + "' on *" +
|
||||
keyword.keyword + ".",
|
||||
keyword.source);
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<ParseDeckResult> unsupported_parameter_value(
|
||||
const KeywordLine& keyword,
|
||||
const std::string_view name) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.unsupported_parameter",
|
||||
"Unsupported value for parameter '" + std::string{name} +
|
||||
"' on *" + keyword.keyword + ".",
|
||||
keyword.source);
|
||||
}
|
||||
|
||||
std::optional<ParseDeckResult> validate_noop_parameters(
|
||||
const KeywordLine& keyword) {
|
||||
if (keyword.keyword == "HEADING") {
|
||||
return validate_parameter_schema(keyword, {});
|
||||
}
|
||||
if (keyword.keyword == "PREPRINT") {
|
||||
if (auto error = validate_parameter_schema(
|
||||
keyword, {"ECHO", "MODEL", "HISTORY", "CONTACT"})) {
|
||||
return error;
|
||||
}
|
||||
for (const auto& [name, value] : keyword.parameters) {
|
||||
const std::string normalized = uppercase_ascii(value);
|
||||
if (normalized != "YES" && normalized != "NO") {
|
||||
return unsupported_parameter_value(keyword, name);
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
if (keyword.keyword == "RESTART") {
|
||||
if (auto error = validate_parameter_schema(
|
||||
keyword, {"FREQUENCY"}, {"WRITE"})) {
|
||||
return error;
|
||||
}
|
||||
if (const std::string* write = parameter(keyword, "WRITE");
|
||||
write != nullptr && !write->empty()) {
|
||||
return unsupported_parameter_value(keyword, "WRITE");
|
||||
}
|
||||
if (const std::string* frequency = parameter(keyword, "FREQUENCY");
|
||||
frequency != nullptr) {
|
||||
std::int64_t value = 0;
|
||||
const auto parsed = std::from_chars(
|
||||
frequency->data(), frequency->data() + frequency->size(), value);
|
||||
if (frequency->empty() || parsed.ec != std::errc{} ||
|
||||
parsed.ptr != frequency->data() + frequency->size() ||
|
||||
value < 0) {
|
||||
return unsupported_parameter_value(keyword, "FREQUENCY");
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
if (keyword.keyword == "OUTPUT") {
|
||||
if (auto error = validate_parameter_schema(
|
||||
keyword, {"VARIABLE"}, {"FIELD", "HISTORY"})) {
|
||||
return error;
|
||||
}
|
||||
const bool field = keyword.parameters.contains("FIELD");
|
||||
const bool history = keyword.parameters.contains("HISTORY");
|
||||
if (field == history) {
|
||||
return unsupported_parameter_value(keyword, "FIELD/HISTORY");
|
||||
}
|
||||
const std::string* flag = parameter(
|
||||
keyword, field ? std::string_view{"FIELD"}
|
||||
: std::string_view{"HISTORY"});
|
||||
if (flag == nullptr || !flag->empty()) {
|
||||
return unsupported_parameter_value(
|
||||
keyword, field ? "FIELD" : "HISTORY");
|
||||
}
|
||||
if (const std::string* variable = parameter(keyword, "VARIABLE");
|
||||
variable != nullptr && uppercase_ascii(*variable) != "PRESELECT") {
|
||||
return unsupported_parameter_value(keyword, "VARIABLE");
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<KeywordLine> parse_keyword_line(
|
||||
const std::string_view line,
|
||||
const SourceLocation& source,
|
||||
@@ -120,6 +331,7 @@ std::optional<KeywordLine> parse_keyword_line(
|
||||
KeywordLine parsed{
|
||||
uppercase_ascii(fields[0]),
|
||||
{},
|
||||
{},
|
||||
source,
|
||||
};
|
||||
for (std::size_t index = 1; index < fields.size(); ++index) {
|
||||
@@ -152,6 +364,9 @@ std::optional<KeywordLine> parse_keyword_line(
|
||||
source);
|
||||
return std::nullopt;
|
||||
}
|
||||
if (equals == std::string_view::npos) {
|
||||
parsed.flag_parameters.insert(key);
|
||||
}
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
@@ -176,20 +391,34 @@ ParseDeckResult missing_parameter(
|
||||
} // namespace
|
||||
|
||||
ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
std::ifstream input{path, std::ios::binary};
|
||||
if (!input) {
|
||||
std::ifstream file{path, std::ios::binary};
|
||||
if (!file) {
|
||||
return failure(
|
||||
DiagnosticStage::io,
|
||||
"abaqus.io.open_failed",
|
||||
"Unable to open Abaqus input file.",
|
||||
SourceLocation{path, 0U, 0U});
|
||||
}
|
||||
const std::string source_bytes{
|
||||
std::istreambuf_iterator<char>{file},
|
||||
std::istreambuf_iterator<char>{},
|
||||
};
|
||||
if (file.bad()) {
|
||||
return failure(
|
||||
DiagnosticStage::io,
|
||||
"abaqus.io.read_failed",
|
||||
"Failed while reading Abaqus input file.",
|
||||
SourceLocation{path, 0U, 0U});
|
||||
}
|
||||
std::istringstream input{source_bytes};
|
||||
|
||||
ParsedDeck deck;
|
||||
Scope scope = Scope::global;
|
||||
std::optional<ParsedPart> current_part;
|
||||
std::optional<ParsedAssembly> current_assembly;
|
||||
std::optional<ParsedInstance> current_instance;
|
||||
std::optional<SourceLocation> current_step_source;
|
||||
bool completed_step = false;
|
||||
DeckRecord* current_record = nullptr;
|
||||
|
||||
std::string line;
|
||||
@@ -214,8 +443,18 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
const std::vector<std::string> fields = split_fields(content);
|
||||
if (scope == Scope::instance) {
|
||||
current_instance->transform_data.push_back(fields);
|
||||
current_instance->transform_sources.push_back(SourceLocation{
|
||||
path,
|
||||
line_number,
|
||||
first_nonspace + 1U,
|
||||
});
|
||||
} else if (current_record != nullptr) {
|
||||
current_record->data.push_back(fields);
|
||||
current_record->data_sources.push_back(SourceLocation{
|
||||
path,
|
||||
line_number,
|
||||
first_nonspace + 1U,
|
||||
});
|
||||
} else {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.data_without_keyword",
|
||||
@@ -239,6 +478,69 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
KeywordLine& keyword = *parsed;
|
||||
current_record = nullptr;
|
||||
|
||||
if (keyword.keyword == "STEP") {
|
||||
if (scope != Scope::global) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.invalid_step_scope",
|
||||
"*STEP is only valid in global input scope.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_schema(
|
||||
keyword, {"NAME", "NLGEOM"})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
if (const std::string* name = parameter(keyword, "NAME");
|
||||
name != nullptr && name->empty()) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.invalid_parameter",
|
||||
"*STEP parameter NAME requires a nonempty value.",
|
||||
source);
|
||||
}
|
||||
if (const std::string* nlgeom = parameter(keyword, "NLGEOM");
|
||||
nlgeom != nullptr && nlgeom->empty()) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.invalid_parameter",
|
||||
"*STEP parameter NLGEOM requires a value.",
|
||||
source);
|
||||
}
|
||||
deck.global_records.push_back({
|
||||
std::move(keyword.keyword),
|
||||
std::move(keyword.parameters),
|
||||
{},
|
||||
source,
|
||||
});
|
||||
current_step_source = source;
|
||||
scope = Scope::step;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (keyword.keyword == "END STEP") {
|
||||
if (auto error = validate_parameter_names(keyword, {})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
if (scope != Scope::step || !current_step_source.has_value()) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.unexpected_end_step",
|
||||
"*END STEP does not match an open *STEP.",
|
||||
source);
|
||||
}
|
||||
deck.global_records.push_back({
|
||||
std::move(keyword.keyword),
|
||||
std::move(keyword.parameters),
|
||||
{},
|
||||
source,
|
||||
});
|
||||
current_step_source.reset();
|
||||
completed_step = true;
|
||||
scope = Scope::global;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (scope == Scope::global && completed_step &&
|
||||
is_known_keyword(keyword.keyword)) {
|
||||
return invalid_record_scope(keyword);
|
||||
}
|
||||
|
||||
if (keyword.keyword == "PART") {
|
||||
if (scope != Scope::global) {
|
||||
return syntax_failure(
|
||||
@@ -246,6 +548,9 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"*PART is only valid in global input scope.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_schema(keyword, {"NAME"})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
const std::string* name = parameter(keyword, "NAME");
|
||||
if (name == nullptr || name->empty()) {
|
||||
return missing_parameter(keyword, "NAME");
|
||||
@@ -262,6 +567,9 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"*END PART does not match an open *PART.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_schema(keyword, {})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
deck.parts.push_back(std::move(*current_part));
|
||||
current_part.reset();
|
||||
scope = Scope::global;
|
||||
@@ -275,6 +583,9 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"*ASSEMBLY is only valid in global input scope.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_schema(keyword, {"NAME"})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
if (deck.assembly.has_value() ||
|
||||
current_assembly.has_value()) {
|
||||
return syntax_failure(
|
||||
@@ -299,6 +610,9 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"*END ASSEMBLY does not match an open *ASSEMBLY.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_schema(keyword, {})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
deck.assembly = std::move(*current_assembly);
|
||||
current_assembly.reset();
|
||||
scope = Scope::global;
|
||||
@@ -313,6 +627,10 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"*INSTANCE is only valid in an open *ASSEMBLY.",
|
||||
source);
|
||||
}
|
||||
if (auto error =
|
||||
validate_parameter_schema(keyword, {"NAME", "PART"})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
const std::string* name = parameter(keyword, "NAME");
|
||||
if (name == nullptr || name->empty()) {
|
||||
return missing_parameter(keyword, "NAME");
|
||||
@@ -322,7 +640,7 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
return missing_parameter(keyword, "PART");
|
||||
}
|
||||
current_instance =
|
||||
ParsedInstance{*name, *part_name, {}, source};
|
||||
ParsedInstance{*name, *part_name, {}, {}, source};
|
||||
scope = Scope::instance;
|
||||
continue;
|
||||
}
|
||||
@@ -336,6 +654,9 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"*END INSTANCE does not match an open *INSTANCE.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_schema(keyword, {})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
current_assembly->instances.push_back(
|
||||
std::move(*current_instance));
|
||||
current_instance.reset();
|
||||
@@ -343,12 +664,149 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (keyword.keyword == "HEADING" ||
|
||||
keyword.keyword == "PREPRINT") {
|
||||
if (scope != Scope::global) {
|
||||
return syntax_failure(
|
||||
keyword.keyword == "HEADING"
|
||||
? "abaqus.syntax.invalid_heading_scope"
|
||||
: "abaqus.syntax.invalid_preprint_scope",
|
||||
"*" + keyword.keyword +
|
||||
" is only valid in global input scope.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_noop_parameters(keyword)) {
|
||||
return std::move(*error);
|
||||
}
|
||||
deck.global_records.push_back({
|
||||
std::move(keyword.keyword),
|
||||
std::move(keyword.parameters),
|
||||
{},
|
||||
source,
|
||||
});
|
||||
if (deck.global_records.back().keyword == "HEADING") {
|
||||
current_record = &deck.global_records.back();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (keyword.keyword == "RESTART" || keyword.keyword == "OUTPUT") {
|
||||
if (scope != Scope::step) {
|
||||
return syntax_failure(
|
||||
keyword.keyword == "RESTART"
|
||||
? "abaqus.syntax.invalid_restart_scope"
|
||||
: "abaqus.syntax.invalid_output_scope",
|
||||
"*" + keyword.keyword +
|
||||
" is only valid inside *STEP.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_noop_parameters(keyword)) {
|
||||
return std::move(*error);
|
||||
}
|
||||
deck.global_records.push_back({
|
||||
std::move(keyword.keyword),
|
||||
std::move(keyword.parameters),
|
||||
{},
|
||||
source,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
if (keyword.keyword == "STATIC") {
|
||||
if (scope != Scope::step) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.invalid_step_scope",
|
||||
"*STATIC is only valid inside *STEP.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_names(keyword, {})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
} else if (keyword.keyword == "CLOAD") {
|
||||
if (scope != Scope::step) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.invalid_cload_scope",
|
||||
"*CLOAD is only valid inside *STEP.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_names(keyword, {})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
} else if (keyword.keyword == "BOUNDARY") {
|
||||
if (scope != Scope::global && scope != Scope::step) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.invalid_boundary_scope",
|
||||
"*BOUNDARY is valid only in global or Step scope.",
|
||||
source);
|
||||
}
|
||||
if (auto error = validate_parameter_names(keyword, {})) {
|
||||
return std::move(*error);
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_supported_record(keyword.keyword)) {
|
||||
return syntax_failure(
|
||||
"abaqus.unsupported_keyword",
|
||||
"Unsupported Abaqus keyword *" + keyword.keyword + ".",
|
||||
source);
|
||||
}
|
||||
if (scope == Scope::step && keyword.keyword != "STATIC" &&
|
||||
keyword.keyword != "BOUNDARY" && keyword.keyword != "CLOAD") {
|
||||
return invalid_record_scope(keyword);
|
||||
}
|
||||
if (scope != Scope::instance) {
|
||||
const bool mesh_scope = scope == Scope::global || scope == Scope::part;
|
||||
const bool set_scope = mesh_scope || scope == Scope::assembly;
|
||||
if ((keyword.keyword == "NODE" || keyword.keyword == "ELEMENT" ||
|
||||
keyword.keyword == "BEAM GENERAL SECTION" ||
|
||||
keyword.keyword == "TRANSVERSE SHEAR STIFFNESS") &&
|
||||
!mesh_scope) {
|
||||
return invalid_record_scope(keyword);
|
||||
}
|
||||
if ((keyword.keyword == "NSET" || keyword.keyword == "ELSET") &&
|
||||
!set_scope) {
|
||||
return invalid_record_scope(keyword);
|
||||
}
|
||||
if ((keyword.keyword == "MATERIAL" ||
|
||||
keyword.keyword == "ELASTIC") &&
|
||||
scope != Scope::global) {
|
||||
return invalid_record_scope(keyword);
|
||||
}
|
||||
}
|
||||
if (scope != Scope::instance) {
|
||||
std::optional<ParseDeckResult> parameter_error;
|
||||
if (keyword.keyword == "NODE" || keyword.keyword == "ELASTIC" ||
|
||||
keyword.keyword == "TRANSVERSE SHEAR STIFFNESS") {
|
||||
parameter_error = validate_parameter_schema(keyword, {});
|
||||
} else if (keyword.keyword == "ELEMENT") {
|
||||
parameter_error = validate_parameter_schema(
|
||||
keyword, {"TYPE", "ELSET"});
|
||||
} else if (keyword.keyword == "NSET") {
|
||||
parameter_error = scope == Scope::assembly
|
||||
? validate_parameter_schema(
|
||||
keyword,
|
||||
{"NSET", "INSTANCE"},
|
||||
{"GENERATE"})
|
||||
: validate_parameter_schema(
|
||||
keyword, {"NSET"}, {"GENERATE"});
|
||||
} else if (keyword.keyword == "ELSET") {
|
||||
parameter_error = scope == Scope::assembly
|
||||
? validate_parameter_schema(
|
||||
keyword,
|
||||
{"ELSET", "INSTANCE"},
|
||||
{"GENERATE"})
|
||||
: validate_parameter_schema(
|
||||
keyword, {"ELSET"}, {"GENERATE"});
|
||||
} else if (keyword.keyword == "MATERIAL") {
|
||||
parameter_error = validate_parameter_schema(keyword, {"NAME"});
|
||||
} else if (keyword.keyword == "BEAM GENERAL SECTION") {
|
||||
parameter_error = validate_parameter_schema(
|
||||
keyword, {"SECTION", "ELSET", "MATERIAL"});
|
||||
}
|
||||
if (parameter_error.has_value()) {
|
||||
return std::move(*parameter_error);
|
||||
}
|
||||
}
|
||||
|
||||
DeckRecord next_record{
|
||||
std::move(keyword.keyword),
|
||||
@@ -359,7 +817,9 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
switch (scope) {
|
||||
case Scope::global:
|
||||
deck.global_records.push_back(std::move(next_record));
|
||||
current_record = &deck.global_records.back();
|
||||
if (deck.global_records.back().keyword != "MATERIAL") {
|
||||
current_record = &deck.global_records.back();
|
||||
}
|
||||
break;
|
||||
case Scope::part:
|
||||
current_part->records.push_back(std::move(next_record));
|
||||
@@ -375,6 +835,10 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"abaqus.syntax.instance_local_keyword",
|
||||
"Keyword records inside *INSTANCE are unsupported.",
|
||||
source);
|
||||
case Scope::step:
|
||||
deck.global_records.push_back(std::move(next_record));
|
||||
current_record = &deck.global_records.back();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,8 +868,18 @@ ParseDeckResult parse_deck(const std::filesystem::path& path) {
|
||||
"Abaqus *ASSEMBLY is not closed by *END ASSEMBLY.",
|
||||
current_assembly->source);
|
||||
}
|
||||
if (current_step_source.has_value()) {
|
||||
return syntax_failure(
|
||||
"abaqus.syntax.unclosed_step",
|
||||
"Abaqus *STEP is not closed by *END STEP.",
|
||||
*current_step_source);
|
||||
}
|
||||
|
||||
return {std::move(deck), {}};
|
||||
return {
|
||||
std::move(deck),
|
||||
{},
|
||||
input_fingerprint(source_bytes),
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,411 @@
|
||||
#include <fesa/io/abaqus/set_resolver.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <charconv>
|
||||
#include <compare>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
struct SetNamespace final {
|
||||
ResolvedSetScope scope;
|
||||
std::string scope_name;
|
||||
ResolvedSetKind kind;
|
||||
|
||||
auto operator<=>(const SetNamespace&) const = default;
|
||||
};
|
||||
|
||||
struct SetKey final {
|
||||
SetNamespace name_space;
|
||||
std::string set_name;
|
||||
|
||||
auto operator<=>(const SetKey&) const = default;
|
||||
};
|
||||
|
||||
struct RawMember final {
|
||||
std::string text;
|
||||
SourceLocation source;
|
||||
};
|
||||
|
||||
struct RawSet final {
|
||||
std::vector<RawMember> members;
|
||||
};
|
||||
|
||||
enum class VisitState { unvisited, visiting, resolved, failed };
|
||||
|
||||
const std::string* parameter(
|
||||
const DeckRecord& record,
|
||||
const std::string_view name) {
|
||||
const auto found = record.parameters.find(name);
|
||||
return found == record.parameters.end() ? nullptr : &found->second;
|
||||
}
|
||||
|
||||
bool has_parameter(
|
||||
const DeckRecord& record,
|
||||
const std::string_view name) {
|
||||
return record.parameters.contains(name);
|
||||
}
|
||||
|
||||
SourceLocation data_source(
|
||||
const DeckRecord& record,
|
||||
const std::size_t row) {
|
||||
return row < record.data_sources.size()
|
||||
? record.data_sources[row]
|
||||
: record.source;
|
||||
}
|
||||
|
||||
bool parse_positive_label(
|
||||
const std::string_view text,
|
||||
std::int64_t& value) {
|
||||
const auto parsed =
|
||||
std::from_chars(text.data(), text.data() + text.size(), value);
|
||||
return parsed.ec == std::errc{} &&
|
||||
parsed.ptr == text.data() + text.size() && value > 0;
|
||||
}
|
||||
|
||||
class SetResolver final {
|
||||
public:
|
||||
explicit SetResolver(const ParsedDeck& deck) : deck_{deck} {}
|
||||
|
||||
[[nodiscard]] SetResolutionResult resolve() {
|
||||
collect_scope(
|
||||
deck_.global_records,
|
||||
{ResolvedSetScope::global, "global", ResolvedSetKind::node});
|
||||
|
||||
for (const ParsedPart& part : deck_.parts) {
|
||||
collect_scope(
|
||||
part.records,
|
||||
{ResolvedSetScope::part,
|
||||
part.name,
|
||||
ResolvedSetKind::node});
|
||||
}
|
||||
|
||||
collect_assembly();
|
||||
|
||||
std::vector<ResolvedSet> sets;
|
||||
sets.reserve(raw_sets_.size());
|
||||
for (const auto& [key, raw_set] : raw_sets_) {
|
||||
static_cast<void>(raw_set);
|
||||
if (!resolve_set(key)) {
|
||||
continue;
|
||||
}
|
||||
sets.push_back({
|
||||
key.name_space.scope_name,
|
||||
key.set_name,
|
||||
resolved_sets_.at(key),
|
||||
key.name_space.scope,
|
||||
key.name_space.kind,
|
||||
});
|
||||
}
|
||||
|
||||
if (!diagnostics_.empty()) {
|
||||
sets.clear();
|
||||
}
|
||||
return {std::move(sets), std::move(diagnostics_)};
|
||||
}
|
||||
|
||||
private:
|
||||
void add_error(
|
||||
std::string code,
|
||||
std::string message,
|
||||
const SourceLocation& source) {
|
||||
diagnostics_.push_back({
|
||||
DiagnosticStage::semantic,
|
||||
Severity::error,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
source,
|
||||
});
|
||||
}
|
||||
|
||||
void collect_scope(
|
||||
const std::vector<DeckRecord>& records,
|
||||
SetNamespace name_space) {
|
||||
collect_entities(records, name_space);
|
||||
collect_set_records(records, std::move(name_space), nullptr);
|
||||
}
|
||||
|
||||
void collect_entities(
|
||||
const std::vector<DeckRecord>& records,
|
||||
const SetNamespace& base_namespace) {
|
||||
for (const DeckRecord& record : records) {
|
||||
ResolvedSetKind kind;
|
||||
if (record.keyword == "NODE") {
|
||||
kind = ResolvedSetKind::node;
|
||||
} else if (record.keyword == "ELEMENT") {
|
||||
kind = ResolvedSetKind::element;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
SetNamespace entity_namespace = base_namespace;
|
||||
entity_namespace.kind = kind;
|
||||
std::set<std::int64_t>& labels = entities_[entity_namespace];
|
||||
for (std::size_t row = 0; row < record.data.size(); ++row) {
|
||||
if (record.data[row].empty()) {
|
||||
continue;
|
||||
}
|
||||
std::int64_t label = 0;
|
||||
if (!parse_positive_label(record.data[row][0], label)) {
|
||||
continue;
|
||||
}
|
||||
labels.insert(label);
|
||||
|
||||
if (kind != ResolvedSetKind::element) {
|
||||
continue;
|
||||
}
|
||||
const std::string* set_name = parameter(record, "ELSET");
|
||||
if (set_name == nullptr || set_name->empty()) {
|
||||
continue;
|
||||
}
|
||||
raw_sets_[{entity_namespace, *set_name}].members.push_back({
|
||||
std::to_string(label),
|
||||
data_source(record, row),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void collect_set_records(
|
||||
const std::vector<DeckRecord>& records,
|
||||
const SetNamespace& base_namespace,
|
||||
const std::string* active_instance) {
|
||||
for (const DeckRecord& record : records) {
|
||||
SetNamespace set_namespace = base_namespace;
|
||||
std::string_view name_parameter;
|
||||
if (record.keyword == "NSET") {
|
||||
set_namespace.kind = ResolvedSetKind::node;
|
||||
name_parameter = "NSET";
|
||||
} else if (record.keyword == "ELSET") {
|
||||
set_namespace.kind = ResolvedSetKind::element;
|
||||
name_parameter = "ELSET";
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
const std::string* set_name = parameter(record, name_parameter);
|
||||
if (set_name == nullptr || set_name->empty()) {
|
||||
add_error(
|
||||
"abaqus.semantic.missing_parameter",
|
||||
"*" + record.keyword + " requires parameter " +
|
||||
std::string{name_parameter} + ".",
|
||||
record.source);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (set_namespace.scope == ResolvedSetScope::assembly) {
|
||||
const std::string* instance = parameter(record, "INSTANCE");
|
||||
if (active_instance == nullptr || instance == nullptr ||
|
||||
*instance != *active_instance) {
|
||||
add_error(
|
||||
"abaqus.semantic.wrong_instance",
|
||||
"Assembly set '" + *set_name +
|
||||
"' must reference the active Instance.",
|
||||
record.source);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
RawSet& raw_set = raw_sets_[{set_namespace, *set_name}];
|
||||
if (has_parameter(record, "GENERATE")) {
|
||||
collect_generate(record, raw_set);
|
||||
} else {
|
||||
collect_explicit(record, raw_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void collect_explicit(
|
||||
const DeckRecord& record,
|
||||
RawSet& raw_set) {
|
||||
for (std::size_t row = 0; row < record.data.size(); ++row) {
|
||||
for (const std::string& field : record.data[row]) {
|
||||
if (field.empty()) {
|
||||
continue;
|
||||
}
|
||||
raw_set.members.push_back({field, data_source(record, row)});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void collect_generate(
|
||||
const DeckRecord& record,
|
||||
RawSet& raw_set) {
|
||||
const SourceLocation source =
|
||||
record.data.empty() ? record.source : data_source(record, 0U);
|
||||
if (record.data.size() != 1U || record.data[0].size() != 3U ||
|
||||
std::ranges::any_of(
|
||||
record.data[0],
|
||||
[](const std::string& field) { return field.empty(); })) {
|
||||
add_error(
|
||||
"abaqus.semantic.invalid_generate",
|
||||
"*" + record.keyword +
|
||||
", GENERATE requires exactly start, end, increment.",
|
||||
source);
|
||||
return;
|
||||
}
|
||||
|
||||
std::int64_t start = 0;
|
||||
std::int64_t end = 0;
|
||||
std::int64_t increment = 0;
|
||||
if (!parse_positive_label(record.data[0][0], start) ||
|
||||
!parse_positive_label(record.data[0][1], end) ||
|
||||
!parse_positive_label(record.data[0][2], increment) ||
|
||||
start > end || (end - start) % increment != 0) {
|
||||
add_error(
|
||||
"abaqus.semantic.invalid_generate",
|
||||
"Invalid *" + record.keyword + " generate range.",
|
||||
source);
|
||||
return;
|
||||
}
|
||||
|
||||
for (std::int64_t label = start;; label += increment) {
|
||||
raw_set.members.push_back({std::to_string(label), source});
|
||||
if (label == end) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void collect_assembly() {
|
||||
if (!deck_.assembly.has_value()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ParsedAssembly& assembly = *deck_.assembly;
|
||||
const ParsedInstance* active_instance =
|
||||
assembly.instances.size() == 1U
|
||||
? &assembly.instances.front()
|
||||
: nullptr;
|
||||
SetNamespace assembly_namespace{
|
||||
ResolvedSetScope::assembly,
|
||||
assembly.name,
|
||||
ResolvedSetKind::node,
|
||||
};
|
||||
|
||||
if (active_instance != nullptr) {
|
||||
const auto part = std::ranges::find(
|
||||
deck_.parts, active_instance->part_name, &ParsedPart::name);
|
||||
if (part != deck_.parts.end()) {
|
||||
for (const ResolvedSetKind kind : {
|
||||
ResolvedSetKind::node,
|
||||
ResolvedSetKind::element}) {
|
||||
const SetNamespace part_namespace{
|
||||
ResolvedSetScope::part,
|
||||
part->name,
|
||||
kind,
|
||||
};
|
||||
SetNamespace lifted_namespace = assembly_namespace;
|
||||
lifted_namespace.kind = kind;
|
||||
const auto labels = entities_.find(part_namespace);
|
||||
if (labels != entities_.end()) {
|
||||
entities_[lifted_namespace] = labels->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::string* instance_name =
|
||||
active_instance == nullptr ? nullptr : &active_instance->name;
|
||||
collect_set_records(
|
||||
assembly.records, assembly_namespace, instance_name);
|
||||
}
|
||||
|
||||
bool resolve_set(const SetKey& key) {
|
||||
VisitState& state = states_[key];
|
||||
if (state == VisitState::resolved) {
|
||||
return true;
|
||||
}
|
||||
if (state == VisitState::failed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
state = VisitState::visiting;
|
||||
bool succeeded = true;
|
||||
std::vector<std::int64_t> labels;
|
||||
for (const RawMember& member : raw_sets_.at(key).members) {
|
||||
std::int64_t label = 0;
|
||||
if (parse_positive_label(member.text, label)) {
|
||||
const auto entity_namespace = entities_.find(key.name_space);
|
||||
if (entity_namespace == entities_.end() ||
|
||||
!entity_namespace->second.contains(label)) {
|
||||
add_error(
|
||||
"abaqus.semantic.missing_set_member",
|
||||
"Set '" + key.set_name +
|
||||
"' references missing entity label " +
|
||||
std::to_string(label) + ".",
|
||||
member.source);
|
||||
succeeded = false;
|
||||
continue;
|
||||
}
|
||||
labels.push_back(label);
|
||||
continue;
|
||||
}
|
||||
|
||||
const SetKey nested_key{key.name_space, member.text};
|
||||
const auto nested = raw_sets_.find(nested_key);
|
||||
if (nested == raw_sets_.end()) {
|
||||
add_error(
|
||||
"abaqus.semantic.missing_set_member",
|
||||
"Set '" + key.set_name + "' references missing set '" +
|
||||
member.text + "'.",
|
||||
member.source);
|
||||
succeeded = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (states_[nested_key] == VisitState::visiting) {
|
||||
add_error(
|
||||
"abaqus.semantic.set_cycle",
|
||||
"Set '" + key.set_name +
|
||||
"' closes a nested set reference cycle through '" +
|
||||
member.text + "'.",
|
||||
member.source);
|
||||
succeeded = false;
|
||||
continue;
|
||||
}
|
||||
if (!resolve_set(nested_key)) {
|
||||
succeeded = false;
|
||||
continue;
|
||||
}
|
||||
const std::vector<std::int64_t>& nested_labels =
|
||||
resolved_sets_.at(nested_key);
|
||||
labels.insert(
|
||||
labels.end(), nested_labels.begin(), nested_labels.end());
|
||||
}
|
||||
|
||||
if (!succeeded) {
|
||||
state = VisitState::failed;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::ranges::sort(labels);
|
||||
labels.erase(std::ranges::unique(labels).begin(), labels.end());
|
||||
resolved_sets_[key] = std::move(labels);
|
||||
state = VisitState::resolved;
|
||||
return true;
|
||||
}
|
||||
|
||||
const ParsedDeck& deck_;
|
||||
std::map<SetNamespace, std::set<std::int64_t>> entities_;
|
||||
std::map<SetKey, RawSet> raw_sets_;
|
||||
std::map<SetKey, VisitState> states_;
|
||||
std::map<SetKey, std::vector<std::int64_t>> resolved_sets_;
|
||||
std::vector<Diagnostic> diagnostics_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
SetResolutionResult resolve_sets(const ParsedDeck& deck) {
|
||||
return SetResolver{deck}.resolve();
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,201 @@
|
||||
#include <fesa/results/result_database.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
void add_error(
|
||||
std::vector<Diagnostic>& diagnostics,
|
||||
std::string code,
|
||||
std::string message) {
|
||||
diagnostics.push_back({
|
||||
DiagnosticStage::results,
|
||||
Severity::error,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
std::nullopt,
|
||||
});
|
||||
}
|
||||
|
||||
bool is_finite(const std::array<double, 6>& field) {
|
||||
return std::ranges::all_of(
|
||||
field,
|
||||
[](const double component) {
|
||||
return std::isfinite(component);
|
||||
});
|
||||
}
|
||||
|
||||
void validate_nodal_frame(
|
||||
const NodalFrame& nodal,
|
||||
std::vector<Diagnostic>& diagnostics) {
|
||||
if (
|
||||
nodal.displacement.size() != nodal.node_ids.size() ||
|
||||
nodal.reaction.size() != nodal.node_ids.size()) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.nodal_size_mismatch",
|
||||
"Nodal IDs, displacement, and reaction fields must have "
|
||||
"matching sizes.");
|
||||
}
|
||||
if (nodal.origins.size() != nodal.node_ids.size()) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.nodal_origin_size_mismatch",
|
||||
"Nodal IDs and origins must have matching sizes.");
|
||||
}
|
||||
|
||||
std::set<std::int64_t> node_ids;
|
||||
for (const NodeId node_id : nodal.node_ids) {
|
||||
if (!node_ids.insert(node_id.value()).second) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.duplicate_node_id",
|
||||
"Nodal frame contains duplicate node ID " +
|
||||
std::to_string(node_id.value()) + ".");
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& displacement : nodal.displacement) {
|
||||
if (!is_finite(displacement)) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.nonfinite_value",
|
||||
"Nodal displacement contains a nonfinite component.");
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& reaction : nodal.reaction) {
|
||||
if (!is_finite(reaction)) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.nonfinite_value",
|
||||
"Nodal reaction contains a nonfinite component.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void validate_beam_section_result(
|
||||
const BeamSectionResult& result,
|
||||
std::vector<Diagnostic>& diagnostics) {
|
||||
if (
|
||||
!std::isfinite(result.xi) ||
|
||||
!is_finite(result.section_strain) ||
|
||||
!is_finite(result.section_force) ||
|
||||
!std::isfinite(result.centroid_sigma_xx) ||
|
||||
!std::ranges::all_of(
|
||||
result.sigma_xx,
|
||||
[](const double value) { return std::isfinite(value); })) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.nonfinite_value",
|
||||
"Beam section result contains a nonfinite value.");
|
||||
}
|
||||
}
|
||||
|
||||
void validate_element_frame(
|
||||
const ElementFrame& element,
|
||||
const NodalFrame& nodal,
|
||||
std::vector<Diagnostic>& diagnostics) {
|
||||
std::set<std::int64_t> nodal_ids;
|
||||
for (const NodeId node_id : nodal.node_ids) {
|
||||
nodal_ids.insert(node_id.value());
|
||||
}
|
||||
|
||||
std::set<std::int64_t> element_ids;
|
||||
for (const BeamElementFrame& beam : element.beams) {
|
||||
if (!element_ids.insert(beam.element.value()).second) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.duplicate_element_id",
|
||||
"Element frame contains duplicate element ID " +
|
||||
std::to_string(beam.element.value()) + ".");
|
||||
}
|
||||
|
||||
if (
|
||||
!is_finite(beam.local_frame.ex) ||
|
||||
!is_finite(beam.local_frame.ey) ||
|
||||
!is_finite(beam.local_frame.ez)) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.nonfinite_value",
|
||||
"Beam local frame contains a nonfinite component.");
|
||||
}
|
||||
|
||||
const BeamSectionResult& first = beam.end_results[0];
|
||||
const BeamSectionResult& second = beam.end_results[1];
|
||||
if (first.end_node == second.end_node) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.duplicate_beam_end_node",
|
||||
"Beam element result contains the same node at both ends.");
|
||||
}
|
||||
if (
|
||||
first.xi != -1.0 || second.xi != 1.0 ||
|
||||
!nodal_ids.contains(first.end_node.value()) ||
|
||||
!nodal_ids.contains(second.end_node.value())) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.invalid_beam_connectivity",
|
||||
"Beam end results must follow (-1, +1) connectivity and "
|
||||
"reference nodes in the nodal frame.");
|
||||
}
|
||||
if (first.sigma_xx.size() != second.sigma_xx.size()) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.recovery_point_count_mismatch",
|
||||
"Beam end results must have matching recovery-point "
|
||||
"counts.");
|
||||
}
|
||||
|
||||
validate_beam_section_result(first, diagnostics);
|
||||
validate_beam_section_result(second, diagnostics);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Status validate_result_database(const ResultDatabase& database) {
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
std::set<std::string> step_names;
|
||||
|
||||
for (const ResultStep& step : database.steps) {
|
||||
if (!step_names.insert(step.name).second) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.duplicate_step_name",
|
||||
"Result database contains duplicate step name '" +
|
||||
step.name + "'.");
|
||||
}
|
||||
|
||||
std::set<double> frame_times;
|
||||
for (const ResultFrame& frame : step.frames) {
|
||||
if (!std::isfinite(frame.step_time)) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.nonfinite_value",
|
||||
"Result frame has a nonfinite step time.");
|
||||
} else if (!frame_times.insert(frame.step_time).second) {
|
||||
add_error(
|
||||
diagnostics,
|
||||
"results.duplicate_frame_time",
|
||||
"Result step '" + step.name +
|
||||
"' contains duplicate frame time " +
|
||||
std::to_string(frame.step_time) + ".");
|
||||
}
|
||||
|
||||
validate_nodal_frame(frame.nodal, diagnostics);
|
||||
validate_element_frame(
|
||||
frame.element, frame.nodal, diagnostics);
|
||||
}
|
||||
}
|
||||
|
||||
return {diagnostics.empty(), std::move(diagnostics)};
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,591 @@
|
||||
#include <fesa/validation/comparison.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
using PositionKey = std::tuple<
|
||||
ReferenceQuantity,
|
||||
std::string,
|
||||
std::int64_t,
|
||||
std::optional<std::int64_t>>;
|
||||
|
||||
void add_failure(
|
||||
std::vector<Diagnostic>& failures,
|
||||
std::string code,
|
||||
std::string message) {
|
||||
failures.push_back({
|
||||
DiagnosticStage::validation,
|
||||
Severity::error,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
std::nullopt,
|
||||
});
|
||||
}
|
||||
|
||||
std::string_view quantity_name(const ReferenceQuantity quantity) {
|
||||
switch (quantity) {
|
||||
case ReferenceQuantity::displacement:
|
||||
return "displacement";
|
||||
case ReferenceQuantity::reaction:
|
||||
return "reaction";
|
||||
case ReferenceQuantity::internal_force:
|
||||
return "internal_force";
|
||||
case ReferenceQuantity::centroid_stress:
|
||||
return "centroid_stress";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
std::size_t expected_component_count(
|
||||
const ReferenceQuantity quantity) {
|
||||
switch (quantity) {
|
||||
case ReferenceQuantity::displacement:
|
||||
case ReferenceQuantity::reaction:
|
||||
case ReferenceQuantity::internal_force:
|
||||
return 6;
|
||||
case ReferenceQuantity::centroid_stress:
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string component_name(
|
||||
const ReferenceQuantity quantity,
|
||||
const std::size_t index) {
|
||||
switch (quantity) {
|
||||
case ReferenceQuantity::displacement:
|
||||
return std::string{NodalFrame::displacement_components[index]};
|
||||
case ReferenceQuantity::reaction:
|
||||
return std::string{NodalFrame::reaction_components[index]};
|
||||
case ReferenceQuantity::internal_force:
|
||||
return std::string{
|
||||
BeamElementFrame::section_force_components[index]};
|
||||
case ReferenceQuantity::centroid_stress:
|
||||
return std::string{BeamElementFrame::axial_stress_component};
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
std::string number_text(const double value) {
|
||||
std::ostringstream stream;
|
||||
stream << std::setprecision(std::numeric_limits<double>::max_digits10)
|
||||
<< value;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
std::string tolerance_text(const Tolerance tolerance) {
|
||||
return " relative_tolerance=" + number_text(tolerance.relative) +
|
||||
" absolute_scale=" + number_text(tolerance.absolute_scale);
|
||||
}
|
||||
|
||||
std::string position_text(
|
||||
const ReferenceQuantity quantity,
|
||||
const ResultPosition& position) {
|
||||
std::string text = "quantity=" + std::string{quantity_name(quantity)} +
|
||||
" instance=" + position.instance_name +
|
||||
" entity=" + std::to_string(position.entity_label);
|
||||
if (position.end_node_label.has_value()) {
|
||||
text += " end_node=" +
|
||||
std::to_string(*position.end_node_label);
|
||||
} else {
|
||||
text += " end_node=n/a";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
std::string scalar_failure_text(
|
||||
const ComparisonSample& sample,
|
||||
const std::size_t component,
|
||||
const double normalized_error) {
|
||||
return position_text(sample.quantity, sample.position) +
|
||||
" component=" + component_name(sample.quantity, component) +
|
||||
" reference=" + number_text(sample.reference[component]) +
|
||||
" actual=" + number_text(sample.actual[component]) +
|
||||
" normalized_error=" + number_text(normalized_error) +
|
||||
tolerance_text(sample.tolerance);
|
||||
}
|
||||
|
||||
std::string unevaluable_failure_text(
|
||||
const ReferenceQuantity quantity,
|
||||
const ResultPosition& position,
|
||||
const Tolerance tolerance,
|
||||
const std::string_view reason) {
|
||||
return position_text(quantity, position) +
|
||||
" component=n/a reference=n/a actual=n/a "
|
||||
"normalized_error=inf" + tolerance_text(tolerance) +
|
||||
" reason=" + std::string{reason};
|
||||
}
|
||||
|
||||
bool origin_matches(
|
||||
const EntityOrigin& origin,
|
||||
const std::string& instance_name,
|
||||
const std::int64_t local_label) {
|
||||
return origin.instance_name == instance_name &&
|
||||
origin.local_label == local_label;
|
||||
}
|
||||
|
||||
ComparisonSampleMatch matching_failure(
|
||||
const ReferenceQuantity quantity,
|
||||
const ResultPosition& position,
|
||||
const Tolerance tolerance,
|
||||
std::string code,
|
||||
const std::string_view reason) {
|
||||
std::vector<Diagnostic> failures;
|
||||
add_failure(
|
||||
failures,
|
||||
std::move(code),
|
||||
unevaluable_failure_text(
|
||||
quantity, position, tolerance, reason));
|
||||
return {std::nullopt, std::move(failures)};
|
||||
}
|
||||
|
||||
std::vector<double> as_vector(const std::array<double, 6>& values) {
|
||||
return {values.begin(), values.end()};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ComparisonSampleMatch make_comparison_sample(
|
||||
const ResultFrame& frame,
|
||||
const ReferenceQuantity quantity,
|
||||
const ResultPosition& position,
|
||||
const std::span<const double> reference,
|
||||
const Tolerance tolerance) {
|
||||
std::vector<double> actual;
|
||||
|
||||
if (
|
||||
quantity == ReferenceQuantity::displacement ||
|
||||
quantity == ReferenceQuantity::reaction) {
|
||||
if (position.end_node_label.has_value()) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.invalid_result_position",
|
||||
"nodal_position_has_end_node");
|
||||
}
|
||||
|
||||
std::optional<std::size_t> matched_index;
|
||||
for (
|
||||
std::size_t index = 0;
|
||||
index < frame.nodal.origins.size();
|
||||
++index) {
|
||||
if (origin_matches(
|
||||
frame.nodal.origins[index],
|
||||
position.instance_name,
|
||||
position.entity_label)) {
|
||||
if (matched_index.has_value()) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.unknown_result_origin",
|
||||
"ambiguous_result_origin");
|
||||
}
|
||||
matched_index = index;
|
||||
}
|
||||
}
|
||||
if (!matched_index.has_value()) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.unknown_result_origin",
|
||||
"unknown_result_origin");
|
||||
}
|
||||
|
||||
const auto& field =
|
||||
quantity == ReferenceQuantity::displacement
|
||||
? frame.nodal.displacement
|
||||
: frame.nodal.reaction;
|
||||
if (*matched_index >= field.size()) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.component_count_mismatch",
|
||||
"missing_actual_components");
|
||||
}
|
||||
actual = as_vector(field[*matched_index]);
|
||||
} else {
|
||||
if (!position.end_node_label.has_value()) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.invalid_element_node_pair",
|
||||
"missing_end_node");
|
||||
}
|
||||
|
||||
const BeamElementFrame* matched_beam = nullptr;
|
||||
for (const BeamElementFrame& beam : frame.element.beams) {
|
||||
if (origin_matches(
|
||||
beam.origin,
|
||||
position.instance_name,
|
||||
position.entity_label)) {
|
||||
if (matched_beam != nullptr) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.unknown_result_origin",
|
||||
"ambiguous_result_origin");
|
||||
}
|
||||
matched_beam = &beam;
|
||||
}
|
||||
}
|
||||
if (matched_beam == nullptr) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.unknown_result_origin",
|
||||
"unknown_result_origin");
|
||||
}
|
||||
|
||||
std::optional<NodeId> end_node;
|
||||
for (
|
||||
std::size_t index = 0;
|
||||
index < frame.nodal.origins.size() &&
|
||||
index < frame.nodal.node_ids.size();
|
||||
++index) {
|
||||
if (origin_matches(
|
||||
frame.nodal.origins[index],
|
||||
position.instance_name,
|
||||
*position.end_node_label)) {
|
||||
if (end_node.has_value()) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.unknown_result_origin",
|
||||
"ambiguous_end_node_origin");
|
||||
}
|
||||
end_node = frame.nodal.node_ids[index];
|
||||
}
|
||||
}
|
||||
if (!end_node.has_value()) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.unknown_result_origin",
|
||||
"unknown_end_node_origin");
|
||||
}
|
||||
|
||||
const BeamSectionResult* matched_end = nullptr;
|
||||
for (const BeamSectionResult& end : matched_beam->end_results) {
|
||||
if (end.end_node == *end_node) {
|
||||
matched_end = &end;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (matched_end == nullptr) {
|
||||
return matching_failure(
|
||||
quantity,
|
||||
position,
|
||||
tolerance,
|
||||
"validation.invalid_element_node_pair",
|
||||
"node_is_not_element_end");
|
||||
}
|
||||
|
||||
if (quantity == ReferenceQuantity::internal_force) {
|
||||
actual = as_vector(matched_end->section_force);
|
||||
} else {
|
||||
actual = {matched_end->centroid_sigma_xx};
|
||||
}
|
||||
}
|
||||
|
||||
ComparisonSample matched{
|
||||
quantity,
|
||||
position,
|
||||
{reference.begin(), reference.end()},
|
||||
std::move(actual),
|
||||
tolerance,
|
||||
};
|
||||
return {std::move(matched), {}};
|
||||
}
|
||||
|
||||
ComparisonReport compare_samples(
|
||||
const std::span<const ComparisonSample> samples) {
|
||||
ComparisonReport report{true, 0.0, {}};
|
||||
std::set<PositionKey> positions;
|
||||
|
||||
for (const ComparisonSample& sample : samples) {
|
||||
const PositionKey key{
|
||||
sample.quantity,
|
||||
sample.position.instance_name,
|
||||
sample.position.entity_label,
|
||||
sample.position.end_node_label,
|
||||
};
|
||||
if (!positions.insert(key).second) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.duplicate_result_position",
|
||||
unevaluable_failure_text(
|
||||
sample.quantity,
|
||||
sample.position,
|
||||
sample.tolerance,
|
||||
"duplicate_result_position"));
|
||||
report.maximum_normalized_error =
|
||||
std::numeric_limits<double>::infinity();
|
||||
continue;
|
||||
}
|
||||
|
||||
const std::size_t expected =
|
||||
expected_component_count(sample.quantity);
|
||||
if (
|
||||
sample.reference.size() != expected ||
|
||||
sample.actual.size() != expected) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.component_count_mismatch",
|
||||
unevaluable_failure_text(
|
||||
sample.quantity,
|
||||
sample.position,
|
||||
sample.tolerance,
|
||||
"component_count_mismatch") +
|
||||
" expected=" + std::to_string(expected) +
|
||||
" reference_count=" +
|
||||
std::to_string(sample.reference.size()) +
|
||||
" actual_count=" +
|
||||
std::to_string(sample.actual.size()));
|
||||
report.maximum_normalized_error =
|
||||
std::numeric_limits<double>::infinity();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
!std::isfinite(sample.tolerance.relative) ||
|
||||
!std::isfinite(sample.tolerance.absolute_scale) ||
|
||||
sample.tolerance.relative < 0.0 ||
|
||||
sample.tolerance.absolute_scale < 0.0) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.invalid_tolerance",
|
||||
unevaluable_failure_text(
|
||||
sample.quantity,
|
||||
sample.position,
|
||||
sample.tolerance,
|
||||
"invalid_tolerance"));
|
||||
report.maximum_normalized_error =
|
||||
std::numeric_limits<double>::infinity();
|
||||
continue;
|
||||
}
|
||||
|
||||
for (std::size_t component = 0; component < expected; ++component) {
|
||||
const double reference = sample.reference[component];
|
||||
const double actual = sample.actual[component];
|
||||
if (!std::isfinite(reference) || !std::isfinite(actual)) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.nonfinite_comparison_value",
|
||||
scalar_failure_text(
|
||||
sample,
|
||||
component,
|
||||
std::numeric_limits<double>::infinity()));
|
||||
report.maximum_normalized_error =
|
||||
std::numeric_limits<double>::infinity();
|
||||
continue;
|
||||
}
|
||||
|
||||
const double denominator =
|
||||
sample.tolerance.absolute_scale +
|
||||
sample.tolerance.relative * std::abs(reference);
|
||||
if (!(denominator > 0.0) || !std::isfinite(denominator)) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.invalid_tolerance",
|
||||
scalar_failure_text(
|
||||
sample,
|
||||
component,
|
||||
std::numeric_limits<double>::infinity()));
|
||||
report.maximum_normalized_error =
|
||||
std::numeric_limits<double>::infinity();
|
||||
continue;
|
||||
}
|
||||
|
||||
const double normalized_error =
|
||||
std::abs(actual - reference) / denominator;
|
||||
report.maximum_normalized_error = std::max(
|
||||
report.maximum_normalized_error,
|
||||
normalized_error);
|
||||
if (!(normalized_error <= 1.0)) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.tolerance_exceeded",
|
||||
scalar_failure_text(
|
||||
sample, component, normalized_error));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
report.passed = report.failures.empty();
|
||||
return report;
|
||||
}
|
||||
|
||||
CorrelationReport correlate_samples(
|
||||
const std::span<const ComparisonSample> samples) {
|
||||
struct Accumulator final {
|
||||
double squared_error{};
|
||||
double squared_reference{};
|
||||
double squared_absolute_scale{};
|
||||
std::size_t value_count{};
|
||||
};
|
||||
|
||||
CorrelationReport report{true, {}, {}};
|
||||
if (samples.empty()) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.empty_comparison",
|
||||
"No comparison samples were provided for correlation.");
|
||||
report.evaluable = false;
|
||||
return report;
|
||||
}
|
||||
|
||||
std::set<PositionKey> positions;
|
||||
std::map<std::pair<ReferenceQuantity, std::size_t>, Accumulator>
|
||||
accumulators;
|
||||
|
||||
for (const ComparisonSample& sample : samples) {
|
||||
const PositionKey key{
|
||||
sample.quantity,
|
||||
sample.position.instance_name,
|
||||
sample.position.entity_label,
|
||||
sample.position.end_node_label,
|
||||
};
|
||||
if (!positions.insert(key).second) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.duplicate_result_position",
|
||||
unevaluable_failure_text(
|
||||
sample.quantity,
|
||||
sample.position,
|
||||
sample.tolerance,
|
||||
"duplicate_result_position"));
|
||||
continue;
|
||||
}
|
||||
|
||||
const std::size_t expected =
|
||||
expected_component_count(sample.quantity);
|
||||
if (
|
||||
sample.reference.size() != expected ||
|
||||
sample.actual.size() != expected) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.component_count_mismatch",
|
||||
unevaluable_failure_text(
|
||||
sample.quantity,
|
||||
sample.position,
|
||||
sample.tolerance,
|
||||
"component_count_mismatch") +
|
||||
" expected=" + std::to_string(expected) +
|
||||
" reference_count=" +
|
||||
std::to_string(sample.reference.size()) +
|
||||
" actual_count=" +
|
||||
std::to_string(sample.actual.size()));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
!std::isfinite(sample.tolerance.relative) ||
|
||||
!std::isfinite(sample.tolerance.absolute_scale) ||
|
||||
sample.tolerance.relative < 0.0 ||
|
||||
sample.tolerance.absolute_scale < 0.0) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.invalid_tolerance",
|
||||
unevaluable_failure_text(
|
||||
sample.quantity,
|
||||
sample.position,
|
||||
sample.tolerance,
|
||||
"invalid_tolerance"));
|
||||
continue;
|
||||
}
|
||||
|
||||
for (std::size_t component = 0; component < expected; ++component) {
|
||||
const double reference = sample.reference[component];
|
||||
const double actual = sample.actual[component];
|
||||
if (!std::isfinite(reference) || !std::isfinite(actual)) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.nonfinite_comparison_value",
|
||||
scalar_failure_text(
|
||||
sample,
|
||||
component,
|
||||
std::numeric_limits<double>::infinity()));
|
||||
continue;
|
||||
}
|
||||
|
||||
const double error = actual - reference;
|
||||
Accumulator& accumulator =
|
||||
accumulators[{sample.quantity, component}];
|
||||
accumulator.squared_error += error * error;
|
||||
accumulator.squared_reference += reference * reference;
|
||||
accumulator.squared_absolute_scale +=
|
||||
sample.tolerance.absolute_scale *
|
||||
sample.tolerance.absolute_scale;
|
||||
++accumulator.value_count;
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& [key, accumulator] : accumulators) {
|
||||
const auto [quantity, component] = key;
|
||||
const double error_l2 = std::sqrt(accumulator.squared_error);
|
||||
const double root_mean_square_error =
|
||||
error_l2 /
|
||||
std::sqrt(static_cast<double>(accumulator.value_count));
|
||||
const double reference_l2 =
|
||||
std::sqrt(accumulator.squared_reference);
|
||||
const double absolute_scale_l2 =
|
||||
std::sqrt(accumulator.squared_absolute_scale);
|
||||
const double denominator =
|
||||
std::max(reference_l2, absolute_scale_l2);
|
||||
const double relative_l2_error = denominator > 0.0
|
||||
? error_l2 / denominator
|
||||
: error_l2 == 0.0
|
||||
? 0.0
|
||||
: std::numeric_limits<
|
||||
double>::infinity();
|
||||
|
||||
report.metrics.push_back({
|
||||
quantity,
|
||||
component,
|
||||
accumulator.value_count,
|
||||
root_mean_square_error,
|
||||
relative_l2_error,
|
||||
});
|
||||
if (
|
||||
!std::isfinite(root_mean_square_error) ||
|
||||
!std::isfinite(relative_l2_error)) {
|
||||
add_failure(
|
||||
report.failures,
|
||||
"validation.nonfinite_correlation_metric",
|
||||
"quantity=" + std::string{quantity_name(quantity)} +
|
||||
" component=" + component_name(quantity, component) +
|
||||
" rmse=" + number_text(root_mean_square_error) +
|
||||
" relative_l2=" + number_text(relative_l2_error));
|
||||
}
|
||||
}
|
||||
|
||||
report.evaluable = report.failures.empty();
|
||||
return report;
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,305 @@
|
||||
#include <fesa/io/hdf5/writer.hpp>
|
||||
#include <fesa/validation/comparison.hpp>
|
||||
#include <fesa/validation/reference_csv.hpp>
|
||||
|
||||
#include <charconv>
|
||||
#include <cmath>
|
||||
#include <filesystem>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
|
||||
struct ComparisonRequest final {
|
||||
std::filesystem::path results;
|
||||
std::string instance;
|
||||
std::filesystem::path displacements;
|
||||
std::filesystem::path reactions;
|
||||
std::filesystem::path internal_forces;
|
||||
double displacement_absolute_scale;
|
||||
double reaction_absolute_scale;
|
||||
double internal_force_absolute_scale;
|
||||
};
|
||||
|
||||
std::string_view quantity_name(const fesa::ReferenceQuantity quantity) {
|
||||
switch (quantity) {
|
||||
case fesa::ReferenceQuantity::displacement:
|
||||
return "displacement";
|
||||
case fesa::ReferenceQuantity::reaction:
|
||||
return "reaction";
|
||||
case fesa::ReferenceQuantity::internal_force:
|
||||
return "internal_force";
|
||||
case fesa::ReferenceQuantity::centroid_stress:
|
||||
return "centroid_stress";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
std::string_view component_name(
|
||||
const fesa::ReferenceQuantity quantity,
|
||||
const std::size_t component) {
|
||||
switch (quantity) {
|
||||
case fesa::ReferenceQuantity::displacement:
|
||||
return fesa::NodalFrame::displacement_components[component];
|
||||
case fesa::ReferenceQuantity::reaction:
|
||||
return fesa::NodalFrame::reaction_components[component];
|
||||
case fesa::ReferenceQuantity::internal_force:
|
||||
return fesa::BeamElementFrame::section_force_components[component];
|
||||
case fesa::ReferenceQuantity::centroid_stress:
|
||||
return fesa::BeamElementFrame::axial_stress_component;
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
std::string_view stage_name(const fesa::DiagnosticStage stage) {
|
||||
switch (stage) {
|
||||
case fesa::DiagnosticStage::io:
|
||||
return "io";
|
||||
case fesa::DiagnosticStage::syntax:
|
||||
return "syntax";
|
||||
case fesa::DiagnosticStage::semantic:
|
||||
return "semantic";
|
||||
case fesa::DiagnosticStage::model:
|
||||
return "model";
|
||||
case fesa::DiagnosticStage::equation:
|
||||
return "equation";
|
||||
case fesa::DiagnosticStage::solver:
|
||||
return "solver";
|
||||
case fesa::DiagnosticStage::results:
|
||||
return "results";
|
||||
case fesa::DiagnosticStage::validation:
|
||||
return "validation";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
void print_diagnostic(const fesa::Diagnostic& diagnostic) {
|
||||
std::cerr << stage_name(diagnostic.stage) << " [" << diagnostic.code
|
||||
<< "]";
|
||||
if (diagnostic.source.has_value()) {
|
||||
const fesa::SourceLocation& source = *diagnostic.source;
|
||||
std::cerr << ' ' << source.file.string() << ':' << source.line << ':'
|
||||
<< source.column;
|
||||
}
|
||||
std::cerr << ": " << diagnostic.message << '\n';
|
||||
}
|
||||
|
||||
void print_diagnostics(const std::vector<fesa::Diagnostic>& diagnostics) {
|
||||
for (const fesa::Diagnostic& diagnostic : diagnostics) {
|
||||
print_diagnostic(diagnostic);
|
||||
}
|
||||
}
|
||||
|
||||
void print_usage() {
|
||||
std::cerr
|
||||
<< "Usage:\n"
|
||||
<< " fesa-reference-compare --results <results.h5> "
|
||||
"--instance <name> --displacements <displacements.csv> "
|
||||
"--reactions <reactions.csv> "
|
||||
"--internal-forces <internal-forces.csv> "
|
||||
"--displacement-absolute-scale <value> "
|
||||
"--reaction-absolute-scale <value> "
|
||||
"--internal-force-absolute-scale <value>\n";
|
||||
}
|
||||
|
||||
std::optional<double> parse_number(const std::string_view text) {
|
||||
double value = 0.0;
|
||||
const auto parsed = std::from_chars(
|
||||
text.data(), text.data() + text.size(), value);
|
||||
if (
|
||||
parsed.ec != std::errc{} ||
|
||||
parsed.ptr != text.data() + text.size() ||
|
||||
!std::isfinite(value)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
std::optional<ComparisonRequest> parse_request(
|
||||
const int argc,
|
||||
char* argv[]) {
|
||||
if (argc != 17) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<std::filesystem::path> results;
|
||||
std::optional<std::string> instance;
|
||||
std::optional<std::filesystem::path> displacements;
|
||||
std::optional<std::filesystem::path> reactions;
|
||||
std::optional<std::filesystem::path> internal_forces;
|
||||
std::optional<double> displacement_absolute_scale;
|
||||
std::optional<double> reaction_absolute_scale;
|
||||
std::optional<double> internal_force_absolute_scale;
|
||||
|
||||
for (int index = 1; index < argc; index += 2) {
|
||||
const std::string_view option{argv[index]};
|
||||
const std::string_view value{argv[index + 1]};
|
||||
if (option == "--results" && !results.has_value()) {
|
||||
results = std::filesystem::path{value};
|
||||
} else if (option == "--instance" && !instance.has_value()) {
|
||||
instance = value;
|
||||
} else if (
|
||||
option == "--displacements" &&
|
||||
!displacements.has_value()) {
|
||||
displacements = std::filesystem::path{value};
|
||||
} else if (option == "--reactions" && !reactions.has_value()) {
|
||||
reactions = std::filesystem::path{value};
|
||||
} else if (
|
||||
option == "--internal-forces" &&
|
||||
!internal_forces.has_value()) {
|
||||
internal_forces = std::filesystem::path{value};
|
||||
} else if (
|
||||
option == "--displacement-absolute-scale" &&
|
||||
!displacement_absolute_scale.has_value()) {
|
||||
displacement_absolute_scale = parse_number(value);
|
||||
} else if (
|
||||
option == "--reaction-absolute-scale" &&
|
||||
!reaction_absolute_scale.has_value()) {
|
||||
reaction_absolute_scale = parse_number(value);
|
||||
} else if (
|
||||
option == "--internal-force-absolute-scale" &&
|
||||
!internal_force_absolute_scale.has_value()) {
|
||||
internal_force_absolute_scale = parse_number(value);
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!results.has_value() || results->empty() ||
|
||||
!instance.has_value() || instance->empty() ||
|
||||
!displacements.has_value() || displacements->empty() ||
|
||||
!reactions.has_value() || reactions->empty() ||
|
||||
!internal_forces.has_value() || internal_forces->empty() ||
|
||||
!displacement_absolute_scale.has_value() ||
|
||||
!reaction_absolute_scale.has_value() ||
|
||||
!internal_force_absolute_scale.has_value() ||
|
||||
*displacement_absolute_scale < 0.0 ||
|
||||
*reaction_absolute_scale < 0.0 ||
|
||||
*internal_force_absolute_scale < 0.0) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return ComparisonRequest{
|
||||
std::move(*results),
|
||||
std::move(*instance),
|
||||
std::move(*displacements),
|
||||
std::move(*reactions),
|
||||
std::move(*internal_forces),
|
||||
*displacement_absolute_scale,
|
||||
*reaction_absolute_scale,
|
||||
*internal_force_absolute_scale,
|
||||
};
|
||||
}
|
||||
|
||||
bool append_samples(
|
||||
const fesa::ResultFrame& frame,
|
||||
const std::vector<fesa::ReferenceRow>& rows,
|
||||
const fesa::Tolerance tolerance,
|
||||
std::vector<fesa::ComparisonSample>& samples) {
|
||||
bool matched = true;
|
||||
for (const fesa::ReferenceRow& row : rows) {
|
||||
fesa::ComparisonSampleMatch match = fesa::make_comparison_sample(
|
||||
frame,
|
||||
row.quantity,
|
||||
row.position,
|
||||
row.values,
|
||||
tolerance);
|
||||
if (!match.sample.has_value()) {
|
||||
print_diagnostics(match.failures);
|
||||
matched = false;
|
||||
continue;
|
||||
}
|
||||
samples.push_back(std::move(*match.sample));
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
const std::optional<ComparisonRequest> request =
|
||||
parse_request(argc, argv);
|
||||
if (!request.has_value()) {
|
||||
print_usage();
|
||||
return 1;
|
||||
}
|
||||
|
||||
const fesa::Hdf5ReadResult results =
|
||||
fesa::read_hdf5_results(request->results);
|
||||
if (!results.database.has_value()) {
|
||||
print_diagnostics(results.diagnostics);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const fesa::ReferenceCsvReadResult displacements =
|
||||
fesa::read_reference_csv(
|
||||
fesa::ReferenceQuantity::displacement,
|
||||
request->displacements,
|
||||
request->instance);
|
||||
const fesa::ReferenceCsvReadResult reactions =
|
||||
fesa::read_reference_csv(
|
||||
fesa::ReferenceQuantity::reaction,
|
||||
request->reactions,
|
||||
request->instance);
|
||||
const fesa::ReferenceCsvReadResult internal_forces =
|
||||
fesa::read_reference_csv(
|
||||
fesa::ReferenceQuantity::internal_force,
|
||||
request->internal_forces,
|
||||
request->instance);
|
||||
if (
|
||||
!displacements.diagnostics.empty() ||
|
||||
!reactions.diagnostics.empty() ||
|
||||
!internal_forces.diagnostics.empty()) {
|
||||
print_diagnostics(displacements.diagnostics);
|
||||
print_diagnostics(reactions.diagnostics);
|
||||
print_diagnostics(internal_forces.diagnostics);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const fesa::ResultFrame& frame =
|
||||
results.database->steps.front().frames.front();
|
||||
std::vector<fesa::ComparisonSample> samples;
|
||||
samples.reserve(
|
||||
displacements.rows.size() + reactions.rows.size() +
|
||||
internal_forces.rows.size());
|
||||
const bool displacements_matched = append_samples(
|
||||
frame,
|
||||
displacements.rows,
|
||||
{0.0, request->displacement_absolute_scale},
|
||||
samples);
|
||||
const bool reactions_matched = append_samples(
|
||||
frame,
|
||||
reactions.rows,
|
||||
{0.0, request->reaction_absolute_scale},
|
||||
samples);
|
||||
const bool internal_forces_matched = append_samples(
|
||||
frame,
|
||||
internal_forces.rows,
|
||||
{0.0, request->internal_force_absolute_scale},
|
||||
samples);
|
||||
if (
|
||||
!displacements_matched || !reactions_matched ||
|
||||
!internal_forces_matched) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const fesa::CorrelationReport report = fesa::correlate_samples(samples);
|
||||
std::cout << std::setprecision(std::numeric_limits<double>::max_digits10);
|
||||
for (const fesa::ComponentCorrelationMetric& metric : report.metrics) {
|
||||
std::cout << "metric quantity=" << quantity_name(metric.quantity)
|
||||
<< " component="
|
||||
<< component_name(metric.quantity, metric.component_index)
|
||||
<< " count=" << metric.value_count
|
||||
<< " rmse=" << metric.root_mean_square_error
|
||||
<< " relative_l2=" << metric.relative_l2_error << '\n';
|
||||
}
|
||||
print_diagnostics(report.failures);
|
||||
return report.evaluable ? 0 : 1;
|
||||
}
|
||||
@@ -0,0 +1,454 @@
|
||||
#include <fesa/validation/reference_csv.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <charconv>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace fesa {
|
||||
namespace {
|
||||
|
||||
constexpr std::string_view instance_column{"Part Instance Name"};
|
||||
constexpr std::string_view node_column{"Node Label"};
|
||||
constexpr std::string_view element_column{"Element Label"};
|
||||
|
||||
using PositionKey =
|
||||
std::tuple<std::string, std::int64_t, std::optional<std::int64_t>>;
|
||||
using ColumnIndices =
|
||||
std::map<std::string, std::size_t, std::less<>>;
|
||||
|
||||
std::size_t column_index(
|
||||
const ColumnIndices& column_indices,
|
||||
const std::string_view name) {
|
||||
return column_indices.find(name)->second;
|
||||
}
|
||||
|
||||
std::string_view trim(const std::string_view value) {
|
||||
constexpr std::string_view whitespace{" \t\f\v\r\n"};
|
||||
const std::size_t first = value.find_first_not_of(whitespace);
|
||||
if (first == std::string_view::npos) {
|
||||
return {};
|
||||
}
|
||||
const std::size_t last = value.find_last_not_of(whitespace);
|
||||
return value.substr(first, last - first + 1U);
|
||||
}
|
||||
|
||||
std::vector<std::string> split_fields(const std::string_view line) {
|
||||
std::vector<std::string> fields;
|
||||
std::size_t first = 0U;
|
||||
while (true) {
|
||||
const std::size_t comma = line.find(',', first);
|
||||
const std::string_view field =
|
||||
comma == std::string_view::npos
|
||||
? line.substr(first)
|
||||
: line.substr(first, comma - first);
|
||||
fields.emplace_back(trim(field));
|
||||
if (comma == std::string_view::npos) {
|
||||
break;
|
||||
}
|
||||
first = comma + 1U;
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
void remove_trailing_empty_fields(std::vector<std::string>& fields) {
|
||||
while (!fields.empty() && fields.back().empty()) {
|
||||
fields.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
ReferenceCsvReadResult failure(
|
||||
const DiagnosticStage stage,
|
||||
std::string code,
|
||||
std::string message,
|
||||
const std::filesystem::path& path,
|
||||
const std::size_t line) {
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
diagnostics.push_back({
|
||||
stage,
|
||||
Severity::error,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
SourceLocation{path, line, line == 0U ? 0U : 1U},
|
||||
});
|
||||
return {{}, std::move(diagnostics)};
|
||||
}
|
||||
|
||||
ReferenceCsvReadResult validation_failure(
|
||||
std::string code,
|
||||
std::string message,
|
||||
const std::filesystem::path& path,
|
||||
const std::size_t line) {
|
||||
return failure(
|
||||
DiagnosticStage::validation,
|
||||
std::move(code),
|
||||
std::move(message),
|
||||
path,
|
||||
line);
|
||||
}
|
||||
|
||||
bool is_valid_utf8(const std::string_view text) {
|
||||
std::size_t index = 0U;
|
||||
while (index < text.size()) {
|
||||
const auto first = static_cast<unsigned char>(text[index]);
|
||||
if (first <= 0x7FU) {
|
||||
++index;
|
||||
continue;
|
||||
}
|
||||
|
||||
std::size_t continuation_count = 0U;
|
||||
std::uint32_t code_point = 0U;
|
||||
std::uint32_t minimum = 0U;
|
||||
if (first >= 0xC2U && first <= 0xDFU) {
|
||||
continuation_count = 1U;
|
||||
code_point = first & 0x1FU;
|
||||
minimum = 0x80U;
|
||||
} else if (first >= 0xE0U && first <= 0xEFU) {
|
||||
continuation_count = 2U;
|
||||
code_point = first & 0x0FU;
|
||||
minimum = 0x800U;
|
||||
} else if (first >= 0xF0U && first <= 0xF4U) {
|
||||
continuation_count = 3U;
|
||||
code_point = first & 0x07U;
|
||||
minimum = 0x10000U;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (index + continuation_count >= text.size()) {
|
||||
return false;
|
||||
}
|
||||
for (std::size_t offset = 1U; offset <= continuation_count; ++offset) {
|
||||
const auto continuation =
|
||||
static_cast<unsigned char>(text[index + offset]);
|
||||
if ((continuation & 0xC0U) != 0x80U) {
|
||||
return false;
|
||||
}
|
||||
code_point = (code_point << 6U) | (continuation & 0x3FU);
|
||||
}
|
||||
if (code_point < minimum || code_point > 0x10FFFFU ||
|
||||
(code_point >= 0xD800U && code_point <= 0xDFFFU)) {
|
||||
return false;
|
||||
}
|
||||
index += continuation_count + 1U;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::size_t line_at_offset(
|
||||
const std::string_view text,
|
||||
const std::size_t offset) {
|
||||
return 1U + static_cast<std::size_t>(std::ranges::count(
|
||||
text.substr(0U, offset), '\n'));
|
||||
}
|
||||
|
||||
std::vector<std::string_view> required_columns(
|
||||
const ReferenceQuantity quantity) {
|
||||
switch (quantity) {
|
||||
case ReferenceQuantity::displacement:
|
||||
return {
|
||||
node_column,
|
||||
"U-U1",
|
||||
"U-U2",
|
||||
"U-U3",
|
||||
"UR-UR1",
|
||||
"UR-UR2",
|
||||
"UR-UR3",
|
||||
};
|
||||
case ReferenceQuantity::reaction:
|
||||
return {
|
||||
node_column,
|
||||
"RF-RF1",
|
||||
"RF-RF2",
|
||||
"RF-RF3",
|
||||
"RM-RM1",
|
||||
"RM-RM2",
|
||||
"RM-RM3",
|
||||
};
|
||||
case ReferenceQuantity::internal_force:
|
||||
return {
|
||||
element_column,
|
||||
node_column,
|
||||
"SF-SF1",
|
||||
"SF-SF2",
|
||||
"SF-SF3",
|
||||
"SM-SM1",
|
||||
"SM-SM2",
|
||||
"SM-SM3",
|
||||
};
|
||||
case ReferenceQuantity::centroid_stress:
|
||||
return {element_column, node_column, "Sxx"};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<std::string_view> value_columns(
|
||||
const ReferenceQuantity quantity) {
|
||||
switch (quantity) {
|
||||
case ReferenceQuantity::displacement:
|
||||
return {"U-U1", "U-U2", "U-U3", "UR-UR1", "UR-UR2", "UR-UR3"};
|
||||
case ReferenceQuantity::reaction:
|
||||
return {"RF-RF1", "RF-RF2", "RF-RF3", "RM-RM1", "RM-RM2", "RM-RM3"};
|
||||
case ReferenceQuantity::internal_force:
|
||||
return {"SF-SF1", "SF-SF3", "SF-SF2", "SM-SM3", "SM-SM1", "SM-SM2"};
|
||||
case ReferenceQuantity::centroid_stress:
|
||||
return {"Sxx"};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
bool parse_positive_label(
|
||||
std::string_view text,
|
||||
std::int64_t& value) {
|
||||
if (text.starts_with('+')) {
|
||||
text.remove_prefix(1U);
|
||||
}
|
||||
const auto parsed = std::from_chars(
|
||||
text.data(), text.data() + text.size(), value);
|
||||
return !text.empty() && parsed.ec == std::errc{} &&
|
||||
parsed.ptr == text.data() + text.size() && value > 0;
|
||||
}
|
||||
|
||||
bool parse_finite_double(std::string_view text, double& value) {
|
||||
if (text.starts_with('+')) {
|
||||
text.remove_prefix(1U);
|
||||
}
|
||||
const auto parsed = std::from_chars(
|
||||
text.data(),
|
||||
text.data() + text.size(),
|
||||
value,
|
||||
std::chars_format::general);
|
||||
return !text.empty() && parsed.ec == std::errc{} &&
|
||||
parsed.ptr == text.data() + text.size() &&
|
||||
std::isfinite(value);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ReferenceCsvReadResult read_reference_csv(
|
||||
const ReferenceQuantity quantity,
|
||||
const std::filesystem::path& path,
|
||||
const std::string_view single_instance_name) {
|
||||
std::ifstream file{path, std::ios::binary};
|
||||
if (!file) {
|
||||
return failure(
|
||||
DiagnosticStage::io,
|
||||
"validation.reference_csv_open_failed",
|
||||
"Unable to open reference CSV file.",
|
||||
path,
|
||||
0U);
|
||||
}
|
||||
|
||||
std::string bytes{
|
||||
std::istreambuf_iterator<char>{file},
|
||||
std::istreambuf_iterator<char>{},
|
||||
};
|
||||
if (file.bad()) {
|
||||
return failure(
|
||||
DiagnosticStage::io,
|
||||
"validation.reference_csv_read_failed",
|
||||
"Failed while reading reference CSV file.",
|
||||
path,
|
||||
0U);
|
||||
}
|
||||
|
||||
constexpr std::string_view bom{"\xEF\xBB\xBF"};
|
||||
if (bytes.starts_with(bom)) {
|
||||
bytes.erase(0U, bom.size());
|
||||
}
|
||||
const std::size_t misplaced_bom = bytes.find(bom);
|
||||
if (misplaced_bom != std::string::npos || !is_valid_utf8(bytes)) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_invalid_encoding",
|
||||
"Reference CSV must be UTF-8 with an optional BOM only at the file start.",
|
||||
path,
|
||||
misplaced_bom == std::string::npos
|
||||
? 1U
|
||||
: line_at_offset(bytes, misplaced_bom));
|
||||
}
|
||||
|
||||
std::istringstream input{bytes};
|
||||
std::string line;
|
||||
if (!std::getline(input, line)) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_missing_header",
|
||||
"Reference CSV is missing its header row.",
|
||||
path,
|
||||
1U);
|
||||
}
|
||||
|
||||
std::vector<std::string> headers = split_fields(line);
|
||||
remove_trailing_empty_fields(headers);
|
||||
ColumnIndices column_indices;
|
||||
for (std::size_t index = 0U; index < headers.size(); ++index) {
|
||||
if (headers[index].empty() ||
|
||||
!column_indices.emplace(headers[index], index).second) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_duplicate_column",
|
||||
"Reference CSV contains an empty or duplicate column name.",
|
||||
path,
|
||||
1U);
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<std::string_view> required = required_columns(quantity);
|
||||
for (const std::string_view name : required) {
|
||||
if (!column_indices.contains(name)) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_missing_column",
|
||||
"Reference CSV is missing required column '" +
|
||||
std::string{name} + "'.",
|
||||
path,
|
||||
1U);
|
||||
}
|
||||
}
|
||||
const bool has_instance = column_indices.contains(instance_column);
|
||||
if (!has_instance && single_instance_name.empty()) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_missing_column",
|
||||
"Reference CSV omits 'Part Instance Name' without a single-Instance name.",
|
||||
path,
|
||||
1U);
|
||||
}
|
||||
|
||||
std::set<std::string, std::less<>> allowed_columns;
|
||||
allowed_columns.emplace(instance_column);
|
||||
for (const std::string_view name : required) {
|
||||
allowed_columns.emplace(name);
|
||||
}
|
||||
for (const std::string& header : headers) {
|
||||
if (!allowed_columns.contains(header)) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_unsupported_column",
|
||||
"Reference CSV contains unsupported column '" + header + "'.",
|
||||
path,
|
||||
1U);
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<std::string_view> components = value_columns(quantity);
|
||||
std::vector<ReferenceRow> rows;
|
||||
std::set<PositionKey> positions;
|
||||
std::size_t line_number = 1U;
|
||||
while (std::getline(input, line)) {
|
||||
++line_number;
|
||||
if (trim(line).empty()) {
|
||||
continue;
|
||||
}
|
||||
std::vector<std::string> fields = split_fields(line);
|
||||
remove_trailing_empty_fields(fields);
|
||||
if (fields.size() != headers.size()) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_invalid_row",
|
||||
"Reference CSV row field count does not match the header.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
|
||||
std::string instance_name = has_instance
|
||||
? fields[column_index(
|
||||
column_indices,
|
||||
instance_column)]
|
||||
: std::string{single_instance_name};
|
||||
if (instance_name.empty()) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_invalid_row",
|
||||
"Reference CSV row has an empty Instance name.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
|
||||
std::int64_t entity_label = 0;
|
||||
const std::string_view entity_column =
|
||||
quantity == ReferenceQuantity::displacement ||
|
||||
quantity == ReferenceQuantity::reaction
|
||||
? node_column
|
||||
: element_column;
|
||||
if (!parse_positive_label(
|
||||
fields[column_index(column_indices, entity_column)],
|
||||
entity_label)) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_invalid_number",
|
||||
"Reference CSV entity label must be a positive integer.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
|
||||
std::optional<std::int64_t> end_node_label;
|
||||
if (quantity == ReferenceQuantity::internal_force ||
|
||||
quantity == ReferenceQuantity::centroid_stress) {
|
||||
std::int64_t parsed_end_node = 0;
|
||||
if (!parse_positive_label(
|
||||
fields[column_index(column_indices, node_column)],
|
||||
parsed_end_node)) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_invalid_number",
|
||||
"Reference CSV end-node label must be a positive integer.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
end_node_label = parsed_end_node;
|
||||
}
|
||||
|
||||
std::vector<double> values;
|
||||
values.reserve(components.size());
|
||||
for (const std::string_view component : components) {
|
||||
double value = 0.0;
|
||||
if (!parse_finite_double(
|
||||
fields[column_index(column_indices, component)],
|
||||
value)) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_invalid_number",
|
||||
"Reference CSV component '" + std::string{component} +
|
||||
"' must be a finite number.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
values.push_back(value);
|
||||
}
|
||||
|
||||
PositionKey key{instance_name, entity_label, end_node_label};
|
||||
if (!positions.insert(key).second) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_duplicate_row",
|
||||
"Reference CSV contains a duplicate result position.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
rows.push_back({
|
||||
quantity,
|
||||
{std::move(instance_name), entity_label, end_node_label},
|
||||
std::move(values),
|
||||
});
|
||||
}
|
||||
if (input.bad()) {
|
||||
return failure(
|
||||
DiagnosticStage::io,
|
||||
"validation.reference_csv_read_failed",
|
||||
"Failed while reading reference CSV file.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
if (rows.empty()) {
|
||||
return validation_failure(
|
||||
"validation.reference_csv_missing_rows",
|
||||
"Reference CSV contains no result rows.",
|
||||
path,
|
||||
line_number);
|
||||
}
|
||||
return {std::move(rows), {}};
|
||||
}
|
||||
|
||||
} // namespace fesa
|
||||
+430
-1
@@ -9,6 +9,12 @@ set_tests_properties(
|
||||
PASS_REGULAR_EXPRESSION "[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||
)
|
||||
|
||||
set_property(
|
||||
TEST VersionCommand
|
||||
PROPERTY ENVIRONMENT_MODIFICATION
|
||||
${FESA_DEPENDENCY_RUNTIME_MODIFICATIONS}
|
||||
)
|
||||
|
||||
add_executable(fesa_dependency_smoke_test
|
||||
unit/dependencies/dependency_smoke_test.cpp
|
||||
)
|
||||
@@ -112,7 +118,11 @@ add_test(
|
||||
)
|
||||
|
||||
add_executable(fesa_abaqus_parser_tests
|
||||
unit/io/abaqus/active_input_test.cpp
|
||||
unit/io/abaqus/input_contract_test.cpp
|
||||
unit/io/abaqus/material_section_mapping_test.cpp
|
||||
unit/io/abaqus/parser_test.cpp
|
||||
unit/io/abaqus/set_resolution_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(fesa_abaqus_parser_tests PRIVATE cxx_std_20)
|
||||
@@ -141,6 +151,60 @@ add_test(
|
||||
--gtest_filter=ScopedDeck.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME AbaqusInputContract
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=AbaqusInputContract/*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME SetResolution
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=SetResolution.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME PartSet
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=PartSet.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME AssemblySet
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=AssemblySet.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ActiveInput
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=ActiveInput.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME SemanticScope
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=SemanticScope.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME MaterialMapping
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=MaterialMapping.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME BeamSection
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=BeamSection.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ShearDefault
|
||||
COMMAND "$<TARGET_FILE:fesa_abaqus_parser_tests>"
|
||||
--gtest_filter=ShearDefault.*
|
||||
)
|
||||
|
||||
add_executable(fesa_deck_to_domain_tests
|
||||
integration/io/minimal_deck_to_domain_test.cpp
|
||||
)
|
||||
@@ -166,11 +230,35 @@ add_test(
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ActiveInstance
|
||||
NAME SingleInstance
|
||||
COMMAND "$<TARGET_FILE:fesa_deck_to_domain_tests>"
|
||||
--gtest_filter=ActiveInstance.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME StepMapping
|
||||
COMMAND "$<TARGET_FILE:fesa_deck_to_domain_tests>"
|
||||
--gtest_filter=StepMapping.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME Boundary
|
||||
COMMAND "$<TARGET_FILE:fesa_deck_to_domain_tests>"
|
||||
--gtest_filter=Boundary.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME Cload
|
||||
COMMAND "$<TARGET_FILE:fesa_deck_to_domain_tests>"
|
||||
--gtest_filter=Cload.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME SuppliedCantilever
|
||||
COMMAND "$<TARGET_FILE:fesa_deck_to_domain_tests>"
|
||||
--gtest_filter=SuppliedCantilever.*
|
||||
)
|
||||
|
||||
add_executable(fesa_fem_primitives_tests
|
||||
unit/fem/beam_frame_test.cpp
|
||||
unit/fem/dof_manager_test.cpp
|
||||
@@ -272,6 +360,24 @@ add_test(
|
||||
--gtest_filter=RigidBody.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME BeamRecovery
|
||||
COMMAND "$<TARGET_FILE:fesa_beam3d2_tests>"
|
||||
--gtest_filter=BeamRecovery.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME SectionForce
|
||||
COMMAND "$<TARGET_FILE:fesa_beam3d2_tests>"
|
||||
--gtest_filter=SectionForce.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME CentroidStress
|
||||
COMMAND "$<TARGET_FILE:fesa_beam3d2_tests>"
|
||||
--gtest_filter=CentroidStress.*
|
||||
)
|
||||
|
||||
add_executable(fesa_serial_assembly_tests
|
||||
unit/assembly/serial_assembler_test.cpp
|
||||
)
|
||||
@@ -309,6 +415,91 @@ add_test(
|
||||
--gtest_filter=SymmetricCsr.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME CanonicalContribution
|
||||
COMMAND "$<TARGET_FILE:fesa_serial_assembly_tests>"
|
||||
--gtest_filter=CanonicalContribution.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME DeterministicMerge
|
||||
COMMAND "$<TARGET_FILE:fesa_serial_assembly_tests>"
|
||||
--gtest_filter=DeterministicMerge.*
|
||||
)
|
||||
|
||||
add_executable(fesa_parallel_assembly_tests
|
||||
unit/assembly/parallel_assembler_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(fesa_parallel_assembly_tests PRIVATE cxx_std_20)
|
||||
target_compile_options(
|
||||
fesa_parallel_assembly_tests
|
||||
PRIVATE
|
||||
/W4
|
||||
/permissive-
|
||||
/EHsc
|
||||
)
|
||||
|
||||
target_link_libraries(fesa_parallel_assembly_tests
|
||||
PRIVATE
|
||||
fesa_core
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ParallelAssembly
|
||||
COMMAND "$<TARGET_FILE:fesa_parallel_assembly_tests>"
|
||||
--gtest_filter=ParallelAssembly.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME TbbElementEvaluation
|
||||
COMMAND "$<TARGET_FILE:fesa_parallel_assembly_tests>"
|
||||
--gtest_filter=TbbElementEvaluation.*
|
||||
)
|
||||
|
||||
set_property(
|
||||
TEST ParallelAssembly TbbElementEvaluation
|
||||
PROPERTY ENVIRONMENT_MODIFICATION
|
||||
${FESA_DEPENDENCY_RUNTIME_MODIFICATIONS}
|
||||
)
|
||||
|
||||
add_executable(fesa_thread_count_determinism_tests
|
||||
integration/assembly/thread_count_determinism_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(
|
||||
fesa_thread_count_determinism_tests PRIVATE cxx_std_20
|
||||
)
|
||||
target_compile_options(
|
||||
fesa_thread_count_determinism_tests
|
||||
PRIVATE
|
||||
/W4
|
||||
/permissive-
|
||||
/EHsc
|
||||
)
|
||||
|
||||
target_link_libraries(fesa_thread_count_determinism_tests
|
||||
PRIVATE
|
||||
fesa_core
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ThreadCountDeterminism
|
||||
COMMAND "$<TARGET_FILE:fesa_thread_count_determinism_tests>"
|
||||
)
|
||||
|
||||
set_property(
|
||||
TEST ThreadCountDeterminism
|
||||
PROPERTY ENVIRONMENT "MKL_NUM_THREADS=1"
|
||||
)
|
||||
set_property(
|
||||
TEST ThreadCountDeterminism
|
||||
PROPERTY ENVIRONMENT_MODIFICATION
|
||||
${FESA_DEPENDENCY_RUNTIME_MODIFICATIONS}
|
||||
)
|
||||
|
||||
add_executable(fesa_constraint_tests
|
||||
unit/constraints/essential_bc_test.cpp
|
||||
)
|
||||
@@ -375,3 +566,241 @@ set_property(
|
||||
PROPERTY ENVIRONMENT_MODIFICATION
|
||||
${FESA_DEPENDENCY_RUNTIME_MODIFICATIONS}
|
||||
)
|
||||
|
||||
add_executable(fesa_result_database_tests
|
||||
unit/results/result_database_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(fesa_result_database_tests PRIVATE cxx_std_20)
|
||||
target_compile_options(
|
||||
fesa_result_database_tests
|
||||
PRIVATE
|
||||
/W4
|
||||
/permissive-
|
||||
/EHsc
|
||||
)
|
||||
|
||||
target_link_libraries(fesa_result_database_tests
|
||||
PRIVATE
|
||||
fesa_core
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME NodalFrame
|
||||
COMMAND "$<TARGET_FILE:fesa_result_database_tests>"
|
||||
--gtest_filter=NodalFrame.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ResultDatabase
|
||||
COMMAND "$<TARGET_FILE:fesa_result_database_tests>"
|
||||
--gtest_filter=ResultDatabase.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ElementFrame
|
||||
COMMAND "$<TARGET_FILE:fesa_result_database_tests>"
|
||||
--gtest_filter=ElementFrame.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ResultContractMetadata
|
||||
COMMAND "$<TARGET_FILE:fesa_result_database_tests>"
|
||||
--gtest_filter=CompleteResultContract.*
|
||||
)
|
||||
|
||||
add_executable(fesa_hdf5_results_tests
|
||||
integration/io/hdf5_results_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(fesa_hdf5_results_tests PRIVATE cxx_std_20)
|
||||
target_compile_options(
|
||||
fesa_hdf5_results_tests
|
||||
PRIVATE
|
||||
/W4
|
||||
/permissive-
|
||||
/EHsc
|
||||
)
|
||||
target_compile_definitions(
|
||||
fesa_hdf5_results_tests
|
||||
PRIVATE
|
||||
FESA_TEST_BINARY_DIR="${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
|
||||
target_link_libraries(fesa_hdf5_results_tests
|
||||
PRIVATE
|
||||
fesa_core
|
||||
HDF5::HDF5
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME Hdf5
|
||||
COMMAND "$<TARGET_FILE:fesa_hdf5_results_tests>"
|
||||
--gtest_filter=Hdf5.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ResultRoundTrip
|
||||
COMMAND "$<TARGET_FILE:fesa_hdf5_results_tests>"
|
||||
--gtest_filter=ResultRoundTrip.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME SelfContainedHdf5
|
||||
COMMAND "$<TARGET_FILE:fesa_hdf5_results_tests>"
|
||||
--gtest_filter=SelfContainedHdf5.*
|
||||
)
|
||||
|
||||
set_property(
|
||||
TEST Hdf5 ResultRoundTrip SelfContainedHdf5
|
||||
PROPERTY ENVIRONMENT_MODIFICATION
|
||||
${FESA_DEPENDENCY_RUNTIME_MODIFICATIONS}
|
||||
)
|
||||
|
||||
add_executable(fesa_linear_static_analysis_tests
|
||||
unit/analysis/linear_static_analysis_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(
|
||||
fesa_linear_static_analysis_tests PRIVATE cxx_std_20
|
||||
)
|
||||
target_compile_options(
|
||||
fesa_linear_static_analysis_tests
|
||||
PRIVATE
|
||||
/W4
|
||||
/permissive-
|
||||
/EHsc
|
||||
)
|
||||
|
||||
target_link_libraries(fesa_linear_static_analysis_tests
|
||||
PRIVATE
|
||||
fesa_core
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME LinearStaticAnalysis
|
||||
COMMAND "$<TARGET_FILE:fesa_linear_static_analysis_tests>"
|
||||
--gtest_filter=LinearStaticAnalysis.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME StaticEquilibrium
|
||||
COMMAND "$<TARGET_FILE:fesa_linear_static_analysis_tests>"
|
||||
--gtest_filter=StaticEquilibrium.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME CompleteResultContract
|
||||
COMMAND "$<TARGET_FILE:fesa_linear_static_analysis_tests>"
|
||||
--gtest_filter=CompleteResultContract.*
|
||||
)
|
||||
|
||||
set_property(
|
||||
TEST LinearStaticAnalysis StaticEquilibrium CompleteResultContract
|
||||
PROPERTY ENVIRONMENT_MODIFICATION
|
||||
${FESA_DEPENDENCY_RUNTIME_MODIFICATIONS}
|
||||
)
|
||||
|
||||
add_executable(fesa_pipeline_integration_tests
|
||||
integration/pipeline/minimal_cantilever_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(
|
||||
fesa_pipeline_integration_tests PRIVATE cxx_std_20
|
||||
)
|
||||
target_compile_options(
|
||||
fesa_pipeline_integration_tests
|
||||
PRIVATE
|
||||
/W4
|
||||
/permissive-
|
||||
/EHsc
|
||||
)
|
||||
target_compile_definitions(
|
||||
fesa_pipeline_integration_tests
|
||||
PRIVATE
|
||||
FESA_CLI_PATH="$<TARGET_FILE:fesa>"
|
||||
FESA_TEST_BINARY_DIR="${CMAKE_BINARY_DIR}"
|
||||
FESA_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
)
|
||||
target_link_libraries(fesa_pipeline_integration_tests
|
||||
PRIVATE
|
||||
fesa_core
|
||||
GTest::gtest_main
|
||||
)
|
||||
add_dependencies(fesa_pipeline_integration_tests fesa)
|
||||
|
||||
add_test(
|
||||
NAME MinimalCantileverPipeline
|
||||
COMMAND "$<TARGET_FILE:fesa_pipeline_integration_tests>"
|
||||
--gtest_filter=MinimalCantileverPipeline.*
|
||||
)
|
||||
|
||||
set_property(
|
||||
TEST MinimalCantileverPipeline
|
||||
PROPERTY ENVIRONMENT_MODIFICATION
|
||||
${FESA_DEPENDENCY_RUNTIME_MODIFICATIONS}
|
||||
)
|
||||
|
||||
add_executable(fesa_validation_comparison_tests
|
||||
unit/validation/comparison_test.cpp
|
||||
unit/validation/reference_csv_test.cpp
|
||||
)
|
||||
|
||||
target_compile_features(
|
||||
fesa_validation_comparison_tests PRIVATE cxx_std_20
|
||||
)
|
||||
target_compile_options(
|
||||
fesa_validation_comparison_tests PRIVATE /W4 /permissive- /EHsc
|
||||
)
|
||||
target_compile_definitions(
|
||||
fesa_validation_comparison_tests
|
||||
PRIVATE
|
||||
FESA_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
)
|
||||
target_link_libraries(
|
||||
fesa_validation_comparison_tests
|
||||
PRIVATE
|
||||
fesa_core
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ComparisonMetric
|
||||
COMMAND "$<TARGET_FILE:fesa_validation_comparison_tests>"
|
||||
--gtest_filter=ComparisonMetric.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME CorrelationMetric
|
||||
COMMAND "$<TARGET_FILE:fesa_validation_comparison_tests>"
|
||||
--gtest_filter=CorrelationMetric.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME EntityMatching
|
||||
COMMAND "$<TARGET_FILE:fesa_validation_comparison_tests>"
|
||||
--gtest_filter=EntityMatching.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME ReferenceCsv
|
||||
COMMAND "$<TARGET_FILE:fesa_validation_comparison_tests>"
|
||||
--gtest_filter=ReferenceCsv.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME InternalForceCsv
|
||||
COMMAND "$<TARGET_FILE:fesa_validation_comparison_tests>"
|
||||
--gtest_filter=InternalForceCsv.*
|
||||
)
|
||||
|
||||
add_test(
|
||||
NAME StressCsv
|
||||
COMMAND "$<TARGET_FILE:fesa_validation_comparison_tests>"
|
||||
--gtest_filter=StressCsv.*
|
||||
)
|
||||
|
||||
add_subdirectory(reference)
|
||||
|
||||
Vendored
+75
@@ -0,0 +1,75 @@
|
||||
# case_id outcome fixture expected_stage expected_code expected_line node_count element_count node_set_count element_set_count prescribed_dof_count nodal_load_count shear_source shear_area_y shear_area_z checked_node_set checked_element_set
|
||||
node_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
element_b31_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
nset_explicit_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
elset_explicit_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
material_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
elastic_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
beam_general_section_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
boundary_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
cload_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
step_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
static_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
end_step_valid valid valid/flat_complete.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
part_valid valid valid/hierarchical_complete.inp - - 0 2 1 2 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
end_part_valid valid valid/hierarchical_complete.inp - - 0 2 1 2 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
assembly_valid valid valid/hierarchical_complete.inp - - 0 2 1 2 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
end_assembly_valid valid valid/hierarchical_complete.inp - - 0 2 1 2 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
instance_valid valid valid/hierarchical_complete.inp - - 0 2 1 2 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
end_instance_valid valid valid/hierarchical_complete.inp - - 0 2 1 2 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
assembly_nset_instance_valid valid valid/hierarchical_complete.inp - - 0 2 1 2 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
generate_nset_valid valid valid/generated_nested_sets.inp - - 0 3 2 2 2 18 1 phase1_default 0.8333333333333334 0.8333333333333334 AllNodes:1,2,3 AllElements:1,2
|
||||
generate_elset_valid valid valid/generated_nested_sets.inp - - 0 3 2 2 2 18 1 phase1_default 0.8333333333333334 0.8333333333333334 AllNodes:1,2,3 AllElements:1,2
|
||||
nested_sets_valid valid valid/generated_nested_sets.inp - - 0 3 2 2 2 18 1 phase1_default 0.8333333333333334 0.8333333333333334 AllNodes:1,2,3 AllElements:1,2
|
||||
transverse_shear_valid valid valid/explicit_transverse_shear.inp - - 0 2 1 1 1 6 1 input 0.8 0.5 Fixed:1 Beam:1
|
||||
heading_noop_valid valid valid/noop_directives.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
preprint_noop_valid valid valid/noop_directives.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
restart_noop_valid valid valid/noop_directives.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
output_noop_valid valid valid/noop_directives.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
enum_case_insensitive_valid valid valid/case_insensitive_enums.inp - - 0 2 1 1 1 6 1 phase1_default 0.8333333333333334 0.8333333333333334 Fixed:1 Beam:1
|
||||
node_duplicate_invalid invalid invalid/node_duplicate.inp semantic abaqus.semantic.duplicate_node_label 3 - - - - - - - - - - -
|
||||
element_type_invalid invalid invalid/element_wrong_type.inp semantic abaqus.semantic.unsupported_element 4 - - - - - - - - - - -
|
||||
part_unclosed_invalid invalid invalid/part_unclosed.inp syntax abaqus.syntax.unclosed_part 1 - - - - - - - - - - -
|
||||
assembly_multiple_invalid invalid invalid/assembly_multiple.inp syntax abaqus.syntax.multiple_assemblies 3 - - - - - - - - - - -
|
||||
instance_transform_invalid invalid invalid/instance_transform.inp semantic abaqus.semantic.instance_transform 5 - - - - - - - - - - -
|
||||
instance_local_mesh_invalid invalid invalid/instance_local_mesh.inp syntax abaqus.syntax.instance_local_keyword 5 - - - - - - - - - - -
|
||||
mixed_mesh_invalid invalid invalid/mixed_mesh.inp semantic abaqus.semantic.mixed_mesh_organization 1 - - - - - - - - - - -
|
||||
nset_parameter_invalid invalid invalid/nset_missing_name.inp semantic abaqus.semantic.missing_parameter 1 - - - - - - - - - - -
|
||||
elset_generate_invalid invalid invalid/elset_invalid_generate.inp semantic abaqus.semantic.invalid_generate 2 - - - - - - - - - - -
|
||||
nested_set_cycle_invalid invalid invalid/nested_set_cycle.inp semantic abaqus.semantic.set_cycle 4 - - - - - - - - - - -
|
||||
set_instance_invalid invalid invalid/assembly_set_wrong_instance.inp semantic abaqus.semantic.wrong_instance 6 - - - - - - - - - - -
|
||||
material_missing_elastic_invalid invalid invalid/material_missing_elastic.inp semantic abaqus.semantic.missing_elastic 1 - - - - - - - - - - -
|
||||
elastic_data_invalid invalid invalid/elastic_invalid_data.inp semantic abaqus.semantic.invalid_elastic_data 3 - - - - - - - - - - -
|
||||
section_type_invalid invalid invalid/section_wrong_type.inp semantic abaqus.semantic.unsupported_section 4 - - - - - - - - - - -
|
||||
section_duplicate_invalid invalid invalid/section_duplicate_assignment.inp semantic abaqus.semantic.duplicate_section_assignment 7 - - - - - - - - - - -
|
||||
transverse_scf_invalid invalid invalid/transverse_nonzero_scf.inp semantic abaqus.semantic.nonzero_scf 8 - - - - - - - - - - -
|
||||
boundary_conflict_invalid invalid invalid/boundary_conflict.inp semantic abaqus.semantic.conflicting_boundary 10 - - - - - - - - - - -
|
||||
cload_dof_invalid invalid invalid/cload_invalid_dof.inp semantic abaqus.semantic.invalid_dof 6 - - - - - - - - - - -
|
||||
step_multiple_invalid invalid invalid/step_multiple.inp semantic abaqus.semantic.step_count 4 - - - - - - - - - - -
|
||||
static_data_invalid invalid invalid/static_invalid_data.inp semantic abaqus.semantic.invalid_static_data 3 - - - - - - - - - - -
|
||||
end_step_missing_invalid invalid invalid/end_step_missing.inp syntax abaqus.syntax.unclosed_step 1 - - - - - - - - - - -
|
||||
heading_parameter_invalid invalid invalid/heading_invalid_parameter.inp syntax abaqus.syntax.unsupported_parameter 1 - - - - - - - - - - -
|
||||
preprint_parameter_invalid invalid invalid/preprint_invalid_parameter.inp syntax abaqus.syntax.unsupported_parameter 1 - - - - - - - - - - -
|
||||
restart_scope_invalid invalid invalid/restart_outside_step.inp syntax abaqus.syntax.invalid_restart_scope 1 - - - - - - - - - - -
|
||||
output_parameter_invalid invalid invalid/output_invalid_parameter.inp syntax abaqus.syntax.unsupported_parameter 3 - - - - - - - - - - -
|
||||
unknown_keyword_invalid invalid invalid/unknown_include.inp syntax abaqus.unsupported_keyword 1 - - - - - - - - - - -
|
||||
node_parameter_invalid invalid invalid/node_unsupported_parameter.inp syntax abaqus.syntax.unsupported_parameter 1 - - - - - - - - - - -
|
||||
node_scope_invalid invalid invalid/node_wrong_scope.inp syntax abaqus.syntax.invalid_node_scope 2 - - - - - - - - - - -
|
||||
material_scope_invalid invalid invalid/material_wrong_scope.inp syntax abaqus.syntax.invalid_material_scope 2 - - - - - - - - - - -
|
||||
generate_form_invalid invalid invalid/generate_valued.inp syntax abaqus.syntax.unsupported_parameter 1 - - - - - - - - - - -
|
||||
flat_set_instance_invalid invalid invalid/flat_set_instance.inp syntax abaqus.syntax.unsupported_parameter 1 - - - - - - - - - - -
|
||||
global_set_hierarchy_invalid invalid invalid/global_set_hierarchical.inp semantic abaqus.semantic.mixed_mesh_organization 1 - - - - - - - - - - -
|
||||
duplicate_part_invalid invalid invalid/duplicate_part.inp semantic abaqus.semantic.duplicate_part 3 - - - - - - - - - - -
|
||||
node_surplus_field_invalid invalid invalid/node_surplus_field.inp semantic abaqus.semantic.invalid_node_data 2 - - - - - - - - - - -
|
||||
node_empty_invalid invalid invalid/node_empty.inp semantic abaqus.semantic.invalid_node_data 1 - - - - - - - - - - -
|
||||
element_surplus_field_invalid invalid invalid/element_surplus_field.inp semantic abaqus.semantic.invalid_element_data 2 - - - - - - - - - - -
|
||||
element_empty_invalid invalid invalid/element_empty.inp semantic abaqus.semantic.invalid_element_data 1 - - - - - - - - - - -
|
||||
hierarchical_part_target_invalid invalid invalid/hierarchical_part_set_target.inp semantic abaqus.semantic.missing_node_target 25 - - - - - - - - - - -
|
||||
material_data_invalid invalid invalid/material_data.inp syntax abaqus.syntax.data_without_keyword 2 - - - - - - - - - - -
|
||||
node_coordinate_invalid invalid invalid/node_invalid_coordinate.inp semantic abaqus.semantic.invalid_number 2 - - - - - - - - - - -
|
||||
element_missing_node_invalid invalid invalid/element_missing_node.inp semantic abaqus.semantic.missing_node 4 - - - - - - - - - - -
|
||||
inactive_part_node_invalid invalid invalid/inactive_part_node_surplus.inp semantic abaqus.semantic.invalid_node_data 3 - - - - - - - - - - -
|
||||
inactive_part_element_invalid invalid invalid/inactive_part_element_type.inp semantic abaqus.semantic.unsupported_element 2 - - - - - - - - - - -
|
||||
inactive_part_section_invalid invalid invalid/inactive_part_section_data.inp semantic abaqus.semantic.invalid_section_data 3 - - - - - - - - - - -
|
||||
inactive_part_duplicate_node_invalid invalid invalid/inactive_part_duplicate_node.inp semantic abaqus.semantic.duplicate_node_label 4 - - - - - - - - - - -
|
||||
inactive_part_missing_node_invalid invalid invalid/inactive_part_missing_node.inp semantic abaqus.semantic.missing_node 5 - - - - - - - - - - -
|
||||
|
@@ -0,0 +1,4 @@
|
||||
*ASSEMBLY, NAME=First
|
||||
*END ASSEMBLY
|
||||
*ASSEMBLY, NAME=Second
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,8 @@
|
||||
*PART, NAME=BeamPart
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=Root
|
||||
*INSTANCE, NAME=Beam-1, PART=BeamPart
|
||||
*END INSTANCE
|
||||
*NSET, NSET=Fixed, INSTANCE=Other
|
||||
1
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,11 @@
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
*NSET, NSET=Fixed
|
||||
1
|
||||
*STEP
|
||||
*STATIC
|
||||
*BOUNDARY
|
||||
Fixed, 1, 1, 0.0
|
||||
*BOUNDARY
|
||||
Fixed, 1, 1, 1.0
|
||||
*END STEP
|
||||
@@ -0,0 +1,7 @@
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
*STEP
|
||||
*STATIC
|
||||
*CLOAD
|
||||
1, 7, 1.0
|
||||
*END STEP
|
||||
@@ -0,0 +1,8 @@
|
||||
*PART, NAME=BeamPart
|
||||
*END PART
|
||||
*PART, NAME=BeamPart
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Beam-1, PART=BeamPart
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,6 @@
|
||||
*MATERIAL, NAME=Steel
|
||||
*ELASTIC
|
||||
-1.0, 0.25
|
||||
*STEP
|
||||
*STATIC
|
||||
*END STEP
|
||||
@@ -0,0 +1,4 @@
|
||||
*ELEMENT, TYPE=B31
|
||||
*STEP
|
||||
*STATIC
|
||||
*END STEP
|
||||
@@ -0,0 +1,13 @@
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
*ELEMENT, TYPE=B31, ELSET=Beam
|
||||
1, 1, 2
|
||||
*MATERIAL, NAME=Steel
|
||||
*ELASTIC
|
||||
210000.0, 0.3
|
||||
*BEAM GENERAL SECTION, SECTION=GENERAL, ELSET=Beam, MATERIAL=Steel
|
||||
1.0, 1.0, 0.0, 1.0, 1.0
|
||||
0.0, 1.0, 0.0
|
||||
*STEP
|
||||
*STATIC
|
||||
*END STEP
|
||||
@@ -0,0 +1,5 @@
|
||||
*ELEMENT, TYPE=B31
|
||||
1, 1, 2, 3
|
||||
*STEP
|
||||
*STATIC
|
||||
*END STEP
|
||||
@@ -0,0 +1,8 @@
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
2, 1.0, 0.0, 0.0
|
||||
*ELEMENT, TYPE=B32, ELSET=Beam
|
||||
1, 1, 2
|
||||
*STEP
|
||||
*STATIC
|
||||
*END STEP
|
||||
@@ -0,0 +1,5 @@
|
||||
*ELSET, ELSET=Beam, GENERATE
|
||||
3, 1, 1
|
||||
*STEP
|
||||
*STATIC
|
||||
*END STEP
|
||||
@@ -0,0 +1,2 @@
|
||||
*STEP
|
||||
*STATIC
|
||||
@@ -0,0 +1,2 @@
|
||||
*NSET, NSET=Fixed, INSTANCE=Beam-1
|
||||
1
|
||||
@@ -0,0 +1,2 @@
|
||||
*NSET, NSET=Generated, GENERATE=YES
|
||||
1, 2, 1
|
||||
@@ -0,0 +1,7 @@
|
||||
*NSET, NSET=Ignored
|
||||
*PART, NAME=BeamPart
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Beam-1, PART=BeamPart
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1 @@
|
||||
*HEADING, NAME=Unsupported
|
||||
@@ -0,0 +1,26 @@
|
||||
*PART, NAME=BeamPart
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
2, 1.0, 0.0, 0.0
|
||||
*ELEMENT, TYPE=B31, ELSET=Beam
|
||||
1, 1, 2
|
||||
*NSET, NSET=Fixed
|
||||
1
|
||||
*ELSET, ELSET=Beam
|
||||
1
|
||||
*BEAM GENERAL SECTION, SECTION=GENERAL, ELSET=Beam, MATERIAL=Steel
|
||||
1.0, 1.0, 0.0, 1.0, 1.0
|
||||
0.0, 1.0, 0.0
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Beam-1, PART=BeamPart
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
*MATERIAL, NAME=Steel
|
||||
*ELASTIC
|
||||
200.0, 0.25
|
||||
*STEP
|
||||
*STATIC
|
||||
*BOUNDARY
|
||||
Fixed, 1, 6
|
||||
*END STEP
|
||||
@@ -0,0 +1,11 @@
|
||||
*PART, NAME=Unused
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
1, 1.0, 0.0, 0.0
|
||||
*END PART
|
||||
*PART, NAME=Active
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Active-1, PART=Active
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,10 @@
|
||||
*PART, NAME=Unused
|
||||
*ELEMENT, TYPE=B32
|
||||
1, 1, 2
|
||||
*END PART
|
||||
*PART, NAME=Active
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Active-1, PART=Active
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,12 @@
|
||||
*PART, NAME=Unused
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
*ELEMENT, TYPE=B31
|
||||
1, 1, 2
|
||||
*END PART
|
||||
*PART, NAME=Active
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Active-1, PART=Active
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,10 @@
|
||||
*PART, NAME=Unused
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0, 9.0
|
||||
*END PART
|
||||
*PART, NAME=Active
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Active-1, PART=Active
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,11 @@
|
||||
*PART, NAME=Unused
|
||||
*BEAM GENERAL SECTION, SECTION=GENERAL, ELSET=Beam, MATERIAL=Steel
|
||||
0.0, 1.0, 0.0, 1.0, 1.0
|
||||
0.0, 1.0, 0.0
|
||||
*END PART
|
||||
*PART, NAME=Active
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=RootAssembly
|
||||
*INSTANCE, NAME=Active-1, PART=Active
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,8 @@
|
||||
*PART, NAME=BeamPart
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=Root
|
||||
*INSTANCE, NAME=Beam-1, PART=BeamPart
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,7 @@
|
||||
*PART, NAME=BeamPart
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=Root
|
||||
*INSTANCE, NAME=Beam-1, PART=BeamPart
|
||||
1.0, 2.0, 3.0
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
@@ -0,0 +1,2 @@
|
||||
*MATERIAL, NAME=Steel
|
||||
unexpected data
|
||||
@@ -0,0 +1,4 @@
|
||||
*MATERIAL, NAME=Steel
|
||||
*STEP
|
||||
*STATIC
|
||||
*END STEP
|
||||
@@ -0,0 +1,3 @@
|
||||
*PART, NAME=BeamPart
|
||||
*MATERIAL, NAME=Steel
|
||||
*END PART
|
||||
@@ -0,0 +1,8 @@
|
||||
*NODE
|
||||
1, 0.0, 0.0, 0.0
|
||||
*PART, NAME=BeamPart
|
||||
*END PART
|
||||
*ASSEMBLY, NAME=Root
|
||||
*INSTANCE, NAME=Beam-1, PART=BeamPart
|
||||
*END INSTANCE
|
||||
*END ASSEMBLY
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user