From b8f6514c9a29617c453c5a7bc12e7df70f25acc8 Mon Sep 17 00:00:00 2001 From: Alder Date: Wed, 6 Dec 2023 13:51:38 +0100 Subject: [PATCH 001/122] remove macos test for now... --- .github/workflows/continuous-integration.yml | 32 +------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index efe796b671..54abe02179 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -55,12 +55,6 @@ on: default: '' type: string - macos-package-artifact: - description: "Name of the Mac OS package artifact. Leave empty to skip building the package." - required: false - default: '' - type: string - jobs: build-linux: @@ -161,33 +155,9 @@ jobs: unit-tests: true integration-tests: ${{ inputs.integration-tests == 'true' }} - build-macos: - runs-on: "macos-latest" - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/build-macos - with: - config: "Release" - tigl_nightly: ${{ inputs.tigl_nightly =='true' }} - tigl_concat_generated_files: ${{ inputs.tigl_concat_generated_files == 'true' }} - tigl_enable_coverage: 'OFF' - package-artifact: ${{ inputs.macos-package-artifact }} - build-artifact: build-macos-latest-Release-nightly-${{ inputs.tigl_nightly }}-concat-${{ inputs.tigl_concat_generated_files }}-cov-OFF-static-ON-python-OFF - - test-macos: - needs: build-macos - runs-on: "macos-latest" - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/test-macos - with: - build-artifact: build-macos-latest-Release-nightly-${{ inputs.tigl_nightly }}-concat-${{ inputs.tigl_concat_generated_files }}-cov-OFF-static-ON-python-OFF - unit-tests: true - integration-tests: ${{ inputs.integration-tests == 'true' }} - draft-release: if: ${{ inputs.draft-release == 'true' }} - needs: ["test-macos", "test-windows", "test-linux"] + needs: ["test-windows", "test-linux"] runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 From 12b6eabc8c32581eeb4c1318642414eda5111a66 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 7 Dec 2023 16:16:10 +0100 Subject: [PATCH 002/122] create and implement new fuselageFuelTanks classes --- cpacs_gen_input/PruneList.txt | 2 +- cpacs_gen_input/cpacs_schema.xsd | 443 ++++++++++++++++-- src/cpacs_other/CCPACSMaterialDefinition.cpp | 1 + src/cpacs_other/CCPACSMaterialDefinition.h | 1 + src/fuselage/CCPACSFramesAssembly.cpp | 5 + src/fuselage/CCPACSFramesAssembly.h | 1 + src/fuselage/CCPACSFuselageSections.cpp | 3 + src/fuselage/CCPACSFuselageSections.h | 1 + src/fuselage/CCPACSFuselageSegments.cpp | 5 + src/fuselage/CCPACSFuselageSegments.h | 1 + src/fuselage/CCPACSSkin.cpp | 3 + src/fuselage/CCPACSSkin.h | 1 + src/fuselage/CCPACSStringersAssembly.cpp | 5 + src/fuselage/CCPACSStringersAssembly.h | 1 + src/generated/CPACSDomeType.cpp | 320 +++++++++++++ src/generated/CPACSDomeType.h | 109 +++++ src/generated/CPACSEllipsoidDome.cpp | 98 ++++ src/generated/CPACSEllipsoidDome.h | 76 +++ src/generated/CPACSEmptyElementBase.cpp | 183 ++++++++ src/generated/CPACSEmptyElementBase.h | 91 ++++ src/generated/CPACSFramesAssembly.cpp | 15 + src/generated/CPACSFramesAssembly.h | 11 +- src/generated/CPACSFuelTankVolume.cpp | 239 ++++++++++ src/generated/CPACSFuelTankVolume.h | 109 +++++ src/generated/CPACSFuselage.cpp | 44 ++ src/generated/CPACSFuselage.h | 9 + src/generated/CPACSFuselageFuelTanks.cpp | 133 ++++++ src/generated/CPACSFuselageFuelTanks.h | 87 ++++ src/generated/CPACSFuselageSections.cpp | 15 + src/generated/CPACSFuselageSections.h | 11 +- src/generated/CPACSFuselageSegments.cpp | 15 + src/generated/CPACSFuselageSegments.h | 11 +- src/generated/CPACSGenericFuelTank.cpp | 373 +++++++++++++++ src/generated/CPACSGenericFuelTank.h | 132 ++++++ .../CPACSGenericFuelTankParameters.cpp | 202 ++++++++ .../CPACSGenericFuelTankParameters.h | 106 +++++ src/generated/CPACSGenericFuelTanks.cpp | 129 +++++ src/generated/CPACSGenericFuelTanks.h | 89 ++++ src/generated/CPACSHull.cpp | 293 ++++++++++++ src/generated/CPACSHull.h | 123 +++++ src/generated/CPACSHullSkinLayers.cpp | 123 +++++ src/generated/CPACSHullSkinLayers.h | 88 ++++ src/generated/CPACSHullStructure.cpp | 340 ++++++++++++++ src/generated/CPACSHullStructure.h | 122 +++++ src/generated/CPACSHulls.cpp | 123 +++++ src/generated/CPACSHulls.h | 88 ++++ src/generated/CPACSIsotensoidDome.cpp | 98 ++++ src/generated/CPACSIsotensoidDome.h | 76 +++ src/generated/CPACSMaterialDefinition.cpp | 15 + src/generated/CPACSMaterialDefinition.h | 8 +- src/generated/CPACSSkin.cpp | 15 + src/generated/CPACSSkin.h | 11 +- src/generated/CPACSStringersAssembly.cpp | 15 + src/generated/CPACSStringersAssembly.h | 11 +- src/generated/CPACSTorisphericalDome.cpp | 121 +++++ src/generated/CPACSTorisphericalDome.h | 82 ++++ src/generated/CPACSTransformation.cpp | 30 ++ src/generated/CPACSTransformation.h | 12 +- src/geometry/CCPACSTransformation.cpp | 12 + src/geometry/CCPACSTransformation.h | 2 + 60 files changed, 4825 insertions(+), 63 deletions(-) create mode 100644 src/generated/CPACSDomeType.cpp create mode 100644 src/generated/CPACSDomeType.h create mode 100644 src/generated/CPACSEllipsoidDome.cpp create mode 100644 src/generated/CPACSEllipsoidDome.h create mode 100644 src/generated/CPACSEmptyElementBase.cpp create mode 100644 src/generated/CPACSEmptyElementBase.h create mode 100644 src/generated/CPACSFuelTankVolume.cpp create mode 100644 src/generated/CPACSFuelTankVolume.h create mode 100644 src/generated/CPACSFuselageFuelTanks.cpp create mode 100644 src/generated/CPACSFuselageFuelTanks.h create mode 100644 src/generated/CPACSGenericFuelTank.cpp create mode 100644 src/generated/CPACSGenericFuelTank.h create mode 100644 src/generated/CPACSGenericFuelTankParameters.cpp create mode 100644 src/generated/CPACSGenericFuelTankParameters.h create mode 100644 src/generated/CPACSGenericFuelTanks.cpp create mode 100644 src/generated/CPACSGenericFuelTanks.h create mode 100644 src/generated/CPACSHull.cpp create mode 100644 src/generated/CPACSHull.h create mode 100644 src/generated/CPACSHullSkinLayers.cpp create mode 100644 src/generated/CPACSHullSkinLayers.h create mode 100644 src/generated/CPACSHullStructure.cpp create mode 100644 src/generated/CPACSHullStructure.h create mode 100644 src/generated/CPACSHulls.cpp create mode 100644 src/generated/CPACSHulls.h create mode 100644 src/generated/CPACSIsotensoidDome.cpp create mode 100644 src/generated/CPACSIsotensoidDome.h create mode 100644 src/generated/CPACSTorisphericalDome.cpp create mode 100644 src/generated/CPACSTorisphericalDome.h diff --git a/cpacs_gen_input/PruneList.txt b/cpacs_gen_input/PruneList.txt index 05cf95c592..ac8b4b3f64 100644 --- a/cpacs_gen_input/PruneList.txt +++ b/cpacs_gen_input/PruneList.txt @@ -43,7 +43,7 @@ CPACSReference // in fuselage CPACSDecks CPACSFuselageCutOuts -CPACSFuselageFuelTanks +CPACSIntegralFuelTanks CPACSCenterFuselageAreasAssembly CPACSFloorPanels CPACSGeneralStructuralMembersAssembly diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index 7718e76a44..3861994935 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -12615,58 +12615,12 @@ marko.alder@dlr.de - - - - - - Definition of one fuselage fuel tank. - - - The definition of fuselage tanks is still preliminary. - Currently, there is no link to any structural elements - - - - - - - - - - - Name of the fuselage fuel tank. - - - - - - Description of the fuselage fuel tank. - - - - - - Link to the tank geometry defined by a compartment. - - - - - - - - - - - - - - List of fuselage fuel tanks. + List of fuel tanks @@ -12677,12 +12631,13 @@ marko.alder@dlr.de - + The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. The fuel tank volume type should also be used for the wing fuel tank + @@ -34132,4 +34087,396 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + + List of fuselage fuel tanks integrated in compartments. + + + + + + + + + + + + + The integral fuel tank geometry is defined by a link to a fuselage geometry compartment. +The fuel tank volume type should also be used for the wing fuel tank + + + + + + + + + + + + + Definition of one fuel tank integrated in a fuselage compartment. + + + The definition of fuselage tanks is still preliminary. + Currently, there is no link to any structural elements + + + + + + + + + + + Name of the fuselage fuel tank. + + + + + + Description of the fuselage fuel tank. + + + + + + Link to the tank geometry defined by a compartment. + + + + + + + + + + + + + + + + + + + Generic fuel tank + + + + + + + + + + + + + + + + + + + + + + Cryogenic tank + + + + + + + + + + Name + + + + + + Description + + + + + + + + + + Volume + + + + + Burst pressure + + + + + + + + + + + + + + Hulls + + + + + + + + + + + + + + + + + + + Hulls + + + + + + + + + + Name + + + + + + Description + + + + + + + + + + + + + + + + + + + + Global design parameters + + + + + + + + + + + Inner radius of the cylinder + + + + + Inner length of the cylinder + + + + + + + + + + + + + + + Dome Type + + + + + + + + + + + + + + + + + + + + + + + + + Emtpy element + + + Base type for string nodes (including external data + attributes) + + + + + + + + + + + + + + + + + Ellipsoid dome + + + + + + + + + + Half axis fraction + + + + + + + + + + + + + Torispherical dome + + + + + + + + + + R1: dish radius + + + + + R2: knuckle radius + + + + + + + + + + + + + Isotensoid dome + + + + + + + + + + Radius of the fitting/smaller polar opening + + + + + + + + + + + + + Structure + + + + + + + + + + + + + + + + + + + + + + + + Skin Layers + + + + + + + + + + + + + + + + diff --git a/src/cpacs_other/CCPACSMaterialDefinition.cpp b/src/cpacs_other/CCPACSMaterialDefinition.cpp index db0f743b40..93650be77f 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.cpp +++ b/src/cpacs_other/CCPACSMaterialDefinition.cpp @@ -30,6 +30,7 @@ CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDMa CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} bool CCPACSMaterialDefinition::isComposite() const diff --git a/src/cpacs_other/CCPACSMaterialDefinition.h b/src/cpacs_other/CCPACSMaterialDefinition.h index 58de1219df..739e726f67 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.h +++ b/src/cpacs_other/CCPACSMaterialDefinition.h @@ -39,6 +39,7 @@ class CCPACSMaterialDefinition : public generated::CPACSMaterialDefinition TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT bool isComposite() const; diff --git a/src/fuselage/CCPACSFramesAssembly.cpp b/src/fuselage/CCPACSFramesAssembly.cpp index c9cab67b0c..b43c89cd27 100644 --- a/src/fuselage/CCPACSFramesAssembly.cpp +++ b/src/fuselage/CCPACSFramesAssembly.cpp @@ -33,6 +33,11 @@ CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUID { } +CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFramesAssembly(parent, uidMgr) +{ +} + void CCPACSFramesAssembly::Invalidate(const boost::optional& source) const { for (size_t i = 0; i < m_frames.size(); i++) diff --git a/src/fuselage/CCPACSFramesAssembly.h b/src/fuselage/CCPACSFramesAssembly.h index a4c2cb9985..dcf5095d0f 100644 --- a/src/fuselage/CCPACSFramesAssembly.h +++ b/src/fuselage/CCPACSFramesAssembly.h @@ -32,6 +32,7 @@ class CCPACSFramesAssembly : public generated::CPACSFramesAssembly public: TIGL_EXPORT CCPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; diff --git a/src/fuselage/CCPACSFuselageSections.cpp b/src/fuselage/CCPACSFuselageSections.cpp index 057e7e24c2..ab30fff703 100644 --- a/src/fuselage/CCPACSFuselageSections.cpp +++ b/src/fuselage/CCPACSFuselageSections.cpp @@ -32,6 +32,9 @@ CCPACSFuselageSections::CCPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDM CCPACSFuselageSections::CCPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr) : generated::CPACSFuselageSections(parent, uidMgr) {} +CCPACSFuselageSections::CCPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFuselageSections(parent, uidMgr) {} + int CCPACSFuselageSections::GetSectionCount() const { return static_cast(m_sections.size()); diff --git a/src/fuselage/CCPACSFuselageSections.h b/src/fuselage/CCPACSFuselageSections.h index 7b8f4f3409..cc69247840 100644 --- a/src/fuselage/CCPACSFuselageSections.h +++ b/src/fuselage/CCPACSFuselageSections.h @@ -38,6 +38,7 @@ class CCPACSFuselageSections : public generated::CPACSFuselageSections public: TIGL_EXPORT CCPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr); // Get section count TIGL_EXPORT int GetSectionCount() const; diff --git a/src/fuselage/CCPACSFuselageSegments.cpp b/src/fuselage/CCPACSFuselageSegments.cpp index 7b7deb0ce4..0fec5828a3 100644 --- a/src/fuselage/CCPACSFuselageSegments.cpp +++ b/src/fuselage/CCPACSFuselageSegments.cpp @@ -60,6 +60,11 @@ CCPACSFuselageSegments::CCPACSFuselageSegments(CCPACSFuselage* parent, CTiglUIDM , guideCurves(*this, &CCPACSFuselageSegments::BuildGuideCurves) {} +CCPACSFuselageSegments::CCPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFuselageSegments(parent, uidMgr) + , guideCurves(*this, &CCPACSFuselageSegments::BuildGuideCurves) +{} + CCPACSConfiguration const& CCPACSFuselageSegments::GetConfiguration() const { if (IsParent()) { diff --git a/src/fuselage/CCPACSFuselageSegments.h b/src/fuselage/CCPACSFuselageSegments.h index f29efdfb90..4da18a436f 100644 --- a/src/fuselage/CCPACSFuselageSegments.h +++ b/src/fuselage/CCPACSFuselageSegments.h @@ -39,6 +39,7 @@ class CCPACSFuselageSegments : public generated::CPACSFuselageSegments public: TIGL_EXPORT CCPACSFuselageSegments(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSFuselageSegments(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSConfiguration const& GetConfiguration() const; diff --git a/src/fuselage/CCPACSSkin.cpp b/src/fuselage/CCPACSSkin.cpp index 7de048a1ae..faaefcfca3 100644 --- a/src/fuselage/CCPACSSkin.cpp +++ b/src/fuselage/CCPACSSkin.cpp @@ -32,6 +32,9 @@ CCPACSSkin::CCPACSSkin(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr) CCPACSSkin::CCPACSSkin(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr) : generated::CPACSSkin(parent, uidMgr) {} +CCPACSSkin::CCPACSSkin(CCPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr) + : generated::CPACSSkin(parent, uidMgr) {} + CTiglRelativelyPositionedComponent const* CCPACSSkin::GetParentComponent() const { diff --git a/src/fuselage/CCPACSSkin.h b/src/fuselage/CCPACSSkin.h index e7d08966d6..1ac507c361 100644 --- a/src/fuselage/CCPACSSkin.h +++ b/src/fuselage/CCPACSSkin.h @@ -29,6 +29,7 @@ class CCPACSSkin : public generated::CPACSSkin public: TIGL_EXPORT CCPACSSkin(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSSkin(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSSkin(CCPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr); // returns the parent as abstract geometric component TIGL_EXPORT CTiglRelativelyPositionedComponent const* GetParentComponent() const; diff --git a/src/fuselage/CCPACSStringersAssembly.cpp b/src/fuselage/CCPACSStringersAssembly.cpp index 5be4594081..42adc8b231 100644 --- a/src/fuselage/CCPACSStringersAssembly.cpp +++ b/src/fuselage/CCPACSStringersAssembly.cpp @@ -32,6 +32,11 @@ CCPACSStringersAssembly::CCPACSStringersAssembly(CCPACSDuctStructure* parent, CT { } +CCPACSStringersAssembly::CCPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : generated::CPACSStringersAssembly(parent, uidMgr) +{ +} + void CCPACSStringersAssembly::Invalidate(const boost::optional& source) const { for (int i = 0; i < (int)m_stringers.size(); i++) { diff --git a/src/fuselage/CCPACSStringersAssembly.h b/src/fuselage/CCPACSStringersAssembly.h index 793abc960a..9e0585beca 100644 --- a/src/fuselage/CCPACSStringersAssembly.h +++ b/src/fuselage/CCPACSStringersAssembly.h @@ -32,6 +32,7 @@ class CCPACSStringersAssembly : public generated::CPACSStringersAssembly public: TIGL_EXPORT CCPACSStringersAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSStringersAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; diff --git a/src/generated/CPACSDomeType.cpp b/src/generated/CPACSDomeType.cpp new file mode 100644 index 0000000000..2aa18a4ce5 --- /dev/null +++ b/src/generated/CPACSDomeType.cpp @@ -0,0 +1,320 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSDomeType.h" +#include "CPACSGenericFuelTankParameters.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDomeType::CPACSDomeType(CPACSGenericFuelTankParameters* parent) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSDomeType::~CPACSDomeType() + { + } + + const CPACSGenericFuelTankParameters* CPACSDomeType::GetParent() const + { + return m_parent; + } + + CPACSGenericFuelTankParameters* CPACSDomeType::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSDomeType::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSDomeType::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + void CPACSDomeType::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element spherical + if (tixi::TixiCheckElement(tixiHandle, xpath + "/spherical")) { + m_spherical_choice1 = boost::in_place(this); + try { + m_spherical_choice1->ReadCPACS(tixiHandle, xpath + "/spherical"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read spherical at xpath " << xpath << ": " << e.what(); + m_spherical_choice1 = boost::none; + } + } + + // read element ellipsoid + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { + m_ellipsoid_choice2 = boost::in_place(this); + try { + m_ellipsoid_choice2->ReadCPACS(tixiHandle, xpath + "/ellipsoid"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read ellipsoid at xpath " << xpath << ": " << e.what(); + m_ellipsoid_choice2 = boost::none; + } + } + + // read element torispherical + if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { + m_torispherical_choice3 = boost::in_place(this); + try { + m_torispherical_choice3->ReadCPACS(tixiHandle, xpath + "/torispherical"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read torispherical at xpath " << xpath << ": " << e.what(); + m_torispherical_choice3 = boost::none; + } + } + + // read element isotensoid + if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { + m_isotensoid_choice4 = boost::in_place(this); + try { + m_isotensoid_choice4->ReadCPACS(tixiHandle, xpath + "/isotensoid"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read isotensoid at xpath " << xpath << ": " << e.what(); + m_isotensoid_choice4 = boost::none; + } + } + + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSDomeType::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element spherical + if (m_spherical_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/spherical"); + m_spherical_choice1->WriteCPACS(tixiHandle, xpath + "/spherical"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/spherical")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/spherical"); + } + } + + // write element ellipsoid + if (m_ellipsoid_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/ellipsoid"); + m_ellipsoid_choice2->WriteCPACS(tixiHandle, xpath + "/ellipsoid"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/ellipsoid"); + } + } + + // write element torispherical + if (m_torispherical_choice3) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/torispherical"); + m_torispherical_choice3->WriteCPACS(tixiHandle, xpath + "/torispherical"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/torispherical"); + } + } + + // write element isotensoid + if (m_isotensoid_choice4) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/isotensoid"); + m_isotensoid_choice4->WriteCPACS(tixiHandle, xpath + "/isotensoid"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/isotensoid"); + } + } + + } + + bool CPACSDomeType::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_spherical_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_ellipsoid_choice2.is_initialized() + || + m_torispherical_choice3.is_initialized() + || + m_isotensoid_choice4.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_ellipsoid_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_spherical_choice1.is_initialized() + || + m_torispherical_choice3.is_initialized() + || + m_isotensoid_choice4.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_torispherical_choice3.is_initialized() + && + // elements of other choices must not be there + !( + m_spherical_choice1.is_initialized() + || + m_ellipsoid_choice2.is_initialized() + || + m_isotensoid_choice4.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_isotensoid_choice4.is_initialized() + && + // elements of other choices must not be there + !( + m_spherical_choice1.is_initialized() + || + m_ellipsoid_choice2.is_initialized() + || + m_torispherical_choice3.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const boost::optional& CPACSDomeType::GetSpherical_choice1() const + { + return m_spherical_choice1; + } + + boost::optional& CPACSDomeType::GetSpherical_choice1() + { + return m_spherical_choice1; + } + + const boost::optional& CPACSDomeType::GetEllipsoid_choice2() const + { + return m_ellipsoid_choice2; + } + + boost::optional& CPACSDomeType::GetEllipsoid_choice2() + { + return m_ellipsoid_choice2; + } + + const boost::optional& CPACSDomeType::GetTorispherical_choice3() const + { + return m_torispherical_choice3; + } + + boost::optional& CPACSDomeType::GetTorispherical_choice3() + { + return m_torispherical_choice3; + } + + const boost::optional& CPACSDomeType::GetIsotensoid_choice4() const + { + return m_isotensoid_choice4; + } + + boost::optional& CPACSDomeType::GetIsotensoid_choice4() + { + return m_isotensoid_choice4; + } + + CPACSEmptyElementBase& CPACSDomeType::GetSpherical_choice1(CreateIfNotExistsTag) + { + if (!m_spherical_choice1) + m_spherical_choice1 = boost::in_place(this); + return *m_spherical_choice1; + } + + void CPACSDomeType::RemoveSpherical_choice1() + { + m_spherical_choice1 = boost::none; + } + + CPACSEllipsoidDome& CPACSDomeType::GetEllipsoid_choice2(CreateIfNotExistsTag) + { + if (!m_ellipsoid_choice2) + m_ellipsoid_choice2 = boost::in_place(this); + return *m_ellipsoid_choice2; + } + + void CPACSDomeType::RemoveEllipsoid_choice2() + { + m_ellipsoid_choice2 = boost::none; + } + + CPACSTorisphericalDome& CPACSDomeType::GetTorispherical_choice3(CreateIfNotExistsTag) + { + if (!m_torispherical_choice3) + m_torispherical_choice3 = boost::in_place(this); + return *m_torispherical_choice3; + } + + void CPACSDomeType::RemoveTorispherical_choice3() + { + m_torispherical_choice3 = boost::none; + } + + CPACSIsotensoidDome& CPACSDomeType::GetIsotensoid_choice4(CreateIfNotExistsTag) + { + if (!m_isotensoid_choice4) + m_isotensoid_choice4 = boost::in_place(this); + return *m_isotensoid_choice4; + } + + void CPACSDomeType::RemoveIsotensoid_choice4() + { + m_isotensoid_choice4 = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDomeType.h b/src/generated/CPACSDomeType.h new file mode 100644 index 0000000000..914def2faf --- /dev/null +++ b/src/generated/CPACSDomeType.h @@ -0,0 +1,109 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CPACSEllipsoidDome.h" +#include "CPACSEmptyElementBase.h" +#include "CPACSIsotensoidDome.h" +#include "CPACSTorisphericalDome.h" +#include "CreateIfNotExists.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSGenericFuelTankParameters; + + // This class is used in: + // CPACSGenericFuelTankParameters + + /// @brief Dome Type + /// + /// + /// + class CPACSDomeType + { + public: + TIGL_EXPORT CPACSDomeType(CPACSGenericFuelTankParameters* parent); + + TIGL_EXPORT virtual ~CPACSDomeType(); + + TIGL_EXPORT CPACSGenericFuelTankParameters* GetParent(); + + TIGL_EXPORT const CPACSGenericFuelTankParameters* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const boost::optional& GetSpherical_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSpherical_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetEllipsoid_choice2() const; + TIGL_EXPORT virtual boost::optional& GetEllipsoid_choice2(); + + TIGL_EXPORT virtual const boost::optional& GetTorispherical_choice3() const; + TIGL_EXPORT virtual boost::optional& GetTorispherical_choice3(); + + TIGL_EXPORT virtual const boost::optional& GetIsotensoid_choice4() const; + TIGL_EXPORT virtual boost::optional& GetIsotensoid_choice4(); + + TIGL_EXPORT virtual CPACSEmptyElementBase& GetSpherical_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSpherical_choice1(); + + TIGL_EXPORT virtual CPACSEllipsoidDome& GetEllipsoid_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveEllipsoid_choice2(); + + TIGL_EXPORT virtual CPACSTorisphericalDome& GetTorispherical_choice3(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveTorispherical_choice3(); + + TIGL_EXPORT virtual CPACSIsotensoidDome& GetIsotensoid_choice4(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveIsotensoid_choice4(); + + protected: + CPACSGenericFuelTankParameters* m_parent; + + boost::optional m_spherical_choice1; + boost::optional m_ellipsoid_choice2; + boost::optional m_torispherical_choice3; + boost::optional m_isotensoid_choice4; + + private: + CPACSDomeType(const CPACSDomeType&) = delete; + CPACSDomeType& operator=(const CPACSDomeType&) = delete; + + CPACSDomeType(CPACSDomeType&&) = delete; + CPACSDomeType& operator=(CPACSDomeType&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDomeType = generated::CPACSDomeType; +using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; +} // namespace tigl diff --git a/src/generated/CPACSEllipsoidDome.cpp b/src/generated/CPACSEllipsoidDome.cpp new file mode 100644 index 0000000000..fdbeb88300 --- /dev/null +++ b/src/generated/CPACSEllipsoidDome.cpp @@ -0,0 +1,98 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSDomeType.h" +#include "CPACSEllipsoidDome.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSEllipsoidDome::CPACSEllipsoidDome(CPACSDomeType* parent) + : m_halfAxisFraction(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSEllipsoidDome::~CPACSEllipsoidDome() + { + } + + const CPACSDomeType* CPACSEllipsoidDome::GetParent() const + { + return m_parent; + } + + CPACSDomeType* CPACSEllipsoidDome::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSEllipsoidDome::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSEllipsoidDome::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + void CPACSEllipsoidDome::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element halfAxisFraction + if (tixi::TixiCheckElement(tixiHandle, xpath + "/halfAxisFraction")) { + m_halfAxisFraction = tixi::TixiGetElement(tixiHandle, xpath + "/halfAxisFraction"); + } + else { + LOG(ERROR) << "Required element halfAxisFraction is missing at xpath " << xpath; + } + + } + + void CPACSEllipsoidDome::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element halfAxisFraction + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/halfAxisFraction"); + tixi::TixiSaveElement(tixiHandle, xpath + "/halfAxisFraction", m_halfAxisFraction); + + } + + const double& CPACSEllipsoidDome::GetHalfAxisFraction() const + { + return m_halfAxisFraction; + } + + void CPACSEllipsoidDome::SetHalfAxisFraction(const double& value) + { + m_halfAxisFraction = value; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSEllipsoidDome.h b/src/generated/CPACSEllipsoidDome.h new file mode 100644 index 0000000000..e4044baaaf --- /dev/null +++ b/src/generated/CPACSEllipsoidDome.h @@ -0,0 +1,76 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSDomeType; + + // This class is used in: + // CPACSDomeType + + /// @brief Ellipsoid dome + /// + /// + class CPACSEllipsoidDome + { + public: + TIGL_EXPORT CPACSEllipsoidDome(CPACSDomeType* parent); + + TIGL_EXPORT virtual ~CPACSEllipsoidDome(); + + TIGL_EXPORT CPACSDomeType* GetParent(); + + TIGL_EXPORT const CPACSDomeType* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const double& GetHalfAxisFraction() const; + TIGL_EXPORT virtual void SetHalfAxisFraction(const double& value); + + protected: + CPACSDomeType* m_parent; + + /// Half axis fraction + double m_halfAxisFraction; + + private: + CPACSEllipsoidDome(const CPACSEllipsoidDome&) = delete; + CPACSEllipsoidDome& operator=(const CPACSEllipsoidDome&) = delete; + + CPACSEllipsoidDome(CPACSEllipsoidDome&&) = delete; + CPACSEllipsoidDome& operator=(CPACSEllipsoidDome&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSEllipsoidDome = generated::CPACSEllipsoidDome; +using CCPACSDomeType = generated::CPACSDomeType; +} // namespace tigl diff --git a/src/generated/CPACSEmptyElementBase.cpp b/src/generated/CPACSEmptyElementBase.cpp new file mode 100644 index 0000000000..d99a015dfe --- /dev/null +++ b/src/generated/CPACSEmptyElementBase.cpp @@ -0,0 +1,183 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSDomeType.h" +#include "CPACSEmptyElementBase.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSEmptyElementBase::CPACSEmptyElementBase(CPACSDomeType* parent) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSEmptyElementBase::~CPACSEmptyElementBase() + { + } + + const CPACSDomeType* CPACSEmptyElementBase::GetParent() const + { + return m_parent; + } + + CPACSDomeType* CPACSEmptyElementBase::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSEmptyElementBase::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSEmptyElementBase::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + void CPACSEmptyElementBase::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute externalDataNodePath + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { + m_externalDataNodePath = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataNodePath"); + if (m_externalDataNodePath->empty()) { + LOG(WARNING) << "Optional attribute externalDataNodePath is present but empty at xpath " << xpath; + } + } + + // read attribute externalFileName + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { + m_externalFileName = tixi::TixiGetAttribute(tixiHandle, xpath, "externalFileName"); + if (m_externalFileName->empty()) { + LOG(WARNING) << "Optional attribute externalFileName is present but empty at xpath " << xpath; + } + } + + // read attribute externalDataDirectory + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { + m_externalDataDirectory = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataDirectory"); + if (m_externalDataDirectory->empty()) { + LOG(WARNING) << "Optional attribute externalDataDirectory is present but empty at xpath " << xpath; + } + } + + // read simpleContent + if (tixi::TixiCheckElement(tixiHandle, xpath)) { + m_value = tixi::TixiGetElement(tixiHandle, xpath); + if (m_value.empty()) { + LOG(WARNING) << "Required element is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; + } + + } + + void CPACSEmptyElementBase::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute externalDataNodePath + if (m_externalDataNodePath) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataNodePath", *m_externalDataNodePath); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataNodePath"); + } + } + + // write attribute externalFileName + if (m_externalFileName) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalFileName", *m_externalFileName); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalFileName"); + } + } + + // write attribute externalDataDirectory + if (m_externalDataDirectory) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataDirectory", *m_externalDataDirectory); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataDirectory"); + } + } + + // write simpleContent + tixi::TixiSaveElement(tixiHandle, xpath, m_value); + + } + + const boost::optional& CPACSEmptyElementBase::GetExternalDataNodePath() const + { + return m_externalDataNodePath; + } + + void CPACSEmptyElementBase::SetExternalDataNodePath(const boost::optional& value) + { + m_externalDataNodePath = value; + } + + const boost::optional& CPACSEmptyElementBase::GetExternalFileName() const + { + return m_externalFileName; + } + + void CPACSEmptyElementBase::SetExternalFileName(const boost::optional& value) + { + m_externalFileName = value; + } + + const boost::optional& CPACSEmptyElementBase::GetExternalDataDirectory() const + { + return m_externalDataDirectory; + } + + void CPACSEmptyElementBase::SetExternalDataDirectory(const boost::optional& value) + { + m_externalDataDirectory = value; + } + + const std::string& CPACSEmptyElementBase::GetValue() const + { + return m_value; + } + + void CPACSEmptyElementBase::SetValue(const std::string& value) + { + m_value = value; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSEmptyElementBase.h b/src/generated/CPACSEmptyElementBase.h new file mode 100644 index 0000000000..cb1ecd6028 --- /dev/null +++ b/src/generated/CPACSEmptyElementBase.h @@ -0,0 +1,91 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSDomeType; + + // This class is used in: + // CPACSDomeType + + /// @brief stringBaseType + /// + /// Base type for string nodes (including external data + /// attributes) + /// + class CPACSEmptyElementBase + { + public: + TIGL_EXPORT CPACSEmptyElementBase(CPACSDomeType* parent); + + TIGL_EXPORT virtual ~CPACSEmptyElementBase(); + + TIGL_EXPORT CPACSDomeType* GetParent(); + + TIGL_EXPORT const CPACSDomeType* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const boost::optional& GetExternalDataNodePath() const; + TIGL_EXPORT virtual void SetExternalDataNodePath(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetExternalFileName() const; + TIGL_EXPORT virtual void SetExternalFileName(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetExternalDataDirectory() const; + TIGL_EXPORT virtual void SetExternalDataDirectory(const boost::optional& value); + + TIGL_EXPORT virtual const std::string& GetValue() const; + TIGL_EXPORT virtual void SetValue(const std::string& value); + + protected: + CPACSDomeType* m_parent; + + boost::optional m_externalDataNodePath; + boost::optional m_externalFileName; + boost::optional m_externalDataDirectory; + std::string m_value; + + private: + CPACSEmptyElementBase(const CPACSEmptyElementBase&) = delete; + CPACSEmptyElementBase& operator=(const CPACSEmptyElementBase&) = delete; + + CPACSEmptyElementBase(CPACSEmptyElementBase&&) = delete; + CPACSEmptyElementBase& operator=(CPACSEmptyElementBase&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSEmptyElementBase = generated::CPACSEmptyElementBase; +using CCPACSDomeType = generated::CPACSDomeType; +} // namespace tigl diff --git a/src/generated/CPACSFramesAssembly.cpp b/src/generated/CPACSFramesAssembly.cpp index c25007f45e..ec015b5b52 100644 --- a/src/generated/CPACSFramesAssembly.cpp +++ b/src/generated/CPACSFramesAssembly.cpp @@ -20,6 +20,7 @@ #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" #include "CPACSFramesAssembly.h" +#include "CPACSHullStructure.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -46,6 +47,14 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } + CPACSFramesAssembly::CPACSFramesAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSHullStructure); + } + CPACSFramesAssembly::~CPACSFramesAssembly() { } @@ -59,6 +68,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } @@ -72,6 +84,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } diff --git a/src/generated/CPACSFramesAssembly.h b/src/generated/CPACSFramesAssembly.h index 1291d8692d..c43a725170 100644 --- a/src/generated/CPACSFramesAssembly.h +++ b/src/generated/CPACSFramesAssembly.h @@ -35,9 +35,12 @@ class CCPACSFuselageStructure; namespace generated { + class CPACSHullStructure; + // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure + // CPACSHullStructure /// @brief framesAssemblyType /// @@ -48,6 +51,7 @@ namespace generated public: TIGL_EXPORT CPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFramesAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFramesAssembly(); @@ -60,7 +64,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -70,7 +74,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -110,4 +114,7 @@ namespace generated } // namespace generated // CPACSFramesAssembly is customized, use type CCPACSFramesAssembly directly + +// Aliases in tigl namespace +using CCPACSHullStructure = generated::CPACSHullStructure; } // namespace tigl diff --git a/src/generated/CPACSFuelTankVolume.cpp b/src/generated/CPACSFuelTankVolume.cpp new file mode 100644 index 0000000000..12c1201058 --- /dev/null +++ b/src/generated/CPACSFuelTankVolume.cpp @@ -0,0 +1,239 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSFuelTankVolume.h" +#include "CPACSGenericFuelTank.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSFuelTankVolume::CPACSFuelTankVolume(CPACSGenericFuelTank* parent) + : m_optimalVolume(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSFuelTankVolume::~CPACSFuelTankVolume() + { + } + + const CPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() const + { + return m_parent; + } + + CPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() + { + return m_parent; + } + + void CPACSFuelTankVolume::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element optimalVolume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/optimalVolume")) { + m_optimalVolume = tixi::TixiGetElement(tixiHandle, xpath + "/optimalVolume"); + } + else { + LOG(ERROR) << "Required element optimalVolume is missing at xpath " << xpath; + } + + // read element usableVolume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/usableVolume")) { + m_usableVolume_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/usableVolume"); + } + + // read element realVolume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/realVolume")) { + m_realVolume_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/realVolume"); + } + + // read element useableVolumeFactor + if (tixi::TixiCheckElement(tixiHandle, xpath + "/useableVolumeFactor")) { + m_useableVolumeFactor_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/useableVolumeFactor"); + } + + // read element realVolumeFactor + if (tixi::TixiCheckElement(tixiHandle, xpath + "/realVolumeFactor")) { + m_realVolumeFactor_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/realVolumeFactor"); + } + + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSFuelTankVolume::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + const std::vector childElemOrder = { "optimalVolume", "usableVolume", "realVolume", "useableVolumeFactor", "realVolumeFactor" }; + + // write element optimalVolume + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/optimalVolume", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/optimalVolume", m_optimalVolume); + + // write element usableVolume + if (m_usableVolume_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/usableVolume", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/usableVolume", *m_usableVolume_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/usableVolume")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/usableVolume"); + } + } + + // write element realVolume + if (m_realVolume_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/realVolume", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/realVolume", *m_realVolume_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/realVolume")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/realVolume"); + } + } + + // write element useableVolumeFactor + if (m_useableVolumeFactor_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/useableVolumeFactor", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/useableVolumeFactor", *m_useableVolumeFactor_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/useableVolumeFactor")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/useableVolumeFactor"); + } + } + + // write element realVolumeFactor + if (m_realVolumeFactor_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/realVolumeFactor", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/realVolumeFactor", *m_realVolumeFactor_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/realVolumeFactor")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/realVolumeFactor"); + } + } + + } + + bool CPACSFuelTankVolume::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + true // m_usableVolume_choice1 is optional in choice + && + true // m_realVolume_choice1 is optional in choice + && + // elements of other choices must not be there + !( + m_useableVolumeFactor_choice2.is_initialized() + || + m_realVolumeFactor_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + true // m_useableVolumeFactor_choice2 is optional in choice + && + true // m_realVolumeFactor_choice2 is optional in choice + && + // elements of other choices must not be there + !( + m_usableVolume_choice1.is_initialized() + || + m_realVolume_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const double& CPACSFuelTankVolume::GetOptimalVolume() const + { + return m_optimalVolume; + } + + void CPACSFuelTankVolume::SetOptimalVolume(const double& value) + { + m_optimalVolume = value; + } + + const boost::optional& CPACSFuelTankVolume::GetUsableVolume_choice1() const + { + return m_usableVolume_choice1; + } + + void CPACSFuelTankVolume::SetUsableVolume_choice1(const boost::optional& value) + { + m_usableVolume_choice1 = value; + } + + const boost::optional& CPACSFuelTankVolume::GetRealVolume_choice1() const + { + return m_realVolume_choice1; + } + + void CPACSFuelTankVolume::SetRealVolume_choice1(const boost::optional& value) + { + m_realVolume_choice1 = value; + } + + const boost::optional& CPACSFuelTankVolume::GetUseableVolumeFactor_choice2() const + { + return m_useableVolumeFactor_choice2; + } + + void CPACSFuelTankVolume::SetUseableVolumeFactor_choice2(const boost::optional& value) + { + m_useableVolumeFactor_choice2 = value; + } + + const boost::optional& CPACSFuelTankVolume::GetRealVolumeFactor_choice2() const + { + return m_realVolumeFactor_choice2; + } + + void CPACSFuelTankVolume::SetRealVolumeFactor_choice2(const boost::optional& value) + { + m_realVolumeFactor_choice2 = value; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSFuelTankVolume.h b/src/generated/CPACSFuelTankVolume.h new file mode 100644 index 0000000000..64926e5cc1 --- /dev/null +++ b/src/generated/CPACSFuelTankVolume.h @@ -0,0 +1,109 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSGenericFuelTank; + + // This class is used in: + // CPACSGenericFuelTank + + /// @brief Definition of different volumes of the fuel tank. + /// + /// + /// + class CPACSFuelTankVolume + { + public: + TIGL_EXPORT CPACSFuelTankVolume(CPACSGenericFuelTank* parent); + + TIGL_EXPORT virtual ~CPACSFuelTankVolume(); + + TIGL_EXPORT CPACSGenericFuelTank* GetParent(); + + TIGL_EXPORT const CPACSGenericFuelTank* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const double& GetOptimalVolume() const; + TIGL_EXPORT virtual void SetOptimalVolume(const double& value); + + TIGL_EXPORT virtual const boost::optional& GetUsableVolume_choice1() const; + TIGL_EXPORT virtual void SetUsableVolume_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetRealVolume_choice1() const; + TIGL_EXPORT virtual void SetRealVolume_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetUseableVolumeFactor_choice2() const; + TIGL_EXPORT virtual void SetUseableVolumeFactor_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetRealVolumeFactor_choice2() const; + TIGL_EXPORT virtual void SetRealVolumeFactor_choice2(const boost::optional& value); + + protected: + CPACSGenericFuelTank* m_parent; + + /// Theoretical volume if material thicknesses + /// (ribs, spars, skins, stringers) and systems (fuel pumps, + /// pipes...) are neglected. + double m_optimalVolume; + + /// Usable fuel volume aircraft operations. + boost::optional m_usableVolume_choice1; + + /// Total real fuel tank volume. + boost::optional m_realVolume_choice1; + + /// Factor between the usalbe fuel volume and + /// the real fuel volume. + boost::optional m_useableVolumeFactor_choice2; + + /// Factor between the real fuel volume and the + /// theoretical optimum fuel volume. + boost::optional m_realVolumeFactor_choice2; + + private: + CPACSFuelTankVolume(const CPACSFuelTankVolume&) = delete; + CPACSFuelTankVolume& operator=(const CPACSFuelTankVolume&) = delete; + + CPACSFuelTankVolume(CPACSFuelTankVolume&&) = delete; + CPACSFuelTankVolume& operator=(CPACSFuelTankVolume&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSFuelTankVolume = generated::CPACSFuelTankVolume; +using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; +} // namespace tigl diff --git a/src/generated/CPACSFuselage.cpp b/src/generated/CPACSFuselage.cpp index 0c4564c5d6..69877ae5c8 100644 --- a/src/generated/CPACSFuselage.cpp +++ b/src/generated/CPACSFuselage.cpp @@ -190,6 +190,17 @@ namespace generated } } + // read element fuelTanks + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTanks")) { + m_fuelTanks = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_fuelTanks->ReadCPACS(tixiHandle, xpath + "/fuelTanks"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read fuelTanks at xpath " << xpath << ": " << e.what(); + m_fuelTanks = boost::none; + } + } + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); } @@ -279,6 +290,17 @@ namespace generated } } + // write element fuelTanks + if (m_fuelTanks) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/fuelTanks"); + m_fuelTanks->WriteCPACS(tixiHandle, xpath + "/fuelTanks"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTanks")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/fuelTanks"); + } + } + } const std::string& CPACSFuselage::GetUID() const @@ -403,6 +425,16 @@ namespace generated return m_compartments; } + const boost::optional& CPACSFuselage::GetFuelTanks() const + { + return m_fuelTanks; + } + + boost::optional& CPACSFuselage::GetFuelTanks() + { + return m_fuelTanks; + } + CCPACSPositionings& CPACSFuselage::GetPositionings(CreateIfNotExistsTag) { if (!m_positionings) @@ -439,6 +471,18 @@ namespace generated m_compartments = boost::none; } + CPACSFuselageFuelTanks& CPACSFuselage::GetFuelTanks(CreateIfNotExistsTag) + { + if (!m_fuelTanks) + m_fuelTanks = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_fuelTanks; + } + + void CPACSFuselage::RemoveFuelTanks() + { + m_fuelTanks = boost::none; + } + const CTiglUIDObject* CPACSFuselage::GetNextUIDObject() const { return this; diff --git a/src/generated/CPACSFuselage.h b/src/generated/CPACSFuselage.h index 5c2511248f..f82102e713 100644 --- a/src/generated/CPACSFuselage.h +++ b/src/generated/CPACSFuselage.h @@ -28,6 +28,7 @@ #include #include #include "CPACSCompartments.h" +#include "CPACSFuselageFuelTanks.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "ITiglUIDRefObject.h" @@ -102,6 +103,9 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetCompartments() const; TIGL_EXPORT virtual boost::optional& GetCompartments(); + TIGL_EXPORT virtual const boost::optional& GetFuelTanks() const; + TIGL_EXPORT virtual boost::optional& GetFuelTanks(); + TIGL_EXPORT virtual CCPACSPositionings& GetPositionings(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemovePositionings(); @@ -111,6 +115,9 @@ namespace generated TIGL_EXPORT virtual CPACSCompartments& GetCompartments(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveCompartments(); + TIGL_EXPORT virtual CPACSFuselageFuelTanks& GetFuelTanks(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveFuelTanks(); + protected: CCPACSFuselages* m_parent; @@ -142,6 +149,8 @@ namespace generated boost::optional m_compartments; + boost::optional m_fuelTanks; + private: TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; diff --git a/src/generated/CPACSFuselageFuelTanks.cpp b/src/generated/CPACSFuselageFuelTanks.cpp new file mode 100644 index 0000000000..27eaa62563 --- /dev/null +++ b/src/generated/CPACSFuselageFuelTanks.cpp @@ -0,0 +1,133 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSFuselage.h" +#include "CPACSFuselageFuelTanks.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSFuselageFuelTanks::CPACSFuselageFuelTanks(CCPACSFuselage* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSFuselageFuelTanks::~CPACSFuselageFuelTanks() + { + } + + const CCPACSFuselage* CPACSFuselageFuelTanks::GetParent() const + { + return m_parent; + } + + CCPACSFuselage* CPACSFuselageFuelTanks::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSFuselageFuelTanks::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSFuselageFuelTanks::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSFuselageFuelTanks::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSFuselageFuelTanks::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSFuselageFuelTanks::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element genericFuelTanks + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFuelTanks")) { + m_genericFuelTanks = boost::in_place(this, m_uidMgr); + try { + m_genericFuelTanks->ReadCPACS(tixiHandle, xpath + "/genericFuelTanks"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read genericFuelTanks at xpath " << xpath << ": " << e.what(); + m_genericFuelTanks = boost::none; + } + } + + } + + void CPACSFuselageFuelTanks::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + const std::vector childElemOrder = { "genericFuelTanks" }; + + // write element genericFuelTanks + if (m_genericFuelTanks) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/genericFuelTanks", childElemOrder); + m_genericFuelTanks->WriteCPACS(tixiHandle, xpath + "/genericFuelTanks"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFuelTanks")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/genericFuelTanks"); + } + } + + } + + const boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() const + { + return m_genericFuelTanks; + } + + boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() + { + return m_genericFuelTanks; + } + + CPACSGenericFuelTanks& CPACSFuselageFuelTanks::GetGenericFuelTanks(CreateIfNotExistsTag) + { + if (!m_genericFuelTanks) + m_genericFuelTanks = boost::in_place(this, m_uidMgr); + return *m_genericFuelTanks; + } + + void CPACSFuselageFuelTanks::RemoveGenericFuelTanks() + { + m_genericFuelTanks = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTanks.h b/src/generated/CPACSFuselageFuelTanks.h new file mode 100644 index 0000000000..d000c69fb7 --- /dev/null +++ b/src/generated/CPACSFuselageFuelTanks.h @@ -0,0 +1,87 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CPACSGenericFuelTanks.h" +#include "CreateIfNotExists.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; +class CCPACSFuselage; + +namespace generated +{ + // This class is used in: + // CPACSFuselage + + /// @brief List of fuel tanks + /// + /// + /// + class CPACSFuselageFuelTanks + { + public: + TIGL_EXPORT CPACSFuselageFuelTanks(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSFuselageFuelTanks(); + + TIGL_EXPORT CCPACSFuselage* GetParent(); + + TIGL_EXPORT const CCPACSFuselage* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const boost::optional& GetGenericFuelTanks() const; + TIGL_EXPORT virtual boost::optional& GetGenericFuelTanks(); + + TIGL_EXPORT virtual CPACSGenericFuelTanks& GetGenericFuelTanks(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveGenericFuelTanks(); + + protected: + CCPACSFuselage* m_parent; + + CTiglUIDManager* m_uidMgr; + + boost::optional m_genericFuelTanks; + + private: + CPACSFuselageFuelTanks(const CPACSFuselageFuelTanks&) = delete; + CPACSFuselageFuelTanks& operator=(const CPACSFuselageFuelTanks&) = delete; + + CPACSFuselageFuelTanks(CPACSFuselageFuelTanks&&) = delete; + CPACSFuselageFuelTanks& operator=(CPACSFuselageFuelTanks&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; +} // namespace tigl diff --git a/src/generated/CPACSFuselageSections.cpp b/src/generated/CPACSFuselageSections.cpp index ba424c4030..66fcfcefdf 100644 --- a/src/generated/CPACSFuselageSections.cpp +++ b/src/generated/CPACSFuselageSections.cpp @@ -20,6 +20,7 @@ #include "CCPACSDuct.h" #include "CCPACSFuselage.h" #include "CPACSFuselageSections.h" +#include "CPACSHull.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -46,6 +47,14 @@ namespace generated m_parentType = &typeid(CCPACSFuselage); } + CPACSFuselageSections::CPACSFuselageSections(CPACSHull* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSHull); + } + CPACSFuselageSections::~CPACSFuselageSections() { } @@ -59,6 +68,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } @@ -72,6 +84,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } diff --git a/src/generated/CPACSFuselageSections.h b/src/generated/CPACSFuselageSections.h index 7949b67402..ad5e3f4ea7 100644 --- a/src/generated/CPACSFuselageSections.h +++ b/src/generated/CPACSFuselageSections.h @@ -35,9 +35,12 @@ class CCPACSFuselage; namespace generated { + class CPACSHull; + // This class is used in: // CPACSDuct // CPACSFuselage + // CPACSHull /// @brief fuselageSectionsType /// @@ -48,6 +51,7 @@ namespace generated public: TIGL_EXPORT CPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageSections(CPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageSections(); @@ -60,7 +64,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -70,7 +74,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -110,4 +114,7 @@ namespace generated } // namespace generated // CPACSFuselageSections is customized, use type CCPACSFuselageSections directly + +// Aliases in tigl namespace +using CCPACSHull = generated::CPACSHull; } // namespace tigl diff --git a/src/generated/CPACSFuselageSegments.cpp b/src/generated/CPACSFuselageSegments.cpp index 91adc3ccc5..4b9a8d9953 100644 --- a/src/generated/CPACSFuselageSegments.cpp +++ b/src/generated/CPACSFuselageSegments.cpp @@ -20,6 +20,7 @@ #include "CCPACSDuct.h" #include "CCPACSFuselage.h" #include "CPACSFuselageSegments.h" +#include "CPACSHull.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -46,6 +47,14 @@ namespace generated m_parentType = &typeid(CCPACSFuselage); } + CPACSFuselageSegments::CPACSFuselageSegments(CPACSHull* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSHull); + } + CPACSFuselageSegments::~CPACSFuselageSegments() { } @@ -59,6 +68,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } @@ -72,6 +84,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } diff --git a/src/generated/CPACSFuselageSegments.h b/src/generated/CPACSFuselageSegments.h index 0cd0da1ec3..82cd408e82 100644 --- a/src/generated/CPACSFuselageSegments.h +++ b/src/generated/CPACSFuselageSegments.h @@ -35,9 +35,12 @@ class CCPACSFuselage; namespace generated { + class CPACSHull; + // This class is used in: // CPACSDuct // CPACSFuselage + // CPACSHull /// @brief fuselageSegmentsType /// @@ -49,6 +52,7 @@ namespace generated public: TIGL_EXPORT CPACSFuselageSegments(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFuselageSegments(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageSegments(CPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageSegments(); @@ -61,7 +65,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -71,7 +75,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -111,4 +115,7 @@ namespace generated } // namespace generated // CPACSFuselageSegments is customized, use type CCPACSFuselageSegments directly + +// Aliases in tigl namespace +using CCPACSHull = generated::CPACSHull; } // namespace tigl diff --git a/src/generated/CPACSGenericFuelTank.cpp b/src/generated/CPACSGenericFuelTank.cpp new file mode 100644 index 0000000000..d70e5ea070 --- /dev/null +++ b/src/generated/CPACSGenericFuelTank.cpp @@ -0,0 +1,373 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSGenericFuelTank.h" +#include "CPACSGenericFuelTanks.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGenericFuelTank::CPACSGenericFuelTank(CPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGenericFuelTank::~CPACSGenericFuelTank() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() const + { + return m_parent; + } + + CPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGenericFuelTank::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element hulls + if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { + m_hulls_choice1 = boost::in_place(this, m_uidMgr); + try { + m_hulls_choice1->ReadCPACS(tixiHandle, xpath + "/hulls"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read hulls at xpath " << xpath << ": " << e.what(); + m_hulls_choice1 = boost::none; + } + } + + // read element designParameters + if (tixi::TixiCheckElement(tixiHandle, xpath + "/designParameters")) { + m_designParameters_choice2 = boost::in_place(this, m_uidMgr); + try { + m_designParameters_choice2->ReadCPACS(tixiHandle, xpath + "/designParameters"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read designParameters at xpath " << xpath << ": " << e.what(); + m_designParameters_choice2 = boost::none; + } + } + + // read element volume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + m_volume = boost::in_place(this); + try { + m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); + m_volume = boost::none; + } + } + + // read element burstPressure + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + m_burstPressure = tixi::TixiGetElement(tixiHandle, xpath + "/burstPressure"); + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSGenericFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + const std::vector childElemOrder = { "name", "description", "hulls", "designParameters", "volume", "burstPressure" }; + + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element hulls + if (m_hulls_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); + m_hulls_choice1->WriteCPACS(tixiHandle, xpath + "/hulls"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/hulls"); + } + } + + // write element designParameters + if (m_designParameters_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/designParameters", childElemOrder); + m_designParameters_choice2->WriteCPACS(tixiHandle, xpath + "/designParameters"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/designParameters")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/designParameters"); + } + } + + // write element volume + if (m_volume) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); + m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); + } + } + + // write element burstPressure + if (m_burstPressure) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/burstPressure", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/burstPressure", *m_burstPressure); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/burstPressure"); + } + } + + } + + bool CPACSGenericFuelTank::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_hulls_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_designParameters_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_designParameters_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_hulls_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const std::string& CPACSGenericFuelTank::GetUID() const + { + return m_uID; + } + + void CPACSGenericFuelTank::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const std::string& CPACSGenericFuelTank::GetName() const + { + return m_name; + } + + void CPACSGenericFuelTank::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSGenericFuelTank::GetDescription() const + { + return m_description; + } + + void CPACSGenericFuelTank::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const boost::optional& CPACSGenericFuelTank::GetHulls_choice1() const + { + return m_hulls_choice1; + } + + boost::optional& CPACSGenericFuelTank::GetHulls_choice1() + { + return m_hulls_choice1; + } + + const boost::optional& CPACSGenericFuelTank::GetDesignParameters_choice2() const + { + return m_designParameters_choice2; + } + + boost::optional& CPACSGenericFuelTank::GetDesignParameters_choice2() + { + return m_designParameters_choice2; + } + + const boost::optional& CPACSGenericFuelTank::GetVolume() const + { + return m_volume; + } + + boost::optional& CPACSGenericFuelTank::GetVolume() + { + return m_volume; + } + + const boost::optional& CPACSGenericFuelTank::GetBurstPressure() const + { + return m_burstPressure; + } + + void CPACSGenericFuelTank::SetBurstPressure(const boost::optional& value) + { + m_burstPressure = value; + } + + CPACSHulls& CPACSGenericFuelTank::GetHulls_choice1(CreateIfNotExistsTag) + { + if (!m_hulls_choice1) + m_hulls_choice1 = boost::in_place(this, m_uidMgr); + return *m_hulls_choice1; + } + + void CPACSGenericFuelTank::RemoveHulls_choice1() + { + m_hulls_choice1 = boost::none; + } + + CPACSGenericFuelTankParameters& CPACSGenericFuelTank::GetDesignParameters_choice2(CreateIfNotExistsTag) + { + if (!m_designParameters_choice2) + m_designParameters_choice2 = boost::in_place(this, m_uidMgr); + return *m_designParameters_choice2; + } + + void CPACSGenericFuelTank::RemoveDesignParameters_choice2() + { + m_designParameters_choice2 = boost::none; + } + + CPACSFuelTankVolume& CPACSGenericFuelTank::GetVolume(CreateIfNotExistsTag) + { + if (!m_volume) + m_volume = boost::in_place(this); + return *m_volume; + } + + void CPACSGenericFuelTank::RemoveVolume() + { + m_volume = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTank.h b/src/generated/CPACSGenericFuelTank.h new file mode 100644 index 0000000000..2764904329 --- /dev/null +++ b/src/generated/CPACSGenericFuelTank.h @@ -0,0 +1,132 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CPACSFuelTankVolume.h" +#include "CPACSGenericFuelTankParameters.h" +#include "CPACSHulls.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSGenericFuelTanks; + + // This class is used in: + // CPACSGenericFuelTanks + + /// @brief Cryogenic tank + /// + /// + class CPACSGenericFuelTank : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSGenericFuelTank(CPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGenericFuelTank(); + + TIGL_EXPORT CPACSGenericFuelTanks* GetParent(); + + TIGL_EXPORT const CPACSGenericFuelTanks* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetHulls_choice1() const; + TIGL_EXPORT virtual boost::optional& GetHulls_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetDesignParameters_choice2() const; + TIGL_EXPORT virtual boost::optional& GetDesignParameters_choice2(); + + TIGL_EXPORT virtual const boost::optional& GetVolume() const; + TIGL_EXPORT virtual boost::optional& GetVolume(); + + TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; + TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); + + TIGL_EXPORT virtual CPACSHulls& GetHulls_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveHulls_choice1(); + + TIGL_EXPORT virtual CPACSGenericFuelTankParameters& GetDesignParameters_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveDesignParameters_choice2(); + + TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveVolume(); + + protected: + CPACSGenericFuelTanks* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + boost::optional m_hulls_choice1; + + boost::optional m_designParameters_choice2; + + /// Volume + boost::optional m_volume; + + /// Burst pressure + boost::optional m_burstPressure; + + private: + CPACSGenericFuelTank(const CPACSGenericFuelTank&) = delete; + CPACSGenericFuelTank& operator=(const CPACSGenericFuelTank&) = delete; + + CPACSGenericFuelTank(CPACSGenericFuelTank&&) = delete; + CPACSGenericFuelTank& operator=(CPACSGenericFuelTank&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; +using CCPACSGenericFuelTanks = generated::CPACSGenericFuelTanks; +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTankParameters.cpp b/src/generated/CPACSGenericFuelTankParameters.cpp new file mode 100644 index 0000000000..1ddca1fba6 --- /dev/null +++ b/src/generated/CPACSGenericFuelTankParameters.cpp @@ -0,0 +1,202 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSGenericFuelTank.h" +#include "CPACSGenericFuelTankParameters.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGenericFuelTankParameters::CPACSGenericFuelTankParameters(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_transformation(this, m_uidMgr) + , m_cylinderRadius(0) + , m_cylinderLength(0) + , m_domeType(this) + , m_material(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGenericFuelTankParameters::~CPACSGenericFuelTankParameters() + { + } + + const CPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() const + { + return m_parent; + } + + CPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGenericFuelTankParameters::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSGenericFuelTankParameters::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSGenericFuelTankParameters::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGenericFuelTankParameters::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGenericFuelTankParameters::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + + // read element cylinderRadius + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { + m_cylinderRadius = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); + } + else { + LOG(ERROR) << "Required element cylinderRadius is missing at xpath " << xpath; + } + + // read element cylinderLength + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { + m_cylinderLength = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderLength"); + } + else { + LOG(ERROR) << "Required element cylinderLength is missing at xpath " << xpath; + } + + // read element domeType + if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { + m_domeType.ReadCPACS(tixiHandle, xpath + "/domeType"); + } + else { + LOG(ERROR) << "Required element domeType is missing at xpath " << xpath; + } + + // read element material + if (tixi::TixiCheckElement(tixiHandle, xpath + "/material")) { + m_material.ReadCPACS(tixiHandle, xpath + "/material"); + } + else { + LOG(ERROR) << "Required element material is missing at xpath " << xpath; + } + + } + + void CPACSGenericFuelTankParameters::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element transformation + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/transformation"); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + + // write element cylinderRadius + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cylinderRadius"); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", m_cylinderRadius); + + // write element cylinderLength + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cylinderLength"); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderLength", m_cylinderLength); + + // write element domeType + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/domeType"); + m_domeType.WriteCPACS(tixiHandle, xpath + "/domeType"); + + // write element material + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/material"); + m_material.WriteCPACS(tixiHandle, xpath + "/material"); + + } + + const CCPACSTransformation& CPACSGenericFuelTankParameters::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSGenericFuelTankParameters::GetTransformation() + { + return m_transformation; + } + + const double& CPACSGenericFuelTankParameters::GetCylinderRadius() const + { + return m_cylinderRadius; + } + + void CPACSGenericFuelTankParameters::SetCylinderRadius(const double& value) + { + m_cylinderRadius = value; + } + + const double& CPACSGenericFuelTankParameters::GetCylinderLength() const + { + return m_cylinderLength; + } + + void CPACSGenericFuelTankParameters::SetCylinderLength(const double& value) + { + m_cylinderLength = value; + } + + const CPACSDomeType& CPACSGenericFuelTankParameters::GetDomeType() const + { + return m_domeType; + } + + CPACSDomeType& CPACSGenericFuelTankParameters::GetDomeType() + { + return m_domeType; + } + + const CCPACSMaterialDefinition& CPACSGenericFuelTankParameters::GetMaterial() const + { + return m_material; + } + + CCPACSMaterialDefinition& CPACSGenericFuelTankParameters::GetMaterial() + { + return m_material; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTankParameters.h b/src/generated/CPACSGenericFuelTankParameters.h new file mode 100644 index 0000000000..a92bf91240 --- /dev/null +++ b/src/generated/CPACSGenericFuelTankParameters.h @@ -0,0 +1,106 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CPACSDomeType.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSGenericFuelTank; + + // This class is used in: + // CPACSGenericFuelTank + + /// @brief Global design parameters + /// + /// + class CPACSGenericFuelTankParameters + { + public: + TIGL_EXPORT CPACSGenericFuelTankParameters(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGenericFuelTankParameters(); + + TIGL_EXPORT CPACSGenericFuelTank* GetParent(); + + TIGL_EXPORT const CPACSGenericFuelTank* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + + TIGL_EXPORT virtual const double& GetCylinderRadius() const; + TIGL_EXPORT virtual void SetCylinderRadius(const double& value); + + TIGL_EXPORT virtual const double& GetCylinderLength() const; + TIGL_EXPORT virtual void SetCylinderLength(const double& value); + + TIGL_EXPORT virtual const CPACSDomeType& GetDomeType() const; + TIGL_EXPORT virtual CPACSDomeType& GetDomeType(); + + TIGL_EXPORT virtual const CCPACSMaterialDefinition& GetMaterial() const; + TIGL_EXPORT virtual CCPACSMaterialDefinition& GetMaterial(); + + protected: + CPACSGenericFuelTank* m_parent; + + CTiglUIDManager* m_uidMgr; + + CCPACSTransformation m_transformation; + + /// Inner radius of the cylinder + double m_cylinderRadius; + + /// Inner length of the cylinder + double m_cylinderLength; + + CPACSDomeType m_domeType; + + CCPACSMaterialDefinition m_material; + + private: + CPACSGenericFuelTankParameters(const CPACSGenericFuelTankParameters&) = delete; + CPACSGenericFuelTankParameters& operator=(const CPACSGenericFuelTankParameters&) = delete; + + CPACSGenericFuelTankParameters(CPACSGenericFuelTankParameters&&) = delete; + CPACSGenericFuelTankParameters& operator=(CPACSGenericFuelTankParameters&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; +using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTanks.cpp b/src/generated/CPACSGenericFuelTanks.cpp new file mode 100644 index 0000000000..8fb5f2b050 --- /dev/null +++ b/src/generated/CPACSGenericFuelTanks.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSFuselageFuelTanks.h" +#include "CPACSGenericFuelTank.h" +#include "CPACSGenericFuelTanks.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGenericFuelTanks::CPACSGenericFuelTanks(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGenericFuelTanks::~CPACSGenericFuelTanks() + { + } + + const CPACSFuselageFuelTanks* CPACSGenericFuelTanks::GetParent() const + { + return m_parent; + } + + CPACSFuselageFuelTanks* CPACSGenericFuelTanks::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGenericFuelTanks::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSGenericFuelTanks::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSGenericFuelTanks::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGenericFuelTanks::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGenericFuelTanks::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element genericFuelTank + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFuelTank")) { + tixi::TixiReadElements(tixiHandle, xpath + "/genericFuelTank", m_genericFuelTanks, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSGenericFuelTanks::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element genericFuelTank + tixi::TixiSaveElements(tixiHandle, xpath + "/genericFuelTank", m_genericFuelTanks); + + } + + const std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() const + { + return m_genericFuelTanks; + } + + std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() + { + return m_genericFuelTanks; + } + + CPACSGenericFuelTank& CPACSGenericFuelTanks::AddGenericFuelTank() + { + m_genericFuelTanks.push_back(make_unique(this, m_uidMgr)); + return *m_genericFuelTanks.back(); + } + + void CPACSGenericFuelTanks::RemoveGenericFuelTank(CPACSGenericFuelTank& ref) + { + for (std::size_t i = 0; i < m_genericFuelTanks.size(); i++) { + if (m_genericFuelTanks[i].get() == &ref) { + m_genericFuelTanks.erase(m_genericFuelTanks.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTanks.h b/src/generated/CPACSGenericFuelTanks.h new file mode 100644 index 0000000000..0271ae8bf0 --- /dev/null +++ b/src/generated/CPACSGenericFuelTanks.h @@ -0,0 +1,89 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSGenericFuelTank; + class CPACSFuselageFuelTanks; + + // This class is used in: + // CPACSFuselageFuelTanks + + /// @brief Generic fuel tank + /// + /// + /// + class CPACSGenericFuelTanks + { + public: + TIGL_EXPORT CPACSGenericFuelTanks(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGenericFuelTanks(); + + TIGL_EXPORT CPACSFuselageFuelTanks* GetParent(); + + TIGL_EXPORT const CPACSFuselageFuelTanks* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetGenericFuelTanks() const; + TIGL_EXPORT virtual std::vector>& GetGenericFuelTanks(); + + TIGL_EXPORT virtual CPACSGenericFuelTank& AddGenericFuelTank(); + TIGL_EXPORT virtual void RemoveGenericFuelTank(CPACSGenericFuelTank& ref); + + protected: + CPACSFuselageFuelTanks* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::vector> m_genericFuelTanks; + + private: + CPACSGenericFuelTanks(const CPACSGenericFuelTanks&) = delete; + CPACSGenericFuelTanks& operator=(const CPACSGenericFuelTanks&) = delete; + + CPACSGenericFuelTanks(CPACSGenericFuelTanks&&) = delete; + CPACSGenericFuelTanks& operator=(CPACSGenericFuelTanks&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSGenericFuelTanks = generated::CPACSGenericFuelTanks; +using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; +using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; +} // namespace tigl diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSHull.cpp new file mode 100644 index 0000000000..500da27cb3 --- /dev/null +++ b/src/generated/CPACSHull.cpp @@ -0,0 +1,293 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSHull.h" +#include "CPACSHulls.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSHull::CPACSHull(CPACSHulls* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_transformation(this, m_uidMgr) + , m_sections(this, m_uidMgr) + , m_segments(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSHull::~CPACSHull() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CPACSHulls* CPACSHull::GetParent() const + { + return m_parent; + } + + CPACSHulls* CPACSHull::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSHull::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSHull::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSHull::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSHull::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSHull::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + + // read element sections + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { + m_sections.ReadCPACS(tixiHandle, xpath + "/sections"); + } + else { + LOG(ERROR) << "Required element sections is missing at xpath " << xpath; + } + + // read element segments + if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { + m_segments.ReadCPACS(tixiHandle, xpath + "/segments"); + } + else { + LOG(ERROR) << "Required element segments is missing at xpath " << xpath; + } + + // read element structure + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { + m_structure = boost::in_place(this, m_uidMgr); + try { + m_structure->ReadCPACS(tixiHandle, xpath + "/structure"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read structure at xpath " << xpath << ": " << e.what(); + m_structure = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSHull::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name"); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element transformation + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/transformation"); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + + // write element sections + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/sections"); + m_sections.WriteCPACS(tixiHandle, xpath + "/sections"); + + // write element segments + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/segments"); + m_segments.WriteCPACS(tixiHandle, xpath + "/segments"); + + // write element structure + if (m_structure) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/structure"); + m_structure->WriteCPACS(tixiHandle, xpath + "/structure"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/structure"); + } + } + + } + + const std::string& CPACSHull::GetUID() const + { + return m_uID; + } + + void CPACSHull::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const std::string& CPACSHull::GetName() const + { + return m_name; + } + + void CPACSHull::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSHull::GetDescription() const + { + return m_description; + } + + void CPACSHull::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const CCPACSTransformation& CPACSHull::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSHull::GetTransformation() + { + return m_transformation; + } + + const CCPACSFuselageSections& CPACSHull::GetSections() const + { + return m_sections; + } + + CCPACSFuselageSections& CPACSHull::GetSections() + { + return m_sections; + } + + const CCPACSFuselageSegments& CPACSHull::GetSegments() const + { + return m_segments; + } + + CCPACSFuselageSegments& CPACSHull::GetSegments() + { + return m_segments; + } + + const boost::optional& CPACSHull::GetStructure() const + { + return m_structure; + } + + boost::optional& CPACSHull::GetStructure() + { + return m_structure; + } + + CPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) + { + if (!m_structure) + m_structure = boost::in_place(this, m_uidMgr); + return *m_structure; + } + + void CPACSHull::RemoveStructure() + { + m_structure = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSHull.h new file mode 100644 index 0000000000..e94df1c2bf --- /dev/null +++ b/src/generated/CPACSHull.h @@ -0,0 +1,123 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include "CPACSHullStructure.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSHulls; + + // This class is used in: + // CPACSHulls + + /// @brief Hulls + /// + /// + class CPACSHull : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSHull(CPACSHulls* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSHull(); + + TIGL_EXPORT CPACSHulls* GetParent(); + + TIGL_EXPORT const CPACSHulls* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + + TIGL_EXPORT virtual const CCPACSFuselageSections& GetSections() const; + TIGL_EXPORT virtual CCPACSFuselageSections& GetSections(); + + TIGL_EXPORT virtual const CCPACSFuselageSegments& GetSegments() const; + TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments(); + + TIGL_EXPORT virtual const boost::optional& GetStructure() const; + TIGL_EXPORT virtual boost::optional& GetStructure(); + + TIGL_EXPORT virtual CPACSHullStructure& GetStructure(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveStructure(); + + protected: + CPACSHulls* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + CCPACSTransformation m_transformation; + + CCPACSFuselageSections m_sections; + + CCPACSFuselageSegments m_segments; + + boost::optional m_structure; + + private: + CPACSHull(const CPACSHull&) = delete; + CPACSHull& operator=(const CPACSHull&) = delete; + + CPACSHull(CPACSHull&&) = delete; + CPACSHull& operator=(CPACSHull&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSHull = generated::CPACSHull; +using CCPACSHulls = generated::CPACSHulls; +} // namespace tigl diff --git a/src/generated/CPACSHullSkinLayers.cpp b/src/generated/CPACSHullSkinLayers.cpp new file mode 100644 index 0000000000..4fe6cac8bb --- /dev/null +++ b/src/generated/CPACSHullSkinLayers.cpp @@ -0,0 +1,123 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include "CPACSHullSkinLayers.h" +#include "CPACSHullStructure.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSHullSkinLayers::CPACSHullSkinLayers(CPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSHullSkinLayers::~CPACSHullSkinLayers() + { + } + + const CPACSHullStructure* CPACSHullSkinLayers::GetParent() const + { + return m_parent; + } + + CPACSHullStructure* CPACSHullSkinLayers::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSHullSkinLayers::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSHullSkinLayers::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSHullSkinLayers::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSHullSkinLayers::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSHullSkinLayers::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element skinLayer + if (tixi::TixiCheckElement(tixiHandle, xpath + "/skinLayer")) { + tixi::TixiReadElements(tixiHandle, xpath + "/skinLayer", m_skinLayers, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSHullSkinLayers::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element skinLayer + tixi::TixiSaveElements(tixiHandle, xpath + "/skinLayer", m_skinLayers); + + } + + const std::vector>& CPACSHullSkinLayers::GetSkinLayers() const + { + return m_skinLayers; + } + + std::vector>& CPACSHullSkinLayers::GetSkinLayers() + { + return m_skinLayers; + } + + CCPACSSkin& CPACSHullSkinLayers::AddSkinLayer() + { + m_skinLayers.push_back(make_unique(this, m_uidMgr)); + return *m_skinLayers.back(); + } + + void CPACSHullSkinLayers::RemoveSkinLayer(CCPACSSkin& ref) + { + for (std::size_t i = 0; i < m_skinLayers.size(); i++) { + if (m_skinLayers[i].get() == &ref) { + m_skinLayers.erase(m_skinLayers.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSHullSkinLayers.h b/src/generated/CPACSHullSkinLayers.h new file mode 100644 index 0000000000..427849fc7c --- /dev/null +++ b/src/generated/CPACSHullSkinLayers.h @@ -0,0 +1,88 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; +class CCPACSSkin; + +namespace generated +{ + class CPACSHullStructure; + + // This class is used in: + // CPACSHullStructure + + /// @brief Skin Layers + /// + /// + /// + class CPACSHullSkinLayers + { + public: + TIGL_EXPORT CPACSHullSkinLayers(CPACSHullStructure* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSHullSkinLayers(); + + TIGL_EXPORT CPACSHullStructure* GetParent(); + + TIGL_EXPORT const CPACSHullStructure* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetSkinLayers() const; + TIGL_EXPORT virtual std::vector>& GetSkinLayers(); + + TIGL_EXPORT virtual CCPACSSkin& AddSkinLayer(); + TIGL_EXPORT virtual void RemoveSkinLayer(CCPACSSkin& ref); + + protected: + CPACSHullStructure* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::vector> m_skinLayers; + + private: + CPACSHullSkinLayers(const CPACSHullSkinLayers&) = delete; + CPACSHullSkinLayers& operator=(const CPACSHullSkinLayers&) = delete; + + CPACSHullSkinLayers(CPACSHullSkinLayers&&) = delete; + CPACSHullSkinLayers& operator=(CPACSHullSkinLayers&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSHullSkinLayers = generated::CPACSHullSkinLayers; +using CCPACSHullStructure = generated::CPACSHullStructure; +} // namespace tigl diff --git a/src/generated/CPACSHullStructure.cpp b/src/generated/CPACSHullStructure.cpp new file mode 100644 index 0000000000..70497bf8bb --- /dev/null +++ b/src/generated/CPACSHullStructure.cpp @@ -0,0 +1,340 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSHull.h" +#include "CPACSHullStructure.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSHullStructure::CPACSHullStructure(CPACSHull* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSHullStructure::~CPACSHullStructure() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CPACSHull* CPACSHullStructure::GetParent() const + { + return m_parent; + } + + CPACSHull* CPACSHullStructure::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSHullStructure::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSHullStructure::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSHullStructure::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSHullStructure::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSHullStructure::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element stringers + if (tixi::TixiCheckElement(tixiHandle, xpath + "/stringers")) { + m_stringers = boost::in_place(this, m_uidMgr); + try { + m_stringers->ReadCPACS(tixiHandle, xpath + "/stringers"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read stringers at xpath " << xpath << ": " << e.what(); + m_stringers = boost::none; + } + } + + // read element frames + if (tixi::TixiCheckElement(tixiHandle, xpath + "/frames")) { + m_frames = boost::in_place(this, m_uidMgr); + try { + m_frames->ReadCPACS(tixiHandle, xpath + "/frames"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read frames at xpath " << xpath << ": " << e.what(); + m_frames = boost::none; + } + } + + // read element virtualStringers + if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualStringers")) { + m_virtualStringers = boost::in_place(this, m_uidMgr); + try { + m_virtualStringers->ReadCPACS(tixiHandle, xpath + "/virtualStringers"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read virtualStringers at xpath " << xpath << ": " << e.what(); + m_virtualStringers = boost::none; + } + } + + // read element virtualFrames + if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualFrames")) { + m_virtualFrames = boost::in_place(this, m_uidMgr); + try { + m_virtualFrames->ReadCPACS(tixiHandle, xpath + "/virtualFrames"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read virtualFrames at xpath " << xpath << ": " << e.what(); + m_virtualFrames = boost::none; + } + } + + // read element skinLayers + if (tixi::TixiCheckElement(tixiHandle, xpath + "/skinLayers")) { + m_skinLayers = boost::in_place(this, m_uidMgr); + try { + m_skinLayers->ReadCPACS(tixiHandle, xpath + "/skinLayers"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read skinLayers at xpath " << xpath << ": " << e.what(); + m_skinLayers = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSHullStructure::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element stringers + if (m_stringers) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/stringers"); + m_stringers->WriteCPACS(tixiHandle, xpath + "/stringers"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/stringers")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/stringers"); + } + } + + // write element frames + if (m_frames) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/frames"); + m_frames->WriteCPACS(tixiHandle, xpath + "/frames"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/frames")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/frames"); + } + } + + // write element virtualStringers + if (m_virtualStringers) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/virtualStringers"); + m_virtualStringers->WriteCPACS(tixiHandle, xpath + "/virtualStringers"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualStringers")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/virtualStringers"); + } + } + + // write element virtualFrames + if (m_virtualFrames) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/virtualFrames"); + m_virtualFrames->WriteCPACS(tixiHandle, xpath + "/virtualFrames"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualFrames")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/virtualFrames"); + } + } + + // write element skinLayers + if (m_skinLayers) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/skinLayers"); + m_skinLayers->WriteCPACS(tixiHandle, xpath + "/skinLayers"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/skinLayers")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/skinLayers"); + } + } + + } + + const std::string& CPACSHullStructure::GetUID() const + { + return m_uID; + } + + void CPACSHullStructure::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const boost::optional& CPACSHullStructure::GetStringers() const + { + return m_stringers; + } + + boost::optional& CPACSHullStructure::GetStringers() + { + return m_stringers; + } + + const boost::optional& CPACSHullStructure::GetFrames() const + { + return m_frames; + } + + boost::optional& CPACSHullStructure::GetFrames() + { + return m_frames; + } + + const boost::optional& CPACSHullStructure::GetVirtualStringers() const + { + return m_virtualStringers; + } + + boost::optional& CPACSHullStructure::GetVirtualStringers() + { + return m_virtualStringers; + } + + const boost::optional& CPACSHullStructure::GetVirtualFrames() const + { + return m_virtualFrames; + } + + boost::optional& CPACSHullStructure::GetVirtualFrames() + { + return m_virtualFrames; + } + + const boost::optional& CPACSHullStructure::GetSkinLayers() const + { + return m_skinLayers; + } + + boost::optional& CPACSHullStructure::GetSkinLayers() + { + return m_skinLayers; + } + + CCPACSStringersAssembly& CPACSHullStructure::GetStringers(CreateIfNotExistsTag) + { + if (!m_stringers) + m_stringers = boost::in_place(this, m_uidMgr); + return *m_stringers; + } + + void CPACSHullStructure::RemoveStringers() + { + m_stringers = boost::none; + } + + CCPACSFramesAssembly& CPACSHullStructure::GetFrames(CreateIfNotExistsTag) + { + if (!m_frames) + m_frames = boost::in_place(this, m_uidMgr); + return *m_frames; + } + + void CPACSHullStructure::RemoveFrames() + { + m_frames = boost::none; + } + + CCPACSStringersAssembly& CPACSHullStructure::GetVirtualStringers(CreateIfNotExistsTag) + { + if (!m_virtualStringers) + m_virtualStringers = boost::in_place(this, m_uidMgr); + return *m_virtualStringers; + } + + void CPACSHullStructure::RemoveVirtualStringers() + { + m_virtualStringers = boost::none; + } + + CCPACSFramesAssembly& CPACSHullStructure::GetVirtualFrames(CreateIfNotExistsTag) + { + if (!m_virtualFrames) + m_virtualFrames = boost::in_place(this, m_uidMgr); + return *m_virtualFrames; + } + + void CPACSHullStructure::RemoveVirtualFrames() + { + m_virtualFrames = boost::none; + } + + CPACSHullSkinLayers& CPACSHullStructure::GetSkinLayers(CreateIfNotExistsTag) + { + if (!m_skinLayers) + m_skinLayers = boost::in_place(this, m_uidMgr); + return *m_skinLayers; + } + + void CPACSHullStructure::RemoveSkinLayers() + { + m_skinLayers = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSHullStructure.h b/src/generated/CPACSHullStructure.h new file mode 100644 index 0000000000..06396bfc9e --- /dev/null +++ b/src/generated/CPACSHullStructure.h @@ -0,0 +1,122 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include "CPACSHullSkinLayers.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSHull; + + // This class is used in: + // CPACSHull + + /// @brief Structure + /// + /// + class CPACSHullStructure : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSHullStructure(CPACSHull* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSHullStructure(); + + TIGL_EXPORT CPACSHull* GetParent(); + + TIGL_EXPORT const CPACSHull* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetStringers() const; + TIGL_EXPORT virtual boost::optional& GetStringers(); + + TIGL_EXPORT virtual const boost::optional& GetFrames() const; + TIGL_EXPORT virtual boost::optional& GetFrames(); + + TIGL_EXPORT virtual const boost::optional& GetVirtualStringers() const; + TIGL_EXPORT virtual boost::optional& GetVirtualStringers(); + + TIGL_EXPORT virtual const boost::optional& GetVirtualFrames() const; + TIGL_EXPORT virtual boost::optional& GetVirtualFrames(); + + TIGL_EXPORT virtual const boost::optional& GetSkinLayers() const; + TIGL_EXPORT virtual boost::optional& GetSkinLayers(); + + TIGL_EXPORT virtual CCPACSStringersAssembly& GetStringers(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveStringers(); + + TIGL_EXPORT virtual CCPACSFramesAssembly& GetFrames(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveFrames(); + + TIGL_EXPORT virtual CCPACSStringersAssembly& GetVirtualStringers(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveVirtualStringers(); + + TIGL_EXPORT virtual CCPACSFramesAssembly& GetVirtualFrames(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveVirtualFrames(); + + TIGL_EXPORT virtual CPACSHullSkinLayers& GetSkinLayers(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSkinLayers(); + + protected: + CPACSHull* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + boost::optional m_stringers; + boost::optional m_frames; + boost::optional m_virtualStringers; + boost::optional m_virtualFrames; + boost::optional m_skinLayers; + + private: + CPACSHullStructure(const CPACSHullStructure&) = delete; + CPACSHullStructure& operator=(const CPACSHullStructure&) = delete; + + CPACSHullStructure(CPACSHullStructure&&) = delete; + CPACSHullStructure& operator=(CPACSHullStructure&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSHullStructure = generated::CPACSHullStructure; +using CCPACSHull = generated::CPACSHull; +} // namespace tigl diff --git a/src/generated/CPACSHulls.cpp b/src/generated/CPACSHulls.cpp new file mode 100644 index 0000000000..3e7f7e6215 --- /dev/null +++ b/src/generated/CPACSHulls.cpp @@ -0,0 +1,123 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSGenericFuelTank.h" +#include "CPACSHull.h" +#include "CPACSHulls.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSHulls::CPACSHulls(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSHulls::~CPACSHulls() + { + } + + const CPACSGenericFuelTank* CPACSHulls::GetParent() const + { + return m_parent; + } + + CPACSGenericFuelTank* CPACSHulls::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSHulls::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSHulls::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSHulls::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSHulls::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSHulls::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element hull + if (tixi::TixiCheckElement(tixiHandle, xpath + "/hull")) { + tixi::TixiReadElements(tixiHandle, xpath + "/hull", m_hulls, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSHulls::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element hull + tixi::TixiSaveElements(tixiHandle, xpath + "/hull", m_hulls); + + } + + const std::vector>& CPACSHulls::GetHulls() const + { + return m_hulls; + } + + std::vector>& CPACSHulls::GetHulls() + { + return m_hulls; + } + + CPACSHull& CPACSHulls::AddHull() + { + m_hulls.push_back(make_unique(this, m_uidMgr)); + return *m_hulls.back(); + } + + void CPACSHulls::RemoveHull(CPACSHull& ref) + { + for (std::size_t i = 0; i < m_hulls.size(); i++) { + if (m_hulls[i].get() == &ref) { + m_hulls.erase(m_hulls.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSHulls.h b/src/generated/CPACSHulls.h new file mode 100644 index 0000000000..b02e0485b9 --- /dev/null +++ b/src/generated/CPACSHulls.h @@ -0,0 +1,88 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSHull; + class CPACSGenericFuelTank; + + // This class is used in: + // CPACSGenericFuelTank + + /// @brief Hulls + /// + /// + class CPACSHulls + { + public: + TIGL_EXPORT CPACSHulls(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSHulls(); + + TIGL_EXPORT CPACSGenericFuelTank* GetParent(); + + TIGL_EXPORT const CPACSGenericFuelTank* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetHulls() const; + TIGL_EXPORT virtual std::vector>& GetHulls(); + + TIGL_EXPORT virtual CPACSHull& AddHull(); + TIGL_EXPORT virtual void RemoveHull(CPACSHull& ref); + + protected: + CPACSGenericFuelTank* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::vector> m_hulls; + + private: + CPACSHulls(const CPACSHulls&) = delete; + CPACSHulls& operator=(const CPACSHulls&) = delete; + + CPACSHulls(CPACSHulls&&) = delete; + CPACSHulls& operator=(CPACSHulls&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSHulls = generated::CPACSHulls; +using CCPACSHull = generated::CPACSHull; +using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; +} // namespace tigl diff --git a/src/generated/CPACSIsotensoidDome.cpp b/src/generated/CPACSIsotensoidDome.cpp new file mode 100644 index 0000000000..8cf7018119 --- /dev/null +++ b/src/generated/CPACSIsotensoidDome.cpp @@ -0,0 +1,98 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSDomeType.h" +#include "CPACSIsotensoidDome.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSIsotensoidDome::CPACSIsotensoidDome(CPACSDomeType* parent) + : m_polarOpeningRadius(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSIsotensoidDome::~CPACSIsotensoidDome() + { + } + + const CPACSDomeType* CPACSIsotensoidDome::GetParent() const + { + return m_parent; + } + + CPACSDomeType* CPACSIsotensoidDome::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSIsotensoidDome::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSIsotensoidDome::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + void CPACSIsotensoidDome::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element polarOpeningRadius + if (tixi::TixiCheckElement(tixiHandle, xpath + "/polarOpeningRadius")) { + m_polarOpeningRadius = tixi::TixiGetElement(tixiHandle, xpath + "/polarOpeningRadius"); + } + else { + LOG(ERROR) << "Required element polarOpeningRadius is missing at xpath " << xpath; + } + + } + + void CPACSIsotensoidDome::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element polarOpeningRadius + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/polarOpeningRadius"); + tixi::TixiSaveElement(tixiHandle, xpath + "/polarOpeningRadius", m_polarOpeningRadius); + + } + + const double& CPACSIsotensoidDome::GetPolarOpeningRadius() const + { + return m_polarOpeningRadius; + } + + void CPACSIsotensoidDome::SetPolarOpeningRadius(const double& value) + { + m_polarOpeningRadius = value; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSIsotensoidDome.h b/src/generated/CPACSIsotensoidDome.h new file mode 100644 index 0000000000..f61a9f7134 --- /dev/null +++ b/src/generated/CPACSIsotensoidDome.h @@ -0,0 +1,76 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSDomeType; + + // This class is used in: + // CPACSDomeType + + /// @brief Isotensoid dome + /// + /// + class CPACSIsotensoidDome + { + public: + TIGL_EXPORT CPACSIsotensoidDome(CPACSDomeType* parent); + + TIGL_EXPORT virtual ~CPACSIsotensoidDome(); + + TIGL_EXPORT CPACSDomeType* GetParent(); + + TIGL_EXPORT const CPACSDomeType* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const double& GetPolarOpeningRadius() const; + TIGL_EXPORT virtual void SetPolarOpeningRadius(const double& value); + + protected: + CPACSDomeType* m_parent; + + /// Radius of the fitting/smaller polar opening + double m_polarOpeningRadius; + + private: + CPACSIsotensoidDome(const CPACSIsotensoidDome&) = delete; + CPACSIsotensoidDome& operator=(const CPACSIsotensoidDome&) = delete; + + CPACSIsotensoidDome(CPACSIsotensoidDome&&) = delete; + CPACSIsotensoidDome& operator=(CPACSIsotensoidDome&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSIsotensoidDome = generated::CPACSIsotensoidDome; +using CCPACSDomeType = generated::CPACSDomeType; +} // namespace tigl diff --git a/src/generated/CPACSMaterialDefinition.cpp b/src/generated/CPACSMaterialDefinition.cpp index c2cbd8f5d0..8cd3b6e21c 100644 --- a/src/generated/CPACSMaterialDefinition.cpp +++ b/src/generated/CPACSMaterialDefinition.cpp @@ -18,6 +18,7 @@ #include #include "CCPACSWingRibCrossSection.h" #include "CPACSCap.h" +#include "CPACSGenericFuelTankParameters.h" #include "CPACSLateralCap.h" #include "CPACSMaterialDefinition.h" #include "CPACSSheetBasedStructuralElement.h" @@ -43,6 +44,14 @@ namespace generated m_parentType = &typeid(CPACSCap); } + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGenericFuelTankParameters); + } + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -113,6 +122,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent()->GetNextUIDParent(); } @@ -144,6 +156,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent()->GetNextUIDParent(); } diff --git a/src/generated/CPACSMaterialDefinition.h b/src/generated/CPACSMaterialDefinition.h index 30da55c36e..ec89b9b19e 100644 --- a/src/generated/CPACSMaterialDefinition.h +++ b/src/generated/CPACSMaterialDefinition.h @@ -35,6 +35,7 @@ class CCPACSWingRibCrossSection; namespace generated { class CPACSCap; + class CPACSGenericFuelTankParameters; class CPACSLateralCap; class CPACSSheetBasedStructuralElement; class CPACSTrackActuator; @@ -44,6 +45,7 @@ namespace generated // This class is used in: // CPACSCap + // CPACSGenericFuelTankParameters // CPACSLateralCap // CPACSSheetBasedStructuralElement // CPACSTrackActuator @@ -61,6 +63,7 @@ namespace generated { public: TIGL_EXPORT CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr); @@ -80,7 +83,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -90,7 +93,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -162,6 +165,7 @@ namespace generated // Aliases in tigl namespace using CCPACSCap = generated::CPACSCap; +using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; using CCPACSLateralCap = generated::CPACSLateralCap; using CCPACSSheetBasedStructuralElement = generated::CPACSSheetBasedStructuralElement; using CCPACSTrackActuator = generated::CPACSTrackActuator; diff --git a/src/generated/CPACSSkin.cpp b/src/generated/CPACSSkin.cpp index dff420f585..2dc026de97 100644 --- a/src/generated/CPACSSkin.cpp +++ b/src/generated/CPACSSkin.cpp @@ -18,6 +18,7 @@ #include #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" +#include "CPACSHullSkinLayers.h" #include "CPACSSkin.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -45,6 +46,14 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } + CPACSSkin::CPACSSkin(CPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSHullSkinLayers); + } + CPACSSkin::~CPACSSkin() { if (m_uidMgr) { @@ -61,6 +70,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } } return nullptr; } @@ -74,6 +86,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } } return nullptr; } diff --git a/src/generated/CPACSSkin.h b/src/generated/CPACSSkin.h index 968c6b6c24..abae4969f0 100644 --- a/src/generated/CPACSSkin.h +++ b/src/generated/CPACSSkin.h @@ -37,9 +37,12 @@ class CCPACSFuselageStructure; namespace generated { + class CPACSHullSkinLayers; + // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure + // CPACSHullSkinLayers /// @brief skinType /// @@ -50,6 +53,7 @@ namespace generated public: TIGL_EXPORT CPACSSkin(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSSkin(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSSkin(CPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSSkin(); @@ -62,7 +66,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -72,7 +76,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -122,4 +126,7 @@ namespace generated } // namespace generated // CPACSSkin is customized, use type CCPACSSkin directly + +// Aliases in tigl namespace +using CCPACSHullSkinLayers = generated::CPACSHullSkinLayers; } // namespace tigl diff --git a/src/generated/CPACSStringersAssembly.cpp b/src/generated/CPACSStringersAssembly.cpp index a852bf1fc9..e21f017fb7 100644 --- a/src/generated/CPACSStringersAssembly.cpp +++ b/src/generated/CPACSStringersAssembly.cpp @@ -19,6 +19,7 @@ #include #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" +#include "CPACSHullStructure.h" #include "CPACSStringersAssembly.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -46,6 +47,14 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } + CPACSStringersAssembly::CPACSStringersAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSHullStructure); + } + CPACSStringersAssembly::~CPACSStringersAssembly() { } @@ -59,6 +68,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } @@ -72,6 +84,9 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } diff --git a/src/generated/CPACSStringersAssembly.h b/src/generated/CPACSStringersAssembly.h index f1f80630d1..b0f24042a0 100644 --- a/src/generated/CPACSStringersAssembly.h +++ b/src/generated/CPACSStringersAssembly.h @@ -35,9 +35,12 @@ class CCPACSFuselageStructure; namespace generated { + class CPACSHullStructure; + // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure + // CPACSHullStructure /// @brief stringersAssemblyType /// @@ -49,6 +52,7 @@ namespace generated public: TIGL_EXPORT CPACSStringersAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSStringersAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSStringersAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSStringersAssembly(); @@ -61,7 +65,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -71,7 +75,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -111,4 +115,7 @@ namespace generated } // namespace generated // CPACSStringersAssembly is customized, use type CCPACSStringersAssembly directly + +// Aliases in tigl namespace +using CCPACSHullStructure = generated::CPACSHullStructure; } // namespace tigl diff --git a/src/generated/CPACSTorisphericalDome.cpp b/src/generated/CPACSTorisphericalDome.cpp new file mode 100644 index 0000000000..2e4bde2044 --- /dev/null +++ b/src/generated/CPACSTorisphericalDome.cpp @@ -0,0 +1,121 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSDomeType.h" +#include "CPACSTorisphericalDome.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSTorisphericalDome::CPACSTorisphericalDome(CPACSDomeType* parent) + : m_dishRadius(0) + , m_knuckleRadius(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSTorisphericalDome::~CPACSTorisphericalDome() + { + } + + const CPACSDomeType* CPACSTorisphericalDome::GetParent() const + { + return m_parent; + } + + CPACSDomeType* CPACSTorisphericalDome::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSTorisphericalDome::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSTorisphericalDome::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + void CPACSTorisphericalDome::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element dishRadius + if (tixi::TixiCheckElement(tixiHandle, xpath + "/dishRadius")) { + m_dishRadius = tixi::TixiGetElement(tixiHandle, xpath + "/dishRadius"); + } + else { + LOG(ERROR) << "Required element dishRadius is missing at xpath " << xpath; + } + + // read element knuckleRadius + if (tixi::TixiCheckElement(tixiHandle, xpath + "/knuckleRadius")) { + m_knuckleRadius = tixi::TixiGetElement(tixiHandle, xpath + "/knuckleRadius"); + } + else { + LOG(ERROR) << "Required element knuckleRadius is missing at xpath " << xpath; + } + + } + + void CPACSTorisphericalDome::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element dishRadius + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/dishRadius"); + tixi::TixiSaveElement(tixiHandle, xpath + "/dishRadius", m_dishRadius); + + // write element knuckleRadius + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/knuckleRadius"); + tixi::TixiSaveElement(tixiHandle, xpath + "/knuckleRadius", m_knuckleRadius); + + } + + const double& CPACSTorisphericalDome::GetDishRadius() const + { + return m_dishRadius; + } + + void CPACSTorisphericalDome::SetDishRadius(const double& value) + { + m_dishRadius = value; + } + + const double& CPACSTorisphericalDome::GetKnuckleRadius() const + { + return m_knuckleRadius; + } + + void CPACSTorisphericalDome::SetKnuckleRadius(const double& value) + { + m_knuckleRadius = value; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSTorisphericalDome.h b/src/generated/CPACSTorisphericalDome.h new file mode 100644 index 0000000000..951b00c137 --- /dev/null +++ b/src/generated/CPACSTorisphericalDome.h @@ -0,0 +1,82 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSDomeType; + + // This class is used in: + // CPACSDomeType + + /// @brief Torispherical dome + /// + /// + class CPACSTorisphericalDome + { + public: + TIGL_EXPORT CPACSTorisphericalDome(CPACSDomeType* parent); + + TIGL_EXPORT virtual ~CPACSTorisphericalDome(); + + TIGL_EXPORT CPACSDomeType* GetParent(); + + TIGL_EXPORT const CPACSDomeType* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const double& GetDishRadius() const; + TIGL_EXPORT virtual void SetDishRadius(const double& value); + + TIGL_EXPORT virtual const double& GetKnuckleRadius() const; + TIGL_EXPORT virtual void SetKnuckleRadius(const double& value); + + protected: + CPACSDomeType* m_parent; + + /// R1: dish radius + double m_dishRadius; + + /// R2: knuckle radius + double m_knuckleRadius; + + private: + CPACSTorisphericalDome(const CPACSTorisphericalDome&) = delete; + CPACSTorisphericalDome& operator=(const CPACSTorisphericalDome&) = delete; + + CPACSTorisphericalDome(CPACSTorisphericalDome&&) = delete; + CPACSTorisphericalDome& operator=(CPACSTorisphericalDome&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSTorisphericalDome = generated::CPACSTorisphericalDome; +using CCPACSDomeType = generated::CPACSDomeType; +} // namespace tigl diff --git a/src/generated/CPACSTransformation.cpp b/src/generated/CPACSTransformation.cpp index 557eda8439..be1b38ac99 100644 --- a/src/generated/CPACSTransformation.cpp +++ b/src/generated/CPACSTransformation.cpp @@ -31,6 +31,8 @@ #include "CCPACSWing.h" #include "CCPACSWingSection.h" #include "CCPACSWingSectionElement.h" +#include "CPACSGenericFuelTankParameters.h" +#include "CPACSHull.h" #include "CPACSLandingGearBase.h" #include "CPACSTransformation.h" #include "CTiglError.h" @@ -98,6 +100,14 @@ namespace generated m_parentType = &typeid(CCPACSFuselageSection); } + CPACSTransformation::CPACSTransformation(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGenericFuelTankParameters); + } + CPACSTransformation::CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -114,6 +124,14 @@ namespace generated m_parentType = &typeid(CCPACSGenericSystem); } + CPACSTransformation::CPACSTransformation(CPACSHull* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSHull); + } + CPACSTransformation::CPACSTransformation(CPACSLandingGearBase* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -199,12 +217,18 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent(); } if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent(); } @@ -254,12 +278,18 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent(); } if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent(); } diff --git a/src/generated/CPACSTransformation.h b/src/generated/CPACSTransformation.h index 2de35de849..a1b893d84e 100644 --- a/src/generated/CPACSTransformation.h +++ b/src/generated/CPACSTransformation.h @@ -50,6 +50,8 @@ class CCPACSWingSection; namespace generated { + class CPACSGenericFuelTankParameters; + class CPACSHull; class CPACSLandingGearBase; // This class is used in: @@ -60,8 +62,10 @@ namespace generated // CPACSFuselage // CPACSFuselageElement // CPACSFuselageSection + // CPACSGenericFuelTankParameters // CPACSGenericGeometricComponent // CPACSGenericSystem + // CPACSHull // CPACSLandingGearBase // CPACSNacelleSection // CPACSRotor @@ -93,8 +97,10 @@ namespace generated TIGL_EXPORT CPACSTransformation(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTransformation(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTransformation(CPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSRotor* parent, CTiglUIDManager* uidMgr); @@ -114,7 +120,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -124,7 +130,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -200,5 +206,7 @@ namespace generated // CPACSTransformation is customized, use type CCPACSTransformation directly // Aliases in tigl namespace +using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; +using CCPACSHull = generated::CPACSHull; using CCPACSLandingGearBase = generated::CPACSLandingGearBase; } // namespace tigl diff --git a/src/geometry/CCPACSTransformation.cpp b/src/geometry/CCPACSTransformation.cpp index 76c7a21226..b262840719 100644 --- a/src/geometry/CCPACSTransformation.cpp +++ b/src/geometry/CCPACSTransformation.cpp @@ -65,6 +65,12 @@ CCPACSTransformation::CCPACSTransformation(CCPACSFuselageSection* parent, CTiglU { } +CCPACSTransformation::CCPACSTransformation(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) + : generated::CPACSTransformation(parent, uidMgr) + , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) +{ +} + CCPACSTransformation::CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) @@ -83,6 +89,12 @@ CCPACSTransformation::CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglU { } +CCPACSTransformation::CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr) + : generated::CPACSTransformation(parent, uidMgr) + , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) +{ +} + CCPACSTransformation::CCPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) diff --git a/src/geometry/CCPACSTransformation.h b/src/geometry/CCPACSTransformation.h index 95d545400a..f7ab3b1ba3 100644 --- a/src/geometry/CCPACSTransformation.h +++ b/src/geometry/CCPACSTransformation.h @@ -39,8 +39,10 @@ class CCPACSTransformation : public generated::CPACSTransformation TIGL_EXPORT CCPACSTransformation(CCPACSDuctAssembly* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSTransformation(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSRotor* parent, CTiglUIDManager* uidMgr); From c1020f54ce455e6459a3bca80809c438f2307fa6 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 28 Dec 2023 20:53:49 +0100 Subject: [PATCH 003/122] add classes to Swig config file --- .github/workflows/continuous-integration.yml | 32 +++++++++++++++++++- bindings/python_internal/configuration.i | 8 +++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 54abe02179..efe796b671 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -55,6 +55,12 @@ on: default: '' type: string + macos-package-artifact: + description: "Name of the Mac OS package artifact. Leave empty to skip building the package." + required: false + default: '' + type: string + jobs: build-linux: @@ -155,9 +161,33 @@ jobs: unit-tests: true integration-tests: ${{ inputs.integration-tests == 'true' }} + build-macos: + runs-on: "macos-latest" + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/build-macos + with: + config: "Release" + tigl_nightly: ${{ inputs.tigl_nightly =='true' }} + tigl_concat_generated_files: ${{ inputs.tigl_concat_generated_files == 'true' }} + tigl_enable_coverage: 'OFF' + package-artifact: ${{ inputs.macos-package-artifact }} + build-artifact: build-macos-latest-Release-nightly-${{ inputs.tigl_nightly }}-concat-${{ inputs.tigl_concat_generated_files }}-cov-OFF-static-ON-python-OFF + + test-macos: + needs: build-macos + runs-on: "macos-latest" + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/test-macos + with: + build-artifact: build-macos-latest-Release-nightly-${{ inputs.tigl_nightly }}-concat-${{ inputs.tigl_concat_generated_files }}-cov-OFF-static-ON-python-OFF + unit-tests: true + integration-tests: ${{ inputs.integration-tests == 'true' }} + draft-release: if: ${{ inputs.draft-release == 'true' }} - needs: ["test-windows", "test-linux"] + needs: ["test-macos", "test-windows", "test-linux"] runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index d7049d34a9..993e56f684 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -325,6 +325,14 @@ namespace tigl %include "CTiglAttachedRotorBlade.h" %include "CPACSRotorHubHinge_type.h" +// --------------- Fuselage tanks -----------------// +// ToDo: Check which classes need to be assigned to boost_optional +// %boost_optional(tigl::generated::CPACSGenericFuelTanks) +// %boost_optional(tigl::generated::CPACSFuselageFuelTanks) + +%include "generated/CPACSGenericFuelTanks.h" +%include "generated/CPACSFuselageFuelTanks.h" + // -------------------- Wing Structure -------------------// namespace tigl { From 3e9e890d335ca3340c21777907b3a870b83c4315 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 29 Dec 2023 17:47:08 +0100 Subject: [PATCH 004/122] set up first (dummy) unittest for fuselageTanks --- .../TestData/simpletest-fuelTanks.cpacs.xml | 259 ++++++++++++++++++ tests/unittests/tiglTanks.cpp | 74 +++++ 2 files changed, 333 insertions(+) create mode 100644 tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml create mode 100644 tests/unittests/tiglTanks.cpp diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml new file mode 100644 index 0000000000..71aa95a5f5 --- /dev/null +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -0,0 +1,259 @@ + + +

+ Fuel tanks test + Simple fuel tank for unit testing + Marko Alder + 2023-12-28T12:00:00 + 1.0.0 + 3.3 +
+ + + + Test aircraft + + + Simple fuselage + + + 1.0 + 0.5 + 0.5 + + + +
+ Fuselage Section 1 + + + + Fuselage Section 1 + fuselageCircleProfileuID + + + +
+
+ Fuselage Section 2 + + + 0.5 + + + + + Fuselage Section 2 + fuselageCircleProfileuID + + + +
+
+ Fuselage Section 3 + + + + Fuselage Section 3 + fuselageCircleProfileuID + + + +
+
+ + + Fuselage Positioning 1 + -0.5 + 90 + 0 + fuselage_1Section1ID + + + Fuselage Positioning 3 + 2 + 90 + 0 + fuselage_1Section1ID + fuselage_1Section3ID + + + + + Fuselage Segment 2 + fuselage_1Section1IDElement1 + fuselage_1Section2IDElement1 + + + Fuselage Segment 3 + fuselage_1Section2IDElement1 + fuselage_1Section3IDElement1 + + + + + + Simple tank + + + Outer hull + + + 1 + 0.3 + 0.3 + + + +
+ Section 1 + + + 1 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 2 + + + 1.5 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 2 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + +
+
+ + + Hull 1 Segment 1 + hull1_section1_element1 + hull1_section2_element1 + + + Hull 1 Segment 2 + hull1_section2_element1 + hull1_section3_element1 + + +
+
+
+
+
+
+ +
+
+
+ + + + Circle + Profile build up from set of Points on Circle where may Dimensions are 1..-1 + + 0.0;0.0;0.0;0.0;0.0 + 0.0;1.0;0.0;-1.0;0.0 + 1.0;0.0;-1.0;0.0;1.0 + + + + +
+ \ No newline at end of file diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp new file mode 100644 index 0000000000..2afc84a118 --- /dev/null +++ b/tests/unittests/tiglTanks.cpp @@ -0,0 +1,74 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2023-12-29 Marko Alder +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Tests for testing duct functions. +*/ + +#include "test.h" +#include "tigl.h" + +#include "generated/CPACSGenericFuelTank.h" +#include "CCPACSConfigurationManager.h" +#include "CTiglUIDManager.h" + +class FuselageTank : public ::testing::Test +{ +protected: + static void SetUpTestCase() + { + const char* filename = "TestData/simpletest-fuelTanks.cpacs.xml"; + ReturnCode tixiRet; + TiglReturnCode tiglRet; + + tiglHandle = -1; + tixiHandle = -1; + + tixiRet = tixiOpenDocument(filename, &tixiHandle); + ASSERT_TRUE (tixiRet == SUCCESS); + tiglRet = tiglOpenCPACSConfiguration(tixiHandle, "testAircraft", &tiglHandle); + ASSERT_TRUE(tiglRet == TIGL_SUCCESS); + } + + static void TearDownTestCase() + { + ASSERT_EQ(tiglCloseCPACSConfiguration(tiglHandle), TIGL_SUCCESS); + ASSERT_EQ(tixiCloseDocument(tixiHandle), SUCCESS); + tiglHandle = -1; + tixiHandle = -1; + } + + void SetUp() override {} + void TearDown() override {} + + static TixiDocumentHandle tixiHandle; + static TiglCPACSConfigurationHandle tiglHandle; + + tigl::CTiglUIDManager& uidMgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); + tigl::CCPACSGenericFuelTank const* fuelTank = &uidMgr.ResolveObject("genericTank1"); + +}; + +TixiDocumentHandle FuselageTank::tixiHandle = 0; +TiglCPACSConfigurationHandle FuselageTank::tiglHandle = 0; + +TEST_F(FuselageTank, getName) +{ + const std::string name = fuelTank->GetName(); + EXPECT_EQ(name, "Simple tank"); +} \ No newline at end of file From b1f8acd05d87a87cb75eefc6a0f3f7706fe987ba Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 29 Dec 2023 17:56:23 +0100 Subject: [PATCH 005/122] format style --- tests/unittests/tiglTanks.cpp | 51 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 2afc84a118..e78206a1b0 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -1,24 +1,24 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2023-12-29 Marko Alder -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) + * + * Created: 2023-12-29 Marko Alder + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** -* @file -* @brief Tests for testing duct functions. -*/ + * @file + * @brief Tests for testing duct functions. + */ #include "test.h" #include "tigl.h" @@ -32,7 +32,7 @@ class FuselageTank : public ::testing::Test protected: static void SetUpTestCase() { - const char* filename = "TestData/simpletest-fuelTanks.cpacs.xml"; + const char *filename = "TestData/simpletest-fuelTanks.cpacs.xml"; ReturnCode tixiRet; TiglReturnCode tiglRet; @@ -40,7 +40,7 @@ class FuselageTank : public ::testing::Test tixiHandle = -1; tixiRet = tixiOpenDocument(filename, &tixiHandle); - ASSERT_TRUE (tixiRet == SUCCESS); + ASSERT_TRUE(tixiRet == SUCCESS); tiglRet = tiglOpenCPACSConfiguration(tixiHandle, "testAircraft", &tiglHandle); ASSERT_TRUE(tiglRet == TIGL_SUCCESS); } @@ -56,19 +56,18 @@ class FuselageTank : public ::testing::Test void SetUp() override {} void TearDown() override {} - static TixiDocumentHandle tixiHandle; + static TixiDocumentHandle tixiHandle; static TiglCPACSConfigurationHandle tiglHandle; - tigl::CTiglUIDManager& uidMgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); - tigl::CCPACSGenericFuelTank const* fuelTank = &uidMgr.ResolveObject("genericTank1"); - + tigl::CTiglUIDManager &uidMgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); + tigl::CCPACSGenericFuelTank const *fuelTank = &uidMgr.ResolveObject("genericTank1"); }; TixiDocumentHandle FuselageTank::tixiHandle = 0; TiglCPACSConfigurationHandle FuselageTank::tiglHandle = 0; TEST_F(FuselageTank, getName) -{ +{ const std::string name = fuelTank->GetName(); EXPECT_EQ(name, "Simple tank"); } \ No newline at end of file From 22e9462518f7c2e2867e513359c46571c8751aae Mon Sep 17 00:00:00 2001 From: Alder Date: Sat, 16 Mar 2024 12:47:21 +0100 Subject: [PATCH 006/122] add CCPACSHull with most code except a problem with parent of segments --- bindings/python_internal/configuration.i | 6 +- cpacs_gen_input/CustomTypes.txt | 3 + src/fuelTanks/CCPACSHull.cpp | 157 +++ src/fuelTanks/CCPACSHull.h | 65 ++ src/generated/CPACSFuselageSections.cpp | 14 +- src/generated/CPACSFuselageSections.h | 12 +- src/generated/CPACSFuselageSegments.cpp | 14 +- src/generated/CPACSFuselageSegments.h | 12 +- src/generated/CPACSHull.cpp | 10 +- src/generated/CPACSHull.h | 3 +- src/generated/CPACSHullStructure.cpp | 8 +- src/generated/CPACSHullStructure.h | 12 +- src/generated/CPACSHulls.cpp | 12 +- src/generated/CPACSHulls.h | 13 +- src/generated/CPACSTransformation.cpp | 14 +- src/generated/CPACSTransformation.h | 9 +- tests/unittests/fuelTanks-tests.py | 22 + tests/unittests/pythonwrapper-tests.py | 1208 +++++++++++----------- tests/unittests/runtests.sh.in | 28 +- tests/unittests/test_fuelTanks.py | 34 + tests/unittests/tiglTanks.cpp | 6 + 21 files changed, 970 insertions(+), 692 deletions(-) create mode 100644 src/fuelTanks/CCPACSHull.cpp create mode 100644 src/fuelTanks/CCPACSHull.h create mode 100644 tests/unittests/fuelTanks-tests.py create mode 100644 tests/unittests/test_fuelTanks.py diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 993e56f684..6967e4b8c7 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -96,6 +96,8 @@ #include "CCPACSDucts.h" #include "CCPACSDuctAssembly.h" #include "CCPACSDuct.h" +#include "generated/CPACSFuselageFuelTanks.h" +#include "generated/CPACSGenericFuelTanks.h" %} %feature("autodoc", "3"); @@ -327,8 +329,8 @@ namespace tigl // --------------- Fuselage tanks -----------------// // ToDo: Check which classes need to be assigned to boost_optional -// %boost_optional(tigl::generated::CPACSGenericFuelTanks) -// %boost_optional(tigl::generated::CPACSFuselageFuelTanks) +%boost_optional(tigl::generated::CPACSGenericFuelTanks) +%boost_optional(tigl::generated::CPACSFuselageFuelTanks) %include "generated/CPACSGenericFuelTanks.h" %include "generated/CPACSFuselageFuelTanks.h" diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index b6003e2a1e..305b595eb8 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -149,3 +149,6 @@ CPACSDuct CCPACSDuct CPACSDuctStructure CCPACSDuctStructure CPACSDuctAssembly CCPACSDuctAssembly CPACSDucts CCPACSDucts + +// Tanks +CPACSHull CCPACSHull diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp new file mode 100644 index 0000000000..3c52df99ac --- /dev/null +++ b/src/fuelTanks/CCPACSHull.cpp @@ -0,0 +1,157 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-03-15 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS duct handling routines. +*/ + +#include "CCPACSHull.h" +#include "CCPACSFuselageSegment.h" +#include "CTiglMakeLoft.h" +#include "CNamedShape.h" +#include "CTiglTopoAlgorithms.h" +#include "tiglcommonfunctions.h" + +namespace tigl { + +CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) + : generated::CPACSHull(parent, uidMgr) + , CTiglRelativelyPositionedComponent(static_cast(nullptr), &m_transformation) +{} + +// CCPACSConfiguration& CCPACSHull::GetConfiguration() const +// { +// return GetParent()->GetParent()->GetConfiguration(); +// } + +std::string CCPACSHull::GetDefaultedUID() const +{ + return generated::CPACSHull::GetUID(); +} + +TiglGeometricComponentType CCPACSHull::GetComponentType() const +{ + return TIGL_COMPONENT_DUCT; +} + +TiglGeometricComponentIntent CCPACSHull::GetComponentIntent() const +{ + // needs to be physical, so that transformation relative to parent works + return TIGL_INTENT_PHYSICAL; +} + +PNamedShape CCPACSHull::BuildLoft() const +{ + TiglContinuity cont = m_segments.GetSegment(1).GetContinuity(); + Standard_Boolean smooth = (cont == ::C0? false : true); + + CTiglMakeLoft lofter; + // add profiles + for (int i=1; i <= m_segments.GetSegmentCount(); i++) { + lofter.addProfiles(m_segments.GetSegment(i).GetStartWire()); + } + lofter.addProfiles(m_segments.GetSegment(m_segments.GetSegmentCount()).GetEndWire()); + + // add guides + lofter.addGuides(m_segments.GetGuideCurveWires()); + + lofter.setMakeSolid(true); + lofter.setMakeSmooth(smooth); + + TopoDS_Shape loftShape = lofter.Shape(); + + std::string loftName = GetUID(); + std::string loftShortName = GetShortShapeName(); + PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + SetFaceTraits(loft); + + return loft; +} + +// get short name for loft +std::string CCPACSHull::GetShortShapeName() const +{ + unsigned int findex = 0; + unsigned int i = 0; + + for (auto& d: GetParent()->GetHulls()) { + ++i; + if (GetUID() == d->GetUID()) { + findex = i; + std::stringstream shortName; + shortName << "D" << findex; + return shortName.str(); + } + } + return "UNKNOWN"; +} + +void CCPACSHull::SetFaceTraits (PNamedShape loft) const +{ + int nFacesTotal = GetNumberOfFaces(loft->Shape()); + int nFacesAero = nFacesTotal; + bool hasSymmetryPlane = GetNumberOfEdges(m_segments.GetSegment(1).GetEndWire()) > 1; + + std::vector names; + names.push_back(loft->Name()); + names.push_back("symmetry"); + names.push_back("Front"); + names.push_back("Rear"); + + if (!CTiglTopoAlgorithms::IsDegenerated(m_segments.GetSegment(1).GetStartWire())) { + nFacesAero-=1; + } + if (!CTiglTopoAlgorithms::IsDegenerated(m_segments.GetSegment(m_segments.GetSegmentCount()).GetEndWire())) { + nFacesAero-=1; + } + + // if we have a smooth surface, the whole fuslage is treatet as one segment + int nSegments = m_segments.GetSegmentCount(); + + int facesPerSegment = nFacesAero/ nSegments; + + int iFaceTotal = 0; + int nSymmetryFaces = (int) hasSymmetryPlane; + for (int iSegment = 0; iSegment < nSegments; ++iSegment) { + for (int iFace = 0; iFace < facesPerSegment - nSymmetryFaces; ++iFace) { + loft->FaceTraits(iFaceTotal++).SetName(names[0].c_str()); + } + for (int iFace = 0; iFace < nSymmetryFaces; ++iFace) { + loft->FaceTraits(iFaceTotal++).SetName(names[1].c_str()); + } + } + + // set the caps + int iFace = 2; + for (;iFaceTotal < nFacesTotal; ++iFaceTotal) { + loft->FaceTraits(iFaceTotal).SetName(names[iFace++].c_str()); + } +} + +// void CCPACSDuct::RegisterInvalidationCallback(std::function const& fn){ +// invalidationCallbacks.push_back(fn); +// } + +// void CCPACSDuct::InvalidateImpl(const boost::optional&) const +// { +// CTiglAbstractGeometricComponent::Reset(); +// for (auto const& invalidator: invalidationCallbacks) { +// invalidator(); +// } +// } + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h new file mode 100644 index 0000000000..edb5828389 --- /dev/null +++ b/src/fuelTanks/CCPACSHull.h @@ -0,0 +1,65 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-03-15 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hull handling routines. +*/ + +#pragma once + +#include "generated/CPACSHull.h" +#include "CTiglRelativelyPositionedComponent.h" +// #include "CCPACSConfiguration.h" +// #include "CCPACSDucts.h" +#include "generated/CPACSHulls.h" + +namespace tigl +{ + +class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositionedComponent +{ +public: + + TIGL_EXPORT explicit CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); + + // TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + + TIGL_EXPORT std::string GetDefaultedUID() const; // override; + TIGL_EXPORT TiglGeometricComponentType GetComponentType() const; // override; + TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const; // override; + + // //Any DuctAssembly that references this duct element, can register its Invalidation + // //as a callback. + // TIGL_EXPORT void RegisterInvalidationCallback(std::function const&); + +protected: + PNamedShape BuildLoft() const; // override; + +private: + + // virtual void InvalidateImpl(const boost::optional&) const override; + + // // get short name for loft + std::string GetShortShapeName() const; + + void SetFaceTraits (PNamedShape loft) const; + + // std::vector> invalidationCallbacks; + +}; + +} diff --git a/src/generated/CPACSFuselageSections.cpp b/src/generated/CPACSFuselageSections.cpp index 66fcfcefdf..787d2a3663 100644 --- a/src/generated/CPACSFuselageSections.cpp +++ b/src/generated/CPACSFuselageSections.cpp @@ -19,8 +19,8 @@ #include #include "CCPACSDuct.h" #include "CCPACSFuselage.h" +#include "CCPACSHull.h" #include "CPACSFuselageSections.h" -#include "CPACSHull.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselage); } - CPACSFuselageSections::CPACSFuselageSections(CPACSHull* parent, CTiglUIDManager* uidMgr) + CPACSFuselageSections::CPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSHull); + m_parentType = &typeid(CCPACSHull); } CPACSFuselageSections::~CPACSFuselageSections() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSFuselageSections.h b/src/generated/CPACSFuselageSections.h index ad5e3f4ea7..77526e5687 100644 --- a/src/generated/CPACSFuselageSections.h +++ b/src/generated/CPACSFuselageSections.h @@ -32,11 +32,10 @@ class CTiglUIDObject; class CCPACSFuselageSection; class CCPACSDuct; class CCPACSFuselage; +class CCPACSHull; namespace generated { - class CPACSHull; - // This class is used in: // CPACSDuct // CPACSFuselage @@ -51,7 +50,7 @@ namespace generated public: TIGL_EXPORT CPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSFuselageSections(CPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageSections(); @@ -64,7 +63,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -74,7 +73,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -114,7 +113,4 @@ namespace generated } // namespace generated // CPACSFuselageSections is customized, use type CCPACSFuselageSections directly - -// Aliases in tigl namespace -using CCPACSHull = generated::CPACSHull; } // namespace tigl diff --git a/src/generated/CPACSFuselageSegments.cpp b/src/generated/CPACSFuselageSegments.cpp index 4b9a8d9953..69077216cb 100644 --- a/src/generated/CPACSFuselageSegments.cpp +++ b/src/generated/CPACSFuselageSegments.cpp @@ -19,8 +19,8 @@ #include #include "CCPACSDuct.h" #include "CCPACSFuselage.h" +#include "CCPACSHull.h" #include "CPACSFuselageSegments.h" -#include "CPACSHull.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselage); } - CPACSFuselageSegments::CPACSFuselageSegments(CPACSHull* parent, CTiglUIDManager* uidMgr) + CPACSFuselageSegments::CPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSHull); + m_parentType = &typeid(CCPACSHull); } CPACSFuselageSegments::~CPACSFuselageSegments() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSFuselageSegments.h b/src/generated/CPACSFuselageSegments.h index 82cd408e82..e7dece2dd1 100644 --- a/src/generated/CPACSFuselageSegments.h +++ b/src/generated/CPACSFuselageSegments.h @@ -32,11 +32,10 @@ class CTiglUIDObject; class CCPACSFuselageSegment; class CCPACSDuct; class CCPACSFuselage; +class CCPACSHull; namespace generated { - class CPACSHull; - // This class is used in: // CPACSDuct // CPACSFuselage @@ -52,7 +51,7 @@ namespace generated public: TIGL_EXPORT CPACSFuselageSegments(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFuselageSegments(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSFuselageSegments(CPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageSegments(); @@ -65,7 +64,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -75,7 +74,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -115,7 +114,4 @@ namespace generated } // namespace generated // CPACSFuselageSegments is customized, use type CCPACSFuselageSegments directly - -// Aliases in tigl namespace -using CCPACSHull = generated::CPACSHull; } // namespace tigl diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSHull.cpp index 500da27cb3..7ed954ac5e 100644 --- a/src/generated/CPACSHull.cpp +++ b/src/generated/CPACSHull.cpp @@ -29,9 +29,9 @@ namespace generated { CPACSHull::CPACSHull(CPACSHulls* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) - , m_transformation(this, m_uidMgr) - , m_sections(this, m_uidMgr) - , m_segments(this, m_uidMgr) + , m_transformation(reinterpret_cast(this), m_uidMgr) + , m_sections(reinterpret_cast(this), m_uidMgr) + , m_segments(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; @@ -142,7 +142,7 @@ namespace generated // read element structure if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { - m_structure = boost::in_place(this, m_uidMgr); + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_structure->ReadCPACS(tixiHandle, xpath + "/structure"); } catch(const std::exception& e) { @@ -280,7 +280,7 @@ namespace generated CPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) { if (!m_structure) - m_structure = boost::in_place(this, m_uidMgr); + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_structure; } diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSHull.h index e94df1c2bf..72dd9bbf94 100644 --- a/src/generated/CPACSHull.h +++ b/src/generated/CPACSHull.h @@ -117,7 +117,8 @@ namespace generated }; } // namespace generated +// CPACSHull is customized, use type CCPACSHull directly + // Aliases in tigl namespace -using CCPACSHull = generated::CPACSHull; using CCPACSHulls = generated::CPACSHulls; } // namespace tigl diff --git a/src/generated/CPACSHullStructure.cpp b/src/generated/CPACSHullStructure.cpp index 70497bf8bb..1863a0525e 100644 --- a/src/generated/CPACSHullStructure.cpp +++ b/src/generated/CPACSHullStructure.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CPACSHull.h" +#include "CCPACSHull.h" #include "CPACSHullStructure.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSHullStructure::CPACSHullStructure(CPACSHull* parent, CTiglUIDManager* uidMgr) + CPACSHullStructure::CPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -39,12 +39,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CPACSHull* CPACSHullStructure::GetParent() const + const CCPACSHull* CPACSHullStructure::GetParent() const { return m_parent; } - CPACSHull* CPACSHullStructure::GetParent() + CCPACSHull* CPACSHullStructure::GetParent() { return m_parent; } diff --git a/src/generated/CPACSHullStructure.h b/src/generated/CPACSHullStructure.h index 06396bfc9e..9977013c65 100644 --- a/src/generated/CPACSHullStructure.h +++ b/src/generated/CPACSHullStructure.h @@ -31,11 +31,10 @@ namespace tigl { class CTiglUIDManager; +class CCPACSHull; namespace generated { - class CPACSHull; - // This class is used in: // CPACSHull @@ -45,13 +44,13 @@ namespace generated class CPACSHullStructure : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSHullStructure(CPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSHullStructure(); - TIGL_EXPORT CPACSHull* GetParent(); + TIGL_EXPORT CCPACSHull* GetParent(); - TIGL_EXPORT const CPACSHull* GetParent() const; + TIGL_EXPORT const CCPACSHull* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -96,7 +95,7 @@ namespace generated TIGL_EXPORT virtual void RemoveSkinLayers(); protected: - CPACSHull* m_parent; + CCPACSHull* m_parent; CTiglUIDManager* m_uidMgr; @@ -118,5 +117,4 @@ namespace generated // Aliases in tigl namespace using CCPACSHullStructure = generated::CPACSHullStructure; -using CCPACSHull = generated::CPACSHull; } // namespace tigl diff --git a/src/generated/CPACSHulls.cpp b/src/generated/CPACSHulls.cpp index 3e7f7e6215..a5734e50f6 100644 --- a/src/generated/CPACSHulls.cpp +++ b/src/generated/CPACSHulls.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include +#include #include "CPACSGenericFuelTank.h" -#include "CPACSHull.h" #include "CPACSHulls.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -92,23 +92,23 @@ namespace generated } - const std::vector>& CPACSHulls::GetHulls() const + const std::vector>& CPACSHulls::GetHulls() const { return m_hulls; } - std::vector>& CPACSHulls::GetHulls() + std::vector>& CPACSHulls::GetHulls() { return m_hulls; } - CPACSHull& CPACSHulls::AddHull() + CCPACSHull& CPACSHulls::AddHull() { - m_hulls.push_back(make_unique(this, m_uidMgr)); + m_hulls.push_back(make_unique(this, m_uidMgr)); return *m_hulls.back(); } - void CPACSHulls::RemoveHull(CPACSHull& ref) + void CPACSHulls::RemoveHull(CCPACSHull& ref) { for (std::size_t i = 0; i < m_hulls.size(); i++) { if (m_hulls[i].get() == &ref) { diff --git a/src/generated/CPACSHulls.h b/src/generated/CPACSHulls.h index b02e0485b9..d026df0dbe 100644 --- a/src/generated/CPACSHulls.h +++ b/src/generated/CPACSHulls.h @@ -27,10 +27,10 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; +class CCPACSHull; namespace generated { - class CPACSHull; class CPACSGenericFuelTank; // This class is used in: @@ -59,18 +59,18 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const std::vector>& GetHulls() const; - TIGL_EXPORT virtual std::vector>& GetHulls(); + TIGL_EXPORT virtual const std::vector>& GetHulls() const; + TIGL_EXPORT virtual std::vector>& GetHulls(); - TIGL_EXPORT virtual CPACSHull& AddHull(); - TIGL_EXPORT virtual void RemoveHull(CPACSHull& ref); + TIGL_EXPORT virtual CCPACSHull& AddHull(); + TIGL_EXPORT virtual void RemoveHull(CCPACSHull& ref); protected: CPACSGenericFuelTank* m_parent; CTiglUIDManager* m_uidMgr; - std::vector> m_hulls; + std::vector> m_hulls; private: CPACSHulls(const CPACSHulls&) = delete; @@ -83,6 +83,5 @@ namespace generated // Aliases in tigl namespace using CCPACSHulls = generated::CPACSHulls; -using CCPACSHull = generated::CPACSHull; using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; } // namespace tigl diff --git a/src/generated/CPACSTransformation.cpp b/src/generated/CPACSTransformation.cpp index be1b38ac99..61775bc68d 100644 --- a/src/generated/CPACSTransformation.cpp +++ b/src/generated/CPACSTransformation.cpp @@ -25,6 +25,7 @@ #include "CCPACSFuselageSection.h" #include "CCPACSFuselageSectionElement.h" #include "CCPACSGenericSystem.h" +#include "CCPACSHull.h" #include "CCPACSNacelleSection.h" #include "CCPACSRotor.h" #include "CCPACSRotorHinge.h" @@ -32,7 +33,6 @@ #include "CCPACSWingSection.h" #include "CCPACSWingSectionElement.h" #include "CPACSGenericFuelTankParameters.h" -#include "CPACSHull.h" #include "CPACSLandingGearBase.h" #include "CPACSTransformation.h" #include "CTiglError.h" @@ -124,12 +124,12 @@ namespace generated m_parentType = &typeid(CCPACSGenericSystem); } - CPACSTransformation::CPACSTransformation(CPACSHull* parent, CTiglUIDManager* uidMgr) + CPACSTransformation::CPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSHull); + m_parentType = &typeid(CCPACSHull); } CPACSTransformation::CPACSTransformation(CPACSLandingGearBase* parent, CTiglUIDManager* uidMgr) @@ -226,8 +226,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } if (IsParent()) { return GetParent(); @@ -287,8 +287,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } if (IsParent()) { return GetParent(); diff --git a/src/generated/CPACSTransformation.h b/src/generated/CPACSTransformation.h index a1b893d84e..2263642203 100644 --- a/src/generated/CPACSTransformation.h +++ b/src/generated/CPACSTransformation.h @@ -41,6 +41,7 @@ class CCPACSFuselageSectionElement; class CCPACSFuselageSection; class CCPACSExternalObject; class CCPACSGenericSystem; +class CCPACSHull; class CCPACSNacelleSection; class CCPACSRotor; class CCPACSRotorHinge; @@ -51,7 +52,6 @@ class CCPACSWingSection; namespace generated { class CPACSGenericFuelTankParameters; - class CPACSHull; class CPACSLandingGearBase; // This class is used in: @@ -100,7 +100,7 @@ namespace generated TIGL_EXPORT CPACSTransformation(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSTransformation(CPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSRotor* parent, CTiglUIDManager* uidMgr); @@ -120,7 +120,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -130,7 +130,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -207,6 +207,5 @@ namespace generated // Aliases in tigl namespace using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; -using CCPACSHull = generated::CPACSHull; using CCPACSLandingGearBase = generated::CPACSLandingGearBase; } // namespace tigl diff --git a/tests/unittests/fuelTanks-tests.py b/tests/unittests/fuelTanks-tests.py new file mode 100644 index 0000000000..a8df3dd1b2 --- /dev/null +++ b/tests/unittests/fuelTanks-tests.py @@ -0,0 +1,22 @@ +import unittest + +from tigl3.tigl3wrapper import * +from tixi3.tixi3wrapper import * + +class TestFuelTanks(unittest.TestCase): + + def setUp(self): + self.tixi = Tixi3() + self.tigl = Tigl3() + self.tixi.open('TestData/simpletest.cpacs.xml') + self.tigl.open(self.tixi, '') + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_tiglGetVersion(self): + print('TIGL-Version: ' + self.tigl.version) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/tests/unittests/pythonwrapper-tests.py b/tests/unittests/pythonwrapper-tests.py index bb1865999c..f65dc5da6a 100644 --- a/tests/unittests/pythonwrapper-tests.py +++ b/tests/unittests/pythonwrapper-tests.py @@ -1,604 +1,604 @@ -#! /usr/bin/env python -# -*- coding: cp1252 -*- -############################################################################# -# Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -# -# Created: 2013-03-13 Martin Siggel -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -############################################################################# - -import unittest -import subprocess -from tiglwrapper import * -from tixiwrapper import * - -skipSlowFunctions = True # Saves you 14 minutes(if True), but leaves out 8 functions - -class TestSimpleCpacs(unittest.TestCase): - - def setUp(self): - self.tixi = Tixi() - self.tigl = Tigl() - self.tixi.open('TestData/simpletest.cpacs.xml') - self.tigl.open(self.tixi, '') - - def tearDown(self): - self.tigl.close() - self.tixi.close() - - def test_tiglGetVersion(self): - print('TIGL-Version: ' + self.tigl.version) - - def test_objectCount(self): - self.assertEqual(self.tigl.getWingCount(),1) - self.assertEqual(self.tigl.getFuselageCount(),1) - self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) - - ########## Exports are faster in this class - def test_exportIGES(self): - filenamePtr = "TestData/export/export0.igs" - self.tigl.exportIGES(filenamePtr) - - def test_exportFusedWingFuselageIGES(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export.igs" - self.tigl.exportFusedWingFuselageIGES(filenamePtr) - - def test_exportSTEP(self): - filenamePtr = 'TestData/export/export.step' - self.tigl.exportSTEP(filenamePtr) - - def test_exportMeshedWingSTL(self): - if not skipSlowFunctions: - wingIndex = 1 - filenamePtr = "TestData/export/export.stl" - deflection = 0.01 - self.tigl.exportMeshedWingSTL(wingIndex, filenamePtr, deflection) - - def test_exportMeshedGeometrySTL(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export3.stl" - deflection = 0.01 - self.tigl.exportMeshedGeometrySTL(filenamePtr, deflection) - - def test_exportMeshedWingVTKByUID(self): - wingUID = "Wing" - filenamePtr ="TestData/export/export.vtk" - deflection = 0.01 - self.tigl.exportMeshedWingVTKByUID(wingUID, filenamePtr, deflection) - - def test_exportMeshedGeometryVTK(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export4.vtk" - deflection = 0.01 - self.tigl.exportMeshedGeometryVTK(filenamePtr, deflection) - - def test_exportMeshedWingVTKSimpleByUID(self): - wingUID = "Wing" - filenamePtr = "TestData/export/export5.vtk" - deflection = 0.01 - self.tigl.exportMeshedWingVTKSimpleByUID(wingUID, filenamePtr, deflection) - - def test_exportMeshedGeometryVTKSimple(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export7.vtk" - deflection = 0.01 - self.tigl.exportMeshedGeometryVTKSimple(filenamePtr, deflection) - - def test_getMaterialUID(self): - compSegmentUID = "WING_CS1" - eta = 0.25 - xsi = 0.9 - nmaterials = self.tigl.wingComponentSegmentGetMaterialCount(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi ) - self.assertEqual(nmaterials, 1) - - material = self.tigl.wingComponentSegmentGetMaterialUID(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi, 1) - self.assertEqual(material, 'MyCellMat') -###### - -# Tests for tigl logging mechanism -class TestTiglLogging(unittest.TestCase): - def get_logs(self, loglevel): - process=subprocess.Popen(['python', 'test_logging.py', "%s" % loglevel], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err=process.communicate() - status=process.returncode - # separate output lines - out=out.decode("UTF-8").rstrip('\n').split('\n') - err=err.decode("UTF-8").rstrip('\n').split('\n') - return (status, out, err) - - def test_test_script(self): - for lev in range(0,4): - self.assertEqual(self.get_logs(lev)[0], 0) - - def test_info(self): - status, out, err = self.get_logs(3) - self.assertTrue(len(out), 1) - self.assertTrue(len(err), 4) - self.assertTrue(out[0].startswith('INF')) - self.assertTrue(out[0].strip().endswith('No far-field defined.')) - self.assertTrue(err[0].startswith('WRN')) - self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) - self.assertTrue(err[1].startswith('WRN')) - self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) - self.assertTrue(err[2].startswith('ERR')) - self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - - def test_warning(self): - status, out, err = self.get_logs(2) - self.assertTrue(len(out), 0) - self.assertTrue(len(err), 4) - self.assertTrue(err[0].startswith('WRN')) - self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) - self.assertTrue(err[1].startswith('WRN')) - self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) - self.assertTrue(err[2].startswith('ERR')) - self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - - def test_error(self): - status, out, err = self.get_logs(1) - self.assertTrue(len(out), 0) - self.assertTrue(len(err), 1) - self.assertTrue(err[0].startswith('ERR')) - self.assertTrue(err[0].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - - def test_silent(self): - status, out, err = self.get_logs(0) - self.assertTrue(len(out), 0) - self.assertTrue(len(err), 0) - - def test_file_logging(self): - status, out, err = self.get_logs(0) - f=open("test_logging.log", 'r') - lines=f.readlines() - f.close() - lout=[line.rstrip('\n') for line in lines] - self.assertTrue(len(lout), 6) - self.assertTrue(lout[0].startswith('TiGL log file created at')) - self.assertTrue(lout[1].startswith('WRN')) - self.assertTrue(lout[1].strip().endswith('CPACS dataset version is higher than TIGL library version!')) - self.assertTrue(lout[2].startswith('WRN')) - self.assertTrue(lout[2].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) - self.assertTrue(lout[3].startswith('INF')) - self.assertTrue(lout[3].strip().endswith('No far-field defined.')) - self.assertTrue(lout[4].startswith('ERR')) - self.assertTrue(lout[4].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - -# ----------------------------------------------------------------------- # -# The following tests should only check, if the python api is correct. -# Correctness of TIGL functions is not tested here (this is done in the c-tests) -class TestTiglApi(unittest.TestCase): - def setUp(self): - self.tigl = Tigl() - self.tixi = Tixi() - self.tigl.logSetVerbosity(TiglLogLevel.TILOG_SILENT) - self.tixi.open('TestData/CPACS_21_D150.xml') - self.tigl.open(self.tixi, 'D150_VAMP') - - def tearDown(self): - self.tigl.close() - self.tixi.close() - - def test_getWingCount(self): - self.assertEqual(self.tigl.getWingCount(),3) - - def test_getFuselageCount(self): - self.assertEqual(self.tigl.getFuselageCount(),1) - - def test_wingGetSegmentCount(self): - self.assertEqual(self.tigl.wingGetSegmentCount(1),3) - self.assertEqual(self.tigl.wingGetSegmentCount(2),1) - self.assertEqual(self.tigl.wingGetSegmentCount(3),1) - - # check illegal wing index error handling - error = TiglReturnCode.TIGL_SUCCESS - try: - self.tigl.wingGetSegmentCount(-1); - except TiglException as e: - error = e.code - self.assertEqual(error, TiglReturnCode.TIGL_INDEX_ERROR) - - def test_wingGetComponentSegmentCount(self): - self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) - self.assertEqual(self.tigl.wingGetComponentSegmentCount(2),1) - self.assertEqual(self.tigl.wingGetComponentSegmentCount(3),1) - - def test_wingGetComponentSegmentUID(self): - wingCompUID = self.tigl.wingGetComponentSegmentUID(1,1) - self.assertEqual(wingCompUID, 'D150_VAMP_W1_CompSeg1') - wingCompUID = self.tigl.wingGetComponentSegmentUID(2,1) - self.assertEqual(wingCompUID, 'D150_VAMP_HL1_CompSeg1') - wingCompUID = self.tigl.wingGetComponentSegmentUID(3,1) - self.assertEqual(wingCompUID, 'D150_VAMP_SL1_CompSeg1') - - def test_wingGetComponentSegmentIndex(self): - compSegIndex = self.tigl.wingGetComponentSegmentIndex(1,'D150_VAMP_W1_CompSeg1') - self.assertEqual(compSegIndex,1) - - def test_wingGetUpperPoint(self): - (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); - - def test_wingGetLowerPoint(self): - (x, y, z) = self.tigl.wingGetLowerPoint(1,1,0.5,0.5); - - def test_wingGetInnerConnectedSegmentCount(self): - segmentCount = self.tigl.wingGetInnerConnectedSegmentCount(1,1) - self.assertEqual(segmentCount,0) - - def test_wingGetOuterConnectedSegmentCount(self): - segmentCount = self.tigl.wingGetOuterConnectedSegmentCount(1,1) - self.assertEqual(segmentCount,1) - - def test_wingGetInnerConnectedSegmentIndex(self): - try: - segIndex = self.tigl.wingGetInnerConnectedSegmentIndex(1,1,0) - self.assertEqual(True, False) - except TiglException as e: - self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) - - def test_wingGetOuterConnectedSegmentIndex(self): - segIndex = self.tigl.wingGetOuterConnectedSegmentIndex(1,1,1) - self.assertEqual(segIndex,2) - - def test_wingGetInnerSectionAndElementIndex(self): - (secindex, elementindex) = self.tigl.wingGetInnerSectionAndElementIndex(1,1) - self.assertEqual(secindex, 1) - self.assertEqual(elementindex,1) - - def test_wingGetOuterSectionAndElementIndex(self): - (secindex, elementindex) = self.tigl.wingGetOuterSectionAndElementIndex(1,1) - self.assertEqual(secindex, 2) - self.assertEqual(elementindex,1) - - def test_wingGetInnerSectionAndElementUID(self): - (secUID, elementUID) = self.tigl.wingGetInnerSectionAndElementUID(1,1) - self.assertEqual(secUID, 'D150_VAMP_W1_Sec1') - self.assertEqual(elementUID, 'D150_VAMP_W1_Sec1_Elem1') - - def test_wingGetOuterSectionAndElementUID(self): - (secUID, elementUID) = self.tigl.wingGetOuterSectionAndElementUID(1,1) - self.assertEqual(secUID, 'D150_VAMP_W1_Sec2') - self.assertEqual(elementUID, 'D150_VAMP_W1_Sec2_Elem1') - - def test_wingGetProfileName(self): - profileName = self.tigl.wingGetProfileName(1,1,1) - self.assertEqual(profileName, 'NameD150_VAMP_W_SupCritProf1') - - def test_wingGetUID(self): - wingUID = self.tigl.wingGetUID(1) - self.assertEqual(wingUID, 'D150_VAMP_W1') - - def test_wingGetIndex(self): - wingIndex = self.tigl.wingGetIndex('D150_VAMP_W1') - self.assertEqual(wingIndex, 1) - - def test_wingGetSegmentUID(self): - segmentUID = self.tigl.wingGetSegmentUID(1,1) - self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') - - def test_wingGetSegmentIndex(self): - segmentIndex, wingIndex = self.tigl.wingGetSegmentIndex('D150_VAMP_W1_Seg1') - self.assertEqual(segmentIndex, 1) - self.assertEqual(wingIndex, 1) - - def test_wingGetSectionUID(self): - sectionUID = self.tigl.wingGetSectionUID(1,1) - self.assertEqual(sectionUID, 'D150_VAMP_W1_Sec1') - - def test_wingGetSymmetry(self): - symm = self.tigl.wingGetSymmetry(1) - self.assertEqual(symm, TiglSymmetryAxis.TIGL_X_Z_PLANE) - - def test_wingComponentSegmentFindSegment(self): - (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); - (segUID, wingUID) = self.tigl.wingComponentSegmentFindSegment('D150_VAMP_W1_CompSeg1',x,y,z) - self.assertEqual(segUID, 'D150_VAMP_W1_Seg1') - self.assertEqual(wingUID, 'D150_VAMP_W1') - - def test_wingComponentSegmentPointGetSegmentEtaXsi(self): - (wingUID, segmentUID, eta, xsi, errorDist) = self.tigl.wingComponentSegmentPointGetSegmentEtaXsi('D150_VAMP_W1_CompSeg1', 0.0, 0.0) - self.assertEqual(wingUID, 'D150_VAMP_W1') - self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') - self.assertAlmostEqual(eta, 0.0) - self.assertAlmostEqual(xsi, 0.0) - self.assertAlmostEqual(errorDist, 0.0) - - def test_wingSegmentPointGetComponentSegmentEtaXsi(self): - (eta, xsi) = self.tigl.wingSegmentPointGetComponentSegmentEtaXsi('D150_VAMP_W1_Seg1', 'D150_VAMP_W1_CompSeg1', 0.0, 0.0) - self.assertAlmostEqual(eta, 0.0) - self.assertAlmostEqual(xsi, 0.0) - - def test_getFuselageCount(self): - fc = self.tigl.getFuselageCount() - self.assertEqual(fc,1) - - def test_fuselageGetSegmentCount(self): - sc = self.tigl.fuselageGetSegmentCount(1) - self.assertEqual(sc,59) - - def test_fuselageGetPoint(self): - for iseg in range(0,59): - (x,y,z) = self.tigl.fuselageGetPoint(1,iseg+1,0.5,0.5) - #check for illegal index - try: - self.tigl.fuselageGetPoint(1,60,0.5,0.5) - self.assertEqual(False, True) - except TiglException as e: - self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) - - def test_fuselageGetPointAngle(self): - wingIDX = 1 - segIDX = 40 - (x,y,z) = self.tigl.fuselageGetPointAngle(wingIDX, segIDX, 0.5, 90.0) - - def test_fuselageGetPointAngleTranslated(self): - fuselIDX = 1 - segIDX = 40 - ytrans = 0.1; - ztrans = -0.1; - (x,y,z) = self.tigl.fuselageGetPointAngleTranslated(fuselIDX, segIDX, 0.5, 90.0, ytrans, ztrans) - - def test_fuselageGetPointOnXPlane(self): - fuselIDX = 1 - segIDX = 40 - zpos = 0.7 - (x,y,z) = self.tigl.fuselageGetPointOnXPlane(fuselIDX, segIDX, 0.5, zpos, 1) - self.assertAlmostEqual(zpos, z) - - def test_fuselageGetNumPointsOnXPlane(self): - fuselIDX = 1 - segIDX = 40 - zpos = 0.7 - num = self.tigl.fuselageGetNumPointsOnXPlane(fuselIDX, segIDX, 0.5, zpos) - self.assertGreater(num, 0) - - def test_fuselageGetPointOnYPlane(self): - fuselIDY = 1 - segIDY = 40 - zpos = 0.7 - (x,y,z) = self.tigl.fuselageGetPointOnYPlane(fuselIDY, segIDY, 0.5, zpos, 1) - self.assertAlmostEqual(zpos, z) - - def test_fuselageGetNumPointsOnYPlane(self): - fuselIDY = 1 - segIDY = 40 - zpos = 0.7 - num = self.tigl.fuselageGetNumPointsOnYPlane(fuselIDY, segIDY, 0.5, zpos) - self.assertGreater(num, 0) - -############################ ANFANG - def test_fuselageGetCircumference(self): - fuselageIndex = 1 - segmentIndex = 1 - eta = 0.5 - ret = self.tigl.fuselageGetCircumference(fuselageIndex, segmentIndex, eta) - self.assertEqual(isinstance(ret, float),True) - - def test_fuselageGetStartConnectedSegmentCount(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetStartConnectedSegmentCount(fuselageIndex, segmentIndex) - self.assertEqual(ret,0) - - def test_fuselageGetEndConnectedSegmentCount(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetEndConnectedSegmentCount(fuselageIndex, segmentIndex) - self.assertEqual(ret,1) - - def test_fuselageGetStartConnectedSegmentIndex(self): - fuselageIndex = 1 - segmentIndex = 2 - n = 1 - ret = self.tigl.fuselageGetStartConnectedSegmentIndex(fuselageIndex, segmentIndex, n) - self.assertEqual(ret,1) - - def test_fuselageGetEndConnectedSegmentIndex(self): - fuselageIndex = 1 - segmentIndex = 1 - n = 1 - ret = self.tigl.fuselageGetEndConnectedSegmentIndex(fuselageIndex, segmentIndex, n) - self.assertEqual(ret,2) - - def test_fuselageGetStartSectionAndElementUID(self): - fuselageIndex = 1 - segmentIndex = 1 - n = 1 - ret = self.tigl.fuselageGetStartSectionAndElementUID(fuselageIndex, segmentIndex) - self.assertEqual(ret,('D150_VAMP_FL1_Sec1', 'D150_VAMP_FL1_Sec1_Elem1')) - - def test_fuselageGetEndSectionAndElementUID(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetEndSectionAndElementUID(fuselageIndex, segmentIndex) - self.assertEqual(ret,('D150_VAMP_FL1_Sec2', 'D150_VAMP_FL1_Sec2_Elem1')) - - def test_fuselageGetStartSectionAndElementIndex(self): - fuselageIndex = 1 - segmentIndex = 2 - ret = self.tigl.fuselageGetStartSectionAndElementIndex(fuselageIndex, segmentIndex) - self.assertEqual(ret,(2,1)) - - def test_fuselageGetEndSectionAndElementIndex(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetEndSectionAndElementIndex(fuselageIndex, segmentIndex) - self.assertEqual(ret,(2,1)) - - def test_fuselageGetProfileName(self): - fuselageIndex = 1 - sectionIndex = 1 - elementIndex = 1 - ret = self.tigl.fuselageGetProfileName(fuselageIndex, sectionIndex, elementIndex) - self.assertEqual(ret,"Circle") - - def test_fuselageGetUID(self): - fuselageIndex = 1 - ret = self.tigl.fuselageGetUID(fuselageIndex) - self.assertEqual(ret,'D150_VAMP_FL1') - - def test_fuselageGetSegmentUID(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetSegmentUID(fuselageIndex, segmentIndex) - self.assertEqual(ret,'D150_VAMP_FL1_Seg1') - - def test_fuselageGetSectionUID(self): - fuselageIndex = 1 - sectionIndex = 1 - ret = self.tigl.fuselageGetSectionUID(fuselageIndex, sectionIndex) - self.assertEqual(isinstance(ret,str),True) - - def test_fuselageGetSymmetry(self): - fuselageIndex = 1 - ret = self.tigl.fuselageGetSymmetry(fuselageIndex) - self.assertEqual(ret,0) - -## Raises TiglException: TIGL_ERROR (1) (both give the same Error) -## def test_componentIntersectionPoint(self): -## print("IntersectionPoint") -## componentUidOne = self.tigl.fuselageGetUID(1) -## componentUidTwo = self.tigl.wingGetUID(1) -## lineID = 1 -## eta = 0.5 -## ret = self.tigl.componentIntersectionPoint(componentUidOne, componentUidTwo, lineID, eta) -## self.assertEqual((len(ret)==3),True) -## -## def test_componentIntersectionLineCount(self): -## print("IntersectionLine") -## componentUidOne = self.tigl.fuselageGetUID(1) -## componentUidTwo = self.tigl.wingGetUID(1) -## ret = self.tigl.componentIntersectionLineCount(componentUidOne, componentUidTwo) - - - def test_wingGetVolume(self): - wingIndex = 1 - ret = self.tigl.wingGetVolume(wingIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSegmentVolume(self): - wingIndex = 1 - segmentIndex = 1 - ret = self.tigl.wingGetSegmentVolume(wingIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_fuselageGetSegmentVolume(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetSegmentVolume(fuselageIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSurfaceArea(self): - wingIndex = 1 - ret = self.tigl.wingGetSurfaceArea(wingIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSegmentSurfaceArea(self): - wingIndex = 1 - segmentIndex = 1 - ret = self.tigl.wingGetSegmentSurfaceArea(wingIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_fuselageGetSegmentSurfaceArea(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetSegmentSurfaceArea(fuselageIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_componentGetHashCode(self): - componentUID = self.tigl.wingGetUID(1) - ret = self.tigl.componentGetHashCode(componentUID) - self.assertEqual(isinstance(ret,int),True) - - def test_configurationGetLength(self): - ret = self.tigl.configurationGetLength() - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSpan(self): - wingUID = self.tigl.wingGetUID(1) - ret = self.tigl.wingGetSpan(wingUID) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSurfaceArea(self): - area = self.tigl.wingGetSurfaceArea(1); - self.assertGreater(area, 125.) - self.assertLess(area, 135.) - - def test_wingGetReferenceArea(self): - area = self.tigl.wingGetReferenceArea(1, TiglSymmetryAxis.TIGL_X_Y_PLANE); - self.assertGreater(area, 60.) - self.assertLess(area, 70.) - - def test_exportMeshedWingVTKByIndex(self): - self.tigl.exportMeshedWingVTKByIndex(1, 'TestData/export/D150modelID_wing1_python.vtp', 0.01) - -###### SLOW Function, basically fuselage based due to complex fuselage geometry - def test_MergedTests(self): - if skipSlowFunctions: - return - print( "Slow Functions (14min)") - - #exportMeshedFuselageSTL - fuselageIndex = 1 - filenamePtr = "TestData/export/export2.stl" - deflection = 0.01 - self.tigl.exportMeshedFuselageSTL(fuselageIndex, filenamePtr, deflection) - - # Fuselage VTK by Index - fuselageIndex = 1 - filenamePtr = "TestData/export/export2.vtk" - deflection = 0.01 - self.tigl.exportMeshedFuselageVTKByIndex(fuselageIndex, filenamePtr, deflection) - - # Fuselage VTk by UID - fuselageUID = "D150_VAMP_FL1" - filenamePtr = "TestData/export/export3.vtk" - deflection = 0.01 - self.tigl.exportMeshedFuselageVTKByUID(fuselageUID, filenamePtr, deflection) - - # Fuselage Simple-VTK by UID - fuselageUID = "D150_VAMP_FL1" - filenamePtr ="TestData/export/export6.vtk" - deflection = 0.01 - self.tigl.exportMeshedFuselageVTKSimpleByUID(fuselageUID, filenamePtr, deflection) - - # Distance to ground - fuselageUID = self.tigl.fuselageGetUID(1) - axisPntX = 0 - axisPntY = 0 - axisPntZ = 10 - axisDirX = 0 - axisDirY = 0 - axisDirZ = 1 - angle = 0 - ret = self.tigl.fuselageGetMinumumDistanceToGround(fuselageUID, axisPntX, axisPntY, axisPntZ, axisDirX, axisDirY, axisDirZ, angle) - - # Volume - ret = self.tigl.fuselageGetVolume(fuselageIndex) - self.assertEqual(isinstance(ret,float),True) - - # Wetted Area - print("50%") - wingUID = self.tigl.wingGetUID(1) - ret = self.tigl.wingGetWettedArea(wingUID) - self.assertEqual(isinstance(ret,float),True) - - # Fuselage Surface Area - fuselageIndex = 1 - ret = self.tigl.fuselageGetSurfaceArea(fuselageIndex) - self.assertEqual(isinstance(ret,float),True) - print("100%") -# ----------------------------------------------------------------------- # -if __name__ == '__main__': - unittest.main() +#! /usr/bin/env python +# -*- coding: cp1252 -*- +############################################################################# +# Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +# +# Created: 2013-03-13 Martin Siggel +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################# + +import unittest +import subprocess +from tiglwrapper import * +from tixiwrapper import * + +skipSlowFunctions = True # Saves you 14 minutes(if True), but leaves out 8 functions + +class TestSimpleCpacs(unittest.TestCase): + + def setUp(self): + self.tixi = Tixi() + self.tigl = Tigl() + self.tixi.open('TestData/simpletest.cpacs.xml') + self.tigl.open(self.tixi, '') + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_tiglGetVersion(self): + print('TIGL-Version: ' + self.tigl.version) + + def test_objectCount(self): + self.assertEqual(self.tigl.getWingCount(),1) + self.assertEqual(self.tigl.getFuselageCount(),1) + self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) + + ########## Exports are faster in this class + def test_exportIGES(self): + filenamePtr = "TestData/export/export0.igs" + self.tigl.exportIGES(filenamePtr) + + def test_exportFusedWingFuselageIGES(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export.igs" + self.tigl.exportFusedWingFuselageIGES(filenamePtr) + + def test_exportSTEP(self): + filenamePtr = 'TestData/export/export.step' + self.tigl.exportSTEP(filenamePtr) + + def test_exportMeshedWingSTL(self): + if not skipSlowFunctions: + wingIndex = 1 + filenamePtr = "TestData/export/export.stl" + deflection = 0.01 + self.tigl.exportMeshedWingSTL(wingIndex, filenamePtr, deflection) + + def test_exportMeshedGeometrySTL(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export3.stl" + deflection = 0.01 + self.tigl.exportMeshedGeometrySTL(filenamePtr, deflection) + + def test_exportMeshedWingVTKByUID(self): + wingUID = "Wing" + filenamePtr ="TestData/export/export.vtk" + deflection = 0.01 + self.tigl.exportMeshedWingVTKByUID(wingUID, filenamePtr, deflection) + + def test_exportMeshedGeometryVTK(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export4.vtk" + deflection = 0.01 + self.tigl.exportMeshedGeometryVTK(filenamePtr, deflection) + + def test_exportMeshedWingVTKSimpleByUID(self): + wingUID = "Wing" + filenamePtr = "TestData/export/export5.vtk" + deflection = 0.01 + self.tigl.exportMeshedWingVTKSimpleByUID(wingUID, filenamePtr, deflection) + + def test_exportMeshedGeometryVTKSimple(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export7.vtk" + deflection = 0.01 + self.tigl.exportMeshedGeometryVTKSimple(filenamePtr, deflection) + + def test_getMaterialUID(self): + compSegmentUID = "WING_CS1" + eta = 0.25 + xsi = 0.9 + nmaterials = self.tigl.wingComponentSegmentGetMaterialCount(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi ) + self.assertEqual(nmaterials, 1) + + material = self.tigl.wingComponentSegmentGetMaterialUID(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi, 1) + self.assertEqual(material, 'MyCellMat') +###### + +# Tests for tigl logging mechanism +class TestTiglLogging(unittest.TestCase): + def get_logs(self, loglevel): + process=subprocess.Popen(['python', 'test_logging.py', "%s" % loglevel], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err=process.communicate() + status=process.returncode + # separate output lines + out=out.decode("UTF-8").rstrip('\n').split('\n') + err=err.decode("UTF-8").rstrip('\n').split('\n') + return (status, out, err) + + def test_test_script(self): + for lev in range(0,4): + self.assertEqual(self.get_logs(lev)[0], 0) + + def test_info(self): + status, out, err = self.get_logs(3) + self.assertTrue(len(out), 1) + self.assertTrue(len(err), 4) + self.assertTrue(out[0].startswith('INF')) + self.assertTrue(out[0].strip().endswith('No far-field defined.')) + self.assertTrue(err[0].startswith('WRN')) + self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) + self.assertTrue(err[1].startswith('WRN')) + self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) + self.assertTrue(err[2].startswith('ERR')) + self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + + def test_warning(self): + status, out, err = self.get_logs(2) + self.assertTrue(len(out), 0) + self.assertTrue(len(err), 4) + self.assertTrue(err[0].startswith('WRN')) + self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) + self.assertTrue(err[1].startswith('WRN')) + self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) + self.assertTrue(err[2].startswith('ERR')) + self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + + def test_error(self): + status, out, err = self.get_logs(1) + self.assertTrue(len(out), 0) + self.assertTrue(len(err), 1) + self.assertTrue(err[0].startswith('ERR')) + self.assertTrue(err[0].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + + def test_silent(self): + status, out, err = self.get_logs(0) + self.assertTrue(len(out), 0) + self.assertTrue(len(err), 0) + + def test_file_logging(self): + status, out, err = self.get_logs(0) + f=open("test_logging.log", 'r') + lines=f.readlines() + f.close() + lout=[line.rstrip('\n') for line in lines] + self.assertTrue(len(lout), 6) + self.assertTrue(lout[0].startswith('TiGL log file created at')) + self.assertTrue(lout[1].startswith('WRN')) + self.assertTrue(lout[1].strip().endswith('CPACS dataset version is higher than TIGL library version!')) + self.assertTrue(lout[2].startswith('WRN')) + self.assertTrue(lout[2].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) + self.assertTrue(lout[3].startswith('INF')) + self.assertTrue(lout[3].strip().endswith('No far-field defined.')) + self.assertTrue(lout[4].startswith('ERR')) + self.assertTrue(lout[4].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + +# ----------------------------------------------------------------------- # +# The following tests should only check, if the python api is correct. +# Correctness of TIGL functions is not tested here (this is done in the c-tests) +class TestTiglApi(unittest.TestCase): + def setUp(self): + self.tigl = Tigl() + self.tixi = Tixi() + self.tigl.logSetVerbosity(TiglLogLevel.TILOG_SILENT) + self.tixi.open('TestData/CPACS_21_D150.xml') + self.tigl.open(self.tixi, 'D150_VAMP') + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_getWingCount(self): + self.assertEqual(self.tigl.getWingCount(),3) + + def test_getFuselageCount(self): + self.assertEqual(self.tigl.getFuselageCount(),1) + + def test_wingGetSegmentCount(self): + self.assertEqual(self.tigl.wingGetSegmentCount(1),3) + self.assertEqual(self.tigl.wingGetSegmentCount(2),1) + self.assertEqual(self.tigl.wingGetSegmentCount(3),1) + + # check illegal wing index error handling + error = TiglReturnCode.TIGL_SUCCESS + try: + self.tigl.wingGetSegmentCount(-1); + except TiglException as e: + error = e.code + self.assertEqual(error, TiglReturnCode.TIGL_INDEX_ERROR) + + def test_wingGetComponentSegmentCount(self): + self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) + self.assertEqual(self.tigl.wingGetComponentSegmentCount(2),1) + self.assertEqual(self.tigl.wingGetComponentSegmentCount(3),1) + + def test_wingGetComponentSegmentUID(self): + wingCompUID = self.tigl.wingGetComponentSegmentUID(1,1) + self.assertEqual(wingCompUID, 'D150_VAMP_W1_CompSeg1') + wingCompUID = self.tigl.wingGetComponentSegmentUID(2,1) + self.assertEqual(wingCompUID, 'D150_VAMP_HL1_CompSeg1') + wingCompUID = self.tigl.wingGetComponentSegmentUID(3,1) + self.assertEqual(wingCompUID, 'D150_VAMP_SL1_CompSeg1') + + def test_wingGetComponentSegmentIndex(self): + compSegIndex = self.tigl.wingGetComponentSegmentIndex(1,'D150_VAMP_W1_CompSeg1') + self.assertEqual(compSegIndex,1) + + def test_wingGetUpperPoint(self): + (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); + + def test_wingGetLowerPoint(self): + (x, y, z) = self.tigl.wingGetLowerPoint(1,1,0.5,0.5); + + def test_wingGetInnerConnectedSegmentCount(self): + segmentCount = self.tigl.wingGetInnerConnectedSegmentCount(1,1) + self.assertEqual(segmentCount,0) + + def test_wingGetOuterConnectedSegmentCount(self): + segmentCount = self.tigl.wingGetOuterConnectedSegmentCount(1,1) + self.assertEqual(segmentCount,1) + + def test_wingGetInnerConnectedSegmentIndex(self): + try: + segIndex = self.tigl.wingGetInnerConnectedSegmentIndex(1,1,0) + self.assertEqual(True, False) + except TiglException as e: + self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) + + def test_wingGetOuterConnectedSegmentIndex(self): + segIndex = self.tigl.wingGetOuterConnectedSegmentIndex(1,1,1) + self.assertEqual(segIndex,2) + + def test_wingGetInnerSectionAndElementIndex(self): + (secindex, elementindex) = self.tigl.wingGetInnerSectionAndElementIndex(1,1) + self.assertEqual(secindex, 1) + self.assertEqual(elementindex,1) + + def test_wingGetOuterSectionAndElementIndex(self): + (secindex, elementindex) = self.tigl.wingGetOuterSectionAndElementIndex(1,1) + self.assertEqual(secindex, 2) + self.assertEqual(elementindex,1) + + def test_wingGetInnerSectionAndElementUID(self): + (secUID, elementUID) = self.tigl.wingGetInnerSectionAndElementUID(1,1) + self.assertEqual(secUID, 'D150_VAMP_W1_Sec1') + self.assertEqual(elementUID, 'D150_VAMP_W1_Sec1_Elem1') + + def test_wingGetOuterSectionAndElementUID(self): + (secUID, elementUID) = self.tigl.wingGetOuterSectionAndElementUID(1,1) + self.assertEqual(secUID, 'D150_VAMP_W1_Sec2') + self.assertEqual(elementUID, 'D150_VAMP_W1_Sec2_Elem1') + + def test_wingGetProfileName(self): + profileName = self.tigl.wingGetProfileName(1,1,1) + self.assertEqual(profileName, 'NameD150_VAMP_W_SupCritProf1') + + def test_wingGetUID(self): + wingUID = self.tigl.wingGetUID(1) + self.assertEqual(wingUID, 'D150_VAMP_W1') + + def test_wingGetIndex(self): + wingIndex = self.tigl.wingGetIndex('D150_VAMP_W1') + self.assertEqual(wingIndex, 1) + + def test_wingGetSegmentUID(self): + segmentUID = self.tigl.wingGetSegmentUID(1,1) + self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') + + def test_wingGetSegmentIndex(self): + segmentIndex, wingIndex = self.tigl.wingGetSegmentIndex('D150_VAMP_W1_Seg1') + self.assertEqual(segmentIndex, 1) + self.assertEqual(wingIndex, 1) + + def test_wingGetSectionUID(self): + sectionUID = self.tigl.wingGetSectionUID(1,1) + self.assertEqual(sectionUID, 'D150_VAMP_W1_Sec1') + + def test_wingGetSymmetry(self): + symm = self.tigl.wingGetSymmetry(1) + self.assertEqual(symm, TiglSymmetryAxis.TIGL_X_Z_PLANE) + + def test_wingComponentSegmentFindSegment(self): + (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); + (segUID, wingUID) = self.tigl.wingComponentSegmentFindSegment('D150_VAMP_W1_CompSeg1',x,y,z) + self.assertEqual(segUID, 'D150_VAMP_W1_Seg1') + self.assertEqual(wingUID, 'D150_VAMP_W1') + + def test_wingComponentSegmentPointGetSegmentEtaXsi(self): + (wingUID, segmentUID, eta, xsi, errorDist) = self.tigl.wingComponentSegmentPointGetSegmentEtaXsi('D150_VAMP_W1_CompSeg1', 0.0, 0.0) + self.assertEqual(wingUID, 'D150_VAMP_W1') + self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') + self.assertAlmostEqual(eta, 0.0) + self.assertAlmostEqual(xsi, 0.0) + self.assertAlmostEqual(errorDist, 0.0) + + def test_wingSegmentPointGetComponentSegmentEtaXsi(self): + (eta, xsi) = self.tigl.wingSegmentPointGetComponentSegmentEtaXsi('D150_VAMP_W1_Seg1', 'D150_VAMP_W1_CompSeg1', 0.0, 0.0) + self.assertAlmostEqual(eta, 0.0) + self.assertAlmostEqual(xsi, 0.0) + + def test_getFuselageCount(self): + fc = self.tigl.getFuselageCount() + self.assertEqual(fc,1) + + def test_fuselageGetSegmentCount(self): + sc = self.tigl.fuselageGetSegmentCount(1) + self.assertEqual(sc,59) + + def test_fuselageGetPoint(self): + for iseg in range(0,59): + (x,y,z) = self.tigl.fuselageGetPoint(1,iseg+1,0.5,0.5) + #check for illegal index + try: + self.tigl.fuselageGetPoint(1,60,0.5,0.5) + self.assertEqual(False, True) + except TiglException as e: + self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) + + def test_fuselageGetPointAngle(self): + wingIDX = 1 + segIDX = 40 + (x,y,z) = self.tigl.fuselageGetPointAngle(wingIDX, segIDX, 0.5, 90.0) + + def test_fuselageGetPointAngleTranslated(self): + fuselIDX = 1 + segIDX = 40 + ytrans = 0.1; + ztrans = -0.1; + (x,y,z) = self.tigl.fuselageGetPointAngleTranslated(fuselIDX, segIDX, 0.5, 90.0, ytrans, ztrans) + + def test_fuselageGetPointOnXPlane(self): + fuselIDX = 1 + segIDX = 40 + zpos = 0.7 + (x,y,z) = self.tigl.fuselageGetPointOnXPlane(fuselIDX, segIDX, 0.5, zpos, 1) + self.assertAlmostEqual(zpos, z) + + def test_fuselageGetNumPointsOnXPlane(self): + fuselIDX = 1 + segIDX = 40 + zpos = 0.7 + num = self.tigl.fuselageGetNumPointsOnXPlane(fuselIDX, segIDX, 0.5, zpos) + self.assertGreater(num, 0) + + def test_fuselageGetPointOnYPlane(self): + fuselIDY = 1 + segIDY = 40 + zpos = 0.7 + (x,y,z) = self.tigl.fuselageGetPointOnYPlane(fuselIDY, segIDY, 0.5, zpos, 1) + self.assertAlmostEqual(zpos, z) + + def test_fuselageGetNumPointsOnYPlane(self): + fuselIDY = 1 + segIDY = 40 + zpos = 0.7 + num = self.tigl.fuselageGetNumPointsOnYPlane(fuselIDY, segIDY, 0.5, zpos) + self.assertGreater(num, 0) + +############################ ANFANG + def test_fuselageGetCircumference(self): + fuselageIndex = 1 + segmentIndex = 1 + eta = 0.5 + ret = self.tigl.fuselageGetCircumference(fuselageIndex, segmentIndex, eta) + self.assertEqual(isinstance(ret, float),True) + + def test_fuselageGetStartConnectedSegmentCount(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetStartConnectedSegmentCount(fuselageIndex, segmentIndex) + self.assertEqual(ret,0) + + def test_fuselageGetEndConnectedSegmentCount(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetEndConnectedSegmentCount(fuselageIndex, segmentIndex) + self.assertEqual(ret,1) + + def test_fuselageGetStartConnectedSegmentIndex(self): + fuselageIndex = 1 + segmentIndex = 2 + n = 1 + ret = self.tigl.fuselageGetStartConnectedSegmentIndex(fuselageIndex, segmentIndex, n) + self.assertEqual(ret,1) + + def test_fuselageGetEndConnectedSegmentIndex(self): + fuselageIndex = 1 + segmentIndex = 1 + n = 1 + ret = self.tigl.fuselageGetEndConnectedSegmentIndex(fuselageIndex, segmentIndex, n) + self.assertEqual(ret,2) + + def test_fuselageGetStartSectionAndElementUID(self): + fuselageIndex = 1 + segmentIndex = 1 + n = 1 + ret = self.tigl.fuselageGetStartSectionAndElementUID(fuselageIndex, segmentIndex) + self.assertEqual(ret,('D150_VAMP_FL1_Sec1', 'D150_VAMP_FL1_Sec1_Elem1')) + + def test_fuselageGetEndSectionAndElementUID(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetEndSectionAndElementUID(fuselageIndex, segmentIndex) + self.assertEqual(ret,('D150_VAMP_FL1_Sec2', 'D150_VAMP_FL1_Sec2_Elem1')) + + def test_fuselageGetStartSectionAndElementIndex(self): + fuselageIndex = 1 + segmentIndex = 2 + ret = self.tigl.fuselageGetStartSectionAndElementIndex(fuselageIndex, segmentIndex) + self.assertEqual(ret,(2,1)) + + def test_fuselageGetEndSectionAndElementIndex(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetEndSectionAndElementIndex(fuselageIndex, segmentIndex) + self.assertEqual(ret,(2,1)) + + def test_fuselageGetProfileName(self): + fuselageIndex = 1 + sectionIndex = 1 + elementIndex = 1 + ret = self.tigl.fuselageGetProfileName(fuselageIndex, sectionIndex, elementIndex) + self.assertEqual(ret,"Circle") + + def test_fuselageGetUID(self): + fuselageIndex = 1 + ret = self.tigl.fuselageGetUID(fuselageIndex) + self.assertEqual(ret,'D150_VAMP_FL1') + + def test_fuselageGetSegmentUID(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetSegmentUID(fuselageIndex, segmentIndex) + self.assertEqual(ret,'D150_VAMP_FL1_Seg1') + + def test_fuselageGetSectionUID(self): + fuselageIndex = 1 + sectionIndex = 1 + ret = self.tigl.fuselageGetSectionUID(fuselageIndex, sectionIndex) + self.assertEqual(isinstance(ret,str),True) + + def test_fuselageGetSymmetry(self): + fuselageIndex = 1 + ret = self.tigl.fuselageGetSymmetry(fuselageIndex) + self.assertEqual(ret,0) + +## Raises TiglException: TIGL_ERROR (1) (both give the same Error) +## def test_componentIntersectionPoint(self): +## print("IntersectionPoint") +## componentUidOne = self.tigl.fuselageGetUID(1) +## componentUidTwo = self.tigl.wingGetUID(1) +## lineID = 1 +## eta = 0.5 +## ret = self.tigl.componentIntersectionPoint(componentUidOne, componentUidTwo, lineID, eta) +## self.assertEqual((len(ret)==3),True) +## +## def test_componentIntersectionLineCount(self): +## print("IntersectionLine") +## componentUidOne = self.tigl.fuselageGetUID(1) +## componentUidTwo = self.tigl.wingGetUID(1) +## ret = self.tigl.componentIntersectionLineCount(componentUidOne, componentUidTwo) + + + def test_wingGetVolume(self): + wingIndex = 1 + ret = self.tigl.wingGetVolume(wingIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSegmentVolume(self): + wingIndex = 1 + segmentIndex = 1 + ret = self.tigl.wingGetSegmentVolume(wingIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_fuselageGetSegmentVolume(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetSegmentVolume(fuselageIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSurfaceArea(self): + wingIndex = 1 + ret = self.tigl.wingGetSurfaceArea(wingIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSegmentSurfaceArea(self): + wingIndex = 1 + segmentIndex = 1 + ret = self.tigl.wingGetSegmentSurfaceArea(wingIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_fuselageGetSegmentSurfaceArea(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetSegmentSurfaceArea(fuselageIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_componentGetHashCode(self): + componentUID = self.tigl.wingGetUID(1) + ret = self.tigl.componentGetHashCode(componentUID) + self.assertEqual(isinstance(ret,int),True) + + def test_configurationGetLength(self): + ret = self.tigl.configurationGetLength() + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSpan(self): + wingUID = self.tigl.wingGetUID(1) + ret = self.tigl.wingGetSpan(wingUID) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSurfaceArea(self): + area = self.tigl.wingGetSurfaceArea(1); + self.assertGreater(area, 125.) + self.assertLess(area, 135.) + + def test_wingGetReferenceArea(self): + area = self.tigl.wingGetReferenceArea(1, TiglSymmetryAxis.TIGL_X_Y_PLANE); + self.assertGreater(area, 60.) + self.assertLess(area, 70.) + + def test_exportMeshedWingVTKByIndex(self): + self.tigl.exportMeshedWingVTKByIndex(1, 'TestData/export/D150modelID_wing1_python.vtp', 0.01) + +###### SLOW Function, basically fuselage based due to complex fuselage geometry + def test_MergedTests(self): + if skipSlowFunctions: + return + print( "Slow Functions (14min)") + + #exportMeshedFuselageSTL + fuselageIndex = 1 + filenamePtr = "TestData/export/export2.stl" + deflection = 0.01 + self.tigl.exportMeshedFuselageSTL(fuselageIndex, filenamePtr, deflection) + + # Fuselage VTK by Index + fuselageIndex = 1 + filenamePtr = "TestData/export/export2.vtk" + deflection = 0.01 + self.tigl.exportMeshedFuselageVTKByIndex(fuselageIndex, filenamePtr, deflection) + + # Fuselage VTk by UID + fuselageUID = "D150_VAMP_FL1" + filenamePtr = "TestData/export/export3.vtk" + deflection = 0.01 + self.tigl.exportMeshedFuselageVTKByUID(fuselageUID, filenamePtr, deflection) + + # Fuselage Simple-VTK by UID + fuselageUID = "D150_VAMP_FL1" + filenamePtr ="TestData/export/export6.vtk" + deflection = 0.01 + self.tigl.exportMeshedFuselageVTKSimpleByUID(fuselageUID, filenamePtr, deflection) + + # Distance to ground + fuselageUID = self.tigl.fuselageGetUID(1) + axisPntX = 0 + axisPntY = 0 + axisPntZ = 10 + axisDirX = 0 + axisDirY = 0 + axisDirZ = 1 + angle = 0 + ret = self.tigl.fuselageGetMinumumDistanceToGround(fuselageUID, axisPntX, axisPntY, axisPntZ, axisDirX, axisDirY, axisDirZ, angle) + + # Volume + ret = self.tigl.fuselageGetVolume(fuselageIndex) + self.assertEqual(isinstance(ret,float),True) + + # Wetted Area + print("50%") + wingUID = self.tigl.wingGetUID(1) + ret = self.tigl.wingGetWettedArea(wingUID) + self.assertEqual(isinstance(ret,float),True) + + # Fuselage Surface Area + fuselageIndex = 1 + ret = self.tigl.fuselageGetSurfaceArea(fuselageIndex) + self.assertEqual(isinstance(ret,float),True) + print("100%") +# ----------------------------------------------------------------------- # +if __name__ == '__main__': + unittest.main() diff --git a/tests/unittests/runtests.sh.in b/tests/unittests/runtests.sh.in index bc45c7f072..3c38f302db 100644 --- a/tests/unittests/runtests.sh.in +++ b/tests/unittests/runtests.sh.in @@ -1,14 +1,14 @@ -#!/bin/bash - -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ -export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ - -echo "Running unit tests..." -./TIGL-unittests - -# now run the python tests -echo $DYLD_LIBRARY_PATH -echo "Running python API tests..." -export PYTHONPATH=$PYTHONPATH:@LIBRARY_OUTPUT_PATH@:@TIXI_INCLUDE_DIRS@../share/tixi/python - -python pythonwrapper-tests.py +#!/bin/bash + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ +export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ + +echo "Running unit tests..." +./TIGL-unittests + +# now run the python tests +echo $DYLD_LIBRARY_PATH +echo "Running python API tests..." +export PYTHONPATH=$PYTHONPATH:@LIBRARY_OUTPUT_PATH@:@TIXI_INCLUDE_DIRS@../share/tixi/python + +python pythonwrapper-tests.py diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py new file mode 100644 index 0000000000..04498d3ebf --- /dev/null +++ b/tests/unittests/test_fuelTanks.py @@ -0,0 +1,34 @@ +import unittest + +from tigl3.tigl3wrapper import * +from tixi3.tixi3wrapper import * +from tigl3 import configuration + +class FuselageTank(unittest.TestCase): + + def setUp(self): + self.tixi = Tixi3() + self.tigl = Tigl3() + self.assertIsNone(self.tixi.open('TestData/simpletest.cpacs.xml')) + self.assertIsNone(self.tigl.open(self.tixi, '')) + + mgr = configuration.CCPACSConfigurationManager_get_instance() + uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() + fuselage = uid_mgr.get_geometric_component('SimpleFuselage') + fuelTanks = fuselage.get_fuel_tanks() + # help(fuselage) + print(fuelTanks) + + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_tiglGetVersion(self): + print('TIGL-Version: ' + self.tigl.version) + + def test_true(self): + self.assertTrue(True) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index e78206a1b0..86d5e5a9f7 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -67,6 +67,12 @@ TixiDocumentHandle FuselageTank::tixiHandle = 0; TiglCPACSConfigurationHandle FuselageTank::tiglHandle = 0; TEST_F(FuselageTank, getName) +{ + const std::string name = fuelTank->GetName(); + EXPECT_EQ(name, "Simple tank"); +} + +TEST_F(FuselageTank, getViaTree) { const std::string name = fuelTank->GetName(); EXPECT_EQ(name, "Simple tank"); From 87392bdd431c37e3c90843d0290657b8f0787e66 Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 17 Mar 2024 12:57:46 +0100 Subject: [PATCH 007/122] fix further stuff; ToDo: search of IsParent and add tanks; add configuration --- src/fuelTanks/CCPACSHull.cpp | 3 ++- src/fuelTanks/CCPACSHull.h | 9 +++---- src/fuselage/CCPACSFuselageSegments.cpp | 4 +++ tests/unittests/tiglTanks.cpp | 35 ++++++++++++++++++++++--- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 3c52df99ac..ea555a9da7 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -35,7 +35,8 @@ CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) // CCPACSConfiguration& CCPACSHull::GetConfiguration() const // { -// return GetParent()->GetParent()->GetConfiguration(); +// // return GetParent()->GetParent()->GetConfiguration(); +// return GetParent()->GetParent() // } std::string CCPACSHull::GetDefaultedUID() const diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index edb5828389..64c1da3d79 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -24,7 +24,6 @@ #include "generated/CPACSHull.h" #include "CTiglRelativelyPositionedComponent.h" // #include "CCPACSConfiguration.h" -// #include "CCPACSDucts.h" #include "generated/CPACSHulls.h" namespace tigl @@ -38,16 +37,16 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned // TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; - TIGL_EXPORT std::string GetDefaultedUID() const; // override; - TIGL_EXPORT TiglGeometricComponentType GetComponentType() const; // override; - TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const; // override; + TIGL_EXPORT std::string GetDefaultedUID() const override; + TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; + TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; // //Any DuctAssembly that references this duct element, can register its Invalidation // //as a callback. // TIGL_EXPORT void RegisterInvalidationCallback(std::function const&); protected: - PNamedShape BuildLoft() const; // override; + PNamedShape BuildLoft() const override; private: diff --git a/src/fuselage/CCPACSFuselageSegments.cpp b/src/fuselage/CCPACSFuselageSegments.cpp index 0fec5828a3..af3cf9596d 100644 --- a/src/fuselage/CCPACSFuselageSegments.cpp +++ b/src/fuselage/CCPACSFuselageSegments.cpp @@ -28,6 +28,7 @@ #include "CCPACSFuselageSegment.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" +#include "CCPACSHull.h" #include "CTiglError.h" #include "sorting.h" #include "CTiglLogging.h" @@ -129,6 +130,9 @@ CTiglRelativelyPositionedComponent const* CCPACSFuselageSegments::GetParentCompo else if (IsParent()) { return GetParent(); } + else if (IsParent()) { + return GetParent(); + } else { throw CTiglError("Unknown parent type for CCPACSFuselageSegments."); } diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 86d5e5a9f7..0ef7c54cc4 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -27,6 +27,25 @@ #include "CCPACSConfigurationManager.h" #include "CTiglUIDManager.h" +#include "CCPACSHull.h" + +// #include "generated/CPACSHulls.h" +// #include "generated/CPACSHull.h" + +// #include "CNamedShape.h" +// #include "tiglcommonfunctions.h" + +// #include +// #include +// #include + +// #include + +// #include +// #include + +// #include + class FuselageTank : public ::testing::Test { protected: @@ -60,7 +79,12 @@ class FuselageTank : public ::testing::Test static TiglCPACSConfigurationHandle tiglHandle; tigl::CTiglUIDManager &uidMgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); + + // generic tank tigl::CCPACSGenericFuelTank const *fuelTank = &uidMgr.ResolveObject("genericTank1"); + + // hulls + const std::vector> &hulls = fuelTank->GetHulls_choice1()->GetHulls(); }; TixiDocumentHandle FuselageTank::tixiHandle = 0; @@ -72,8 +96,13 @@ TEST_F(FuselageTank, getName) EXPECT_EQ(name, "Simple tank"); } -TEST_F(FuselageTank, getViaTree) +TEST_F(FuselageTank, countHulls) { - const std::string name = fuelTank->GetName(); - EXPECT_EQ(name, "Simple tank"); + EXPECT_EQ(hulls.size(), 1); +} + +TEST_F(FuselageTank, testLoft) +{ + const std::unique_ptr &hull = hulls.at(0); + const PNamedShape &loft = hull->GetLoft(); } \ No newline at end of file From 245085d5e3e1a43014fe2d6e2c2998410ae7282d Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 17 Mar 2024 13:11:02 +0100 Subject: [PATCH 008/122] add GetConfiguration() --- src/fuelTanks/CCPACSHull.cpp | 13 ++++++++----- src/fuelTanks/CCPACSHull.h | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index ea555a9da7..60cec5a12f 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -25,6 +25,10 @@ #include "CNamedShape.h" #include "CTiglTopoAlgorithms.h" #include "tiglcommonfunctions.h" +#include "generated/CPACSGenericFuelTank.h" +#include "generated/CPACSGenericFuelTanks.h" +#include "generated/CPACSFuselageFuelTanks.h" + namespace tigl { @@ -33,11 +37,10 @@ CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) , CTiglRelativelyPositionedComponent(static_cast(nullptr), &m_transformation) {} -// CCPACSConfiguration& CCPACSHull::GetConfiguration() const -// { -// // return GetParent()->GetParent()->GetConfiguration(); -// return GetParent()->GetParent() -// } +CCPACSConfiguration& CCPACSHull::GetConfiguration() const +{ + return GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetConfiguration(); +} std::string CCPACSHull::GetDefaultedUID() const { diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 64c1da3d79..02b3c0e80a 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -23,7 +23,7 @@ #include "generated/CPACSHull.h" #include "CTiglRelativelyPositionedComponent.h" -// #include "CCPACSConfiguration.h" +#include "CCPACSConfiguration.h" #include "generated/CPACSHulls.h" namespace tigl @@ -35,7 +35,7 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned TIGL_EXPORT explicit CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); - // TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; TIGL_EXPORT std::string GetDefaultedUID() const override; TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; From 15216cbdf2592c31620dc05298cfdd90334ebca2 Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 17 Mar 2024 13:52:52 +0100 Subject: [PATCH 009/122] fix errors in loft-building --- src/fuselage/CCPACSFuselageSegment.cpp | 14 ++++++++++++++ src/fuselage/CCPACSFuselageSegments.cpp | 3 +++ src/fuselage/CTiglFuselageConnection.cpp | 8 ++++++++ 3 files changed, 25 insertions(+) diff --git a/src/fuselage/CCPACSFuselageSegment.cpp b/src/fuselage/CCPACSFuselageSegment.cpp index 59a2b7e141..5c67b30751 100644 --- a/src/fuselage/CCPACSFuselageSegment.cpp +++ b/src/fuselage/CCPACSFuselageSegment.cpp @@ -25,6 +25,7 @@ #include "CTiglFuselageSegmentGuidecurveBuilder.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" +#include "CCPACSHull.h" #include "CCPACSFuselageProfile.h" #include "CCPACSConfiguration.h" @@ -266,6 +267,19 @@ std::string CCPACSFuselageSegment::GetShortShapeName() const } } } + else if (m_parent->IsParent()) { + + prefix = "H"; + auto* hull = m_parent->GetParent(); + unsigned int i = 0; + for (auto& h: hull->GetParent()->GetHulls()) { + ++i; + if (hull->GetUID() == h->GetUID()) { + findex = i; + break; + } + } + } else if (m_parent->IsParent()) { prefix = "F"; diff --git a/src/fuselage/CCPACSFuselageSegments.cpp b/src/fuselage/CCPACSFuselageSegments.cpp index af3cf9596d..695267c9e8 100644 --- a/src/fuselage/CCPACSFuselageSegments.cpp +++ b/src/fuselage/CCPACSFuselageSegments.cpp @@ -74,6 +74,9 @@ CCPACSConfiguration const& CCPACSFuselageSegments::GetConfiguration() const else if (IsParent()) { return GetParent()->GetConfiguration(); } + else if (IsParent()) { + return GetParent()->GetConfiguration(); + } else { throw CTiglError("CCPACSFuselageSegments: Unknown parent."); diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index aaece305ce..fd1d5c9356 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -27,6 +27,8 @@ #include "CTiglError.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" +#include "CCPACSHull.h" +#include "CPACSGenericFuelTank.h" #include "CCPACSFuselageSections.h" #include "CCPACSFuselageSection.h" #include "CCPACSFuselageSegment.h" @@ -159,6 +161,9 @@ CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSection else if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetSections(); } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections(); + } else { throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); } @@ -172,6 +177,9 @@ boost::optional& CTiglFuselageConnection::GetParentComponent else if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetPositionings(); } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetPositionings(); + } else { throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); } From c867888c6df991da38feef7d2c1ace12d50a950d Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 17 Mar 2024 21:28:15 +0100 Subject: [PATCH 010/122] add further Custom-Classes --- cpacs_gen_input/CustomTypes.txt | 3 + cpacs_gen_input/cpacs_schema.xsd | 2 +- src/fuelTanks/CCPACSGenericFuelTank.cpp | 34 +++++++++ src/fuelTanks/CCPACSGenericFuelTank.h | 39 +++++++++++ src/fuelTanks/CCPACSGenericFuelTanks.cpp | 31 ++++++++ src/fuelTanks/CCPACSGenericFuelTanks.h | 39 +++++++++++ src/fuelTanks/CCPACSHull.cpp | 6 +- src/fuelTanks/CCPACSHulls.cpp | 70 +++++++++++++++++++ src/fuelTanks/CCPACSHulls.h | 52 ++++++++++++++ src/fuselage/CCPACSFuselageSegment.cpp | 1 + src/fuselage/CTiglFuselageConnection.cpp | 3 +- src/generated/CPACSFuelTankVolume.cpp | 8 +-- src/generated/CPACSFuelTankVolume.h | 12 ++-- src/generated/CPACSFuselageFuelTanks.cpp | 6 +- src/generated/CPACSFuselageFuelTanks.h | 10 +-- src/generated/CPACSGenericFuelTank.cpp | 51 ++++++++++---- src/generated/CPACSGenericFuelTank.h | 31 ++++---- .../CPACSGenericFuelTankParameters.cpp | 31 ++------ .../CPACSGenericFuelTankParameters.h | 18 ++--- src/generated/CPACSGenericFuelTanks.cpp | 14 ++-- src/generated/CPACSGenericFuelTanks.h | 16 ++--- src/generated/CPACSHull.cpp | 8 +-- src/generated/CPACSHull.h | 14 ++-- src/generated/CPACSHulls.cpp | 12 ++-- src/generated/CPACSHulls.h | 15 ++-- src/generated/CPACSTransformation.cpp | 14 ++-- src/generated/CPACSTransformation.h | 11 ++- src/geometry/CCPACSTransformation.cpp | 10 +-- src/geometry/CCPACSTransformation.h | 2 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 2 +- tests/unittests/tiglTanks.cpp | 2 +- 31 files changed, 411 insertions(+), 156 deletions(-) create mode 100644 src/fuelTanks/CCPACSGenericFuelTank.cpp create mode 100644 src/fuelTanks/CCPACSGenericFuelTank.h create mode 100644 src/fuelTanks/CCPACSGenericFuelTanks.cpp create mode 100644 src/fuelTanks/CCPACSGenericFuelTanks.h create mode 100644 src/fuelTanks/CCPACSHulls.cpp create mode 100644 src/fuelTanks/CCPACSHulls.h diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index 305b595eb8..c2205f47b7 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -152,3 +152,6 @@ CPACSDucts CCPACSDucts // Tanks CPACSHull CCPACSHull +CPACSHulls CCPACSHulls +CPACSGenericFuelTank CCPACSGenericFuelTank +CPACSGenericFuelTanks CCPACSGenericFuelTanks \ No newline at end of file diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index 9b2699b04f..a4d6fc63f1 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -34211,6 +34211,7 @@ The fuel tank volume type should also be used for the wing fuel tank + Volume @@ -34295,7 +34296,6 @@ The fuel tank volume type should also be used for the wing fuel tank - Inner radius of the cylinder diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp new file mode 100644 index 0000000000..1c52ddb8f9 --- /dev/null +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -0,0 +1,34 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS ducts handling routines. +*/ + +#include "CCPACSGenericFuelTank.h" +#include "CTiglError.h" + +#include + +namespace tigl { + +CCPACSGenericFuelTank::CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) + : generated::CPACSGenericFuelTank(parent, uidMgr) + // , enabled(false) +{} + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSGenericFuelTank.h new file mode 100644 index 0000000000..5ce61e85b6 --- /dev/null +++ b/src/fuelTanks/CCPACSGenericFuelTank.h @@ -0,0 +1,39 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hulls handling routines. +*/ + +#pragma once + +#include "generated/CPACSGenericFuelTank.h" +// #include + +namespace tigl { + +class CCPACSGenericFuelTank: public generated::CPACSGenericFuelTank +{ +public: + + TIGL_EXPORT CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); + +private: + +}; + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.cpp b/src/fuelTanks/CCPACSGenericFuelTanks.cpp new file mode 100644 index 0000000000..0bc3baab44 --- /dev/null +++ b/src/fuelTanks/CCPACSGenericFuelTanks.cpp @@ -0,0 +1,31 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS ducts handling routines. +*/ + +#include "CCPACSGenericFuelTanks.h" +#include "CTiglError.h" + +namespace tigl { + +CCPACSGenericFuelTanks::CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr) + : generated::CPACSGenericFuelTanks(parent, uidMgr) +{} + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.h b/src/fuelTanks/CCPACSGenericFuelTanks.h new file mode 100644 index 0000000000..6dcdf4cd4c --- /dev/null +++ b/src/fuelTanks/CCPACSGenericFuelTanks.h @@ -0,0 +1,39 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hulls handling routines. +*/ + +#pragma once + +#include "generated/CPACSGenericFuelTanks.h" +// #include + +namespace tigl { + +class CCPACSGenericFuelTanks: public generated::CPACSGenericFuelTanks +{ +public: + + TIGL_EXPORT CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); + +private: + +}; + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 60cec5a12f..6155a0bc25 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -20,14 +20,14 @@ */ #include "CCPACSHull.h" +#include "CCPACSHulls.h" #include "CCPACSFuselageSegment.h" #include "CTiglMakeLoft.h" #include "CNamedShape.h" #include "CTiglTopoAlgorithms.h" #include "tiglcommonfunctions.h" -#include "generated/CPACSGenericFuelTank.h" -#include "generated/CPACSGenericFuelTanks.h" -#include "generated/CPACSFuselageFuelTanks.h" +#include "CCPACSGenericFuelTank.h" +#include "CCPACSGenericFuelTanks.h" namespace tigl { diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp new file mode 100644 index 0000000000..e665546da4 --- /dev/null +++ b/src/fuelTanks/CCPACSHulls.cpp @@ -0,0 +1,70 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hulls handling routines. +*/ + +#include "CCPACSHulls.h" +#include "CCPACSHull.h" +#include "CTiglError.h" + +// #include + +namespace tigl { + +CCPACSHulls::CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) + : generated::CPACSHulls(parent, uidMgr) + , enabled(false) +{} + +// void CCPACSHulls::RegisterInvalidationCallback(std::function const& fn){ +// invalidationCallbacks.push_back(fn); +// } + +CCPACSHull const& CCPACSHulls::GetHull(std::string const& uid) const +{ + return const_cast(*this).GetHull(uid); +} + +CCPACSHull& CCPACSHulls::GetHull(std::string const& uid) +{ + auto it = std::find_if(m_hulls.begin(), m_hulls.end(), [&](std::unique_ptr const& v){ return v->GetUID() == uid; }); + + if ( it != std::end(m_hulls)) { + return **it; + } + throw CTiglError("Could not find hull with uid" + uid); +} + + +bool CCPACSHulls::IsEnabled() const +{ + return enabled; +} + +void CCPACSHulls::SetEnabled(bool val) +{ + if (enabled != val) { + for (auto const& invalidator: invalidationCallbacks) { + invalidator(); + } + enabled = val; + } +} + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSHulls.h b/src/fuelTanks/CCPACSHulls.h new file mode 100644 index 0000000000..c889f714dc --- /dev/null +++ b/src/fuelTanks/CCPACSHulls.h @@ -0,0 +1,52 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hulls handling routines. +*/ + +#pragma once + +#include "generated/CPACSHulls.h" +#include + +namespace tigl { + +class CCPACSHulls: public generated::CPACSHulls +{ +public: + + TIGL_EXPORT CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + + + TIGL_EXPORT CCPACSHull const& GetHull(std::string const& uid) const; + TIGL_EXPORT CCPACSHull& GetHull(std::string const& uid); + + TIGL_EXPORT bool IsEnabled() const; + TIGL_EXPORT void SetEnabled(bool val=true); + + // //Any AbstractGeometricComponent, that shall be cut with ducts, can register its Invalidation + // //as a callback. + // TIGL_EXPORT void RegisterInvalidationCallback(std::function const&); + +private: + bool enabled; + + std::vector> invalidationCallbacks; +}; + +} //namespace tigl diff --git a/src/fuselage/CCPACSFuselageSegment.cpp b/src/fuselage/CCPACSFuselageSegment.cpp index 5c67b30751..1d72cf70f8 100644 --- a/src/fuselage/CCPACSFuselageSegment.cpp +++ b/src/fuselage/CCPACSFuselageSegment.cpp @@ -26,6 +26,7 @@ #include "CCPACSFuselage.h" #include "CCPACSDuct.h" #include "CCPACSHull.h" +#include "CCPACSHulls.h" #include "CCPACSFuselageProfile.h" #include "CCPACSConfiguration.h" diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index fd1d5c9356..07c37c639a 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -28,7 +28,8 @@ #include "CCPACSFuselage.h" #include "CCPACSDuct.h" #include "CCPACSHull.h" -#include "CPACSGenericFuelTank.h" +#include "CCPACSHulls.h" +#include "CCPACSGenericFuelTank.h" #include "CCPACSFuselageSections.h" #include "CCPACSFuselageSection.h" #include "CCPACSFuselageSegment.h" diff --git a/src/generated/CPACSFuelTankVolume.cpp b/src/generated/CPACSFuelTankVolume.cpp index 12c1201058..55a29da7ca 100644 --- a/src/generated/CPACSFuelTankVolume.cpp +++ b/src/generated/CPACSFuelTankVolume.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include +#include "CCPACSGenericFuelTank.h" #include "CPACSFuelTankVolume.h" -#include "CPACSGenericFuelTank.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDObject.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSFuelTankVolume::CPACSFuelTankVolume(CPACSGenericFuelTank* parent) + CPACSFuelTankVolume::CPACSFuelTankVolume(CCPACSGenericFuelTank* parent) : m_optimalVolume(0) { //assert(parent != NULL); @@ -38,12 +38,12 @@ namespace generated { } - const CPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() const + const CCPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() const { return m_parent; } - CPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() + CCPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() { return m_parent; } diff --git a/src/generated/CPACSFuelTankVolume.h b/src/generated/CPACSFuelTankVolume.h index 64926e5cc1..763c5efe96 100644 --- a/src/generated/CPACSFuelTankVolume.h +++ b/src/generated/CPACSFuelTankVolume.h @@ -26,11 +26,10 @@ namespace tigl { class CTiglUIDObject; +class CCPACSGenericFuelTank; namespace generated { - class CPACSGenericFuelTank; - // This class is used in: // CPACSGenericFuelTank @@ -41,13 +40,13 @@ namespace generated class CPACSFuelTankVolume { public: - TIGL_EXPORT CPACSFuelTankVolume(CPACSGenericFuelTank* parent); + TIGL_EXPORT CPACSFuelTankVolume(CCPACSGenericFuelTank* parent); TIGL_EXPORT virtual ~CPACSFuelTankVolume(); - TIGL_EXPORT CPACSGenericFuelTank* GetParent(); + TIGL_EXPORT CCPACSGenericFuelTank* GetParent(); - TIGL_EXPORT const CPACSGenericFuelTank* GetParent() const; + TIGL_EXPORT const CCPACSGenericFuelTank* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -73,7 +72,7 @@ namespace generated TIGL_EXPORT virtual void SetRealVolumeFactor_choice2(const boost::optional& value); protected: - CPACSGenericFuelTank* m_parent; + CCPACSGenericFuelTank* m_parent; /// Theoretical volume if material thicknesses /// (ribs, spars, skins, stringers) and systems (fuel pumps, @@ -105,5 +104,4 @@ namespace generated // Aliases in tigl namespace using CCPACSFuelTankVolume = generated::CPACSFuelTankVolume; -using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; } // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTanks.cpp b/src/generated/CPACSFuselageFuelTanks.cpp index 27eaa62563..edf8737535 100644 --- a/src/generated/CPACSFuselageFuelTanks.cpp +++ b/src/generated/CPACSFuselageFuelTanks.cpp @@ -107,17 +107,17 @@ namespace generated } - const boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() const + const boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() const { return m_genericFuelTanks; } - boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() + boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() { return m_genericFuelTanks; } - CPACSGenericFuelTanks& CPACSFuselageFuelTanks::GetGenericFuelTanks(CreateIfNotExistsTag) + CCPACSGenericFuelTanks& CPACSFuselageFuelTanks::GetGenericFuelTanks(CreateIfNotExistsTag) { if (!m_genericFuelTanks) m_genericFuelTanks = boost::in_place(this, m_uidMgr); diff --git a/src/generated/CPACSFuselageFuelTanks.h b/src/generated/CPACSFuselageFuelTanks.h index d000c69fb7..548e5c4dee 100644 --- a/src/generated/CPACSFuselageFuelTanks.h +++ b/src/generated/CPACSFuselageFuelTanks.h @@ -19,9 +19,9 @@ #include #include +#include #include #include -#include "CPACSGenericFuelTanks.h" #include "CreateIfNotExists.h" #include "tigl_internal.h" @@ -60,10 +60,10 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const boost::optional& GetGenericFuelTanks() const; - TIGL_EXPORT virtual boost::optional& GetGenericFuelTanks(); + TIGL_EXPORT virtual const boost::optional& GetGenericFuelTanks() const; + TIGL_EXPORT virtual boost::optional& GetGenericFuelTanks(); - TIGL_EXPORT virtual CPACSGenericFuelTanks& GetGenericFuelTanks(CreateIfNotExistsTag); + TIGL_EXPORT virtual CCPACSGenericFuelTanks& GetGenericFuelTanks(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveGenericFuelTanks(); protected: @@ -71,7 +71,7 @@ namespace generated CTiglUIDManager* m_uidMgr; - boost::optional m_genericFuelTanks; + boost::optional m_genericFuelTanks; private: CPACSFuselageFuelTanks(const CPACSFuselageFuelTanks&) = delete; diff --git a/src/generated/CPACSGenericFuelTank.cpp b/src/generated/CPACSGenericFuelTank.cpp index d70e5ea070..708e77f94f 100644 --- a/src/generated/CPACSGenericFuelTank.cpp +++ b/src/generated/CPACSGenericFuelTank.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include +#include "CCPACSGenericFuelTanks.h" #include "CPACSGenericFuelTank.h" -#include "CPACSGenericFuelTanks.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,8 +27,9 @@ namespace tigl { namespace generated { - CPACSGenericFuelTank::CPACSGenericFuelTank(CPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) + CPACSGenericFuelTank::CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) + , m_transformation(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; @@ -39,12 +40,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() const + const CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() const { return m_parent; } - CPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() + CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() { return m_parent; } @@ -115,7 +116,7 @@ namespace generated // read element hulls if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { - m_hulls_choice1 = boost::in_place(this, m_uidMgr); + m_hulls_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_hulls_choice1->ReadCPACS(tixiHandle, xpath + "/hulls"); } catch(const std::exception& e) { @@ -126,7 +127,7 @@ namespace generated // read element designParameters if (tixi::TixiCheckElement(tixiHandle, xpath + "/designParameters")) { - m_designParameters_choice2 = boost::in_place(this, m_uidMgr); + m_designParameters_choice2 = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_designParameters_choice2->ReadCPACS(tixiHandle, xpath + "/designParameters"); } catch(const std::exception& e) { @@ -135,9 +136,17 @@ namespace generated } } + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + // read element volume if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - m_volume = boost::in_place(this); + m_volume = boost::in_place(reinterpret_cast(this)); try { m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); } catch(const std::exception& e) { @@ -159,7 +168,7 @@ namespace generated void CPACSGenericFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "name", "description", "hulls", "designParameters", "volume", "burstPressure" }; + const std::vector childElemOrder = { "name", "description", "hulls", "designParameters", "transformation", "volume", "burstPressure" }; // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); @@ -201,6 +210,10 @@ namespace generated } } + // write element transformation + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + // write element volume if (m_volume) { tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); @@ -293,12 +306,12 @@ namespace generated m_description = value; } - const boost::optional& CPACSGenericFuelTank::GetHulls_choice1() const + const boost::optional& CPACSGenericFuelTank::GetHulls_choice1() const { return m_hulls_choice1; } - boost::optional& CPACSGenericFuelTank::GetHulls_choice1() + boost::optional& CPACSGenericFuelTank::GetHulls_choice1() { return m_hulls_choice1; } @@ -313,6 +326,16 @@ namespace generated return m_designParameters_choice2; } + const CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() + { + return m_transformation; + } + const boost::optional& CPACSGenericFuelTank::GetVolume() const { return m_volume; @@ -333,10 +356,10 @@ namespace generated m_burstPressure = value; } - CPACSHulls& CPACSGenericFuelTank::GetHulls_choice1(CreateIfNotExistsTag) + CCPACSHulls& CPACSGenericFuelTank::GetHulls_choice1(CreateIfNotExistsTag) { if (!m_hulls_choice1) - m_hulls_choice1 = boost::in_place(this, m_uidMgr); + m_hulls_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_hulls_choice1; } @@ -348,7 +371,7 @@ namespace generated CPACSGenericFuelTankParameters& CPACSGenericFuelTank::GetDesignParameters_choice2(CreateIfNotExistsTag) { if (!m_designParameters_choice2) - m_designParameters_choice2 = boost::in_place(this, m_uidMgr); + m_designParameters_choice2 = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_designParameters_choice2; } @@ -360,7 +383,7 @@ namespace generated CPACSFuelTankVolume& CPACSGenericFuelTank::GetVolume(CreateIfNotExistsTag) { if (!m_volume) - m_volume = boost::in_place(this); + m_volume = boost::in_place(reinterpret_cast(this)); return *m_volume; } diff --git a/src/generated/CPACSGenericFuelTank.h b/src/generated/CPACSGenericFuelTank.h index 2764904329..02cb40ea48 100644 --- a/src/generated/CPACSGenericFuelTank.h +++ b/src/generated/CPACSGenericFuelTank.h @@ -19,11 +19,12 @@ #include #include +#include +#include #include #include #include "CPACSFuelTankVolume.h" #include "CPACSGenericFuelTankParameters.h" -#include "CPACSHulls.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -31,11 +32,10 @@ namespace tigl { class CTiglUIDManager; +class CCPACSGenericFuelTanks; namespace generated { - class CPACSGenericFuelTanks; - // This class is used in: // CPACSGenericFuelTanks @@ -45,13 +45,13 @@ namespace generated class CPACSGenericFuelTank : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSGenericFuelTank(CPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSGenericFuelTank(); - TIGL_EXPORT CPACSGenericFuelTanks* GetParent(); + TIGL_EXPORT CCPACSGenericFuelTanks* GetParent(); - TIGL_EXPORT const CPACSGenericFuelTanks* GetParent() const; + TIGL_EXPORT const CCPACSGenericFuelTanks* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -73,19 +73,22 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetDescription() const; TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - TIGL_EXPORT virtual const boost::optional& GetHulls_choice1() const; - TIGL_EXPORT virtual boost::optional& GetHulls_choice1(); + TIGL_EXPORT virtual const boost::optional& GetHulls_choice1() const; + TIGL_EXPORT virtual boost::optional& GetHulls_choice1(); TIGL_EXPORT virtual const boost::optional& GetDesignParameters_choice2() const; TIGL_EXPORT virtual boost::optional& GetDesignParameters_choice2(); + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + TIGL_EXPORT virtual const boost::optional& GetVolume() const; TIGL_EXPORT virtual boost::optional& GetVolume(); TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); - TIGL_EXPORT virtual CPACSHulls& GetHulls_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual CCPACSHulls& GetHulls_choice1(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveHulls_choice1(); TIGL_EXPORT virtual CPACSGenericFuelTankParameters& GetDesignParameters_choice2(CreateIfNotExistsTag); @@ -95,7 +98,7 @@ namespace generated TIGL_EXPORT virtual void RemoveVolume(); protected: - CPACSGenericFuelTanks* m_parent; + CCPACSGenericFuelTanks* m_parent; CTiglUIDManager* m_uidMgr; @@ -107,10 +110,12 @@ namespace generated /// Description boost::optional m_description; - boost::optional m_hulls_choice1; + boost::optional m_hulls_choice1; boost::optional m_designParameters_choice2; + CCPACSTransformation m_transformation; + /// Volume boost::optional m_volume; @@ -126,7 +131,5 @@ namespace generated }; } // namespace generated -// Aliases in tigl namespace -using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; -using CCPACSGenericFuelTanks = generated::CPACSGenericFuelTanks; +// CPACSGenericFuelTank is customized, use type CCPACSGenericFuelTank directly } // namespace tigl diff --git a/src/generated/CPACSGenericFuelTankParameters.cpp b/src/generated/CPACSGenericFuelTankParameters.cpp index 1ddca1fba6..e78406de17 100644 --- a/src/generated/CPACSGenericFuelTankParameters.cpp +++ b/src/generated/CPACSGenericFuelTankParameters.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CPACSGenericFuelTank.h" +#include "CCPACSGenericFuelTank.h" #include "CPACSGenericFuelTankParameters.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -28,9 +28,8 @@ namespace tigl { namespace generated { - CPACSGenericFuelTankParameters::CPACSGenericFuelTankParameters(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) + CPACSGenericFuelTankParameters::CPACSGenericFuelTankParameters(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) - , m_transformation(this, m_uidMgr) , m_cylinderRadius(0) , m_cylinderLength(0) , m_domeType(this) @@ -44,12 +43,12 @@ namespace generated { } - const CPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() const + const CCPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() const { return m_parent; } - CPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() + CCPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() { return m_parent; } @@ -82,14 +81,6 @@ namespace generated void CPACSGenericFuelTankParameters::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { - // read element transformation - if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { - m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); - } - else { - LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; - } - // read element cylinderRadius if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { m_cylinderRadius = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); @@ -126,10 +117,6 @@ namespace generated void CPACSGenericFuelTankParameters::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - // write element transformation - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/transformation"); - m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); - // write element cylinderRadius tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cylinderRadius"); tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", m_cylinderRadius); @@ -148,16 +135,6 @@ namespace generated } - const CCPACSTransformation& CPACSGenericFuelTankParameters::GetTransformation() const - { - return m_transformation; - } - - CCPACSTransformation& CPACSGenericFuelTankParameters::GetTransformation() - { - return m_transformation; - } - const double& CPACSGenericFuelTankParameters::GetCylinderRadius() const { return m_cylinderRadius; diff --git a/src/generated/CPACSGenericFuelTankParameters.h b/src/generated/CPACSGenericFuelTankParameters.h index a92bf91240..bd1d0379b7 100644 --- a/src/generated/CPACSGenericFuelTankParameters.h +++ b/src/generated/CPACSGenericFuelTankParameters.h @@ -18,7 +18,6 @@ #pragma once #include -#include #include #include #include "CPACSDomeType.h" @@ -28,11 +27,10 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; +class CCPACSGenericFuelTank; namespace generated { - class CPACSGenericFuelTank; - // This class is used in: // CPACSGenericFuelTank @@ -42,13 +40,13 @@ namespace generated class CPACSGenericFuelTankParameters { public: - TIGL_EXPORT CPACSGenericFuelTankParameters(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSGenericFuelTankParameters(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSGenericFuelTankParameters(); - TIGL_EXPORT CPACSGenericFuelTank* GetParent(); + TIGL_EXPORT CCPACSGenericFuelTank* GetParent(); - TIGL_EXPORT const CPACSGenericFuelTank* GetParent() const; + TIGL_EXPORT const CCPACSGenericFuelTank* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -59,9 +57,6 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; - TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const double& GetCylinderRadius() const; TIGL_EXPORT virtual void SetCylinderRadius(const double& value); @@ -75,12 +70,10 @@ namespace generated TIGL_EXPORT virtual CCPACSMaterialDefinition& GetMaterial(); protected: - CPACSGenericFuelTank* m_parent; + CCPACSGenericFuelTank* m_parent; CTiglUIDManager* m_uidMgr; - CCPACSTransformation m_transformation; - /// Inner radius of the cylinder double m_cylinderRadius; @@ -102,5 +95,4 @@ namespace generated // Aliases in tigl namespace using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; -using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; } // namespace tigl diff --git a/src/generated/CPACSGenericFuelTanks.cpp b/src/generated/CPACSGenericFuelTanks.cpp index 8fb5f2b050..79a955dbb5 100644 --- a/src/generated/CPACSGenericFuelTanks.cpp +++ b/src/generated/CPACSGenericFuelTanks.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include +#include #include "CPACSFuselageFuelTanks.h" -#include "CPACSGenericFuelTank.h" #include "CPACSGenericFuelTanks.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -86,7 +86,7 @@ namespace generated { // read element genericFuelTank if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFuelTank")) { - tixi::TixiReadElements(tixiHandle, xpath + "/genericFuelTank", m_genericFuelTanks, 1, tixi::xsdUnbounded, this, m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/genericFuelTank", m_genericFuelTanks, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); } } @@ -98,23 +98,23 @@ namespace generated } - const std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() const + const std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() const { return m_genericFuelTanks; } - std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() + std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() { return m_genericFuelTanks; } - CPACSGenericFuelTank& CPACSGenericFuelTanks::AddGenericFuelTank() + CCPACSGenericFuelTank& CPACSGenericFuelTanks::AddGenericFuelTank() { - m_genericFuelTanks.push_back(make_unique(this, m_uidMgr)); + m_genericFuelTanks.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); return *m_genericFuelTanks.back(); } - void CPACSGenericFuelTanks::RemoveGenericFuelTank(CPACSGenericFuelTank& ref) + void CPACSGenericFuelTanks::RemoveGenericFuelTank(CCPACSGenericFuelTank& ref) { for (std::size_t i = 0; i < m_genericFuelTanks.size(); i++) { if (m_genericFuelTanks[i].get() == &ref) { diff --git a/src/generated/CPACSGenericFuelTanks.h b/src/generated/CPACSGenericFuelTanks.h index 0271ae8bf0..fa7587f867 100644 --- a/src/generated/CPACSGenericFuelTanks.h +++ b/src/generated/CPACSGenericFuelTanks.h @@ -27,10 +27,10 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; +class CCPACSGenericFuelTank; namespace generated { - class CPACSGenericFuelTank; class CPACSFuselageFuelTanks; // This class is used in: @@ -60,18 +60,18 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const std::vector>& GetGenericFuelTanks() const; - TIGL_EXPORT virtual std::vector>& GetGenericFuelTanks(); + TIGL_EXPORT virtual const std::vector>& GetGenericFuelTanks() const; + TIGL_EXPORT virtual std::vector>& GetGenericFuelTanks(); - TIGL_EXPORT virtual CPACSGenericFuelTank& AddGenericFuelTank(); - TIGL_EXPORT virtual void RemoveGenericFuelTank(CPACSGenericFuelTank& ref); + TIGL_EXPORT virtual CCPACSGenericFuelTank& AddGenericFuelTank(); + TIGL_EXPORT virtual void RemoveGenericFuelTank(CCPACSGenericFuelTank& ref); protected: CPACSFuselageFuelTanks* m_parent; CTiglUIDManager* m_uidMgr; - std::vector> m_genericFuelTanks; + std::vector> m_genericFuelTanks; private: CPACSGenericFuelTanks(const CPACSGenericFuelTanks&) = delete; @@ -82,8 +82,8 @@ namespace generated }; } // namespace generated +// CPACSGenericFuelTanks is customized, use type CCPACSGenericFuelTanks directly + // Aliases in tigl namespace -using CCPACSGenericFuelTanks = generated::CPACSGenericFuelTanks; -using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; } // namespace tigl diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSHull.cpp index 7ed954ac5e..d11bf9bbb8 100644 --- a/src/generated/CPACSHull.cpp +++ b/src/generated/CPACSHull.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include +#include "CCPACSHulls.h" #include "CPACSHull.h" -#include "CPACSHulls.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSHull::CPACSHull(CPACSHulls* parent, CTiglUIDManager* uidMgr) + CPACSHull::CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) , m_sections(reinterpret_cast(this), m_uidMgr) @@ -42,12 +42,12 @@ namespace generated if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CPACSHulls* CPACSHull::GetParent() const + const CCPACSHulls* CPACSHull::GetParent() const { return m_parent; } - CPACSHulls* CPACSHull::GetParent() + CCPACSHulls* CPACSHull::GetParent() { return m_parent; } diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSHull.h index 72dd9bbf94..94a2896b71 100644 --- a/src/generated/CPACSHull.h +++ b/src/generated/CPACSHull.h @@ -32,11 +32,10 @@ namespace tigl { class CTiglUIDManager; +class CCPACSHulls; namespace generated { - class CPACSHulls; - // This class is used in: // CPACSHulls @@ -46,13 +45,13 @@ namespace generated class CPACSHull : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSHull(CPACSHulls* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSHull(); - TIGL_EXPORT CPACSHulls* GetParent(); + TIGL_EXPORT CCPACSHulls* GetParent(); - TIGL_EXPORT const CPACSHulls* GetParent() const; + TIGL_EXPORT const CCPACSHulls* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -88,7 +87,7 @@ namespace generated TIGL_EXPORT virtual void RemoveStructure(); protected: - CPACSHulls* m_parent; + CCPACSHulls* m_parent; CTiglUIDManager* m_uidMgr; @@ -118,7 +117,4 @@ namespace generated } // namespace generated // CPACSHull is customized, use type CCPACSHull directly - -// Aliases in tigl namespace -using CCPACSHulls = generated::CPACSHulls; } // namespace tigl diff --git a/src/generated/CPACSHulls.cpp b/src/generated/CPACSHulls.cpp index a5734e50f6..f3b6570de6 100644 --- a/src/generated/CPACSHulls.cpp +++ b/src/generated/CPACSHulls.cpp @@ -17,7 +17,7 @@ #include #include -#include "CPACSGenericFuelTank.h" +#include "CCPACSGenericFuelTank.h" #include "CPACSHulls.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSHulls::CPACSHulls(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) + CPACSHulls::CPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CPACSGenericFuelTank* CPACSHulls::GetParent() const + const CCPACSGenericFuelTank* CPACSHulls::GetParent() const { return m_parent; } - CPACSGenericFuelTank* CPACSHulls::GetParent() + CCPACSGenericFuelTank* CPACSHulls::GetParent() { return m_parent; } @@ -80,7 +80,7 @@ namespace generated { // read element hull if (tixi::TixiCheckElement(tixiHandle, xpath + "/hull")) { - tixi::TixiReadElements(tixiHandle, xpath + "/hull", m_hulls, 1, tixi::xsdUnbounded, this, m_uidMgr); + tixi::TixiReadElements(tixiHandle, xpath + "/hull", m_hulls, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); } } @@ -104,7 +104,7 @@ namespace generated CCPACSHull& CPACSHulls::AddHull() { - m_hulls.push_back(make_unique(this, m_uidMgr)); + m_hulls.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); return *m_hulls.back(); } diff --git a/src/generated/CPACSHulls.h b/src/generated/CPACSHulls.h index d026df0dbe..e82d8de7ca 100644 --- a/src/generated/CPACSHulls.h +++ b/src/generated/CPACSHulls.h @@ -28,11 +28,10 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSHull; +class CCPACSGenericFuelTank; namespace generated { - class CPACSGenericFuelTank; - // This class is used in: // CPACSGenericFuelTank @@ -42,13 +41,13 @@ namespace generated class CPACSHulls { public: - TIGL_EXPORT CPACSHulls(CPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSHulls(); - TIGL_EXPORT CPACSGenericFuelTank* GetParent(); + TIGL_EXPORT CCPACSGenericFuelTank* GetParent(); - TIGL_EXPORT const CPACSGenericFuelTank* GetParent() const; + TIGL_EXPORT const CCPACSGenericFuelTank* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -66,7 +65,7 @@ namespace generated TIGL_EXPORT virtual void RemoveHull(CCPACSHull& ref); protected: - CPACSGenericFuelTank* m_parent; + CCPACSGenericFuelTank* m_parent; CTiglUIDManager* m_uidMgr; @@ -81,7 +80,5 @@ namespace generated }; } // namespace generated -// Aliases in tigl namespace -using CCPACSHulls = generated::CPACSHulls; -using CCPACSGenericFuelTank = generated::CPACSGenericFuelTank; +// CPACSHulls is customized, use type CCPACSHulls directly } // namespace tigl diff --git a/src/generated/CPACSTransformation.cpp b/src/generated/CPACSTransformation.cpp index 61775bc68d..df5f3cff13 100644 --- a/src/generated/CPACSTransformation.cpp +++ b/src/generated/CPACSTransformation.cpp @@ -24,6 +24,7 @@ #include "CCPACSFuselage.h" #include "CCPACSFuselageSection.h" #include "CCPACSFuselageSectionElement.h" +#include "CCPACSGenericFuelTank.h" #include "CCPACSGenericSystem.h" #include "CCPACSHull.h" #include "CCPACSNacelleSection.h" @@ -32,7 +33,6 @@ #include "CCPACSWing.h" #include "CCPACSWingSection.h" #include "CCPACSWingSectionElement.h" -#include "CPACSGenericFuelTankParameters.h" #include "CPACSLandingGearBase.h" #include "CPACSTransformation.h" #include "CTiglError.h" @@ -100,12 +100,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselageSection); } - CPACSTransformation::CPACSTransformation(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) + CPACSTransformation::CPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSGenericFuelTankParameters); + m_parentType = &typeid(CCPACSGenericFuelTank); } CPACSTransformation::CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr) @@ -217,8 +217,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); + if (IsParent()) { + return GetParent(); } if (IsParent()) { return GetParent(); @@ -278,8 +278,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); + if (IsParent()) { + return GetParent(); } if (IsParent()) { return GetParent(); diff --git a/src/generated/CPACSTransformation.h b/src/generated/CPACSTransformation.h index 2263642203..0372020cd6 100644 --- a/src/generated/CPACSTransformation.h +++ b/src/generated/CPACSTransformation.h @@ -39,6 +39,7 @@ class CCPACSEnginePylon; class CCPACSFuselage; class CCPACSFuselageSectionElement; class CCPACSFuselageSection; +class CCPACSGenericFuelTank; class CCPACSExternalObject; class CCPACSGenericSystem; class CCPACSHull; @@ -51,7 +52,6 @@ class CCPACSWingSection; namespace generated { - class CPACSGenericFuelTankParameters; class CPACSLandingGearBase; // This class is used in: @@ -62,7 +62,7 @@ namespace generated // CPACSFuselage // CPACSFuselageElement // CPACSFuselageSection - // CPACSGenericFuelTankParameters + // CPACSGenericFuelTank // CPACSGenericGeometricComponent // CPACSGenericSystem // CPACSHull @@ -97,7 +97,7 @@ namespace generated TIGL_EXPORT CPACSTransformation(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSTransformation(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); @@ -120,7 +120,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -130,7 +130,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -206,6 +206,5 @@ namespace generated // CPACSTransformation is customized, use type CCPACSTransformation directly // Aliases in tigl namespace -using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; using CCPACSLandingGearBase = generated::CPACSLandingGearBase; } // namespace tigl diff --git a/src/geometry/CCPACSTransformation.cpp b/src/geometry/CCPACSTransformation.cpp index b262840719..487a4350b2 100644 --- a/src/geometry/CCPACSTransformation.cpp +++ b/src/geometry/CCPACSTransformation.cpp @@ -65,31 +65,31 @@ CCPACSTransformation::CCPACSTransformation(CCPACSFuselageSection* parent, CTiglU { } -CCPACSTransformation::CCPACSTransformation(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) +CCPACSTransformation::CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) { } -CCPACSTransformation::CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr) +CCPACSTransformation::CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) { } -CCPACSTransformation::CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr) +CCPACSTransformation::CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) { } -CCPACSTransformation::CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr) +CCPACSTransformation::CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) { } -CCPACSTransformation::CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr) +CCPACSTransformation::CCPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) { diff --git a/src/geometry/CCPACSTransformation.h b/src/geometry/CCPACSTransformation.h index f7ab3b1ba3..26ee631781 100644 --- a/src/geometry/CCPACSTransformation.h +++ b/src/geometry/CCPACSTransformation.h @@ -39,10 +39,10 @@ class CCPACSTransformation : public generated::CPACSTransformation TIGL_EXPORT CCPACSTransformation(CCPACSDuctAssembly* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSTransformation(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSRotor* parent, CTiglUIDManager* uidMgr); diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 71aa95a5f5..d3a5608d76 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -110,7 +110,7 @@ Section 1 - 1 + 0 diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 0ef7c54cc4..bc548373bf 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -23,7 +23,7 @@ #include "test.h" #include "tigl.h" -#include "generated/CPACSGenericFuelTank.h" +#include "CCPACSGenericFuelTank.h" #include "CCPACSConfigurationManager.h" #include "CTiglUIDManager.h" From 690afd697617e0af7ad371e6320fd7fdd234616f Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 17 Mar 2024 21:46:16 +0100 Subject: [PATCH 011/122] code clean-up so far --- src/api/tigl.h | 1 + src/fuelTanks/CCPACSGenericFuelTank.cpp | 3 +-- src/fuelTanks/CCPACSGenericFuelTank.h | 3 +-- src/fuelTanks/CCPACSGenericFuelTanks.cpp | 2 +- src/fuelTanks/CCPACSGenericFuelTanks.h | 3 +-- src/fuelTanks/CCPACSHull.cpp | 14 +------------- src/fuelTanks/CCPACSHull.h | 12 ++---------- src/fuelTanks/CCPACSHulls.cpp | 23 ----------------------- src/fuelTanks/CCPACSHulls.h | 10 ---------- 9 files changed, 8 insertions(+), 63 deletions(-) diff --git a/src/api/tigl.h b/src/api/tigl.h index 9de0990a52..f58c4093d8 100644 --- a/src/api/tigl.h +++ b/src/api/tigl.h @@ -233,6 +233,7 @@ TIGL_COMPONENT_ENGINE_NACELLE, /**< The Component is a engine nacelle */ TIGL_COMPONENT_FUSELAGE_WALL, /**< The Component is a fuselage wall */ TIGL_COMPONENT_CONTROL_SURFACE_DEVICE, /**< The component is a control surface device (flap) */ TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ +TIGL_COMPONENT_FUSELAGE_TANK_HULL, /**< The Component is a hull of a fuselage tank */ TIGL_COMPONENT_OTHER }; diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp index 1c52ddb8f9..b533728678 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -16,7 +16,7 @@ */ /** * @file -* @brief Implementation of CPACS ducts handling routines. +* @brief Implementation of CPACS genericFuelTank handling routines. */ #include "CCPACSGenericFuelTank.h" @@ -28,7 +28,6 @@ namespace tigl { CCPACSGenericFuelTank::CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) : generated::CPACSGenericFuelTank(parent, uidMgr) - // , enabled(false) {} } //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSGenericFuelTank.h index 5ce61e85b6..d806cb4910 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.h +++ b/src/fuelTanks/CCPACSGenericFuelTank.h @@ -16,13 +16,12 @@ */ /** * @file -* @brief Implementation of CPACS hulls handling routines. +* @brief Implementation of CPACS genericFuelTank handling routines. */ #pragma once #include "generated/CPACSGenericFuelTank.h" -// #include namespace tigl { diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.cpp b/src/fuelTanks/CCPACSGenericFuelTanks.cpp index 0bc3baab44..c59bbc3f3f 100644 --- a/src/fuelTanks/CCPACSGenericFuelTanks.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTanks.cpp @@ -16,7 +16,7 @@ */ /** * @file -* @brief Implementation of CPACS ducts handling routines. +* @brief Implementation of CPACS genericFuelTanks handling routines. */ #include "CCPACSGenericFuelTanks.h" diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.h b/src/fuelTanks/CCPACSGenericFuelTanks.h index 6dcdf4cd4c..2f18dd5a3a 100644 --- a/src/fuelTanks/CCPACSGenericFuelTanks.h +++ b/src/fuelTanks/CCPACSGenericFuelTanks.h @@ -16,13 +16,12 @@ */ /** * @file -* @brief Implementation of CPACS hulls handling routines. +* @brief Implementation of CPACS genericFuelTanks handling routines. */ #pragma once #include "generated/CPACSGenericFuelTanks.h" -// #include namespace tigl { diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 6155a0bc25..68651b7df2 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -49,7 +49,7 @@ std::string CCPACSHull::GetDefaultedUID() const TiglGeometricComponentType CCPACSHull::GetComponentType() const { - return TIGL_COMPONENT_DUCT; + return TIGL_COMPONENT_FUSELAGE_TANK_HULL; } TiglGeometricComponentIntent CCPACSHull::GetComponentIntent() const @@ -146,16 +146,4 @@ void CCPACSHull::SetFaceTraits (PNamedShape loft) const } } -// void CCPACSDuct::RegisterInvalidationCallback(std::function const& fn){ -// invalidationCallbacks.push_back(fn); -// } - -// void CCPACSDuct::InvalidateImpl(const boost::optional&) const -// { -// CTiglAbstractGeometricComponent::Reset(); -// for (auto const& invalidator: invalidationCallbacks) { -// invalidator(); -// } -// } - } //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 02b3c0e80a..7086ab46c5 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -24,7 +24,7 @@ #include "generated/CPACSHull.h" #include "CTiglRelativelyPositionedComponent.h" #include "CCPACSConfiguration.h" -#include "generated/CPACSHulls.h" +#include "CCPACSHulls.h" namespace tigl { @@ -41,24 +41,16 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; - // //Any DuctAssembly that references this duct element, can register its Invalidation - // //as a callback. - // TIGL_EXPORT void RegisterInvalidationCallback(std::function const&); - protected: PNamedShape BuildLoft() const override; private: - // virtual void InvalidateImpl(const boost::optional&) const override; - - // // get short name for loft + // get short name for loft std::string GetShortShapeName() const; void SetFaceTraits (PNamedShape loft) const; - // std::vector> invalidationCallbacks; - }; } diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp index e665546da4..d72d6ca1c0 100644 --- a/src/fuelTanks/CCPACSHulls.cpp +++ b/src/fuelTanks/CCPACSHulls.cpp @@ -23,19 +23,12 @@ #include "CCPACSHull.h" #include "CTiglError.h" -// #include - namespace tigl { CCPACSHulls::CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) : generated::CPACSHulls(parent, uidMgr) - , enabled(false) {} -// void CCPACSHulls::RegisterInvalidationCallback(std::function const& fn){ -// invalidationCallbacks.push_back(fn); -// } - CCPACSHull const& CCPACSHulls::GetHull(std::string const& uid) const { return const_cast(*this).GetHull(uid); @@ -51,20 +44,4 @@ CCPACSHull& CCPACSHulls::GetHull(std::string const& uid) throw CTiglError("Could not find hull with uid" + uid); } - -bool CCPACSHulls::IsEnabled() const -{ - return enabled; -} - -void CCPACSHulls::SetEnabled(bool val) -{ - if (enabled != val) { - for (auto const& invalidator: invalidationCallbacks) { - invalidator(); - } - enabled = val; - } -} - } //namespace tigl diff --git a/src/fuelTanks/CCPACSHulls.h b/src/fuelTanks/CCPACSHulls.h index c889f714dc..4479bc12f7 100644 --- a/src/fuelTanks/CCPACSHulls.h +++ b/src/fuelTanks/CCPACSHulls.h @@ -32,21 +32,11 @@ class CCPACSHulls: public generated::CPACSHulls TIGL_EXPORT CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSHull const& GetHull(std::string const& uid) const; TIGL_EXPORT CCPACSHull& GetHull(std::string const& uid); - TIGL_EXPORT bool IsEnabled() const; - TIGL_EXPORT void SetEnabled(bool val=true); - - // //Any AbstractGeometricComponent, that shall be cut with ducts, can register its Invalidation - // //as a callback. - // TIGL_EXPORT void RegisterInvalidationCallback(std::function const&); - private: - bool enabled; - std::vector> invalidationCallbacks; }; } //namespace tigl From e22523d0ccf6da8f42d20b4c93cf3671e6153555 Mon Sep 17 00:00:00 2001 From: Alder Date: Mon, 18 Mar 2024 11:47:34 +0100 Subject: [PATCH 012/122] allow to directly refer to other CTiglRelativelyPositionedComponents for referencing --- src/fuelTanks/CCPACSHull.cpp | 2 +- src/geometry/CTiglRelativelyPositionedComponent.cpp | 6 ++++++ src/geometry/CTiglRelativelyPositionedComponent.h | 2 ++ .../TestData/simpletest-fuelTanks.cpacs.xml | 12 ++++++++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 68651b7df2..2a58a9327d 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -34,7 +34,7 @@ namespace tigl { CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) : generated::CPACSHull(parent, uidMgr) - , CTiglRelativelyPositionedComponent(static_cast(nullptr), &m_transformation) + , CTiglRelativelyPositionedComponent(GetParent()->GetParent()->GetParent()->GetParent()->GetParent(), &m_transformation) {} CCPACSConfiguration& CCPACSHull::GetConfiguration() const diff --git a/src/geometry/CTiglRelativelyPositionedComponent.cpp b/src/geometry/CTiglRelativelyPositionedComponent.cpp index 426a2d158c..1ca8c80fce 100644 --- a/src/geometry/CTiglRelativelyPositionedComponent.cpp +++ b/src/geometry/CTiglRelativelyPositionedComponent.cpp @@ -40,6 +40,12 @@ CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(MaybeOpti CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(MaybeOptionalPtr parentUid, MaybeOptionalPtr trans, boost::optional* symmetryAxis) : _parent(NULL), _parentUID(parentUid), _transformation(trans), _symmetryAxis(symmetryAxis){} +CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans) + : _parent(parent), _transformation(trans), _symmetryAxis(nullptr){} + +CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis) + : _parent(parent), _transformation(trans), _symmetryAxis(symmetryAxis){} + void CTiglRelativelyPositionedComponent::Reset() const { CTiglAbstractGeometricComponent::Reset(); diff --git a/src/geometry/CTiglRelativelyPositionedComponent.h b/src/geometry/CTiglRelativelyPositionedComponent.h index eadd7dd37a..c9b2c70cc8 100644 --- a/src/geometry/CTiglRelativelyPositionedComponent.h +++ b/src/geometry/CTiglRelativelyPositionedComponent.h @@ -120,6 +120,8 @@ class CTiglRelativelyPositionedComponent : public CTiglAbstractGeometricComponen TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(MaybeOptionalPtr parentUid, MaybeOptionalPtr trans); TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(MaybeOptionalPtr parentUid, MaybeOptionalPtr trans, boost::optional* symmetryAxis); + TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans); + TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis); TIGL_EXPORT void Reset() const; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index d3a5608d76..e9b9a89fb5 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -17,6 +17,9 @@ Simple fuselage + + 1 + 1.0 0.5 @@ -72,7 +75,7 @@ Fuselage Positioning 3 - 2 + 2.1 90 0 fuselage_1Section1ID @@ -140,7 +143,7 @@ Section 3 - 2 + 1 @@ -166,6 +169,11 @@ + + + 2 + + From e0c4709eb2471b99ea09621194f78639490b3a54 Mon Sep 17 00:00:00 2001 From: Alder Date: Mon, 18 Mar 2024 14:51:39 +0100 Subject: [PATCH 013/122] combine hull shapes in tank --- cpacs_gen_input/cpacs_schema.xsd | 2 +- src/api/tigl.h | 3 +- src/fuelTanks/CCPACSGenericFuelTank.cpp | 58 ++++++++- src/fuelTanks/CCPACSGenericFuelTank.h | 15 ++- src/fuelTanks/CCPACSHull.cpp | 4 +- src/fuelTanks/CCPACSHull.h | 1 - src/generated/CPACSGenericFuelTank.cpp | 46 +++---- src/generated/CPACSGenericFuelTank.h | 10 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 114 ++++++++++++++---- tests/unittests/tiglTanks.cpp | 2 +- 10 files changed, 197 insertions(+), 58 deletions(-) diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index a4d6fc63f1..c0fe72e375 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -34207,11 +34207,11 @@ The fuel tank volume type should also be used for the wing fuel tank + - Volume diff --git a/src/api/tigl.h b/src/api/tigl.h index f58c4093d8..b3fc5bbb99 100644 --- a/src/api/tigl.h +++ b/src/api/tigl.h @@ -232,7 +232,8 @@ TIGL_COMPONENT_ENGINE_PYLON, /**< The Component is a engine pylon */ TIGL_COMPONENT_ENGINE_NACELLE, /**< The Component is a engine nacelle */ TIGL_COMPONENT_FUSELAGE_WALL, /**< The Component is a fuselage wall */ TIGL_COMPONENT_CONTROL_SURFACE_DEVICE, /**< The component is a control surface device (flap) */ -TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ +TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ +TIGL_COMPONENT_FUSELAGE_TANK, /**< The Component is a fuselage tank */ TIGL_COMPONENT_FUSELAGE_TANK_HULL, /**< The Component is a hull of a fuselage tank */ TIGL_COMPONENT_OTHER }; diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp index b533728678..3c74c4623f 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -20,14 +20,68 @@ */ #include "CCPACSGenericFuelTank.h" +#include "CCPACSHull.h" #include "CTiglError.h" - -#include +#include "CGroupShapes.h" namespace tigl { CCPACSGenericFuelTank::CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) : generated::CPACSGenericFuelTank(parent, uidMgr) + , CTiglRelativelyPositionedComponent(GetParent()->GetParent()->GetParent(), &m_transformation) {} +CCPACSConfiguration& CCPACSGenericFuelTank::GetConfiguration() const +{ + return GetParent()->GetParent()->GetParent()->GetConfiguration(); +} + +std::string CCPACSGenericFuelTank::GetDefaultedUID() const +{ + return generated::CPACSGenericFuelTank::GetUID(); +} + +TiglGeometricComponentType CCPACSGenericFuelTank::GetComponentType() const +{ + return TIGL_COMPONENT_FUSELAGE_TANK; +} + +TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const +{ + // needs to be physical, so that transformation relative to parent works + return TIGL_INTENT_PHYSICAL; +} + +PNamedShape CCPACSGenericFuelTank::BuildLoft() const +{ + const auto& hulls = GetHulls_choice1()->GetHulls(); + ListPNamedShape shapes; + + for (const auto& hull : hulls) { + auto loft = hull->GetLoft(); + shapes.push_back(loft); + } + + PNamedShape groupedShape = CGroupShapes(shapes); + + return groupedShape; +} + +std::string CCPACSGenericFuelTank::GetShortShapeName() const +{ + unsigned int findex = 0; + unsigned int i = 0; + + for (auto& t: GetParent()->GetGenericFuelTanks()) { + ++i; + if (GetUID() == t->GetUID()) { + findex = i; + std::stringstream shortName; + shortName << "D" << findex; + return shortName.str(); + } + } + return "UNKNOWN"; +} + } //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSGenericFuelTank.h index d806cb4910..2cb22ee11a 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.h +++ b/src/fuelTanks/CCPACSGenericFuelTank.h @@ -22,16 +22,29 @@ #pragma once #include "generated/CPACSGenericFuelTank.h" +#include "CTiglRelativelyPositionedComponent.h" +#include "CCPACSConfiguration.h" namespace tigl { -class CCPACSGenericFuelTank: public generated::CPACSGenericFuelTank +class CCPACSGenericFuelTank: public generated::CPACSGenericFuelTank, public CTiglRelativelyPositionedComponent { public: TIGL_EXPORT CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + + TIGL_EXPORT std::string GetDefaultedUID() const override; + TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; + TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; + private: + PNamedShape BuildLoft() const override; + +private: + + std::string GetShortShapeName() const; }; diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 2a58a9327d..e247b58f31 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -34,12 +34,12 @@ namespace tigl { CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) : generated::CPACSHull(parent, uidMgr) - , CTiglRelativelyPositionedComponent(GetParent()->GetParent()->GetParent()->GetParent()->GetParent(), &m_transformation) + , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation) {} CCPACSConfiguration& CCPACSHull::GetConfiguration() const { - return GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetConfiguration(); + return GetParent()->GetParent()->GetConfiguration(); } std::string CCPACSHull::GetDefaultedUID() const diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 7086ab46c5..64740f7e34 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -24,7 +24,6 @@ #include "generated/CPACSHull.h" #include "CTiglRelativelyPositionedComponent.h" #include "CCPACSConfiguration.h" -#include "CCPACSHulls.h" namespace tigl { diff --git a/src/generated/CPACSGenericFuelTank.cpp b/src/generated/CPACSGenericFuelTank.cpp index 708e77f94f..132d503296 100644 --- a/src/generated/CPACSGenericFuelTank.cpp +++ b/src/generated/CPACSGenericFuelTank.cpp @@ -114,6 +114,14 @@ namespace generated } } + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + // read element hulls if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { m_hulls_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); @@ -136,14 +144,6 @@ namespace generated } } - // read element transformation - if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { - m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); - } - else { - LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; - } - // read element volume if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { m_volume = boost::in_place(reinterpret_cast(this)); @@ -168,7 +168,7 @@ namespace generated void CPACSGenericFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "name", "description", "hulls", "designParameters", "transformation", "volume", "burstPressure" }; + const std::vector childElemOrder = { "name", "description", "transformation", "hulls", "designParameters", "volume", "burstPressure" }; // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); @@ -188,6 +188,10 @@ namespace generated } } + // write element transformation + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + // write element hulls if (m_hulls_choice1) { tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); @@ -210,10 +214,6 @@ namespace generated } } - // write element transformation - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); - m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); - // write element volume if (m_volume) { tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); @@ -306,6 +306,16 @@ namespace generated m_description = value; } + const CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() + { + return m_transformation; + } + const boost::optional& CPACSGenericFuelTank::GetHulls_choice1() const { return m_hulls_choice1; @@ -326,16 +336,6 @@ namespace generated return m_designParameters_choice2; } - const CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() const - { - return m_transformation; - } - - CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() - { - return m_transformation; - } - const boost::optional& CPACSGenericFuelTank::GetVolume() const { return m_volume; diff --git a/src/generated/CPACSGenericFuelTank.h b/src/generated/CPACSGenericFuelTank.h index 02cb40ea48..8103195527 100644 --- a/src/generated/CPACSGenericFuelTank.h +++ b/src/generated/CPACSGenericFuelTank.h @@ -73,15 +73,15 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetDescription() const; TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + TIGL_EXPORT virtual const boost::optional& GetHulls_choice1() const; TIGL_EXPORT virtual boost::optional& GetHulls_choice1(); TIGL_EXPORT virtual const boost::optional& GetDesignParameters_choice2() const; TIGL_EXPORT virtual boost::optional& GetDesignParameters_choice2(); - TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; - TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const boost::optional& GetVolume() const; TIGL_EXPORT virtual boost::optional& GetVolume(); @@ -110,12 +110,12 @@ namespace generated /// Description boost::optional m_description; + CCPACSTransformation m_transformation; + boost::optional m_hulls_choice1; boost::optional m_designParameters_choice2; - CCPACSTransformation m_transformation; - /// Volume boost::optional m_volume; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index e9b9a89fb5..d47bf0e35c 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -75,7 +75,7 @@ Fuselage Positioning 3 - 2.1 + 3.1 90 0 fuselage_1Section1ID @@ -98,6 +98,11 @@ Simple tank + + + 1 + + Outer hull @@ -109,7 +114,7 @@ -

+
Section 1 @@ -117,37 +122,109 @@ - + Section 1 Element 1 fuselageCircleProfileuID
-
+
Section 2 - 1.5 + 1 - + Section 2 Element 1 fuselageCircleProfileuID
-
+
Section 3 + + + 1.5 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + +
+ + + + Outer hull Segment 1 + outerHull_section1_element1 + outerHull_section2_element1 + + + Outer hull Segment 2 + outerHull_section2_element1 + outerHull_section3_element1 + + + + + Inner hull + + + 0.2 + + + 0.8 + 0.2 + 0.2 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 2 1 - + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 1.5 + + + + Section 3 Element 1 fuselageCircleProfileuID @@ -156,24 +233,19 @@
- - Hull 1 Segment 1 - hull1_section1_element1 - hull1_section2_element1 + + Inner hull Segment 1 + innerHull_section1_element1 + innerHull_section2_element1 - - Hull 1 Segment 2 - hull1_section2_element1 - hull1_section3_element1 + + Inner hull Segment 2 + innerHull_section2_element1 + innerHull_section3_element1
- - - 2 - - diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index bc548373bf..71e4dac3d9 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -98,7 +98,7 @@ TEST_F(FuselageTank, getName) TEST_F(FuselageTank, countHulls) { - EXPECT_EQ(hulls.size(), 1); + EXPECT_EQ(hulls.size(), 2); } TEST_F(FuselageTank, testLoft) From 0eca07e5566851df82b14b3baa2c5d638e1fb27f Mon Sep 17 00:00:00 2001 From: Alder Date: Tue, 19 Mar 2024 20:21:29 +0100 Subject: [PATCH 014/122] add additional hull tests in c++ and python --- bindings/python_internal/configuration.i | 27 +++++++--- src/fuelTanks/CCPACSHull.cpp | 67 ++++++++++++++++++++++++ src/fuelTanks/CCPACSHull.h | 15 ++++++ tests/unittests/fuelTanks-tests.py | 22 -------- tests/unittests/test_fuelTanks.py | 38 ++++++++------ tests/unittests/tiglTanks.cpp | 10 ++++ 6 files changed, 134 insertions(+), 45 deletions(-) delete mode 100644 tests/unittests/fuelTanks-tests.py diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 6967e4b8c7..fabae86012 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -97,7 +97,12 @@ #include "CCPACSDuctAssembly.h" #include "CCPACSDuct.h" #include "generated/CPACSFuselageFuelTanks.h" -#include "generated/CPACSGenericFuelTanks.h" +#include "CCPACSGenericFuelTanks.h" +#include "CCPACSGenericFuelTank.h" +#include "CCPACSHulls.h" +#include "CCPACSHull.h" + + %} %feature("autodoc", "3"); @@ -328,14 +333,22 @@ namespace tigl %include "CPACSRotorHubHinge_type.h" // --------------- Fuselage tanks -----------------// -// ToDo: Check which classes need to be assigned to boost_optional -%boost_optional(tigl::generated::CPACSGenericFuelTanks) +%boost_optional(tigl::CCPACSGenericFuelTanks) %boost_optional(tigl::generated::CPACSFuselageFuelTanks) -%include "generated/CPACSGenericFuelTanks.h" +namespace tigl { +class CCPACSFuselageSegments; +} +%include "CTiglFuselageConnection.h" +%include "CCPACSFuselageSegment.h" +%include "CCPACSFuselageSegments.h" +%include "CCPACSGenericFuelTanks.h" +%include "CCPACSGenericFuelTank.h" +%include "CCPACSHulls.h" +%include "CCPACSHull.h" %include "generated/CPACSFuselageFuelTanks.h" -// -------------------- Wing Structure -------------------// +// -------------------- Wing Structure -------------------// namespace tigl { class CCPACSWingCSStructure; @@ -545,7 +558,9 @@ class CCPACSWingRibsPositioning; tigl::CCPACSEnginePylon, tigl::CCPACSTrailingEdgeDevice, tigl::CCPACSDuct, - tigl::CCPACSDuctAssembly + tigl::CCPACSDuctAssembly, + tigl::CCPACSGenericFuelTank, + tigl::CCPACSHull ); namespace tigl diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index e247b58f31..791fd9a943 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -29,6 +29,11 @@ #include "CCPACSGenericFuelTank.h" #include "CCPACSGenericFuelTanks.h" +#include "GProp_GProps.hxx" +#include "BRepGProp.hxx" +#include "TopTools_IndexedMapOfShape.hxx" +#include "TopExp.hxx" + namespace tigl { @@ -58,6 +63,68 @@ TiglGeometricComponentIntent CCPACSHull::GetComponentIntent() const return TIGL_INTENT_PHYSICAL; } +int CCPACSHull::GetSectionCount() const +{ + return m_sections.GetSectionCount(); +} + +int CCPACSHull::GetSegmentCount() const +{ + return m_segments.GetSegmentCount(); +} + +CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) +{ + return m_segments.GetSegment(index); +} + +const CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) const +{ + return m_segments.GetSegment(index); +} + +CCPACSFuselageSegment& CCPACSHull::GetSegment(std::string uid) +{ + return m_segments.GetSegment(uid); +} + +double CCPACSHull::GetVolume() +{ + const TopoDS_Shape fusedSegments = GetLoft()->Shape(); + + GProp_GProps hull; + BRepGProp::VolumeProperties(fusedSegments, hull); + double myVolume = hull.Mass(); + return myVolume; +} + +double CCPACSHull::GetSurfaceArea() +{ + const PNamedShape& fusedSegments = GetLoft(); + + // loop over all faces that are not symmetry, front or rear + double myArea = 0.; + + TopTools_IndexedMapOfShape shapeMap; + TopExp::MapShapes(fusedSegments->Shape(), TopAbs_FACE, shapeMap); + for (int i = 1; i <= shapeMap.Extent(); ++i) { + if (GetUID() == fusedSegments->GetFaceTraits(i-1).Name()) { + const TopoDS_Face& f = TopoDS::Face(shapeMap(i)); + GProp_GProps System; + BRepGProp::SurfaceProperties(f, System); + myArea += System.Mass(); + } + } + + // Calculate surface area + return myArea; +} + +double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) +{ + return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); +} + PNamedShape CCPACSHull::BuildLoft() const { TiglContinuity cont = m_segments.GetSegment(1).GetContinuity(); diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 64740f7e34..30694afaae 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -40,6 +40,21 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; + TIGL_EXPORT int GetSectionCount() const; + + TIGL_EXPORT int GetSegmentCount() const; + + TIGL_EXPORT CCPACSFuselageSegment& GetSegment(const int index); + TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(const int index) const; + TIGL_EXPORT CCPACSFuselageSegment& GetSegment(std::string uid); + + TIGL_EXPORT double GetVolume(); + + TIGL_EXPORT double GetSurfaceArea(); + + TIGL_EXPORT double GetCircumference(int segmentIndex, double eta); + + protected: PNamedShape BuildLoft() const override; diff --git a/tests/unittests/fuelTanks-tests.py b/tests/unittests/fuelTanks-tests.py deleted file mode 100644 index a8df3dd1b2..0000000000 --- a/tests/unittests/fuelTanks-tests.py +++ /dev/null @@ -1,22 +0,0 @@ -import unittest - -from tigl3.tigl3wrapper import * -from tixi3.tixi3wrapper import * - -class TestFuelTanks(unittest.TestCase): - - def setUp(self): - self.tixi = Tixi3() - self.tigl = Tigl3() - self.tixi.open('TestData/simpletest.cpacs.xml') - self.tigl.open(self.tixi, '') - - def tearDown(self): - self.tigl.close() - self.tixi.close() - - def test_tiglGetVersion(self): - print('TIGL-Version: ' + self.tigl.version) - -if __name__ == '__main__': - unittest.main() \ No newline at end of file diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 04498d3ebf..bdb230bea2 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -4,31 +4,35 @@ from tixi3.tixi3wrapper import * from tigl3 import configuration + class FuselageTank(unittest.TestCase): def setUp(self): self.tixi = Tixi3() self.tigl = Tigl3() - self.assertIsNone(self.tixi.open('TestData/simpletest.cpacs.xml')) - self.assertIsNone(self.tigl.open(self.tixi, '')) - + self.assertIsNone(self.tixi.open("TestData/simpletest-fuelTanks.cpacs.xml")) + self.assertIsNone(self.tigl.open(self.tixi, "")) + mgr = configuration.CCPACSConfigurationManager_get_instance() uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() - fuselage = uid_mgr.get_geometric_component('SimpleFuselage') - fuelTanks = fuselage.get_fuel_tanks() - # help(fuselage) - print(fuelTanks) - - + + self.fuelTank = uid_mgr.get_geometric_component("genericTank1") + self.hull = uid_mgr.get_geometric_component("outerHull") + def tearDown(self): self.tigl.close() self.tixi.close() - def test_tiglGetVersion(self): - print('TIGL-Version: ' + self.tigl.version) - - def test_true(self): - self.assertTrue(True) - -if __name__ == '__main__': - unittest.main() \ No newline at end of file + def test_fuelTank(self): + print("Intend: " + self.tigl.version) + + def test_hull(self): + self.assertEqual(self.hull.get_section_count(), 3) + self.assertEqual(self.hull.get_segment_count(), 2) + self.assertEqual(self.hull.get_volume(), 0.41085764204179498) + self.assertEqual(self.hull.get_surface_area(), 2.7879599486116566) + self.assertEqual(self.hull.get_circumference(1, 0.5), 1.8586415856382374) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 71e4dac3d9..42612c94cb 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -85,6 +85,7 @@ class FuselageTank : public ::testing::Test // hulls const std::vector> &hulls = fuelTank->GetHulls_choice1()->GetHulls(); + tigl::CCPACSHull *hull = &uidMgr.ResolveObject("outerHull"); }; TixiDocumentHandle FuselageTank::tixiHandle = 0; @@ -105,4 +106,13 @@ TEST_F(FuselageTank, testLoft) { const std::unique_ptr &hull = hulls.at(0); const PNamedShape &loft = hull->GetLoft(); +} + +TEST_F(FuselageTank, hull) +{ + EXPECT_EQ(hull->GetSectionCount(), 3); + EXPECT_EQ(hull->GetSegmentCount(), 2); + EXPECT_EQ(hull->GetVolume(),0.41085764204179498); + EXPECT_EQ(hull->GetSurfaceArea(), 2.7879599486116566); + EXPECT_EQ(hull->GetCircumference(1, 0.5), 1.8586415856382374); } \ No newline at end of file From a55b3aded6885d64ac6c1b4852c8814ced0b426b Mon Sep 17 00:00:00 2001 From: Alder Date: Tue, 19 Mar 2024 22:47:35 +0100 Subject: [PATCH 015/122] add further tests --- src/fuelTanks/CCPACSHull.cpp | 24 ++++++++++++++++++++++++ src/fuelTanks/CCPACSHull.h | 5 ++++- tests/unittests/test_fuelTanks.py | 21 ++++++++++++++++++--- tests/unittests/tiglTanks.cpp | 16 +++++++++++++--- 4 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 791fd9a943..09fe470814 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -68,6 +68,30 @@ int CCPACSHull::GetSectionCount() const return m_sections.GetSectionCount(); } +CCPACSFuselageSection& CCPACSHull::GetSection(int index) const +{ + return m_sections.GetSection(index); +} + +TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const +{ + // search for the section in all segments + for (int n = 0; n < GetSegmentCount(); ++n) { + const CCPACSFuselageSegment& segment = GetSegment(n+1); + + if ( section_uid == segment.GetStartSectionUID() ) { + return BuildFace( segment.GetStartWire() ); + } + else if ( section_uid == segment.GetEndSectionUID() ) { + return BuildFace( segment.GetEndWire() ); + } + } + throw CTiglError("GetSectionFace: Could not find a section for the given UID"); + return TopoDS_Shape(); +} + + + int CCPACSHull::GetSegmentCount() const { return m_segments.GetSegmentCount(); diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 30694afaae..40e46a69d8 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -40,10 +40,13 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; + // Section operations TIGL_EXPORT int GetSectionCount() const; + TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; + TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string section_uid) const; + // Segment operations TIGL_EXPORT int GetSegmentCount() const; - TIGL_EXPORT CCPACSFuselageSegment& GetSegment(const int index); TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(const int index) const; TIGL_EXPORT CCPACSFuselageSegment& GetSegment(std::string uid); diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index bdb230bea2..e879e77f6e 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -4,6 +4,8 @@ from tixi3.tixi3wrapper import * from tigl3 import configuration +from OCC.Core.TopoDS import TopoDS_Face + class FuselageTank(unittest.TestCase): @@ -29,9 +31,22 @@ def test_fuelTank(self): def test_hull(self): self.assertEqual(self.hull.get_section_count(), 3) self.assertEqual(self.hull.get_segment_count(), 2) - self.assertEqual(self.hull.get_volume(), 0.41085764204179498) - self.assertEqual(self.hull.get_surface_area(), 2.7879599486116566) - self.assertEqual(self.hull.get_circumference(1, 0.5), 1.8586415856382374) + self.assertAlmostEqual(round(self.hull.get_volume(), 2), 0.41) + self.assertAlmostEqual(round(self.hull.get_surface_area(), 2), 2.79) + self.assertAlmostEqual(round(self.hull.get_circumference(1, 0.5), 2), 1.86) + + self.assertEqual(self.hull.get_segment_count(), 2) + self.assertIsInstance( + self.hull.get_segment(1), configuration.CCPACSFuselageSegment + ) + + self.assertEqual(self.hull.get_section_count(), 3) + self.assertIsInstance( + self.hull.get_section(1), configuration.CCPACSFuselageSection + ) + self.assertIsInstance( + self.hull.get_section_face("outerHull_section3"), TopoDS_Face + ) if __name__ == "__main__": diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 42612c94cb..5ede64acc5 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -112,7 +112,17 @@ TEST_F(FuselageTank, hull) { EXPECT_EQ(hull->GetSectionCount(), 3); EXPECT_EQ(hull->GetSegmentCount(), 2); - EXPECT_EQ(hull->GetVolume(),0.41085764204179498); - EXPECT_EQ(hull->GetSurfaceArea(), 2.7879599486116566); - EXPECT_EQ(hull->GetCircumference(1, 0.5), 1.8586415856382374); + EXPECT_NEAR(hull->GetVolume(), 0.41, 1e-2); + EXPECT_NEAR(hull->GetSurfaceArea(), 2.79, 1e-2); + EXPECT_NEAR(hull->GetCircumference(1, 0.5), 1.86, 1e-2); + + EXPECT_EQ(hull->GetSectionCount(), 3); + EXPECT_NO_THROW(hull->GetSection(1)); + EXPECT_NO_THROW(hull->GetSectionFace("outerHull_section1")); + EXPECT_THROW(hull->GetSection(4), tigl::CTiglError); + + EXPECT_EQ(hull->GetSegmentCount(), 2); + EXPECT_NO_THROW(hull->GetSegment(1)); + EXPECT_NO_THROW(hull->GetSegment("outerHull_segment1")); + EXPECT_THROW(hull->GetSegment(3), tigl::CTiglError); } \ No newline at end of file From 2dbe361a8cf8995afbd69dd962f6355f25756592 Mon Sep 17 00:00:00 2001 From: Alder Date: Wed, 20 Mar 2024 22:11:36 +0100 Subject: [PATCH 016/122] add hull methods and corresponding tests --- src/cpacs_other/CCPACSAircraftModel.cpp | 2 +- src/fuelTanks/CCPACSHull.cpp | 69 ++++++++++++++++++++++--- src/fuelTanks/CCPACSHull.h | 42 +++++++++++++-- src/fuelTanks/CCPACSHulls.cpp | 25 +++++++++ src/fuelTanks/CCPACSHulls.h | 14 ++++- tests/unittests/test_fuelTanks.py | 14 +++-- tests/unittests/tiglTanks.cpp | 23 +++++---- 7 files changed, 164 insertions(+), 25 deletions(-) diff --git a/src/cpacs_other/CCPACSAircraftModel.cpp b/src/cpacs_other/CCPACSAircraftModel.cpp index e80663a3ec..a40d4c9a3b 100644 --- a/src/cpacs_other/CCPACSAircraftModel.cpp +++ b/src/cpacs_other/CCPACSAircraftModel.cpp @@ -8,7 +8,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. -* You may obtain a copy of the License at +* You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 09fe470814..db7542a7fd 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -38,7 +38,7 @@ namespace tigl { CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) - : generated::CPACSHull(parent, uidMgr) + : generated::CPACSHull(parent, uidMgr) , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation) {} @@ -90,8 +90,6 @@ TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const return TopoDS_Shape(); } - - int CCPACSHull::GetSegmentCount() const { return m_segments.GetSegmentCount(); @@ -177,18 +175,77 @@ PNamedShape CCPACSHull::BuildLoft() const return loft; } +gp_Pnt CCPACSHull::GetPoint(int segmentIndex, double eta, double zeta) +{ + return ((CCPACSFuselageSegment &) GetSegment(segmentIndex)).GetPoint(eta, zeta, getPointBehavior); +} + +// Sets the GetPoint behavior to asParameterOnSurface or onLinearLoft +void CCPACSHull::SetGetPointBehavior(TiglGetPointBehavior behavior) +{ + getPointBehavior = behavior; +} + +TiglGetPointBehavior CCPACSHull::GetGetPointBehavior() const +{ + return getPointBehavior; +} + +CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) +{ + return const_cast(static_cast(*this).GetGuideCurveSegment(uid)); +} + +const CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) const +{ + for (int i = 1; i <= m_segments.GetSegmentCount(); i++) { + const CCPACSFuselageSegment& segment = m_segments.GetSegment(i); + + if (!segment.GetGuideCurves()) { + continue; + } + + if (segment.GetGuideCurves()->GuideCurveExists(uid)) { + return segment.GetGuideCurves()->GetGuideCurve(uid); + } + } + throw tigl::CTiglError("Guide Curve with UID " + uid + " does not exists", TIGL_ERROR); +} + +std::vector CCPACSHull::GetGuideCurvePoints() const +{ + std::vector points; + + // connect the belonging guide curve segments + for (int isegment = 1; isegment <= GetSegmentCount(); ++isegment) { + const CCPACSFuselageSegment& segment = m_segments.GetSegment(isegment); + + if (!segment.GetGuideCurves()) { + continue; + } + + const CCPACSGuideCurves& segmentCurves = *segment.GetGuideCurves(); + for (int iguide = 1; iguide <= segmentCurves.GetGuideCurveCount(); ++iguide) { + const CCPACSGuideCurve& curve = segmentCurves.GetGuideCurve(iguide); + std::vector curPoints = curve.GetCurvePoints(); + points.insert(points.end(), curPoints.begin(), curPoints.end()); + } + } + return points; +} + // get short name for loft std::string CCPACSHull::GetShortShapeName() const { unsigned int findex = 0; unsigned int i = 0; - for (auto& d: GetParent()->GetHulls()) { + for (auto& h: GetParent()->GetHulls()) { ++i; - if (GetUID() == d->GetUID()) { + if (GetUID() == h->GetUID()) { findex = i; std::stringstream shortName; - shortName << "D" << findex; + shortName << "H" << findex; return shortName.str(); } } diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 40e46a69d8..3a03f9b279 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -32,41 +32,75 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned { public: + // Constructor TIGL_EXPORT explicit CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); + // Get the parent configuration TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + // Get the default uID TIGL_EXPORT std::string GetDefaultedUID() const override; + + // Get the component type: TIGL_COMPONENT_FUSELAGE_TANK_HULL TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; + // Get the component intent: TIGL_INTENT_PHYSICAL TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; - // Section operations + // Get number of sections TIGL_EXPORT int GetSectionCount() const; + // Get a specific section TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; + // Get a section face TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string section_uid) const; - // Segment operations + // Get number of segments TIGL_EXPORT int GetSegmentCount() const; + // Get a specific segment via its index TIGL_EXPORT CCPACSFuselageSegment& GetSegment(const int index); TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(const int index) const; + // Get a specific segment via its uID TIGL_EXPORT CCPACSFuselageSegment& GetSegment(std::string uid); + // Get the volume of the hull TIGL_EXPORT double GetVolume(); + // Get the surface area of the hull TIGL_EXPORT double GetSurfaceArea(); + // Get the circumference of the hull TIGL_EXPORT double GetCircumference(int segmentIndex, double eta); + // Get a point on the given hull segment in dependence of a parameters eta and zeta with + // 0.0 <= eta <= 1.0 and 0.0 <= zeta <= 1.0. For eta = 0.0 the point lies on the start + // profile of the segment, for eta = 1.0 on the end profile of the segment. For zeta = 0.0 + // the point is the start point of the profile wire, for zeta = 1.0 the last profile wire point. + TIGL_EXPORT gp_Pnt GetPoint(int segmentIndex, double eta, double zeta); + // Set the getPointBehavior to asParameterOnSurface or onLinearLoft + TIGL_EXPORT void SetGetPointBehavior(TiglGetPointBehavior behavior = asParameterOnSurface); + // Get the getPointBehavior + TIGL_EXPORT TiglGetPointBehavior GetGetPointBehavior() const; + + // Get the guide curve segment (partial guide curve) with a given uID + TIGL_EXPORT CCPACSGuideCurve& GetGuideCurveSegment(std::string uid); + TIGL_EXPORT const CCPACSGuideCurve& GetGuideCurveSegment(std::string uid) const; + // Returns all guide curve points + TIGL_EXPORT std::vector GetGuideCurvePoints() const; + protected: + + // Build the loft PNamedShape BuildLoft() const override; + // Set the face traints + void SetFaceTraits (PNamedShape loft) const; + private: - // get short name for loft + // Get short name for loft std::string GetShortShapeName() const; - void SetFaceTraits (PNamedShape loft) const; + TiglGetPointBehavior getPointBehavior {asParameterOnSurface}; }; diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp index d72d6ca1c0..70c383ce0b 100644 --- a/src/fuelTanks/CCPACSHulls.cpp +++ b/src/fuelTanks/CCPACSHulls.cpp @@ -29,6 +29,11 @@ CCPACSHulls::CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) : generated::CPACSHulls(parent, uidMgr) {} +int CCPACSHulls::GetHullsCount() const +{ + return static_cast(m_hulls.size()); +} + CCPACSHull const& CCPACSHulls::GetHull(std::string const& uid) const { return const_cast(*this).GetHull(uid); @@ -44,4 +49,24 @@ CCPACSHull& CCPACSHulls::GetHull(std::string const& uid) throw CTiglError("Could not find hull with uid" + uid); } +CCPACSHull& CCPACSHulls::GetHull(int index) const +{ + index--; + if (index < 0 || index >= GetHullsCount()) { + throw CTiglError("Invalid index in CCPACSHulls::GetHull", TIGL_INDEX_ERROR); + } + return *m_hulls[index]; +} + +int CCPACSHulls::GetHullIndex(const std::string& UID) const +{ + for (int i=0; i < GetHullsCount(); i++) { + const std::string tmpUID(m_hulls[i]->GetUID()); + if (tmpUID == UID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CCPACSHulls::GetHullIndex", TIGL_UID_ERROR); +} + } //namespace tigl diff --git a/src/fuelTanks/CCPACSHulls.h b/src/fuelTanks/CCPACSHulls.h index 4479bc12f7..30584c6245 100644 --- a/src/fuelTanks/CCPACSHulls.h +++ b/src/fuelTanks/CCPACSHulls.h @@ -32,8 +32,18 @@ class CCPACSHulls: public generated::CPACSHulls TIGL_EXPORT CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSHull const& GetHull(std::string const& uid) const; - TIGL_EXPORT CCPACSHull& GetHull(std::string const& uid); + // Get a specific hull for a given uID + TIGL_EXPORT CCPACSHull const& GetHull(std::string const& uID) const; + TIGL_EXPORT CCPACSHull& GetHull(std::string const& uID); + + // Get a specific hull for a given index. + TIGL_EXPORT CCPACSHull& GetHull(int index) const; + + // Returns the hull index for a given uID. + TIGL_EXPORT int GetHullIndex(const std::string& uID) const; + + // Returns the total count of fuselages in a configuration + TIGL_EXPORT int GetHullsCount() const; private: diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index e879e77f6e..992fadbc50 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -25,9 +25,6 @@ def tearDown(self): self.tigl.close() self.tixi.close() - def test_fuelTank(self): - print("Intend: " + self.tigl.version) - def test_hull(self): self.assertEqual(self.hull.get_section_count(), 3) self.assertEqual(self.hull.get_segment_count(), 2) @@ -48,6 +45,17 @@ def test_hull(self): self.hull.get_section_face("outerHull_section3"), TopoDS_Face ) + self.assertEqual(self.hull.get_defaulted_uid(), "outerHull") + + self.assertIsInstance( + self.hull.get_configuration(), configuration.CCPACSConfiguration + ) + + point = self.hull.get_point(1, 0.5, 0.5) + self.assertAlmostEqual(round(point.X(), 2), 2.54) + self.assertAlmostEqual(round(point.Y(), 2), 0) + self.assertAlmostEqual(round(point.Z(), 2), -0.3) + if __name__ == "__main__": unittest.main() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 5ede64acc5..b71bb76f1c 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -84,7 +84,7 @@ class FuselageTank : public ::testing::Test tigl::CCPACSGenericFuelTank const *fuelTank = &uidMgr.ResolveObject("genericTank1"); // hulls - const std::vector> &hulls = fuelTank->GetHulls_choice1()->GetHulls(); + const boost::optional &hulls = fuelTank->GetHulls_choice1(); tigl::CCPACSHull *hull = &uidMgr.ResolveObject("outerHull"); }; @@ -97,15 +97,13 @@ TEST_F(FuselageTank, getName) EXPECT_EQ(name, "Simple tank"); } -TEST_F(FuselageTank, countHulls) +TEST_F(FuselageTank, hulls) { - EXPECT_EQ(hulls.size(), 2); -} - -TEST_F(FuselageTank, testLoft) -{ - const std::unique_ptr &hull = hulls.at(0); - const PNamedShape &loft = hull->GetLoft(); + EXPECT_EQ(hulls->GetHullsCount(), 2); + EXPECT_EQ(hulls->GetHull(1).GetDefaultedUID(), "outerHull"); + EXPECT_EQ(hulls->GetHull("outerHull").GetDefaultedUID(), "outerHull"); + EXPECT_EQ(hulls->GetHullIndex("outerHull"), 1); + EXPECT_EQ(hulls->GetHulls().at(0)->GetDefaultedUID(), "outerHull"); } TEST_F(FuselageTank, hull) @@ -125,4 +123,11 @@ TEST_F(FuselageTank, hull) EXPECT_NO_THROW(hull->GetSegment(1)); EXPECT_NO_THROW(hull->GetSegment("outerHull_segment1")); EXPECT_THROW(hull->GetSegment(3), tigl::CTiglError); + + EXPECT_EQ(hull->GetDefaultedUID(), "outerHull"); + EXPECT_NO_THROW(hull->GetConfiguration()); + + EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 2.54, 1e-2); + EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); + EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Z(), -0.3, 1e-1); } \ No newline at end of file From 4ba6e2c453da17cba0eeafc2d52a83fd902a7543 Mon Sep 17 00:00:00 2001 From: Alder Date: Wed, 20 Mar 2024 23:27:13 +0100 Subject: [PATCH 017/122] CCPACSGenericFuelTank: add getter for hulls; add c++ and python tests --- bindings/python_internal/configuration.i | 2 ++ tests/unittests/test_fuelTanks.py | 9 ++++++++- tests/unittests/tiglTanks.cpp | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index fabae86012..967341e26f 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -335,9 +335,11 @@ namespace tigl // --------------- Fuselage tanks -----------------// %boost_optional(tigl::CCPACSGenericFuelTanks) %boost_optional(tigl::generated::CPACSFuselageFuelTanks) +%boost_optional(tigl::CCPACSHulls) namespace tigl { class CCPACSFuselageSegments; +class CCPACSHulls; } %include "CTiglFuselageConnection.h" %include "CCPACSFuselageSegment.h" diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 992fadbc50..99dd4be32c 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -17,13 +17,20 @@ def setUp(self): mgr = configuration.CCPACSConfigurationManager_get_instance() uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() - + self.fuelTank = uid_mgr.get_geometric_component("genericTank1") self.hull = uid_mgr.get_geometric_component("outerHull") + + # print(self.fuelTank.has_hulls()) def tearDown(self): self.tigl.close() self.tixi.close() + + def test_genericTank(self): + self.assertTrue(self.fuelTank.has_hulls(), True) + self.assertIsInstance(self.fuelTank.get_hulls(), configuration.CCPACSHulls) + # help(self.fuelTank.get_hulls()) def test_hull(self): self.assertEqual(self.hull.get_section_count(), 3) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index b71bb76f1c..b1983eee6b 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -97,6 +97,12 @@ TEST_F(FuselageTank, getName) EXPECT_EQ(name, "Simple tank"); } +TEST_F(FuselageTank, tank) +{ + EXPECT_TRUE(fuelTank->HasHulls()); + EXPECT_NO_THROW(fuelTank->GetHulls()); +} + TEST_F(FuselageTank, hulls) { EXPECT_EQ(hulls->GetHullsCount(), 2); From 3180c7ac6998bad9a001d81fcec8dfae44addf8c Mon Sep 17 00:00:00 2001 From: Alder Date: Wed, 20 Mar 2024 23:57:30 +0100 Subject: [PATCH 018/122] forgot to add src in previous commit... --- src/fuelTanks/CCPACSGenericFuelTank.cpp | 30 +++++++++++++++++++++++++ src/fuelTanks/CCPACSGenericFuelTank.h | 7 ++++++ 2 files changed, 37 insertions(+) diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp index 3c74c4623f..789c24c2ed 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -52,6 +52,36 @@ TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const return TIGL_INTENT_PHYSICAL; } +bool CCPACSGenericFuelTank::HasHulls() const +{ + if (GetHulls_choice1()->GetHullsCount()>0) { + return true; + } + else { + return false; + } +} + +boost::optional& CCPACSGenericFuelTank::GetHulls() +{ + if (HasHulls()) { + return GetHulls_choice1(); + } + else { + throw CTiglError("No hulls defined."); + } +} + +const boost::optional& CCPACSGenericFuelTank::GetHulls() const +{ + if (HasHulls()) { + return GetHulls_choice1(); + } + else { + throw CTiglError("No hulls defined."); + } +} + PNamedShape CCPACSGenericFuelTank::BuildLoft() const { const auto& hulls = GetHulls_choice1()->GetHulls(); diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSGenericFuelTank.h index 2cb22ee11a..de11ac770e 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.h +++ b/src/fuelTanks/CCPACSGenericFuelTank.h @@ -39,6 +39,13 @@ class CCPACSGenericFuelTank: public generated::CPACSGenericFuelTank, public CTig TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; + // Check if hulls are available + TIGL_EXPORT bool HasHulls() const; + + // Get hulls + TIGL_EXPORT boost::optional& GetHulls(); + TIGL_EXPORT const boost::optional& GetHulls() const; + private: PNamedShape BuildLoft() const override; From ccd28ad7bf5c50feb6c49eed0010f9b1b0e2a4cc Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 21 Mar 2024 00:19:16 +0100 Subject: [PATCH 019/122] swig expose CPACSGenericFuelTank --- bindings/python_internal/configuration.i | 7 +++++++ tests/unittests/test_fuelTanks.py | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 967341e26f..429f1b3d36 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -97,6 +97,8 @@ #include "CCPACSDuctAssembly.h" #include "CCPACSDuct.h" #include "generated/CPACSFuselageFuelTanks.h" +#include "generated/CPACSGenericFuelTank.h" +#include "generated/CPACSFuelTankVolume.h" #include "CCPACSGenericFuelTanks.h" #include "CCPACSGenericFuelTank.h" #include "CCPACSHulls.h" @@ -336,11 +338,15 @@ namespace tigl %boost_optional(tigl::CCPACSGenericFuelTanks) %boost_optional(tigl::generated::CPACSFuselageFuelTanks) %boost_optional(tigl::CCPACSHulls) +%boost_optional(tigl::generated::CPACSFuelTankVolume) namespace tigl { class CCPACSFuselageSegments; class CCPACSHulls; } + +%include "generated/CPACSFuelTankVolume.h" +%include "generated/CPACSGenericFuelTank.h" %include "CTiglFuselageConnection.h" %include "CCPACSFuselageSegment.h" %include "CCPACSFuselageSegments.h" @@ -350,6 +356,7 @@ class CCPACSHulls; %include "CCPACSHull.h" %include "generated/CPACSFuselageFuelTanks.h" + // -------------------- Wing Structure -------------------// namespace tigl { diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 99dd4be32c..ea6432485b 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -20,8 +20,6 @@ def setUp(self): self.fuelTank = uid_mgr.get_geometric_component("genericTank1") self.hull = uid_mgr.get_geometric_component("outerHull") - - # print(self.fuelTank.has_hulls()) def tearDown(self): self.tigl.close() @@ -30,7 +28,7 @@ def tearDown(self): def test_genericTank(self): self.assertTrue(self.fuelTank.has_hulls(), True) self.assertIsInstance(self.fuelTank.get_hulls(), configuration.CCPACSHulls) - # help(self.fuelTank.get_hulls()) + self.assertEqual(self.fuelTank.get_name(), "Simple tank") def test_hull(self): self.assertEqual(self.hull.get_section_count(), 3) From 366812673531efbb2f39f4c6bbb9d38b56d3a56a Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 21 Mar 2024 09:12:39 +0100 Subject: [PATCH 020/122] add CCPACSGenericFuelTanks methods; add python and c++ tests --- bindings/python_internal/configuration.i | 3 ++ src/fuelTanks/CCPACSGenericFuelTanks.cpp | 41 ++++++++++++++++++++++++ src/fuelTanks/CCPACSGenericFuelTanks.h | 13 ++++++++ src/fuelTanks/CCPACSHulls.cpp | 14 ++++---- tests/unittests/test_fuelTanks.py | 34 ++++++++++++++++++-- tests/unittests/tiglTanks.cpp | 13 +++++++- 6 files changed, 107 insertions(+), 11 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 429f1b3d36..d029eb7921 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -97,6 +97,7 @@ #include "CCPACSDuctAssembly.h" #include "CCPACSDuct.h" #include "generated/CPACSFuselageFuelTanks.h" +#include "generated/CPACSGenericFuelTanks.h" #include "generated/CPACSGenericFuelTank.h" #include "generated/CPACSFuelTankVolume.h" #include "CCPACSGenericFuelTanks.h" @@ -337,6 +338,7 @@ namespace tigl // --------------- Fuselage tanks -----------------// %boost_optional(tigl::CCPACSGenericFuelTanks) %boost_optional(tigl::generated::CPACSFuselageFuelTanks) +%boost_optional(tigl::generated::CPACSGenericFuelTanks) %boost_optional(tigl::CCPACSHulls) %boost_optional(tigl::generated::CPACSFuelTankVolume) @@ -345,6 +347,7 @@ class CCPACSFuselageSegments; class CCPACSHulls; } +%include "generated/CPACSGenericFuelTanks.h" %include "generated/CPACSFuelTankVolume.h" %include "generated/CPACSGenericFuelTank.h" %include "CTiglFuselageConnection.h" diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.cpp b/src/fuelTanks/CCPACSGenericFuelTanks.cpp index c59bbc3f3f..1e6f508c3a 100644 --- a/src/fuelTanks/CCPACSGenericFuelTanks.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTanks.cpp @@ -20,6 +20,7 @@ */ #include "CCPACSGenericFuelTanks.h" +#include "CCPACSGenericFuelTank.h" #include "CTiglError.h" namespace tigl { @@ -28,4 +29,44 @@ CCPACSGenericFuelTanks::CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks : generated::CPACSGenericFuelTanks(parent, uidMgr) {} +int CCPACSGenericFuelTanks::GetGenericFuelTanksCount() const +{ + return static_cast(m_genericFuelTanks.size()); +} + +CCPACSGenericFuelTank const& CCPACSGenericFuelTanks::GetGenericFuelTank(std::string const& uID) const +{ + return const_cast(*this).GetGenericFuelTank(uID); +} + +CCPACSGenericFuelTank& CCPACSGenericFuelTanks::GetGenericFuelTank(std::string const& uID) +{ + auto it = std::find_if(m_genericFuelTanks.begin(), m_genericFuelTanks.end(), [&](std::unique_ptr const& v){ return v->GetUID() == uID; }); + + if ( it != std::end(m_genericFuelTanks)) { + return **it; + } + throw CTiglError("Could not find genericFuelTank with uid" + uID); +} + +CCPACSGenericFuelTank& CCPACSGenericFuelTanks::GetGenericFuelTank(int index) const +{ + index--; + if (index < 0 || index >= GetGenericFuelTanksCount()) { + throw CTiglError("Invalid index in CCPACSGenericFuelTanks::GetGenericFuelTank", TIGL_INDEX_ERROR); + } + return *m_genericFuelTanks[index]; +} + +int CCPACSGenericFuelTanks::GetGenericFuelTankIndex(const std::string& uID) const +{ + for (int i=0; i < GetGenericFuelTanksCount(); i++) { + const std::string tmpUID(m_genericFuelTanks[i]->GetUID()); + if (tmpUID == uID) { + return i+1; + } + } + throw CTiglError("Invalid UID in CCPACSGenericFuelTanks::GetGenericFuelTankIndex", TIGL_UID_ERROR); +} + } //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.h b/src/fuelTanks/CCPACSGenericFuelTanks.h index 2f18dd5a3a..9cae60fdb7 100644 --- a/src/fuelTanks/CCPACSGenericFuelTanks.h +++ b/src/fuelTanks/CCPACSGenericFuelTanks.h @@ -31,6 +31,19 @@ class CCPACSGenericFuelTanks: public generated::CPACSGenericFuelTanks TIGL_EXPORT CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); + // Get a specific hull for a given uID + TIGL_EXPORT CCPACSGenericFuelTank const& GetGenericFuelTank(std::string const& uID) const; + TIGL_EXPORT CCPACSGenericFuelTank& GetGenericFuelTank(std::string const& uID); + + // Get a specific hull for a given index. + TIGL_EXPORT CCPACSGenericFuelTank& GetGenericFuelTank(int index) const; + + // Returns the hull index for a given uID. + TIGL_EXPORT int GetGenericFuelTankIndex(const std::string& uID) const; + + // Returns the total count of fuselages in a configuration + TIGL_EXPORT int GetGenericFuelTanksCount() const; + private: }; diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp index 70c383ce0b..37ade6941f 100644 --- a/src/fuelTanks/CCPACSHulls.cpp +++ b/src/fuelTanks/CCPACSHulls.cpp @@ -34,19 +34,19 @@ int CCPACSHulls::GetHullsCount() const return static_cast(m_hulls.size()); } -CCPACSHull const& CCPACSHulls::GetHull(std::string const& uid) const +CCPACSHull const& CCPACSHulls::GetHull(std::string const& uID) const { - return const_cast(*this).GetHull(uid); + return const_cast(*this).GetHull(uID); } -CCPACSHull& CCPACSHulls::GetHull(std::string const& uid) +CCPACSHull& CCPACSHulls::GetHull(std::string const& uID) { - auto it = std::find_if(m_hulls.begin(), m_hulls.end(), [&](std::unique_ptr const& v){ return v->GetUID() == uid; }); + auto it = std::find_if(m_hulls.begin(), m_hulls.end(), [&](std::unique_ptr const& v){ return v->GetUID() == uID; }); if ( it != std::end(m_hulls)) { return **it; } - throw CTiglError("Could not find hull with uid" + uid); + throw CTiglError("Could not find hull with uid" + uID); } CCPACSHull& CCPACSHulls::GetHull(int index) const @@ -58,11 +58,11 @@ CCPACSHull& CCPACSHulls::GetHull(int index) const return *m_hulls[index]; } -int CCPACSHulls::GetHullIndex(const std::string& UID) const +int CCPACSHulls::GetHullIndex(const std::string& uID) const { for (int i=0; i < GetHullsCount(); i++) { const std::string tmpUID(m_hulls[i]->GetUID()); - if (tmpUID == UID) { + if (tmpUID == uID) { return i+1; } } diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index ea6432485b..a1b53a5866 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -17,20 +17,48 @@ def setUp(self): mgr = configuration.CCPACSConfigurationManager_get_instance() uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() - + self.fuelTank = uid_mgr.get_geometric_component("genericTank1") self.hull = uid_mgr.get_geometric_component("outerHull") def tearDown(self): self.tigl.close() self.tixi.close() - - def test_genericTank(self): + + def test_genericFuelTanks(self): + # Test custom class methods: + fuelTanks = self.fuelTank.get_parent() + self.assertIsInstance( + fuelTanks.get_generic_fuel_tank(1), configuration.CCPACSGenericFuelTank + ) + self.assertEqual( + fuelTanks.get_generic_fuel_tank(1).get_defaulted_uid(), "genericTank1" + ) + self.assertIsInstance( + fuelTanks.get_generic_fuel_tank("genericTank1"), + configuration.CCPACSGenericFuelTank, + ) + self.assertEqual( + fuelTanks.get_generic_fuel_tank_index("genericTank1"), + 1, + ) + self.assertEqual(fuelTanks.get_generic_fuel_tanks_count(), 1) + + # Test availability of generated class: + self.assertIsInstance( + fuelTanks.get_parent(), configuration.CPACSFuselageFuelTanks + ) + + def test_genericFuelTank(self): + # Test custom class methods: self.assertTrue(self.fuelTank.has_hulls(), True) self.assertIsInstance(self.fuelTank.get_hulls(), configuration.CCPACSHulls) + + # Test availability of generated class: self.assertEqual(self.fuelTank.get_name(), "Simple tank") def test_hull(self): + # Test custom class methods: self.assertEqual(self.hull.get_section_count(), 3) self.assertEqual(self.hull.get_segment_count(), 2) self.assertAlmostEqual(round(self.hull.get_volume(), 2), 0.41) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index b1983eee6b..01ea8eb96b 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -24,6 +24,7 @@ #include "tigl.h" #include "CCPACSGenericFuelTank.h" +#include "CCPACSGenericFuelTanks.h" #include "CCPACSConfigurationManager.h" #include "CTiglUIDManager.h" @@ -97,7 +98,17 @@ TEST_F(FuselageTank, getName) EXPECT_EQ(name, "Simple tank"); } -TEST_F(FuselageTank, tank) +TEST_F(FuselageTank, genericFuelTanks) +{ + std::string uID = "genericTank1"; + const tigl::CCPACSGenericFuelTanks* fuelTanks = fuelTank->GetParent(); + EXPECT_EQ(fuelTanks->GetGenericFuelTank(1).GetDefaultedUID(), uID); + EXPECT_NO_THROW(fuelTanks->GetGenericFuelTank(uID)); + EXPECT_EQ(fuelTanks->GetGenericFuelTankIndex(uID), 1); + EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 1); +} + +TEST_F(FuselageTank, genericFuelTank) { EXPECT_TRUE(fuelTank->HasHulls()); EXPECT_NO_THROW(fuelTank->GetHulls()); From 4122340753f1751f193e8ce86ec604c709e8f187 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 22 Mar 2024 11:42:29 +0100 Subject: [PATCH 021/122] expose generated hull classes and add corresponding python tests --- bindings/python_internal/configuration.i | 4 +++ tests/unittests/test_fuelTanks.py | 32 +++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index d029eb7921..e7219896d2 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -102,7 +102,9 @@ #include "generated/CPACSFuelTankVolume.h" #include "CCPACSGenericFuelTanks.h" #include "CCPACSGenericFuelTank.h" +#include "generated/CPACSHulls.h" #include "CCPACSHulls.h" +#include "generated/CPACSHull.h" #include "CCPACSHull.h" @@ -355,7 +357,9 @@ class CCPACSHulls; %include "CCPACSFuselageSegments.h" %include "CCPACSGenericFuelTanks.h" %include "CCPACSGenericFuelTank.h" +%include "generated/CPACSHulls.h" %include "CCPACSHulls.h" +%include "generated/CPACSHull.h" %include "CCPACSHull.h" %include "generated/CPACSFuselageFuelTanks.h" diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index a1b53a5866..9d6abb7a83 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -28,18 +28,21 @@ def tearDown(self): def test_genericFuelTanks(self): # Test custom class methods: fuelTanks = self.fuelTank.get_parent() + tank1_uID = "genericTank1" + + ## Test accessability of childs: self.assertIsInstance( fuelTanks.get_generic_fuel_tank(1), configuration.CCPACSGenericFuelTank ) self.assertEqual( - fuelTanks.get_generic_fuel_tank(1).get_defaulted_uid(), "genericTank1" + fuelTanks.get_generic_fuel_tank(1).get_defaulted_uid(), tank1_uID ) self.assertIsInstance( - fuelTanks.get_generic_fuel_tank("genericTank1"), + fuelTanks.get_generic_fuel_tank(tank1_uID), configuration.CCPACSGenericFuelTank, ) self.assertEqual( - fuelTanks.get_generic_fuel_tank_index("genericTank1"), + fuelTanks.get_generic_fuel_tank_index(tank1_uID), 1, ) self.assertEqual(fuelTanks.get_generic_fuel_tanks_count(), 1) @@ -57,6 +60,26 @@ def test_genericFuelTank(self): # Test availability of generated class: self.assertEqual(self.fuelTank.get_name(), "Simple tank") + def test_hulls(self): + # Test custom class methods: + hulls = self.hull.get_parent() + hull1_uID = "outerHull" + + ## Test accessability of childs: + self.assertIsInstance(hulls.get_hull(1), configuration.CCPACSHull) + self.assertEqual(hulls.get_hull(1).get_defaulted_uid(), hull1_uID) + self.assertIsInstance(hulls.get_hull(hull1_uID), configuration.CCPACSHull) + self.assertEqual( + hulls.get_hull_index(hull1_uID), + 1, + ) + self.assertEqual(hulls.get_hulls_count(), 2) + + # Test availability of generated class: + self.assertIsInstance( + hulls.get_parent(), configuration.CCPACSGenericFuelTank + ) + def test_hull(self): # Test custom class methods: self.assertEqual(self.hull.get_section_count(), 3) @@ -89,6 +112,9 @@ def test_hull(self): self.assertAlmostEqual(round(point.Y(), 2), 0) self.assertAlmostEqual(round(point.Z(), 2), -0.3) + # Test availability of generated class: + self.assertEqual(self.hull.get_name(), "Outer hull") + if __name__ == "__main__": unittest.main() From 79f2be34d8c46ea0b813aa34bff04500ce9a2405 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 22 Mar 2024 11:43:49 +0100 Subject: [PATCH 022/122] pretty print (black formatter) --- tests/unittests/test_fuelTanks.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 9d6abb7a83..6d4461a3a7 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -76,9 +76,7 @@ def test_hulls(self): self.assertEqual(hulls.get_hulls_count(), 2) # Test availability of generated class: - self.assertIsInstance( - hulls.get_parent(), configuration.CCPACSGenericFuelTank - ) + self.assertIsInstance(hulls.get_parent(), configuration.CCPACSGenericFuelTank) def test_hull(self): # Test custom class methods: From b52ed8d3ba77fd98f4fff153c093c920a8b26897 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 22 Mar 2024 15:20:49 +0100 Subject: [PATCH 023/122] add second tank with guide curves; add test cases; swig expose CCPACSGuideCurve --- bindings/python_internal/configuration.i | 1 + .../TestData/simpletest-fuelTanks.cpacs.xml | 251 +++++++++++++----- tests/unittests/test_fuelTanks.py | 19 +- tests/unittests/tiglTanks.cpp | 13 +- 4 files changed, 210 insertions(+), 74 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index e7219896d2..52372d0e9d 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -437,6 +437,7 @@ class CCPACSWingRibsPositioning; %include "CPACSGuideCurve_continuity.h" %include "generated/CPACSGuideCurve.h" %include "generated/CPACSGuideCurves.h" +%include "CCPACSGuideCurve.h" %include "CCPACSGuideCurves.h" %include "generated/CPACSCst2D.h" %include "ITiglWingProfileAlgo.h" diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index d47bf0e35c..a478c0e946 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -100,7 +100,7 @@ Simple tank - 1 + -0.2 @@ -247,78 +247,151 @@ + + Simple tank 2 + Test case for guide curves + + + 1.5 + + + + + Outer hull + + + 1 + 0.3 + 0.3 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + 0.01 + 0.01 + + + + +
+
+ Section 2 + + + 0.5 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 1 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + 0.01 + 0.01 + + + + +
+
+ + + Outer hull Segment 1 + genericTank2_outerHull_section1_element1 + genericTank2_outerHull_section2_element1 + + + Guide Segment 1 Upper + gc_upper + 0 + 0 + + + Guide Segment 1 Starbord + gc_starbord + 0.25 + 0.25 + + + Guide Segment 1 Lower + gc_lower + 0.5 + 0.5 + + + Guide Segment 1 Port + gc_port + 0.75 + 0.75 + + + + + Outer hull Segment 2 + genericTank2_outerHull_section2_element1 + genericTank2_outerHull_section3_element1 + + + Guide Segment 2 Upper + gc_upper + genericTank2_seg1_upper + 0 + + + Guide Segment 2 Starbord + gc_starbord + genericTank2_seg1_starbord + 0.25 + + + Guide Segment 2 Lower + gc_lower + genericTank2_seg1_lower + 0.5 + + + Guide Segment 2 Port + gc_port + genericTank2_seg1_port + 0.75 + + + + +
+
+
- @@ -334,6 +407,44 @@ + + + Upper Guide Curve Profile + This profile is used for tank test cases + + 0.3 + 0.5 + 0.0 + + + + Starbord Guide Curve Profile + This profile is used for tank test cases + + 0.0 + 0.5 + 0.3 + + + + Lower Guide Curve Profile + This profile is used for tank test cases + + -0.3 + 0.5 + 0.0 + + + + Port Guide Curve Profile + This profile is used for tank test cases + + 0.0 + 0.5 + -0.3 + + + \ No newline at end of file diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 6d4461a3a7..d7dd7c9423 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -20,6 +20,9 @@ def setUp(self): self.fuelTank = uid_mgr.get_geometric_component("genericTank1") self.hull = uid_mgr.get_geometric_component("outerHull") + self.hull_with_guides = uid_mgr.get_geometric_component( + "genericTank2_outerHull" + ) def tearDown(self): self.tigl.close() @@ -45,7 +48,7 @@ def test_genericFuelTanks(self): fuelTanks.get_generic_fuel_tank_index(tank1_uID), 1, ) - self.assertEqual(fuelTanks.get_generic_fuel_tanks_count(), 1) + self.assertEqual(fuelTanks.get_generic_fuel_tanks_count(), 2) # Test availability of generated class: self.assertIsInstance( @@ -106,10 +109,22 @@ def test_hull(self): ) point = self.hull.get_point(1, 0.5, 0.5) - self.assertAlmostEqual(round(point.X(), 2), 2.54) + self.assertAlmostEqual(round(point.X(), 2), 1.34) self.assertAlmostEqual(round(point.Y(), 2), 0) self.assertAlmostEqual(round(point.Z(), 2), -0.3) + point = self.hull_with_guides.get_guide_curve_points()[1] + self.assertAlmostEqual(round(point.X(), 2), 2.75, 1e-2) + self.assertAlmostEqual(round(point.Y(), 2), 0.0, 1e-5) + self.assertAlmostEqual(round(point.Z(), 2), -0.24, 1e-2) + + self.assertEqual( + self.hull_with_guides.get_guide_curve_segment( + "genericTank2_seg1_upper" + ).get_guide_curve_profile_uid(), + "gc_upper", + ) + # Test availability of generated class: self.assertEqual(self.hull.get_name(), "Outer hull") diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 01ea8eb96b..480c588e69 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -87,6 +87,7 @@ class FuselageTank : public ::testing::Test // hulls const boost::optional &hulls = fuelTank->GetHulls_choice1(); tigl::CCPACSHull *hull = &uidMgr.ResolveObject("outerHull"); + tigl::CCPACSHull *hull_with_guides = &uidMgr.ResolveObject("genericTank2_outerHull"); }; TixiDocumentHandle FuselageTank::tixiHandle = 0; @@ -105,7 +106,7 @@ TEST_F(FuselageTank, genericFuelTanks) EXPECT_EQ(fuelTanks->GetGenericFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(fuelTanks->GetGenericFuelTank(uID)); EXPECT_EQ(fuelTanks->GetGenericFuelTankIndex(uID), 1); - EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 1); + EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 2); } TEST_F(FuselageTank, genericFuelTank) @@ -144,7 +145,15 @@ TEST_F(FuselageTank, hull) EXPECT_EQ(hull->GetDefaultedUID(), "outerHull"); EXPECT_NO_THROW(hull->GetConfiguration()); - EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 2.54, 1e-2); + EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 1.34, 1e-2); EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Z(), -0.3, 1e-1); + + auto points = hull_with_guides->GetGuideCurvePoints(); + EXPECT_EQ(points.size(), 24); + EXPECT_NEAR(points.at(1).X(), 2.75, 1e-2); + EXPECT_NEAR(points.at(1).Y(), 0, 1e-5); + EXPECT_NEAR(points.at(1).Z(), -0.24, 1e-2); + + EXPECT_EQ(hull_with_guides->GetGuideCurveSegment("genericTank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); } \ No newline at end of file From 20b01087a6b665230eb23f69cca3c6c9075a6ee9 Mon Sep 17 00:00:00 2001 From: Alder Date: Tue, 26 Mar 2024 15:43:18 +0100 Subject: [PATCH 024/122] implement hull structure and corresponding tests --- bindings/python_internal/configuration.i | 6 +++ cpacs_gen_input/CustomTypes.txt | 3 +- src/fuelTanks/CCPACSHullStructure.cpp | 28 +++++++++++++ src/fuelTanks/CCPACSHullStructure.h | 37 ++++++++++++++++ src/fuselage/ITiglFuselageDuctStructure.h | 6 +-- src/generated/CPACSFramesAssembly.cpp | 14 +++---- src/generated/CPACSFramesAssembly.h | 12 ++---- src/generated/CPACSHull.cpp | 6 +-- src/generated/CPACSHull.h | 22 +++++----- src/generated/CPACSHullSkinLayers.cpp | 8 ++-- src/generated/CPACSHullSkinLayers.h | 12 +++--- src/generated/CPACSHullStructure.cpp | 20 ++++----- src/generated/CPACSHullStructure.h | 3 +- src/generated/CPACSStringersAssembly.cpp | 14 +++---- src/generated/CPACSStringersAssembly.h | 12 ++---- .../TestData/simpletest-fuelTanks.cpacs.xml | 42 +++++++++++++++++++ tests/unittests/test_fuelTanks.py | 10 +++++ tests/unittests/tiglTanks.cpp | 8 ++++ 18 files changed, 192 insertions(+), 71 deletions(-) create mode 100644 src/fuelTanks/CCPACSHullStructure.cpp create mode 100644 src/fuelTanks/CCPACSHullStructure.h diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 52372d0e9d..5b5d291fde 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -106,6 +106,9 @@ #include "CCPACSHulls.h" #include "generated/CPACSHull.h" #include "CCPACSHull.h" +#include "generated/CPACSHullStructure.h" +#include "CCPACSHullStructure.h" +#include "CCPACSFrame.h" %} @@ -343,12 +346,15 @@ namespace tigl %boost_optional(tigl::generated::CPACSGenericFuelTanks) %boost_optional(tigl::CCPACSHulls) %boost_optional(tigl::generated::CPACSFuelTankVolume) +%boost_optional(tigl::CCPACSHullStructure) namespace tigl { class CCPACSFuselageSegments; class CCPACSHulls; } +%include "generated/CPACSHullStructure.h" +%include "CCPACSHullStructure.h" %include "generated/CPACSGenericFuelTanks.h" %include "generated/CPACSFuelTankVolume.h" %include "generated/CPACSGenericFuelTank.h" diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index c2205f47b7..b9039d9459 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -154,4 +154,5 @@ CPACSDucts CCPACSDucts CPACSHull CCPACSHull CPACSHulls CCPACSHulls CPACSGenericFuelTank CCPACSGenericFuelTank -CPACSGenericFuelTanks CCPACSGenericFuelTanks \ No newline at end of file +CPACSGenericFuelTanks CCPACSGenericFuelTanks +CPACSHullStructure CCPACSHullStructure \ No newline at end of file diff --git a/src/fuelTanks/CCPACSHullStructure.cpp b/src/fuelTanks/CCPACSHullStructure.cpp new file mode 100644 index 0000000000..b5292af50a --- /dev/null +++ b/src/fuelTanks/CCPACSHullStructure.cpp @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2018 RISC Software GmbH +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "CCPACSHullStructure.h" +#include "CCPACSHull.h" + +namespace tigl +{ +CCPACSHullStructure::CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr) + : generated::CPACSHullStructure(parent, uidMgr) + , ITiglFuselageDuctStructure(parent) +{ +} + +} // namespace tigl diff --git a/src/fuelTanks/CCPACSHullStructure.h b/src/fuelTanks/CCPACSHullStructure.h new file mode 100644 index 0000000000..68aef14f9e --- /dev/null +++ b/src/fuelTanks/CCPACSHullStructure.h @@ -0,0 +1,37 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hulls handling routines. +*/ + +#pragma once + +#include "generated/CPACSHullStructure.h" +#include "CTiglRelativelyPositionedComponent.h" +#include "ITiglFuselageDuctStructure.h" + +namespace tigl +{ + +class CCPACSHullStructure : public generated::CPACSHullStructure, public ITiglFuselageDuctStructure +{ +public: + TIGL_EXPORT CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr); +}; + +} //namespace tigl diff --git a/src/fuselage/ITiglFuselageDuctStructure.h b/src/fuselage/ITiglFuselageDuctStructure.h index c0701b4de6..8cedf84071 100644 --- a/src/fuselage/ITiglFuselageDuctStructure.h +++ b/src/fuselage/ITiglFuselageDuctStructure.h @@ -33,8 +33,8 @@ class CCPACSFuselageStringerFramePosition; /** * @brief The ITiglFuselageDuctStructure class provides some common - * geometric functionality needed by structural elements of both - * ducts and fuselages + * geometric functionality needed by structural elements of + * ducts, fuselages, and hulls */ class ITiglFuselageDuctStructure { @@ -45,7 +45,7 @@ class ITiglFuselageDuctStructure TIGL_EXPORT TopoDS_Shape const& GetLoft() const; - // calculates the intersection of the stringer frame position with the parent loft (duct/fuselage) + // calculates the intersection of the stringer frame position with the parent loft (duct/fuselage/hull) TIGL_EXPORT gp_Lin Intersection(CCPACSFuselageStringerFramePosition const& pos) const; TIGL_EXPORT gp_Lin Intersection(gp_Pnt pRef, double angleRef) const; diff --git a/src/generated/CPACSFramesAssembly.cpp b/src/generated/CPACSFramesAssembly.cpp index ec015b5b52..e65d2630d8 100644 --- a/src/generated/CPACSFramesAssembly.cpp +++ b/src/generated/CPACSFramesAssembly.cpp @@ -19,8 +19,8 @@ #include #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" +#include "CCPACSHullStructure.h" #include "CPACSFramesAssembly.h" -#include "CPACSHullStructure.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } - CPACSFramesAssembly::CPACSFramesAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr) + CPACSFramesAssembly::CPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSHullStructure); + m_parentType = &typeid(CCPACSHullStructure); } CPACSFramesAssembly::~CPACSFramesAssembly() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSFramesAssembly.h b/src/generated/CPACSFramesAssembly.h index c43a725170..c96de805f2 100644 --- a/src/generated/CPACSFramesAssembly.h +++ b/src/generated/CPACSFramesAssembly.h @@ -32,11 +32,10 @@ class CTiglUIDObject; class CCPACSFrame; class CCPACSDuctStructure; class CCPACSFuselageStructure; +class CCPACSHullStructure; namespace generated { - class CPACSHullStructure; - // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure @@ -51,7 +50,7 @@ namespace generated public: TIGL_EXPORT CPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSFramesAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFramesAssembly(); @@ -64,7 +63,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -74,7 +73,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -114,7 +113,4 @@ namespace generated } // namespace generated // CPACSFramesAssembly is customized, use type CCPACSFramesAssembly directly - -// Aliases in tigl namespace -using CCPACSHullStructure = generated::CPACSHullStructure; } // namespace tigl diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSHull.cpp index d11bf9bbb8..a033f5174b 100644 --- a/src/generated/CPACSHull.cpp +++ b/src/generated/CPACSHull.cpp @@ -267,17 +267,17 @@ namespace generated return m_segments; } - const boost::optional& CPACSHull::GetStructure() const + const boost::optional& CPACSHull::GetStructure() const { return m_structure; } - boost::optional& CPACSHull::GetStructure() + boost::optional& CPACSHull::GetStructure() { return m_structure; } - CPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) + CCPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) { if (!m_structure) m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSHull.h index 94a2896b71..2433b459b7 100644 --- a/src/generated/CPACSHull.h +++ b/src/generated/CPACSHull.h @@ -21,10 +21,10 @@ #include #include #include +#include #include #include #include -#include "CPACSHullStructure.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -80,10 +80,10 @@ namespace generated TIGL_EXPORT virtual const CCPACSFuselageSegments& GetSegments() const; TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments(); - TIGL_EXPORT virtual const boost::optional& GetStructure() const; - TIGL_EXPORT virtual boost::optional& GetStructure(); + TIGL_EXPORT virtual const boost::optional& GetStructure() const; + TIGL_EXPORT virtual boost::optional& GetStructure(); - TIGL_EXPORT virtual CPACSHullStructure& GetStructure(CreateIfNotExistsTag); + TIGL_EXPORT virtual CCPACSHullStructure& GetStructure(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStructure(); protected: @@ -91,21 +91,21 @@ namespace generated CTiglUIDManager* m_uidMgr; - std::string m_uID; + std::string m_uID; /// Name - std::string m_name; + std::string m_name; /// Description - boost::optional m_description; + boost::optional m_description; - CCPACSTransformation m_transformation; + CCPACSTransformation m_transformation; - CCPACSFuselageSections m_sections; + CCPACSFuselageSections m_sections; - CCPACSFuselageSegments m_segments; + CCPACSFuselageSegments m_segments; - boost::optional m_structure; + boost::optional m_structure; private: CPACSHull(const CPACSHull&) = delete; diff --git a/src/generated/CPACSHullSkinLayers.cpp b/src/generated/CPACSHullSkinLayers.cpp index 4fe6cac8bb..b8fcf56532 100644 --- a/src/generated/CPACSHullSkinLayers.cpp +++ b/src/generated/CPACSHullSkinLayers.cpp @@ -17,8 +17,8 @@ #include #include +#include "CCPACSHullStructure.h" #include "CPACSHullSkinLayers.h" -#include "CPACSHullStructure.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSHullSkinLayers::CPACSHullSkinLayers(CPACSHullStructure* parent, CTiglUIDManager* uidMgr) + CPACSHullSkinLayers::CPACSHullSkinLayers(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CPACSHullStructure* CPACSHullSkinLayers::GetParent() const + const CCPACSHullStructure* CPACSHullSkinLayers::GetParent() const { return m_parent; } - CPACSHullStructure* CPACSHullSkinLayers::GetParent() + CCPACSHullStructure* CPACSHullSkinLayers::GetParent() { return m_parent; } diff --git a/src/generated/CPACSHullSkinLayers.h b/src/generated/CPACSHullSkinLayers.h index 427849fc7c..365b75134e 100644 --- a/src/generated/CPACSHullSkinLayers.h +++ b/src/generated/CPACSHullSkinLayers.h @@ -28,11 +28,10 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSSkin; +class CCPACSHullStructure; namespace generated { - class CPACSHullStructure; - // This class is used in: // CPACSHullStructure @@ -43,13 +42,13 @@ namespace generated class CPACSHullSkinLayers { public: - TIGL_EXPORT CPACSHullSkinLayers(CPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSHullSkinLayers(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSHullSkinLayers(); - TIGL_EXPORT CPACSHullStructure* GetParent(); + TIGL_EXPORT CCPACSHullStructure* GetParent(); - TIGL_EXPORT const CPACSHullStructure* GetParent() const; + TIGL_EXPORT const CCPACSHullStructure* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -67,7 +66,7 @@ namespace generated TIGL_EXPORT virtual void RemoveSkinLayer(CCPACSSkin& ref); protected: - CPACSHullStructure* m_parent; + CCPACSHullStructure* m_parent; CTiglUIDManager* m_uidMgr; @@ -84,5 +83,4 @@ namespace generated // Aliases in tigl namespace using CCPACSHullSkinLayers = generated::CPACSHullSkinLayers; -using CCPACSHullStructure = generated::CPACSHullStructure; } // namespace tigl diff --git a/src/generated/CPACSHullStructure.cpp b/src/generated/CPACSHullStructure.cpp index 1863a0525e..1f02917129 100644 --- a/src/generated/CPACSHullStructure.cpp +++ b/src/generated/CPACSHullStructure.cpp @@ -90,7 +90,7 @@ namespace generated // read element stringers if (tixi::TixiCheckElement(tixiHandle, xpath + "/stringers")) { - m_stringers = boost::in_place(this, m_uidMgr); + m_stringers = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_stringers->ReadCPACS(tixiHandle, xpath + "/stringers"); } catch(const std::exception& e) { @@ -101,7 +101,7 @@ namespace generated // read element frames if (tixi::TixiCheckElement(tixiHandle, xpath + "/frames")) { - m_frames = boost::in_place(this, m_uidMgr); + m_frames = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_frames->ReadCPACS(tixiHandle, xpath + "/frames"); } catch(const std::exception& e) { @@ -112,7 +112,7 @@ namespace generated // read element virtualStringers if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualStringers")) { - m_virtualStringers = boost::in_place(this, m_uidMgr); + m_virtualStringers = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_virtualStringers->ReadCPACS(tixiHandle, xpath + "/virtualStringers"); } catch(const std::exception& e) { @@ -123,7 +123,7 @@ namespace generated // read element virtualFrames if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualFrames")) { - m_virtualFrames = boost::in_place(this, m_uidMgr); + m_virtualFrames = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_virtualFrames->ReadCPACS(tixiHandle, xpath + "/virtualFrames"); } catch(const std::exception& e) { @@ -134,7 +134,7 @@ namespace generated // read element skinLayers if (tixi::TixiCheckElement(tixiHandle, xpath + "/skinLayers")) { - m_skinLayers = boost::in_place(this, m_uidMgr); + m_skinLayers = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_skinLayers->ReadCPACS(tixiHandle, xpath + "/skinLayers"); } catch(const std::exception& e) { @@ -279,7 +279,7 @@ namespace generated CCPACSStringersAssembly& CPACSHullStructure::GetStringers(CreateIfNotExistsTag) { if (!m_stringers) - m_stringers = boost::in_place(this, m_uidMgr); + m_stringers = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_stringers; } @@ -291,7 +291,7 @@ namespace generated CCPACSFramesAssembly& CPACSHullStructure::GetFrames(CreateIfNotExistsTag) { if (!m_frames) - m_frames = boost::in_place(this, m_uidMgr); + m_frames = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_frames; } @@ -303,7 +303,7 @@ namespace generated CCPACSStringersAssembly& CPACSHullStructure::GetVirtualStringers(CreateIfNotExistsTag) { if (!m_virtualStringers) - m_virtualStringers = boost::in_place(this, m_uidMgr); + m_virtualStringers = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_virtualStringers; } @@ -315,7 +315,7 @@ namespace generated CCPACSFramesAssembly& CPACSHullStructure::GetVirtualFrames(CreateIfNotExistsTag) { if (!m_virtualFrames) - m_virtualFrames = boost::in_place(this, m_uidMgr); + m_virtualFrames = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_virtualFrames; } @@ -327,7 +327,7 @@ namespace generated CPACSHullSkinLayers& CPACSHullStructure::GetSkinLayers(CreateIfNotExistsTag) { if (!m_skinLayers) - m_skinLayers = boost::in_place(this, m_uidMgr); + m_skinLayers = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_skinLayers; } diff --git a/src/generated/CPACSHullStructure.h b/src/generated/CPACSHullStructure.h index 9977013c65..8e1d4bec00 100644 --- a/src/generated/CPACSHullStructure.h +++ b/src/generated/CPACSHullStructure.h @@ -115,6 +115,5 @@ namespace generated }; } // namespace generated -// Aliases in tigl namespace -using CCPACSHullStructure = generated::CPACSHullStructure; +// CPACSHullStructure is customized, use type CCPACSHullStructure directly } // namespace tigl diff --git a/src/generated/CPACSStringersAssembly.cpp b/src/generated/CPACSStringersAssembly.cpp index e21f017fb7..8b202c13ee 100644 --- a/src/generated/CPACSStringersAssembly.cpp +++ b/src/generated/CPACSStringersAssembly.cpp @@ -19,7 +19,7 @@ #include #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" -#include "CPACSHullStructure.h" +#include "CCPACSHullStructure.h" #include "CPACSStringersAssembly.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } - CPACSStringersAssembly::CPACSStringersAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr) + CPACSStringersAssembly::CPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSHullStructure); + m_parentType = &typeid(CCPACSHullStructure); } CPACSStringersAssembly::~CPACSStringersAssembly() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSStringersAssembly.h b/src/generated/CPACSStringersAssembly.h index b0f24042a0..fb8be9549a 100644 --- a/src/generated/CPACSStringersAssembly.h +++ b/src/generated/CPACSStringersAssembly.h @@ -32,11 +32,10 @@ class CTiglUIDObject; class CCPACSFuselageStringer; class CCPACSDuctStructure; class CCPACSFuselageStructure; +class CCPACSHullStructure; namespace generated { - class CPACSHullStructure; - // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure @@ -52,7 +51,7 @@ namespace generated public: TIGL_EXPORT CPACSStringersAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSStringersAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSStringersAssembly(CPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSStringersAssembly(); @@ -65,7 +64,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -75,7 +74,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -115,7 +114,4 @@ namespace generated } // namespace generated // CPACSStringersAssembly is customized, use type CCPACSStringersAssembly directly - -// Aliases in tigl namespace -using CCPACSHullStructure = generated::CPACSHullStructure; } // namespace tigl diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index a478c0e946..ca5d4b4bcf 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -172,6 +172,19 @@ outerHull_section3_element1 + + + + + dummyMaterial + outerHull_section2 + 0 + 0 + 45 + + + + Inner hull @@ -446,5 +459,34 @@ + + + + Frame structural element + + sheet + dummyMaterial + 0.05 + + T + + + + + + dummyMaterial + + + + + + + Dummy material + 1 + + 1 + + + \ No newline at end of file diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index d7dd7c9423..f84744252c 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -128,6 +128,16 @@ def test_hull(self): # Test availability of generated class: self.assertEqual(self.hull.get_name(), "Outer hull") + def test_structure(self): + structure = self.hull.get_structure() + # Test custom class methods: + self.assertIsInstance( + structure.get_frames(), configuration.CCPACSFramesAssembly + ) + + # Test availability of generated class: + self.assertEqual(structure.get_uid(), "outerHullStructure") + if __name__ == "__main__": unittest.main() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 480c588e69..ffe5ab5538 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -156,4 +156,12 @@ TEST_F(FuselageTank, hull) EXPECT_NEAR(points.at(1).Z(), -0.24, 1e-2); EXPECT_EQ(hull_with_guides->GetGuideCurveSegment("genericTank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); +} + +TEST_F(FuselageTank, structure) +{ + auto &structure = hull->GetStructure(); + + EXPECT_EQ(structure->GetFrames()->GetFrames().size(),1); + EXPECT_EQ(structure->GetUID(), "outerHullStructure"); } \ No newline at end of file From 7f20e741006a0238d9ed823e6be21dbbe06c1b35 Mon Sep 17 00:00:00 2001 From: Alder Date: Tue, 26 Mar 2024 16:29:14 +0100 Subject: [PATCH 025/122] format according to TiGL-style guide using clang --- src/fuelTanks/CCPACSGenericFuelTank.cpp | 16 ++++--- src/fuelTanks/CCPACSGenericFuelTank.h | 8 ++-- src/fuelTanks/CCPACSGenericFuelTanks.cpp | 15 ++++--- src/fuelTanks/CCPACSGenericFuelTanks.h | 9 ++-- src/fuelTanks/CCPACSHull.cpp | 55 ++++++++++++------------ src/fuelTanks/CCPACSHull.h | 11 ++--- src/fuelTanks/CCPACSHulls.cpp | 15 ++++--- src/fuelTanks/CCPACSHulls.h | 7 ++- 8 files changed, 67 insertions(+), 69 deletions(-) diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp index 789c24c2ed..2a9b0e2ebd 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -24,12 +24,14 @@ #include "CTiglError.h" #include "CGroupShapes.h" -namespace tigl { +namespace tigl +{ CCPACSGenericFuelTank::CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) : generated::CPACSGenericFuelTank(parent, uidMgr) , CTiglRelativelyPositionedComponent(GetParent()->GetParent()->GetParent(), &m_transformation) -{} +{ +} CCPACSConfiguration& CCPACSGenericFuelTank::GetConfiguration() const { @@ -54,7 +56,7 @@ TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const bool CCPACSGenericFuelTank::HasHulls() const { - if (GetHulls_choice1()->GetHullsCount()>0) { + if (GetHulls_choice1()->GetHullsCount() > 0) { return true; } else { @@ -85,7 +87,7 @@ const boost::optional& CCPACSGenericFuelTank::GetHulls() const PNamedShape CCPACSGenericFuelTank::BuildLoft() const { const auto& hulls = GetHulls_choice1()->GetHulls(); - ListPNamedShape shapes; + ListPNamedShape shapes; for (const auto& hull : hulls) { auto loft = hull->GetLoft(); @@ -93,16 +95,16 @@ PNamedShape CCPACSGenericFuelTank::BuildLoft() const } PNamedShape groupedShape = CGroupShapes(shapes); - + return groupedShape; } std::string CCPACSGenericFuelTank::GetShortShapeName() const { unsigned int findex = 0; - unsigned int i = 0; + unsigned int i = 0; - for (auto& t: GetParent()->GetGenericFuelTanks()) { + for (auto& t : GetParent()->GetGenericFuelTanks()) { ++i; if (GetUID() == t->GetUID()) { findex = i; diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSGenericFuelTank.h index de11ac770e..c60a2bf3e8 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.h +++ b/src/fuelTanks/CCPACSGenericFuelTank.h @@ -25,12 +25,12 @@ #include "CTiglRelativelyPositionedComponent.h" #include "CCPACSConfiguration.h" -namespace tigl { +namespace tigl +{ -class CCPACSGenericFuelTank: public generated::CPACSGenericFuelTank, public CTiglRelativelyPositionedComponent +class CCPACSGenericFuelTank : public generated::CPACSGenericFuelTank, public CTiglRelativelyPositionedComponent { public: - TIGL_EXPORT CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; @@ -50,9 +50,7 @@ class CCPACSGenericFuelTank: public generated::CPACSGenericFuelTank, public CTig PNamedShape BuildLoft() const override; private: - std::string GetShortShapeName() const; - }; } //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.cpp b/src/fuelTanks/CCPACSGenericFuelTanks.cpp index 1e6f508c3a..660d53113b 100644 --- a/src/fuelTanks/CCPACSGenericFuelTanks.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTanks.cpp @@ -23,11 +23,13 @@ #include "CCPACSGenericFuelTank.h" #include "CTiglError.h" -namespace tigl { +namespace tigl +{ CCPACSGenericFuelTanks::CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr) : generated::CPACSGenericFuelTanks(parent, uidMgr) -{} +{ +} int CCPACSGenericFuelTanks::GetGenericFuelTanksCount() const { @@ -41,9 +43,10 @@ CCPACSGenericFuelTank const& CCPACSGenericFuelTanks::GetGenericFuelTank(std::str CCPACSGenericFuelTank& CCPACSGenericFuelTanks::GetGenericFuelTank(std::string const& uID) { - auto it = std::find_if(m_genericFuelTanks.begin(), m_genericFuelTanks.end(), [&](std::unique_ptr const& v){ return v->GetUID() == uID; }); + auto it = std::find_if(m_genericFuelTanks.begin(), m_genericFuelTanks.end(), + [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); - if ( it != std::end(m_genericFuelTanks)) { + if (it != std::end(m_genericFuelTanks)) { return **it; } throw CTiglError("Could not find genericFuelTank with uid" + uID); @@ -60,10 +63,10 @@ CCPACSGenericFuelTank& CCPACSGenericFuelTanks::GetGenericFuelTank(int index) con int CCPACSGenericFuelTanks::GetGenericFuelTankIndex(const std::string& uID) const { - for (int i=0; i < GetGenericFuelTanksCount(); i++) { + for (int i = 0; i < GetGenericFuelTanksCount(); i++) { const std::string tmpUID(m_genericFuelTanks[i]->GetUID()); if (tmpUID == uID) { - return i+1; + return i + 1; } } throw CTiglError("Invalid UID in CCPACSGenericFuelTanks::GetGenericFuelTankIndex", TIGL_UID_ERROR); diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.h b/src/fuelTanks/CCPACSGenericFuelTanks.h index 9cae60fdb7..e5bd3ef82f 100644 --- a/src/fuelTanks/CCPACSGenericFuelTanks.h +++ b/src/fuelTanks/CCPACSGenericFuelTanks.h @@ -23,12 +23,12 @@ #include "generated/CPACSGenericFuelTanks.h" -namespace tigl { +namespace tigl +{ -class CCPACSGenericFuelTanks: public generated::CPACSGenericFuelTanks +class CCPACSGenericFuelTanks : public generated::CPACSGenericFuelTanks { public: - TIGL_EXPORT CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); // Get a specific hull for a given uID @@ -43,9 +43,6 @@ class CCPACSGenericFuelTanks: public generated::CPACSGenericFuelTanks // Returns the total count of fuselages in a configuration TIGL_EXPORT int GetGenericFuelTanksCount() const; - -private: - }; } //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index db7542a7fd..571d145b44 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -34,13 +34,14 @@ #include "TopTools_IndexedMapOfShape.hxx" #include "TopExp.hxx" - -namespace tigl { +namespace tigl +{ CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) : generated::CPACSHull(parent, uidMgr) , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation) -{} +{ +} CCPACSConfiguration& CCPACSHull::GetConfiguration() const { @@ -77,13 +78,13 @@ TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const { // search for the section in all segments for (int n = 0; n < GetSegmentCount(); ++n) { - const CCPACSFuselageSegment& segment = GetSegment(n+1); + const CCPACSFuselageSegment& segment = GetSegment(n + 1); - if ( section_uid == segment.GetStartSectionUID() ) { - return BuildFace( segment.GetStartWire() ); + if (section_uid == segment.GetStartSectionUID()) { + return BuildFace(segment.GetStartWire()); } - else if ( section_uid == segment.GetEndSectionUID() ) { - return BuildFace( segment.GetEndWire() ); + else if (section_uid == segment.GetEndSectionUID()) { + return BuildFace(segment.GetEndWire()); } } throw CTiglError("GetSectionFace: Could not find a section for the given UID"); @@ -130,7 +131,7 @@ double CCPACSHull::GetSurfaceArea() TopTools_IndexedMapOfShape shapeMap; TopExp::MapShapes(fusedSegments->Shape(), TopAbs_FACE, shapeMap); for (int i = 1; i <= shapeMap.Extent(); ++i) { - if (GetUID() == fusedSegments->GetFaceTraits(i-1).Name()) { + if (GetUID() == fusedSegments->GetFaceTraits(i - 1).Name()) { const TopoDS_Face& f = TopoDS::Face(shapeMap(i)); GProp_GProps System; BRepGProp::SurfaceProperties(f, System); @@ -149,12 +150,12 @@ double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) PNamedShape CCPACSHull::BuildLoft() const { - TiglContinuity cont = m_segments.GetSegment(1).GetContinuity(); - Standard_Boolean smooth = (cont == ::C0? false : true); + TiglContinuity cont = m_segments.GetSegment(1).GetContinuity(); + Standard_Boolean smooth = (cont == ::C0 ? false : true); CTiglMakeLoft lofter; // add profiles - for (int i=1; i <= m_segments.GetSegmentCount(); i++) { + for (int i = 1; i <= m_segments.GetSegmentCount(); i++) { lofter.addProfiles(m_segments.GetSegment(i).GetStartWire()); } lofter.addProfiles(m_segments.GetSegment(m_segments.GetSegmentCount()).GetEndWire()); @@ -165,9 +166,9 @@ PNamedShape CCPACSHull::BuildLoft() const lofter.setMakeSolid(true); lofter.setMakeSmooth(smooth); - TopoDS_Shape loftShape = lofter.Shape(); + TopoDS_Shape loftShape = lofter.Shape(); - std::string loftName = GetUID(); + std::string loftName = GetUID(); std::string loftShortName = GetShortShapeName(); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); SetFaceTraits(loft); @@ -177,7 +178,7 @@ PNamedShape CCPACSHull::BuildLoft() const gp_Pnt CCPACSHull::GetPoint(int segmentIndex, double eta, double zeta) { - return ((CCPACSFuselageSegment &) GetSegment(segmentIndex)).GetPoint(eta, zeta, getPointBehavior); + return ((CCPACSFuselageSegment&)GetSegment(segmentIndex)).GetPoint(eta, zeta, getPointBehavior); } // Sets the GetPoint behavior to asParameterOnSurface or onLinearLoft @@ -225,7 +226,7 @@ std::vector CCPACSHull::GetGuideCurvePoints() const } const CCPACSGuideCurves& segmentCurves = *segment.GetGuideCurves(); - for (int iguide = 1; iguide <= segmentCurves.GetGuideCurveCount(); ++iguide) { + for (int iguide = 1; iguide <= segmentCurves.GetGuideCurveCount(); ++iguide) { const CCPACSGuideCurve& curve = segmentCurves.GetGuideCurve(iguide); std::vector curPoints = curve.GetCurvePoints(); points.insert(points.end(), curPoints.begin(), curPoints.end()); @@ -238,9 +239,9 @@ std::vector CCPACSHull::GetGuideCurvePoints() const std::string CCPACSHull::GetShortShapeName() const { unsigned int findex = 0; - unsigned int i = 0; + unsigned int i = 0; - for (auto& h: GetParent()->GetHulls()) { + for (auto& h : GetParent()->GetHulls()) { ++i; if (GetUID() == h->GetUID()) { findex = i; @@ -252,10 +253,10 @@ std::string CCPACSHull::GetShortShapeName() const return "UNKNOWN"; } -void CCPACSHull::SetFaceTraits (PNamedShape loft) const +void CCPACSHull::SetFaceTraits(PNamedShape loft) const { - int nFacesTotal = GetNumberOfFaces(loft->Shape()); - int nFacesAero = nFacesTotal; + int nFacesTotal = GetNumberOfFaces(loft->Shape()); + int nFacesAero = nFacesTotal; bool hasSymmetryPlane = GetNumberOfEdges(m_segments.GetSegment(1).GetEndWire()) > 1; std::vector names; @@ -265,19 +266,19 @@ void CCPACSHull::SetFaceTraits (PNamedShape loft) const names.push_back("Rear"); if (!CTiglTopoAlgorithms::IsDegenerated(m_segments.GetSegment(1).GetStartWire())) { - nFacesAero-=1; + nFacesAero -= 1; } if (!CTiglTopoAlgorithms::IsDegenerated(m_segments.GetSegment(m_segments.GetSegmentCount()).GetEndWire())) { - nFacesAero-=1; + nFacesAero -= 1; } // if we have a smooth surface, the whole fuslage is treatet as one segment int nSegments = m_segments.GetSegmentCount(); - int facesPerSegment = nFacesAero/ nSegments; + int facesPerSegment = nFacesAero / nSegments; - int iFaceTotal = 0; - int nSymmetryFaces = (int) hasSymmetryPlane; + int iFaceTotal = 0; + int nSymmetryFaces = (int)hasSymmetryPlane; for (int iSegment = 0; iSegment < nSegments; ++iSegment) { for (int iFace = 0; iFace < facesPerSegment - nSymmetryFaces; ++iFace) { loft->FaceTraits(iFaceTotal++).SetName(names[0].c_str()); @@ -289,7 +290,7 @@ void CCPACSHull::SetFaceTraits (PNamedShape loft) const // set the caps int iFace = 2; - for (;iFaceTotal < nFacesTotal; ++iFaceTotal) { + for (; iFaceTotal < nFacesTotal; ++iFaceTotal) { loft->FaceTraits(iFaceTotal).SetName(names[iFace++].c_str()); } } diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 3a03f9b279..8ea2836fb5 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -31,7 +31,6 @@ namespace tigl class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositionedComponent { public: - // Constructor TIGL_EXPORT explicit CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); @@ -86,22 +85,18 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned // Returns all guide curve points TIGL_EXPORT std::vector GetGuideCurvePoints() const; - protected: - // Build the loft PNamedShape BuildLoft() const override; // Set the face traints - void SetFaceTraits (PNamedShape loft) const; + void SetFaceTraits(PNamedShape loft) const; private: - // Get short name for loft std::string GetShortShapeName() const; - TiglGetPointBehavior getPointBehavior {asParameterOnSurface}; - + TiglGetPointBehavior getPointBehavior{asParameterOnSurface}; }; -} +} // namespace tigl diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp index 37ade6941f..f7328c7df3 100644 --- a/src/fuelTanks/CCPACSHulls.cpp +++ b/src/fuelTanks/CCPACSHulls.cpp @@ -23,11 +23,13 @@ #include "CCPACSHull.h" #include "CTiglError.h" -namespace tigl { +namespace tigl +{ CCPACSHulls::CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) : generated::CPACSHulls(parent, uidMgr) -{} +{ +} int CCPACSHulls::GetHullsCount() const { @@ -41,9 +43,10 @@ CCPACSHull const& CCPACSHulls::GetHull(std::string const& uID) const CCPACSHull& CCPACSHulls::GetHull(std::string const& uID) { - auto it = std::find_if(m_hulls.begin(), m_hulls.end(), [&](std::unique_ptr const& v){ return v->GetUID() == uID; }); + auto it = std::find_if(m_hulls.begin(), m_hulls.end(), + [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); - if ( it != std::end(m_hulls)) { + if (it != std::end(m_hulls)) { return **it; } throw CTiglError("Could not find hull with uid" + uID); @@ -60,10 +63,10 @@ CCPACSHull& CCPACSHulls::GetHull(int index) const int CCPACSHulls::GetHullIndex(const std::string& uID) const { - for (int i=0; i < GetHullsCount(); i++) { + for (int i = 0; i < GetHullsCount(); i++) { const std::string tmpUID(m_hulls[i]->GetUID()); if (tmpUID == uID) { - return i+1; + return i + 1; } } throw CTiglError("Invalid UID in CCPACSHulls::GetHullIndex", TIGL_UID_ERROR); diff --git a/src/fuelTanks/CCPACSHulls.h b/src/fuelTanks/CCPACSHulls.h index 30584c6245..813a18d715 100644 --- a/src/fuelTanks/CCPACSHulls.h +++ b/src/fuelTanks/CCPACSHulls.h @@ -24,12 +24,12 @@ #include "generated/CPACSHulls.h" #include -namespace tigl { +namespace tigl +{ -class CCPACSHulls: public generated::CPACSHulls +class CCPACSHulls : public generated::CPACSHulls { public: - TIGL_EXPORT CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); // Get a specific hull for a given uID @@ -46,7 +46,6 @@ class CCPACSHulls: public generated::CPACSHulls TIGL_EXPORT int GetHullsCount() const; private: - }; } //namespace tigl From 5fe1f5411d09be257b6dc34bd20542925eb160dc Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 17 May 2024 13:05:52 +0200 Subject: [PATCH 026/122] start implementation of parametric tanks --- bindings/python_internal/configuration.i | 2 +- cpacs_gen_input/cpacs_schema.xsd | 60 ++--- src/common/tiglcommonfunctions.cpp | 14 ++ src/common/tiglcommonfunctions.h | 6 + src/cpacs_other/CCPACSMaterialDefinition.cpp | 1 - src/cpacs_other/CCPACSMaterialDefinition.h | 1 - src/fuelTanks/CCPACSGenericFuelTank.cpp | 32 +-- src/fuelTanks/CCPACSGenericFuelTank.h | 7 - src/fuelTanks/CCPACSHull.cpp | 194 ++++++++++++--- src/fuselage/CTiglFuselageConnection.cpp | 3 +- src/generated/CPACSDomeType.cpp | 18 +- src/generated/CPACSDomeType.h | 14 +- src/generated/CPACSGenericFuelTank.cpp | 120 +-------- src/generated/CPACSGenericFuelTank.h | 32 +-- .../CPACSGenericFuelTankParameters.cpp | 179 ------------- .../CPACSGenericFuelTankParameters.h | 98 -------- src/generated/CPACSHull.cpp | 235 ++++++++++++++++-- src/generated/CPACSHull.h | 51 +++- src/generated/CPACSMaterialDefinition.cpp | 15 -- src/generated/CPACSMaterialDefinition.h | 8 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 55 ++++ tests/unittests/tiglTanks.cpp | 49 ++-- 22 files changed, 579 insertions(+), 615 deletions(-) delete mode 100644 src/generated/CPACSGenericFuelTankParameters.cpp delete mode 100644 src/generated/CPACSGenericFuelTankParameters.h diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 5b5d291fde..87749fc715 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -344,7 +344,6 @@ namespace tigl %boost_optional(tigl::CCPACSGenericFuelTanks) %boost_optional(tigl::generated::CPACSFuselageFuelTanks) %boost_optional(tigl::generated::CPACSGenericFuelTanks) -%boost_optional(tigl::CCPACSHulls) %boost_optional(tigl::generated::CPACSFuelTankVolume) %boost_optional(tigl::CCPACSHullStructure) @@ -368,6 +367,7 @@ class CCPACSHulls; %include "generated/CPACSHull.h" %include "CCPACSHull.h" %include "generated/CPACSFuselageFuelTanks.h" +%include "generated/CPACSDomeType.h" // -------------------- Wing Structure -------------------// diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index c0fe72e375..f4b7073f63 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -34208,10 +34208,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - + Volume @@ -34259,7 +34256,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + Name @@ -34273,46 +34270,33 @@ The fuel tank volume type should also be used for the wing fuel tank - - + + + + + + + + + Inner radius of the cylinder + + + + + Inner length of the cylinder + + + + + - + - - - - - - Global design parameters - - - - - - - - - - Inner radius of the cylinder - - - - - Inner length of the cylinder - - - - - - - - - diff --git a/src/common/tiglcommonfunctions.cpp b/src/common/tiglcommonfunctions.cpp index 0bc1aea968..f3da1b8dbc 100644 --- a/src/common/tiglcommonfunctions.cpp +++ b/src/common/tiglcommonfunctions.cpp @@ -1523,6 +1523,20 @@ void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices } } +TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& edge) +{ + TopTools_ListOfShape edgeList; + GetEndVertices(edge, edgeList); + return TopoDS::Vertex(edgeList.First()); +} + +TopoDS_Vertex GetLastVertex(const TopoDS_Edge& edge) +{ + TopTools_ListOfShape edgeList; + GetEndVertices(edge, edgeList); + return TopoDS::Vertex(edgeList.Last()); +} + TopoDS_Face GetNearestFace(const TopoDS_Shape& shape, const gp_Pnt& pnt) { TopExp_Explorer explorer; diff --git a/src/common/tiglcommonfunctions.h b/src/common/tiglcommonfunctions.h index d6fd063420..5c4b2936b2 100644 --- a/src/common/tiglcommonfunctions.h +++ b/src/common/tiglcommonfunctions.h @@ -319,6 +319,12 @@ TIGL_EXPORT bool CheckCommonVertex(const TopoDS_Edge& e1, const TopoDS_Edge& e2) // Method for searching all vertices which are only connected to a single edge TIGL_EXPORT void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices); +// Method to return the first vertex of an edge +TIGL_EXPORT TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& e); + +// Method to return the last vertex of an edge +TIGL_EXPORT TopoDS_Vertex GetLastVertex(const TopoDS_Edge& e); + // Method for finding the face which has the lowest distance to the passed point TIGL_EXPORT TopoDS_Face GetNearestFace(const TopoDS_Shape& src, const gp_Pnt& pnt); diff --git a/src/cpacs_other/CCPACSMaterialDefinition.cpp b/src/cpacs_other/CCPACSMaterialDefinition.cpp index 93650be77f..db0f743b40 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.cpp +++ b/src/cpacs_other/CCPACSMaterialDefinition.cpp @@ -30,7 +30,6 @@ CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDMa CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} bool CCPACSMaterialDefinition::isComposite() const diff --git a/src/cpacs_other/CCPACSMaterialDefinition.h b/src/cpacs_other/CCPACSMaterialDefinition.h index 739e726f67..58de1219df 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.h +++ b/src/cpacs_other/CCPACSMaterialDefinition.h @@ -39,7 +39,6 @@ class CCPACSMaterialDefinition : public generated::CPACSMaterialDefinition TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT bool isComposite() const; diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp index 2a9b0e2ebd..e2232dbbd6 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -54,39 +54,9 @@ TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const return TIGL_INTENT_PHYSICAL; } -bool CCPACSGenericFuelTank::HasHulls() const -{ - if (GetHulls_choice1()->GetHullsCount() > 0) { - return true; - } - else { - return false; - } -} - -boost::optional& CCPACSGenericFuelTank::GetHulls() -{ - if (HasHulls()) { - return GetHulls_choice1(); - } - else { - throw CTiglError("No hulls defined."); - } -} - -const boost::optional& CCPACSGenericFuelTank::GetHulls() const -{ - if (HasHulls()) { - return GetHulls_choice1(); - } - else { - throw CTiglError("No hulls defined."); - } -} - PNamedShape CCPACSGenericFuelTank::BuildLoft() const { - const auto& hulls = GetHulls_choice1()->GetHulls(); + const auto& hulls = GetHulls().GetHulls(); ListPNamedShape shapes; for (const auto& hull : hulls) { diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSGenericFuelTank.h index c60a2bf3e8..3980032409 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.h +++ b/src/fuelTanks/CCPACSGenericFuelTank.h @@ -39,13 +39,6 @@ class CCPACSGenericFuelTank : public generated::CPACSGenericFuelTank, public CTi TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; - // Check if hulls are available - TIGL_EXPORT bool HasHulls() const; - - // Get hulls - TIGL_EXPORT boost::optional& GetHulls(); - TIGL_EXPORT const boost::optional& GetHulls() const; - private: PNamedShape BuildLoft() const override; diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 571d145b44..de7e1117cb 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -28,12 +28,26 @@ #include "tiglcommonfunctions.h" #include "CCPACSGenericFuelTank.h" #include "CCPACSGenericFuelTanks.h" +#include "generated/CPACSDomeType.h" +#include "generated/CPACSEllipsoidDome.h" +#include "generated/CPACSTorisphericalDome.h" #include "GProp_GProps.hxx" #include "BRepGProp.hxx" #include "TopTools_IndexedMapOfShape.hxx" #include "TopExp.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace tigl { @@ -66,12 +80,15 @@ TiglGeometricComponentIntent CCPACSHull::GetComponentIntent() const int CCPACSHull::GetSectionCount() const { - return m_sections.GetSectionCount(); + // ToDo: add exception handling + // ToDo: .get() or .get_ptr()? + return m_sections_choice1.get().GetSectionCount(); } CCPACSFuselageSection& CCPACSHull::GetSection(int index) const { - return m_sections.GetSection(index); + // ToDo: add exception handling + return m_sections_choice1.get().GetSection(index); } TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const @@ -93,22 +110,26 @@ TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const int CCPACSHull::GetSegmentCount() const { - return m_segments.GetSegmentCount(); + // ToDo: add exception handling + return m_segments_choice1.get().GetSegmentCount(); } CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) { - return m_segments.GetSegment(index); + // ToDo: add exception handling + return m_segments_choice1.get().GetSegment(index); } const CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) const { - return m_segments.GetSegment(index); + // ToDo: add exception handling + return m_segments_choice1.get().GetSegment(index); } CCPACSFuselageSegment& CCPACSHull::GetSegment(std::string uid) { - return m_segments.GetSegment(uid); + // ToDo: add exception handling + return m_segments_choice1.get().GetSegment(uid); } double CCPACSHull::GetVolume() @@ -148,32 +169,144 @@ double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); } +// ToDo: Add parametric build algorithms PNamedShape CCPACSHull::BuildLoft() const { - TiglContinuity cont = m_segments.GetSegment(1).GetContinuity(); - Standard_Boolean smooth = (cont == ::C0 ? false : true); + if (m_segments_choice1 && m_sections_choice1) { + TiglContinuity cont = m_segments_choice1.get().GetSegment(1).GetContinuity(); + Standard_Boolean smooth = (cont == ::C0 ? false : true); + + CTiglMakeLoft lofter; + // add profiles + for (int i = 1; i <= m_segments_choice1.get().GetSegmentCount(); i++) { + lofter.addProfiles(m_segments_choice1.get().GetSegment(i).GetStartWire()); + } + lofter.addProfiles( + m_segments_choice1.get().GetSegment(m_segments_choice1.get().GetSegmentCount()).GetEndWire()); + + // add guides + lofter.addGuides(m_segments_choice1.get().GetGuideCurveWires()); + + lofter.setMakeSolid(true); + lofter.setMakeSmooth(smooth); + + TopoDS_Shape loftShape = lofter.Shape(); - CTiglMakeLoft lofter; - // add profiles - for (int i = 1; i <= m_segments.GetSegmentCount(); i++) { - lofter.addProfiles(m_segments.GetSegment(i).GetStartWire()); + std::string loftName = GetUID(); + std::string loftShortName = GetShortShapeName(); + PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + SetFaceTraits(loft); + + return loft; } - lofter.addProfiles(m_segments.GetSegment(m_segments.GetSegmentCount()).GetEndWire()); + else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { + double cylinderRadius = m_cylinderRadius_choice2.get(); + double cylinderLength = m_cylinderLength_choice2.get(); + + double R, r, a, c, axRatio, h, alpha; + + if (m_domeType_choice2.get().GetSpherical_choice1()) { + R = cylinderRadius; + a = 0.0; + axRatio = 1.0; + } + else if (m_domeType_choice2.get().GetEllipsoid_choice2()) { + R = cylinderRadius; + a = 0.0; + axRatio = m_domeType_choice2.get().GetEllipsoid_choice2().get().GetHalfAxisFraction(); + } + else if (m_domeType_choice2.get().GetTorispherical_choice3()) { + R = m_domeType_choice2.get().GetTorispherical_choice3().get().GetDishRadius(); + a = m_domeType_choice2.get().GetTorispherical_choice3().get().GetKnuckleRadius(); + axRatio = 1.0; + } + + if (a > 0.0) { + c = cylinderRadius - a; + h = R - sqrt((a + c - R) * (a - c - R)); + r = c * (1.0 + pow((R / a - 1), -1.0)); + alpha = acos((r - c) / a); + } + else { + alpha = 0.0; + h = R; + } + + gp_Dir dir(0.0, 1.0, 0.0); + + gp_Pnt p1_l(R - h, 0.0, 0.0); + gp_Pnt p1_r(cylinderLength - (R - h), 0.0, 0.0); + + gp_Elips ellips_l_gp(gp_Ax2(p1_l, dir), R, R * axRatio); + gp_Elips ellips_r_gp(gp_Ax2(p1_r, dir), R, R * axRatio); - // add guides - lofter.addGuides(m_segments.GetGuideCurveWires()); + GC_MakeArcOfEllipse arc1_l(ellips_l_gp, -M_PI / 2, -alpha, Standard_True); + GC_MakeArcOfEllipse arc1_r(ellips_r_gp, alpha, M_PI / 2, Standard_True); - lofter.setMakeSolid(true); - lofter.setMakeSmooth(smooth); + TopoDS_Edge edge1_l = BRepBuilderAPI_MakeEdge(arc1_l.Value()).Edge(); + TopoDS_Edge edge1_r = BRepBuilderAPI_MakeEdge(arc1_r.Value()).Edge(); - TopoDS_Shape loftShape = lofter.Shape(); + TopoDS_Edge edge2_l; + TopoDS_Edge edge2_r; - std::string loftName = GetUID(); - std::string loftShortName = GetShortShapeName(); - PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); - SetFaceTraits(loft); + TopoDS_Vertex v1; + TopoDS_Vertex v2; + if (a > 0) { + gp_Pnt p2_l(0, 0.0, cylinderRadius - a); + gp_Pnt p2_r(cylinderLength, 0.0, cylinderRadius - a); - return loft; + gp_Circ circ2_l_gp(gp_Ax2(p2_l, dir), a); + gp_Circ circ2_r_gp(gp_Ax2(p2_r, dir), a); + + GC_MakeArcOfCircle arc2_l(circ2_l_gp, -alpha, 0, Standard_True); + GC_MakeArcOfCircle arc2_r(circ2_r_gp, 0, alpha, Standard_True); + + edge2_l = BRepBuilderAPI_MakeEdge(arc2_l.Value()).Edge(); + edge2_r = BRepBuilderAPI_MakeEdge(arc2_r.Value()).Edge(); + + v1 = GetLastVertex(edge2_l); + v2 = GetFirstVertex(edge2_r); + } + else { + v1 = GetLastVertex(edge1_l); + v2 = GetFirstVertex(edge1_r); + } + + TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + + BRepBuilderAPI_MakeWire wire; + std::vector edges; + if (a > 0) { + edges = {edge1_l, edge2_l, cylinder_edge, edge2_r, edge1_r}; + } + else { + edges = {edge1_l, cylinder_edge, edge1_r}; + } + + for (const auto& edge : edges) { + wire.Add(edge); + } + + gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); + TopoDS_Shape loftShape = BRepPrimAPI_MakeRevol(wire.Shape(), ax).Shape(); + + // gp_Trsf translationTrsf; + // translationTrsf.SetTranslation(gp_Vec(h, 0, 0)); + // BRepBuilderAPI_Transform shapeTranslation(loftShape, translationTrsf); + // shapeTranslation.Build(); + // TopoDS_Shape loftShape_translated = shapeTranslation.Shape(); + + std::string loftName = GetUID(); + std::string loftShortName = GetShortShapeName(); + PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + + return loft; + } + else { + throw CTiglError("No valid combination of segments and sections or parametric specification for lofting of " + "tank hull available.", + TIGL_ERROR); + } } gp_Pnt CCPACSHull::GetPoint(int segmentIndex, double eta, double zeta) @@ -199,8 +332,8 @@ CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) const CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) const { - for (int i = 1; i <= m_segments.GetSegmentCount(); i++) { - const CCPACSFuselageSegment& segment = m_segments.GetSegment(i); + for (int i = 1; i <= m_segments_choice1.get().GetSegmentCount(); i++) { + const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(i); if (!segment.GetGuideCurves()) { continue; @@ -219,7 +352,7 @@ std::vector CCPACSHull::GetGuideCurvePoints() const // connect the belonging guide curve segments for (int isegment = 1; isegment <= GetSegmentCount(); ++isegment) { - const CCPACSFuselageSegment& segment = m_segments.GetSegment(isegment); + const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(isegment); if (!segment.GetGuideCurves()) { continue; @@ -257,7 +390,7 @@ void CCPACSHull::SetFaceTraits(PNamedShape loft) const { int nFacesTotal = GetNumberOfFaces(loft->Shape()); int nFacesAero = nFacesTotal; - bool hasSymmetryPlane = GetNumberOfEdges(m_segments.GetSegment(1).GetEndWire()) > 1; + bool hasSymmetryPlane = GetNumberOfEdges(m_segments_choice1.get().GetSegment(1).GetEndWire()) > 1; std::vector names; names.push_back(loft->Name()); @@ -265,15 +398,16 @@ void CCPACSHull::SetFaceTraits(PNamedShape loft) const names.push_back("Front"); names.push_back("Rear"); - if (!CTiglTopoAlgorithms::IsDegenerated(m_segments.GetSegment(1).GetStartWire())) { + if (!CTiglTopoAlgorithms::IsDegenerated(m_segments_choice1.get().GetSegment(1).GetStartWire())) { nFacesAero -= 1; } - if (!CTiglTopoAlgorithms::IsDegenerated(m_segments.GetSegment(m_segments.GetSegmentCount()).GetEndWire())) { + if (!CTiglTopoAlgorithms::IsDegenerated( + m_segments_choice1.get().GetSegment(m_segments_choice1.get().GetSegmentCount()).GetEndWire())) { nFacesAero -= 1; } // if we have a smooth surface, the whole fuslage is treatet as one segment - int nSegments = m_segments.GetSegmentCount(); + int nSegments = m_segments_choice1.get().GetSegmentCount(); int facesPerSegment = nFacesAero / nSegments; diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index 07c37c639a..b45ac139cb 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -162,8 +162,9 @@ CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSection else if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetSections(); } + // ToDo: add exception handling else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections(); + return segment->GetParent()->GetParent()->GetSections_choice1().get(); } else { throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); diff --git a/src/generated/CPACSDomeType.cpp b/src/generated/CPACSDomeType.cpp index 2aa18a4ce5..dabd8adf43 100644 --- a/src/generated/CPACSDomeType.cpp +++ b/src/generated/CPACSDomeType.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include +#include "CCPACSHull.h" #include "CPACSDomeType.h" -#include "CPACSGenericFuelTankParameters.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDObject.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSDomeType::CPACSDomeType(CPACSGenericFuelTankParameters* parent) + CPACSDomeType::CPACSDomeType(CCPACSHull* parent) { //assert(parent != NULL); m_parent = parent; @@ -37,30 +37,24 @@ namespace generated { } - const CPACSGenericFuelTankParameters* CPACSDomeType::GetParent() const + const CCPACSHull* CPACSDomeType::GetParent() const { return m_parent; } - CPACSGenericFuelTankParameters* CPACSDomeType::GetParent() + CCPACSHull* CPACSDomeType::GetParent() { return m_parent; } const CTiglUIDObject* CPACSDomeType::GetNextUIDParent() const { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; + return m_parent; } CTiglUIDObject* CPACSDomeType::GetNextUIDParent() { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; + return m_parent; } void CPACSDomeType::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) diff --git a/src/generated/CPACSDomeType.h b/src/generated/CPACSDomeType.h index 914def2faf..36f3a83edd 100644 --- a/src/generated/CPACSDomeType.h +++ b/src/generated/CPACSDomeType.h @@ -31,13 +31,12 @@ namespace tigl { class CTiglUIDObject; +class CCPACSHull; namespace generated { - class CPACSGenericFuelTankParameters; - // This class is used in: - // CPACSGenericFuelTankParameters + // CPACSHull /// @brief Dome Type /// @@ -46,13 +45,13 @@ namespace generated class CPACSDomeType { public: - TIGL_EXPORT CPACSDomeType(CPACSGenericFuelTankParameters* parent); + TIGL_EXPORT CPACSDomeType(CCPACSHull* parent); TIGL_EXPORT virtual ~CPACSDomeType(); - TIGL_EXPORT CPACSGenericFuelTankParameters* GetParent(); + TIGL_EXPORT CCPACSHull* GetParent(); - TIGL_EXPORT const CPACSGenericFuelTankParameters* GetParent() const; + TIGL_EXPORT const CCPACSHull* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -87,7 +86,7 @@ namespace generated TIGL_EXPORT virtual void RemoveIsotensoid_choice4(); protected: - CPACSGenericFuelTankParameters* m_parent; + CCPACSHull* m_parent; boost::optional m_spherical_choice1; boost::optional m_ellipsoid_choice2; @@ -105,5 +104,4 @@ namespace generated // Aliases in tigl namespace using CCPACSDomeType = generated::CPACSDomeType; -using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; } // namespace tigl diff --git a/src/generated/CPACSGenericFuelTank.cpp b/src/generated/CPACSGenericFuelTank.cpp index 132d503296..9acc2be3f7 100644 --- a/src/generated/CPACSGenericFuelTank.cpp +++ b/src/generated/CPACSGenericFuelTank.cpp @@ -30,6 +30,7 @@ namespace generated CPACSGenericFuelTank::CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) + , m_hulls(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; @@ -124,24 +125,10 @@ namespace generated // read element hulls if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { - m_hulls_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_hulls_choice1->ReadCPACS(tixiHandle, xpath + "/hulls"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read hulls at xpath " << xpath << ": " << e.what(); - m_hulls_choice1 = boost::none; - } + m_hulls.ReadCPACS(tixiHandle, xpath + "/hulls"); } - - // read element designParameters - if (tixi::TixiCheckElement(tixiHandle, xpath + "/designParameters")) { - m_designParameters_choice2 = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_designParameters_choice2->ReadCPACS(tixiHandle, xpath + "/designParameters"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read designParameters at xpath " << xpath << ": " << e.what(); - m_designParameters_choice2 = boost::none; - } + else { + LOG(ERROR) << "Required element hulls is missing at xpath " << xpath; } // read element volume @@ -161,14 +148,11 @@ namespace generated } if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); - if (!ValidateChoices()) { - LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; - } } void CPACSGenericFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "name", "description", "transformation", "hulls", "designParameters", "volume", "burstPressure" }; + const std::vector childElemOrder = { "name", "description", "transformation", "hulls", "volume", "burstPressure" }; // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); @@ -193,26 +177,8 @@ namespace generated m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); // write element hulls - if (m_hulls_choice1) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); - m_hulls_choice1->WriteCPACS(tixiHandle, xpath + "/hulls"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/hulls"); - } - } - - // write element designParameters - if (m_designParameters_choice2) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/designParameters", childElemOrder); - m_designParameters_choice2->WriteCPACS(tixiHandle, xpath + "/designParameters"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/designParameters")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/designParameters"); - } - } + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); + m_hulls.WriteCPACS(tixiHandle, xpath + "/hulls"); // write element volume if (m_volume) { @@ -238,36 +204,6 @@ namespace generated } - bool CPACSGenericFuelTank::ValidateChoices() const - { - return - ( - ( - ( - // mandatory elements of this choice must be there - m_hulls_choice1.is_initialized() - && - // elements of other choices must not be there - !( - m_designParameters_choice2.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_designParameters_choice2.is_initialized() - && - // elements of other choices must not be there - !( - m_hulls_choice1.is_initialized() - ) - ) - == 1 - ) - ) - ; - } - const std::string& CPACSGenericFuelTank::GetUID() const { return m_uID; @@ -316,24 +252,14 @@ namespace generated return m_transformation; } - const boost::optional& CPACSGenericFuelTank::GetHulls_choice1() const - { - return m_hulls_choice1; - } - - boost::optional& CPACSGenericFuelTank::GetHulls_choice1() - { - return m_hulls_choice1; - } - - const boost::optional& CPACSGenericFuelTank::GetDesignParameters_choice2() const + const CCPACSHulls& CPACSGenericFuelTank::GetHulls() const { - return m_designParameters_choice2; + return m_hulls; } - boost::optional& CPACSGenericFuelTank::GetDesignParameters_choice2() + CCPACSHulls& CPACSGenericFuelTank::GetHulls() { - return m_designParameters_choice2; + return m_hulls; } const boost::optional& CPACSGenericFuelTank::GetVolume() const @@ -356,30 +282,6 @@ namespace generated m_burstPressure = value; } - CCPACSHulls& CPACSGenericFuelTank::GetHulls_choice1(CreateIfNotExistsTag) - { - if (!m_hulls_choice1) - m_hulls_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_hulls_choice1; - } - - void CPACSGenericFuelTank::RemoveHulls_choice1() - { - m_hulls_choice1 = boost::none; - } - - CPACSGenericFuelTankParameters& CPACSGenericFuelTank::GetDesignParameters_choice2(CreateIfNotExistsTag) - { - if (!m_designParameters_choice2) - m_designParameters_choice2 = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_designParameters_choice2; - } - - void CPACSGenericFuelTank::RemoveDesignParameters_choice2() - { - m_designParameters_choice2 = boost::none; - } - CPACSFuelTankVolume& CPACSGenericFuelTank::GetVolume(CreateIfNotExistsTag) { if (!m_volume) diff --git a/src/generated/CPACSGenericFuelTank.h b/src/generated/CPACSGenericFuelTank.h index 8103195527..dd43b43b68 100644 --- a/src/generated/CPACSGenericFuelTank.h +++ b/src/generated/CPACSGenericFuelTank.h @@ -24,7 +24,6 @@ #include #include #include "CPACSFuelTankVolume.h" -#include "CPACSGenericFuelTankParameters.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -62,8 +61,6 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT bool ValidateChoices() const; - TIGL_EXPORT virtual const std::string& GetUID() const; TIGL_EXPORT virtual void SetUID(const std::string& value); @@ -76,11 +73,8 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const boost::optional& GetHulls_choice1() const; - TIGL_EXPORT virtual boost::optional& GetHulls_choice1(); - - TIGL_EXPORT virtual const boost::optional& GetDesignParameters_choice2() const; - TIGL_EXPORT virtual boost::optional& GetDesignParameters_choice2(); + TIGL_EXPORT virtual const CCPACSHulls& GetHulls() const; + TIGL_EXPORT virtual CCPACSHulls& GetHulls(); TIGL_EXPORT virtual const boost::optional& GetVolume() const; TIGL_EXPORT virtual boost::optional& GetVolume(); @@ -88,12 +82,6 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); - TIGL_EXPORT virtual CCPACSHulls& GetHulls_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveHulls_choice1(); - - TIGL_EXPORT virtual CPACSGenericFuelTankParameters& GetDesignParameters_choice2(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveDesignParameters_choice2(); - TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveVolume(); @@ -102,25 +90,23 @@ namespace generated CTiglUIDManager* m_uidMgr; - std::string m_uID; + std::string m_uID; /// Name - std::string m_name; + std::string m_name; /// Description - boost::optional m_description; - - CCPACSTransformation m_transformation; + boost::optional m_description; - boost::optional m_hulls_choice1; + CCPACSTransformation m_transformation; - boost::optional m_designParameters_choice2; + CCPACSHulls m_hulls; /// Volume - boost::optional m_volume; + boost::optional m_volume; /// Burst pressure - boost::optional m_burstPressure; + boost::optional m_burstPressure; private: CPACSGenericFuelTank(const CPACSGenericFuelTank&) = delete; diff --git a/src/generated/CPACSGenericFuelTankParameters.cpp b/src/generated/CPACSGenericFuelTankParameters.cpp deleted file mode 100644 index e78406de17..0000000000 --- a/src/generated/CPACSGenericFuelTankParameters.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSGenericFuelTank.h" -#include "CPACSGenericFuelTankParameters.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSGenericFuelTankParameters::CPACSGenericFuelTankParameters(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - , m_cylinderRadius(0) - , m_cylinderLength(0) - , m_domeType(this) - , m_material(this, m_uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSGenericFuelTankParameters::~CPACSGenericFuelTankParameters() - { - } - - const CCPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() const - { - return m_parent; - } - - CCPACSGenericFuelTank* CPACSGenericFuelTankParameters::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSGenericFuelTankParameters::GetNextUIDParent() const - { - return m_parent; - } - - CTiglUIDObject* CPACSGenericFuelTankParameters::GetNextUIDParent() - { - return m_parent; - } - - CTiglUIDManager& CPACSGenericFuelTankParameters::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSGenericFuelTankParameters::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSGenericFuelTankParameters::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read element cylinderRadius - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { - m_cylinderRadius = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); - } - else { - LOG(ERROR) << "Required element cylinderRadius is missing at xpath " << xpath; - } - - // read element cylinderLength - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { - m_cylinderLength = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderLength"); - } - else { - LOG(ERROR) << "Required element cylinderLength is missing at xpath " << xpath; - } - - // read element domeType - if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { - m_domeType.ReadCPACS(tixiHandle, xpath + "/domeType"); - } - else { - LOG(ERROR) << "Required element domeType is missing at xpath " << xpath; - } - - // read element material - if (tixi::TixiCheckElement(tixiHandle, xpath + "/material")) { - m_material.ReadCPACS(tixiHandle, xpath + "/material"); - } - else { - LOG(ERROR) << "Required element material is missing at xpath " << xpath; - } - - } - - void CPACSGenericFuelTankParameters::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write element cylinderRadius - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cylinderRadius"); - tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", m_cylinderRadius); - - // write element cylinderLength - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cylinderLength"); - tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderLength", m_cylinderLength); - - // write element domeType - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/domeType"); - m_domeType.WriteCPACS(tixiHandle, xpath + "/domeType"); - - // write element material - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/material"); - m_material.WriteCPACS(tixiHandle, xpath + "/material"); - - } - - const double& CPACSGenericFuelTankParameters::GetCylinderRadius() const - { - return m_cylinderRadius; - } - - void CPACSGenericFuelTankParameters::SetCylinderRadius(const double& value) - { - m_cylinderRadius = value; - } - - const double& CPACSGenericFuelTankParameters::GetCylinderLength() const - { - return m_cylinderLength; - } - - void CPACSGenericFuelTankParameters::SetCylinderLength(const double& value) - { - m_cylinderLength = value; - } - - const CPACSDomeType& CPACSGenericFuelTankParameters::GetDomeType() const - { - return m_domeType; - } - - CPACSDomeType& CPACSGenericFuelTankParameters::GetDomeType() - { - return m_domeType; - } - - const CCPACSMaterialDefinition& CPACSGenericFuelTankParameters::GetMaterial() const - { - return m_material; - } - - CCPACSMaterialDefinition& CPACSGenericFuelTankParameters::GetMaterial() - { - return m_material; - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTankParameters.h b/src/generated/CPACSGenericFuelTankParameters.h deleted file mode 100644 index bd1d0379b7..0000000000 --- a/src/generated/CPACSGenericFuelTankParameters.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include "CPACSDomeType.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; -class CTiglUIDObject; -class CCPACSGenericFuelTank; - -namespace generated -{ - // This class is used in: - // CPACSGenericFuelTank - - /// @brief Global design parameters - /// - /// - class CPACSGenericFuelTankParameters - { - public: - TIGL_EXPORT CPACSGenericFuelTankParameters(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSGenericFuelTankParameters(); - - TIGL_EXPORT CCPACSGenericFuelTank* GetParent(); - - TIGL_EXPORT const CCPACSGenericFuelTank* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT virtual const double& GetCylinderRadius() const; - TIGL_EXPORT virtual void SetCylinderRadius(const double& value); - - TIGL_EXPORT virtual const double& GetCylinderLength() const; - TIGL_EXPORT virtual void SetCylinderLength(const double& value); - - TIGL_EXPORT virtual const CPACSDomeType& GetDomeType() const; - TIGL_EXPORT virtual CPACSDomeType& GetDomeType(); - - TIGL_EXPORT virtual const CCPACSMaterialDefinition& GetMaterial() const; - TIGL_EXPORT virtual CCPACSMaterialDefinition& GetMaterial(); - - protected: - CCPACSGenericFuelTank* m_parent; - - CTiglUIDManager* m_uidMgr; - - /// Inner radius of the cylinder - double m_cylinderRadius; - - /// Inner length of the cylinder - double m_cylinderLength; - - CPACSDomeType m_domeType; - - CCPACSMaterialDefinition m_material; - - private: - CPACSGenericFuelTankParameters(const CPACSGenericFuelTankParameters&) = delete; - CPACSGenericFuelTankParameters& operator=(const CPACSGenericFuelTankParameters&) = delete; - - CPACSGenericFuelTankParameters(CPACSGenericFuelTankParameters&&) = delete; - CPACSGenericFuelTankParameters& operator=(CPACSGenericFuelTankParameters&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; -} // namespace tigl diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSHull.cpp index a033f5174b..36c1075005 100644 --- a/src/generated/CPACSHull.cpp +++ b/src/generated/CPACSHull.cpp @@ -30,8 +30,6 @@ namespace generated CPACSHull::CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) - , m_sections(reinterpret_cast(this), m_uidMgr) - , m_segments(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; @@ -126,18 +124,45 @@ namespace generated // read element sections if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { - m_sections.ReadCPACS(tixiHandle, xpath + "/sections"); - } - else { - LOG(ERROR) << "Required element sections is missing at xpath " << xpath; + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_sections_choice1->ReadCPACS(tixiHandle, xpath + "/sections"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read sections at xpath " << xpath << ": " << e.what(); + m_sections_choice1 = boost::none; + } } // read element segments if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { - m_segments.ReadCPACS(tixiHandle, xpath + "/segments"); + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_segments_choice1->ReadCPACS(tixiHandle, xpath + "/segments"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read segments at xpath " << xpath << ": " << e.what(); + m_segments_choice1 = boost::none; + } } - else { - LOG(ERROR) << "Required element segments is missing at xpath " << xpath; + + // read element cylinderRadius + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { + m_cylinderRadius_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); + } + + // read element cylinderLength + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { + m_cylinderLength_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderLength"); + } + + // read element domeType + if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + try { + m_domeType_choice2->ReadCPACS(tixiHandle, xpath + "/domeType"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read domeType at xpath " << xpath << ": " << e.what(); + m_domeType_choice2 = boost::none; + } } // read element structure @@ -152,20 +177,25 @@ namespace generated } if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } } void CPACSHull::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { + const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure" }; + // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); // write element name - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name"); + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); // write element description if (m_description) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); } else { @@ -175,20 +205,67 @@ namespace generated } // write element transformation - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/transformation"); + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); // write element sections - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/sections"); - m_sections.WriteCPACS(tixiHandle, xpath + "/sections"); + if (m_sections_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/sections", childElemOrder); + m_sections_choice1->WriteCPACS(tixiHandle, xpath + "/sections"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/sections"); + } + } // write element segments - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/segments"); - m_segments.WriteCPACS(tixiHandle, xpath + "/segments"); + if (m_segments_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/segments", childElemOrder); + m_segments_choice1->WriteCPACS(tixiHandle, xpath + "/segments"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/segments"); + } + } + + // write element cylinderRadius + if (m_cylinderRadius_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderRadius", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", *m_cylinderRadius_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderRadius"); + } + } + + // write element cylinderLength + if (m_cylinderLength_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderLength", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderLength", *m_cylinderLength_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderLength"); + } + } + + // write element domeType + if (m_domeType_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/domeType", childElemOrder); + m_domeType_choice2->WriteCPACS(tixiHandle, xpath + "/domeType"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/domeType"); + } + } // write element structure if (m_structure) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/structure"); + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/structure", childElemOrder); m_structure->WriteCPACS(tixiHandle, xpath + "/structure"); } else { @@ -199,6 +276,48 @@ namespace generated } + bool CPACSHull::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_sections_choice1.is_initialized() + && + m_segments_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_cylinderRadius_choice2.is_initialized() + || + m_cylinderLength_choice2.is_initialized() + || + m_domeType_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_cylinderRadius_choice2.is_initialized() + && + m_cylinderLength_choice2.is_initialized() + && + m_domeType_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_sections_choice1.is_initialized() + || + m_segments_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + const std::string& CPACSHull::GetUID() const { return m_uID; @@ -247,24 +366,54 @@ namespace generated return m_transformation; } - const CCPACSFuselageSections& CPACSHull::GetSections() const + const boost::optional& CPACSHull::GetSections_choice1() const + { + return m_sections_choice1; + } + + boost::optional& CPACSHull::GetSections_choice1() + { + return m_sections_choice1; + } + + const boost::optional& CPACSHull::GetSegments_choice1() const + { + return m_segments_choice1; + } + + boost::optional& CPACSHull::GetSegments_choice1() + { + return m_segments_choice1; + } + + const boost::optional& CPACSHull::GetCylinderRadius_choice2() const + { + return m_cylinderRadius_choice2; + } + + void CPACSHull::SetCylinderRadius_choice2(const boost::optional& value) + { + m_cylinderRadius_choice2 = value; + } + + const boost::optional& CPACSHull::GetCylinderLength_choice2() const { - return m_sections; + return m_cylinderLength_choice2; } - CCPACSFuselageSections& CPACSHull::GetSections() + void CPACSHull::SetCylinderLength_choice2(const boost::optional& value) { - return m_sections; + m_cylinderLength_choice2 = value; } - const CCPACSFuselageSegments& CPACSHull::GetSegments() const + const boost::optional& CPACSHull::GetDomeType_choice2() const { - return m_segments; + return m_domeType_choice2; } - CCPACSFuselageSegments& CPACSHull::GetSegments() + boost::optional& CPACSHull::GetDomeType_choice2() { - return m_segments; + return m_domeType_choice2; } const boost::optional& CPACSHull::GetStructure() const @@ -277,6 +426,42 @@ namespace generated return m_structure; } + CCPACSFuselageSections& CPACSHull::GetSections_choice1(CreateIfNotExistsTag) + { + if (!m_sections_choice1) + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_sections_choice1; + } + + void CPACSHull::RemoveSections_choice1() + { + m_sections_choice1 = boost::none; + } + + CCPACSFuselageSegments& CPACSHull::GetSegments_choice1(CreateIfNotExistsTag) + { + if (!m_segments_choice1) + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_segments_choice1; + } + + void CPACSHull::RemoveSegments_choice1() + { + m_segments_choice1 = boost::none; + } + + CPACSDomeType& CPACSHull::GetDomeType_choice2(CreateIfNotExistsTag) + { + if (!m_domeType_choice2) + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + return *m_domeType_choice2; + } + + void CPACSHull::RemoveDomeType_choice2() + { + m_domeType_choice2 = boost::none; + } + CCPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) { if (!m_structure) diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSHull.h index 2433b459b7..00ea512d72 100644 --- a/src/generated/CPACSHull.h +++ b/src/generated/CPACSHull.h @@ -25,6 +25,7 @@ #include #include #include +#include "CPACSDomeType.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -62,6 +63,8 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + TIGL_EXPORT bool ValidateChoices() const; + TIGL_EXPORT virtual const std::string& GetUID() const; TIGL_EXPORT virtual void SetUID(const std::string& value); @@ -74,15 +77,33 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const CCPACSFuselageSections& GetSections() const; - TIGL_EXPORT virtual CCPACSFuselageSections& GetSections(); + TIGL_EXPORT virtual const boost::optional& GetSections_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSections_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetSegments_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSegments_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetCylinderRadius_choice2() const; + TIGL_EXPORT virtual void SetCylinderRadius_choice2(const boost::optional& value); - TIGL_EXPORT virtual const CCPACSFuselageSegments& GetSegments() const; - TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments(); + TIGL_EXPORT virtual const boost::optional& GetCylinderLength_choice2() const; + TIGL_EXPORT virtual void SetCylinderLength_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetDomeType_choice2() const; + TIGL_EXPORT virtual boost::optional& GetDomeType_choice2(); TIGL_EXPORT virtual const boost::optional& GetStructure() const; TIGL_EXPORT virtual boost::optional& GetStructure(); + TIGL_EXPORT virtual CCPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSections_choice1(); + + TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSegments_choice1(); + + TIGL_EXPORT virtual CPACSDomeType& GetDomeType_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveDomeType_choice2(); + TIGL_EXPORT virtual CCPACSHullStructure& GetStructure(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStructure(); @@ -91,21 +112,29 @@ namespace generated CTiglUIDManager* m_uidMgr; - std::string m_uID; + std::string m_uID; /// Name - std::string m_name; + std::string m_name; /// Description - boost::optional m_description; + boost::optional m_description; + + CCPACSTransformation m_transformation; + + boost::optional m_sections_choice1; + + boost::optional m_segments_choice1; - CCPACSTransformation m_transformation; + /// Inner radius of the cylinder + boost::optional m_cylinderRadius_choice2; - CCPACSFuselageSections m_sections; + /// Inner length of the cylinder + boost::optional m_cylinderLength_choice2; - CCPACSFuselageSegments m_segments; + boost::optional m_domeType_choice2; - boost::optional m_structure; + boost::optional m_structure; private: CPACSHull(const CPACSHull&) = delete; diff --git a/src/generated/CPACSMaterialDefinition.cpp b/src/generated/CPACSMaterialDefinition.cpp index 8cd3b6e21c..c2cbd8f5d0 100644 --- a/src/generated/CPACSMaterialDefinition.cpp +++ b/src/generated/CPACSMaterialDefinition.cpp @@ -18,7 +18,6 @@ #include #include "CCPACSWingRibCrossSection.h" #include "CPACSCap.h" -#include "CPACSGenericFuelTankParameters.h" #include "CPACSLateralCap.h" #include "CPACSMaterialDefinition.h" #include "CPACSSheetBasedStructuralElement.h" @@ -44,14 +43,6 @@ namespace generated m_parentType = &typeid(CPACSCap); } - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSGenericFuelTankParameters); - } - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -122,9 +113,6 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } if (IsParent()) { return GetParent()->GetNextUIDParent(); } @@ -156,9 +144,6 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } if (IsParent()) { return GetParent()->GetNextUIDParent(); } diff --git a/src/generated/CPACSMaterialDefinition.h b/src/generated/CPACSMaterialDefinition.h index ec89b9b19e..30da55c36e 100644 --- a/src/generated/CPACSMaterialDefinition.h +++ b/src/generated/CPACSMaterialDefinition.h @@ -35,7 +35,6 @@ class CCPACSWingRibCrossSection; namespace generated { class CPACSCap; - class CPACSGenericFuelTankParameters; class CPACSLateralCap; class CPACSSheetBasedStructuralElement; class CPACSTrackActuator; @@ -45,7 +44,6 @@ namespace generated // This class is used in: // CPACSCap - // CPACSGenericFuelTankParameters // CPACSLateralCap // CPACSSheetBasedStructuralElement // CPACSTrackActuator @@ -63,7 +61,6 @@ namespace generated { public: TIGL_EXPORT CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSGenericFuelTankParameters* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr); @@ -83,7 +80,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -93,7 +90,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -165,7 +162,6 @@ namespace generated // Aliases in tigl namespace using CCPACSCap = generated::CPACSCap; -using CCPACSGenericFuelTankParameters = generated::CPACSGenericFuelTankParameters; using CCPACSLateralCap = generated::CPACSLateralCap; using CCPACSSheetBasedStructuralElement = generated::CPACSSheetBasedStructuralElement; using CCPACSTrackActuator = generated::CPACSTrackActuator; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index ca5d4b4bcf..092e380a9e 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -402,6 +402,61 @@ + + Simple tank 3 + Test case for simple parametrization + + + 3.5 + + + + + Hull with spherical dome + + + 10. + + + 1.0 + 2.0 + + + + + + Hull with ellipsoid dome + + + 10. + + + 1.0 + 2.0 + + + 0.5 + + + + + Hull with torispherical dome + + + 10. + + + 1.0 + 2.0 + + + 2.0 + 0.2 + + + + + diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index ffe5ab5538..16be8dc592 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -52,7 +52,7 @@ class FuselageTank : public ::testing::Test protected: static void SetUpTestCase() { - const char *filename = "TestData/simpletest-fuelTanks.cpacs.xml"; + const char* filename = "TestData/simpletest-fuelTanks.cpacs.xml"; ReturnCode tixiRet; TiglReturnCode tiglRet; @@ -73,24 +73,30 @@ class FuselageTank : public ::testing::Test tixiHandle = -1; } - void SetUp() override {} - void TearDown() override {} + void SetUp() override + { + } + void TearDown() override + { + } static TixiDocumentHandle tixiHandle; static TiglCPACSConfigurationHandle tiglHandle; - tigl::CTiglUIDManager &uidMgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); + tigl::CTiglUIDManager& uidMgr = + tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); // generic tank - tigl::CCPACSGenericFuelTank const *fuelTank = &uidMgr.ResolveObject("genericTank1"); + tigl::CCPACSGenericFuelTank const* fuelTank = &uidMgr.ResolveObject("genericTank1"); // hulls - const boost::optional &hulls = fuelTank->GetHulls_choice1(); - tigl::CCPACSHull *hull = &uidMgr.ResolveObject("outerHull"); - tigl::CCPACSHull *hull_with_guides = &uidMgr.ResolveObject("genericTank2_outerHull"); + const tigl::CCPACSHulls& hulls = fuelTank->GetHulls(); + tigl::CCPACSHull* hull = &uidMgr.ResolveObject("outerHull"); + tigl::CCPACSHull* hull_with_guides = &uidMgr.ResolveObject("genericTank2_outerHull"); + tigl::CCPACSHull* hull_spheric = &uidMgr.ResolveObject("genericTank3_sphericalDome"); }; -TixiDocumentHandle FuselageTank::tixiHandle = 0; +TixiDocumentHandle FuselageTank::tixiHandle = 0; TiglCPACSConfigurationHandle FuselageTank::tiglHandle = 0; TEST_F(FuselageTank, getName) @@ -101,27 +107,27 @@ TEST_F(FuselageTank, getName) TEST_F(FuselageTank, genericFuelTanks) { - std::string uID = "genericTank1"; + std::string uID = "genericTank1"; const tigl::CCPACSGenericFuelTanks* fuelTanks = fuelTank->GetParent(); EXPECT_EQ(fuelTanks->GetGenericFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(fuelTanks->GetGenericFuelTank(uID)); EXPECT_EQ(fuelTanks->GetGenericFuelTankIndex(uID), 1); - EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 2); + EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 3); } TEST_F(FuselageTank, genericFuelTank) { - EXPECT_TRUE(fuelTank->HasHulls()); EXPECT_NO_THROW(fuelTank->GetHulls()); } +// ToDo: Check how to use pointer -> TEST_F(FuselageTank, hulls) { - EXPECT_EQ(hulls->GetHullsCount(), 2); - EXPECT_EQ(hulls->GetHull(1).GetDefaultedUID(), "outerHull"); - EXPECT_EQ(hulls->GetHull("outerHull").GetDefaultedUID(), "outerHull"); - EXPECT_EQ(hulls->GetHullIndex("outerHull"), 1); - EXPECT_EQ(hulls->GetHulls().at(0)->GetDefaultedUID(), "outerHull"); + EXPECT_EQ(hulls.GetHullsCount(), 2); + EXPECT_EQ(hulls.GetHull(1).GetDefaultedUID(), "outerHull"); + EXPECT_EQ(hulls.GetHull("outerHull").GetDefaultedUID(), "outerHull"); + EXPECT_EQ(hulls.GetHullIndex("outerHull"), 1); + EXPECT_EQ(hulls.GetHulls().at(0)->GetDefaultedUID(), "outerHull"); } TEST_F(FuselageTank, hull) @@ -158,10 +164,15 @@ TEST_F(FuselageTank, hull) EXPECT_EQ(hull_with_guides->GetGuideCurveSegment("genericTank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); } +TEST_F(FuselageTank, parametric_hull) +{ + auto &loft = hull_spheric->GetLoft(); +} + TEST_F(FuselageTank, structure) { - auto &structure = hull->GetStructure(); + auto& structure = hull->GetStructure(); - EXPECT_EQ(structure->GetFrames()->GetFrames().size(),1); + EXPECT_EQ(structure->GetFrames()->GetFrames().size(), 1); EXPECT_EQ(structure->GetUID(), "outerHullStructure"); } \ No newline at end of file From dc1bf36a2996c6692c95bd77fc9a87f150b0878d Mon Sep 17 00:00:00 2001 From: Alder Date: Tue, 21 May 2024 15:20:15 +0200 Subject: [PATCH 027/122] implement isotensoid domes. Working, but still ugly --- src/fuelTanks/CCPACSHull.cpp | 184 ++++++++++++------ src/fuelTanks/CCPACSHull.h | 3 + .../TestData/simpletest-fuelTanks.cpacs.xml | 31 ++- 3 files changed, 146 insertions(+), 72 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index de7e1117cb..01beb14397 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -47,6 +47,7 @@ #include #include #include +#include namespace tigl { @@ -169,23 +170,50 @@ double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); } -// ToDo: Add parametric build algorithms +void CCPACSHull::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, + std::vector& r) const +{ + double dPhi = 1.0 / nodeNumber; + + r.push_back(rCyl); + x.push_back(0.0); + + double phi = 0.0; + double alpha = std::asin(rPolarOpening / rCyl); + + while (std::tan(alpha) * std::tan(alpha) < 2 && r.back() > 1.22 * rPolarOpening) { + phi += dPhi; + alpha = std::asin(rPolarOpening / r.back()); + double rm = r.back() / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); + double dr = rm * dPhi * std::sin(phi); + r.push_back(r.back() - dr); + double dx = rm * dPhi * std::cos(phi); + x.push_back(x.back() + dx); + } + + double slope = (r.back() - r[r.size() - 2]) / (x.back() - x[x.size() - 2]); + for (int i = 0; i < 5; ++i) { + x.push_back(x.back() + (rPolarOpening - r.back()) / slope); + r.push_back(r.back() + slope * (x.back() - x[x.size() - 2])); + } +} + PNamedShape CCPACSHull::BuildLoft() const { if (m_segments_choice1 && m_sections_choice1) { - TiglContinuity cont = m_segments_choice1.get().GetSegment(1).GetContinuity(); + const auto& segments = m_segments_choice1.get(); + TiglContinuity cont = segments.GetSegment(1).GetContinuity(); Standard_Boolean smooth = (cont == ::C0 ? false : true); CTiglMakeLoft lofter; // add profiles - for (int i = 1; i <= m_segments_choice1.get().GetSegmentCount(); i++) { - lofter.addProfiles(m_segments_choice1.get().GetSegment(i).GetStartWire()); + for (int i = 1; i <= segments.GetSegmentCount(); i++) { + lofter.addProfiles(segments.GetSegment(i).GetStartWire()); } - lofter.addProfiles( - m_segments_choice1.get().GetSegment(m_segments_choice1.get().GetSegmentCount()).GetEndWire()); + lofter.addProfiles(segments.GetSegment(segments.GetSegmentCount()).GetEndWire()); // add guides - lofter.addGuides(m_segments_choice1.get().GetGuideCurveWires()); + lofter.addGuides(segments.GetGuideCurveWires()); lofter.setMakeSolid(true); lofter.setMakeSmooth(smooth); @@ -200,87 +228,118 @@ PNamedShape CCPACSHull::BuildLoft() const return loft; } else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { + + // Determine dome type + const auto* spherical = m_domeType_choice2.get_ptr()->GetSpherical_choice1().get_ptr(); + const auto* ellipsoid = m_domeType_choice2.get_ptr()->GetEllipsoid_choice2().get_ptr(); + const auto* torispherical = m_domeType_choice2.get_ptr()->GetTorispherical_choice3().get_ptr(); + const auto* isotensoid = m_domeType_choice2.get_ptr()->GetIsotensoid_choice4().get_ptr(); + double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double R, r, a, c, axRatio, h, alpha; - - if (m_domeType_choice2.get().GetSpherical_choice1()) { - R = cylinderRadius; - a = 0.0; - axRatio = 1.0; - } - else if (m_domeType_choice2.get().GetEllipsoid_choice2()) { - R = cylinderRadius; - a = 0.0; - axRatio = m_domeType_choice2.get().GetEllipsoid_choice2().get().GetHalfAxisFraction(); - } - else if (m_domeType_choice2.get().GetTorispherical_choice3()) { - R = m_domeType_choice2.get().GetTorispherical_choice3().get().GetDishRadius(); - a = m_domeType_choice2.get().GetTorispherical_choice3().get().GetKnuckleRadius(); - axRatio = 1.0; + // if (spherical || ellipsoid || torispherical) { + // BuildTorisphericalWire(); + // } + // else { + // BuildIsotensoidWire(); + // } + // Default settings, following the nomenclature and equations from https://mathworld.wolfram.com/TorisphericalDome.html + // R - Radius of the sphere (crown radius) + // r - Radius where the transition from sphere to torus occurs + // a - Radius of the torus (knuckle radius) + // c - Distance from the center to the center of the torus tube + // h - Height from the base of the dome to the top + double R = cylinderRadius, h = cylinderRadius, r = 0.0, a = 0.0, c = 0.0, axRatio = 1.0, alpha = 0.0; + + if (ellipsoid) { + axRatio = ellipsoid->GetHalfAxisFraction(); + h = R * axRatio; } + else if (torispherical) { + R = torispherical->GetDishRadius(); + a = torispherical->GetKnuckleRadius(); - if (a > 0.0) { c = cylinderRadius - a; h = R - sqrt((a + c - R) * (a - c - R)); r = c * (1.0 + pow((R / a - 1), -1.0)); alpha = acos((r - c) / a); } - else { - alpha = 0.0; - h = R; - } gp_Dir dir(0.0, 1.0, 0.0); + TopoDS_Edge edge1_l, edge1_r; - gp_Pnt p1_l(R - h, 0.0, 0.0); - gp_Pnt p1_r(cylinderLength - (R - h), 0.0, 0.0); + if (spherical || ellipsoid || torispherical) { + gp_Pnt p1_l(R - h, 0.0, 0.0); + gp_Pnt p1_r(cylinderLength - (R - h), 0.0, 0.0); - gp_Elips ellips_l_gp(gp_Ax2(p1_l, dir), R, R * axRatio); - gp_Elips ellips_r_gp(gp_Ax2(p1_r, dir), R, R * axRatio); + gp_Elips ellips_l_gp(gp_Ax2(p1_l, dir), R, R * axRatio); + gp_Elips ellips_r_gp(gp_Ax2(p1_r, dir), R, R * axRatio); - GC_MakeArcOfEllipse arc1_l(ellips_l_gp, -M_PI / 2, -alpha, Standard_True); - GC_MakeArcOfEllipse arc1_r(ellips_r_gp, alpha, M_PI / 2, Standard_True); + GC_MakeArcOfEllipse arc1_l(ellips_l_gp, -M_PI / 2, -alpha, Standard_True); + GC_MakeArcOfEllipse arc1_r(ellips_r_gp, alpha, M_PI / 2, Standard_True); - TopoDS_Edge edge1_l = BRepBuilderAPI_MakeEdge(arc1_l.Value()).Edge(); - TopoDS_Edge edge1_r = BRepBuilderAPI_MakeEdge(arc1_r.Value()).Edge(); + edge1_l = BRepBuilderAPI_MakeEdge(arc1_l.Value()).Edge(); + edge1_r = BRepBuilderAPI_MakeEdge(arc1_r.Value()).Edge(); + } + else if (isotensoid) { + + double polarOpeningRadius = isotensoid->GetPolarOpeningRadius(); + std::vector x, r; + IsotensoidContour(cylinderRadius, polarOpeningRadius, 50, x, r); + + TColgp_Array1OfPnt array1(1, x.size()); + for (size_t i = 0; i < x.size(); ++i) { + array1.SetValue(i + 1, gp_Pnt(-x[i], 0.0, r[i])); + } + Handle(Geom_BSplineCurve) bspline_l = GeomAPI_PointsToBSpline(array1).Curve(); + edge1_l = BRepBuilderAPI_MakeEdge(bspline_l); + + TColgp_Array1OfPnt array2(1, x.size()); + for (size_t i = 0; i < x.size(); ++i) { + array2.SetValue(i + 1, gp_Pnt(x[i] + cylinderLength, 0.0, r[i])); + } + Handle(Geom_BSplineCurve) bspline_r = GeomAPI_PointsToBSpline(array2).Curve(); + edge1_r = BRepBuilderAPI_MakeEdge(bspline_r); + } - TopoDS_Edge edge2_l; - TopoDS_Edge edge2_r; + TopoDS_Edge edge2_l, edge2_r; + TopoDS_Vertex v1, v2; - TopoDS_Vertex v1; - TopoDS_Vertex v2; - if (a > 0) { - gp_Pnt p2_l(0, 0.0, cylinderRadius - a); - gp_Pnt p2_r(cylinderLength, 0.0, cylinderRadius - a); + if (spherical || ellipsoid || torispherical) { + if (a > 0) { + gp_Pnt p2_l(0, 0.0, cylinderRadius - a); + gp_Pnt p2_r(cylinderLength, 0.0, cylinderRadius - a); - gp_Circ circ2_l_gp(gp_Ax2(p2_l, dir), a); - gp_Circ circ2_r_gp(gp_Ax2(p2_r, dir), a); + gp_Circ circ2_l_gp(gp_Ax2(p2_l, dir), a); + gp_Circ circ2_r_gp(gp_Ax2(p2_r, dir), a); - GC_MakeArcOfCircle arc2_l(circ2_l_gp, -alpha, 0, Standard_True); - GC_MakeArcOfCircle arc2_r(circ2_r_gp, 0, alpha, Standard_True); + GC_MakeArcOfCircle arc2_l(circ2_l_gp, -alpha, 0, Standard_True); + GC_MakeArcOfCircle arc2_r(circ2_r_gp, 0, alpha, Standard_True); - edge2_l = BRepBuilderAPI_MakeEdge(arc2_l.Value()).Edge(); - edge2_r = BRepBuilderAPI_MakeEdge(arc2_r.Value()).Edge(); + edge2_l = BRepBuilderAPI_MakeEdge(arc2_l.Value()).Edge(); + edge2_r = BRepBuilderAPI_MakeEdge(arc2_r.Value()).Edge(); - v1 = GetLastVertex(edge2_l); - v2 = GetFirstVertex(edge2_r); + v1 = GetLastVertex(edge2_l); + v2 = GetFirstVertex(edge2_r); + } + else { + v1 = GetLastVertex(edge1_l); + v2 = GetFirstVertex(edge1_r); + } } - else { - v1 = GetLastVertex(edge1_l); + else if (isotensoid) { + v1 = GetFirstVertex(edge1_l); v2 = GetFirstVertex(edge1_r); } TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); BRepBuilderAPI_MakeWire wire; - std::vector edges; + std::vector edges = {edge1_l, cylinder_edge, edge1_r}; if (a > 0) { - edges = {edge1_l, edge2_l, cylinder_edge, edge2_r, edge1_r}; - } - else { - edges = {edge1_l, cylinder_edge, edge1_r}; + edges.insert(edges.begin() + 1, edge2_l); + edges.insert(edges.end() - 1, edge2_r); } for (const auto& edge : edges) { @@ -290,15 +349,12 @@ PNamedShape CCPACSHull::BuildLoft() const gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); TopoDS_Shape loftShape = BRepPrimAPI_MakeRevol(wire.Shape(), ax).Shape(); - // gp_Trsf translationTrsf; - // translationTrsf.SetTranslation(gp_Vec(h, 0, 0)); - // BRepBuilderAPI_Transform shapeTranslation(loftShape, translationTrsf); - // shapeTranslation.Build(); - // TopoDS_Shape loftShape_translated = shapeTranslation.Shape(); + tigl::CTiglTransformation transform = this->GetTransformationMatrix(); + TopoDS_Shape TransformedShape = transform.Transform(loftShape); std::string loftName = GetUID(); std::string loftShortName = GetShortShapeName(); - PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + PNamedShape loft(new CNamedShape(TransformedShape, loftName.c_str(), loftShortName.c_str())); return loft; } diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 8ea2836fb5..447a0293f8 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -97,6 +97,9 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned std::string GetShortShapeName() const; TiglGetPointBehavior getPointBehavior{asParameterOnSurface}; + + void IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, + std::vector& r) const; }; } // namespace tigl diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 092e380a9e..4889d7ae32 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -407,7 +407,7 @@ Test case for simple parametrization - 3.5 + -1 @@ -415,11 +415,11 @@ Hull with spherical dome - 10. + 0. 1.0 - 2.0 + 10.0 @@ -428,26 +428,26 @@ Hull with ellipsoid dome - 10. + 0. 1.0 - 2.0 + 10.0 0.5 - + Hull with torispherical dome - 10. + 0. 1.0 - 2.0 + 10.0 2.0 @@ -455,6 +455,21 @@ + + Hull with isotensoid dome + + + 0. + + + 1.0 + 10.0 + + + 0.1 + + + From 8c32e9f38bd203e309e5561c26cd1570e8f62ebd Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 23 May 2024 17:31:10 +0200 Subject: [PATCH 028/122] refactor parametric tanks --- src/fuelTanks/CCPACSHull.cpp | 298 ++++++++++-------- src/fuelTanks/CCPACSHull.h | 13 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 36 ++- tests/unittests/tiglTanks.cpp | 4 +- 4 files changed, 198 insertions(+), 153 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 01beb14397..52f45aa87a 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -44,8 +44,8 @@ #include #include #include -#include #include +#include #include #include @@ -196,166 +196,198 @@ void CCPACSHull::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNu x.push_back(x.back() + (rPolarOpening - r.back()) / slope); r.push_back(r.back() + slope * (x.back() - x[x.size() - 2])); } + + double dx = x.back() - x.front(); + for (auto& val : x) { + val -= dx; + } } -PNamedShape CCPACSHull::BuildLoft() const +TopoDS_Shape CCPACSHull::BuildShapeFromSegments() const { - if (m_segments_choice1 && m_sections_choice1) { - const auto& segments = m_segments_choice1.get(); - TiglContinuity cont = segments.GetSegment(1).GetContinuity(); - Standard_Boolean smooth = (cont == ::C0 ? false : true); - - CTiglMakeLoft lofter; - // add profiles - for (int i = 1; i <= segments.GetSegmentCount(); i++) { - lofter.addProfiles(segments.GetSegment(i).GetStartWire()); - } - lofter.addProfiles(segments.GetSegment(segments.GetSegmentCount()).GetEndWire()); + const auto& segments = m_segments_choice1.get(); + TiglContinuity cont = segments.GetSegment(1).GetContinuity(); + Standard_Boolean smooth = (cont == ::C0 ? false : true); + + CTiglMakeLoft lofter; + // add profiles + for (int i = 1; i <= segments.GetSegmentCount(); i++) { + lofter.addProfiles(segments.GetSegment(i).GetStartWire()); + } + lofter.addProfiles(segments.GetSegment(segments.GetSegmentCount()).GetEndWire()); - // add guides - lofter.addGuides(segments.GetGuideCurveWires()); + // add guides + lofter.addGuides(segments.GetGuideCurveWires()); - lofter.setMakeSolid(true); - lofter.setMakeSmooth(smooth); + lofter.setMakeSolid(true); + lofter.setMakeSmooth(smooth); - TopoDS_Shape loftShape = lofter.Shape(); + return lofter.Shape(); +} - std::string loftName = GetUID(); - std::string loftShortName = GetShortShapeName(); - PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); - SetFaceTraits(loft); +void CCPACSHull::BuildTankWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const +{ + for (const auto& edge : edges) { + wire.Add(edge); + } - return loft; + TopoDS_Vertex v2 = GetLastVertex(edges.back()); + gp_Pnt mirror_point(BRep_Tool::Pnt(v2).X(), 0, 0); + gp_Trsf mirror; + mirror.SetMirror(gp_Ax2(mirror_point, gp_Dir(1, 0, 0))); + + for (auto it = edges.rbegin(); it != edges.rend(); ++it) { + TopoDS_Shape mirrored_edge = BRepBuilderAPI_Transform(*it, mirror).Shape(); + wire.Add(TopoDS::Edge(mirrored_edge)); } - else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { +} - // Determine dome type - const auto* spherical = m_domeType_choice2.get_ptr()->GetSpherical_choice1().get_ptr(); - const auto* ellipsoid = m_domeType_choice2.get_ptr()->GetEllipsoid_choice2().get_ptr(); - const auto* torispherical = m_domeType_choice2.get_ptr()->GetTorispherical_choice3().get_ptr(); - const auto* isotensoid = m_domeType_choice2.get_ptr()->GetIsotensoid_choice4().get_ptr(); - - double cylinderRadius = m_cylinderRadius_choice2.get(); - double cylinderLength = m_cylinderLength_choice2.get(); - - // if (spherical || ellipsoid || torispherical) { - // BuildTorisphericalWire(); - // } - // else { - // BuildIsotensoidWire(); - // } - // Default settings, following the nomenclature and equations from https://mathworld.wolfram.com/TorisphericalDome.html - // R - Radius of the sphere (crown radius) - // r - Radius where the transition from sphere to torus occurs - // a - Radius of the torus (knuckle radius) - // c - Distance from the center to the center of the torus tube - // h - Height from the base of the dome to the top - double R = cylinderRadius, h = cylinderRadius, r = 0.0, a = 0.0, c = 0.0, axRatio = 1.0, alpha = 0.0; - - if (ellipsoid) { - axRatio = ellipsoid->GetHalfAxisFraction(); - h = R * axRatio; - } - else if (torispherical) { - R = torispherical->GetDishRadius(); - a = torispherical->GetKnuckleRadius(); - - c = cylinderRadius - a; - h = R - sqrt((a + c - R) * (a - c - R)); - r = c * (1.0 + pow((R / a - 1), -1.0)); - alpha = acos((r - c) / a); - } +void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const +{ + double cylinderRadius = m_cylinderRadius_choice2.get(); + double cylinderLength = m_cylinderLength_choice2.get(); - gp_Dir dir(0.0, 1.0, 0.0); - TopoDS_Edge edge1_l, edge1_r; + const auto* spherical = m_domeType_choice2->GetSpherical_choice1().get_ptr(); + const auto* ellipsoid = m_domeType_choice2->GetEllipsoid_choice2().get_ptr(); - if (spherical || ellipsoid || torispherical) { - gp_Pnt p1_l(R - h, 0.0, 0.0); - gp_Pnt p1_r(cylinderLength - (R - h), 0.0, 0.0); + double R = cylinderRadius, h = cylinderRadius, axRatio = 1.0; - gp_Elips ellips_l_gp(gp_Ax2(p1_l, dir), R, R * axRatio); - gp_Elips ellips_r_gp(gp_Ax2(p1_r, dir), R, R * axRatio); + if (ellipsoid) { + axRatio = ellipsoid->GetHalfAxisFraction(); + h = R * axRatio; + } - GC_MakeArcOfEllipse arc1_l(ellips_l_gp, -M_PI / 2, -alpha, Standard_True); - GC_MakeArcOfEllipse arc1_r(ellips_r_gp, alpha, M_PI / 2, Standard_True); + gp_Dir dir(0.0, 1.0, 0.0); - edge1_l = BRepBuilderAPI_MakeEdge(arc1_l.Value()).Edge(); - edge1_r = BRepBuilderAPI_MakeEdge(arc1_r.Value()).Edge(); - } - else if (isotensoid) { - - double polarOpeningRadius = isotensoid->GetPolarOpeningRadius(); - std::vector x, r; - IsotensoidContour(cylinderRadius, polarOpeningRadius, 50, x, r); - - TColgp_Array1OfPnt array1(1, x.size()); - for (size_t i = 0; i < x.size(); ++i) { - array1.SetValue(i + 1, gp_Pnt(-x[i], 0.0, r[i])); - } - Handle(Geom_BSplineCurve) bspline_l = GeomAPI_PointsToBSpline(array1).Curve(); - edge1_l = BRepBuilderAPI_MakeEdge(bspline_l); - - TColgp_Array1OfPnt array2(1, x.size()); - for (size_t i = 0; i < x.size(); ++i) { - array2.SetValue(i + 1, gp_Pnt(x[i] + cylinderLength, 0.0, r[i])); - } - Handle(Geom_BSplineCurve) bspline_r = GeomAPI_PointsToBSpline(array2).Curve(); - edge1_r = BRepBuilderAPI_MakeEdge(bspline_r); - } + gp_Pnt p(h, 0.0, 0.0); - TopoDS_Edge edge2_l, edge2_r; - TopoDS_Vertex v1, v2; + gp_Elips ellips(gp_Ax2(p, dir), R, R * axRatio); - if (spherical || ellipsoid || torispherical) { - if (a > 0) { - gp_Pnt p2_l(0, 0.0, cylinderRadius - a); - gp_Pnt p2_r(cylinderLength, 0.0, cylinderRadius - a); + GC_MakeArcOfEllipse arc(ellips, -M_PI / 2, 0.0, Standard_True); - gp_Circ circ2_l_gp(gp_Ax2(p2_l, dir), a); - gp_Circ circ2_r_gp(gp_Ax2(p2_r, dir), a); + TopoDS_Edge dome_edge = BRepBuilderAPI_MakeEdge(arc.Value()).Edge(); - GC_MakeArcOfCircle arc2_l(circ2_l_gp, -alpha, 0, Standard_True); - GC_MakeArcOfCircle arc2_r(circ2_r_gp, 0, alpha, Standard_True); + TopoDS_Vertex v1 = GetLastVertex(dome_edge); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); - edge2_l = BRepBuilderAPI_MakeEdge(arc2_l.Value()).Edge(); - edge2_r = BRepBuilderAPI_MakeEdge(arc2_r.Value()).Edge(); + TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); - v1 = GetLastVertex(edge2_l); - v2 = GetFirstVertex(edge2_r); - } - else { - v1 = GetLastVertex(edge1_l); - v2 = GetFirstVertex(edge1_r); - } - } - else if (isotensoid) { - v1 = GetFirstVertex(edge1_l); - v2 = GetFirstVertex(edge1_r); - } + std::vector edges = {dome_edge, cylinder_edge}; + BuildTankWire(edges, wire); +} - TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); +void CCPACSHull::BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const +{ + double cylinderRadius = m_cylinderRadius_choice2.get(); + double cylinderLength = m_cylinderLength_choice2.get(); - BRepBuilderAPI_MakeWire wire; - std::vector edges = {edge1_l, cylinder_edge, edge1_r}; - if (a > 0) { - edges.insert(edges.begin() + 1, edge2_l); - edges.insert(edges.end() - 1, edge2_r); - } + const auto* torispherical = m_domeType_choice2->GetTorispherical_choice3().get_ptr(); - for (const auto& edge : edges) { - wire.Add(edge); - } + double R = torispherical->GetDishRadius(); // Radius of the sphere (crown radius) + double r = torispherical->GetKnuckleRadius(); // Radius of the torus (knuckle radius) + + double c = cylinderRadius - r; // Distance from the center to the center of the torus tube + double h = R - sqrt((r + c - R) * (r - c - R)); // Height from the base of the dome to the top + double rt = c * (1.0 + pow((R / r - 1), -1.0)); // Radius where the transition from sphere to torus occurs + double alpha = acos((rt - c) / r); // Angle under which the transition from sphere to torus occurs + + gp_Dir dir(0.0, 1.0, 0.0); + + gp_Pnt p1(R, 0.0, 0.0); + gp_Pnt p2(h, 0.0, cylinderRadius - r); - gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); - TopoDS_Shape loftShape = BRepPrimAPI_MakeRevol(wire.Shape(), ax).Shape(); + gp_Circ circ1(gp_Ax2(p1, dir), R); + gp_Circ circ2(gp_Ax2(p2, dir), r); - tigl::CTiglTransformation transform = this->GetTransformationMatrix(); - TopoDS_Shape TransformedShape = transform.Transform(loftShape); + GC_MakeArcOfCircle arc1(circ1, -M_PI / 2, -alpha, Standard_True); + GC_MakeArcOfCircle arc2(circ2, -alpha, 0, Standard_True); - std::string loftName = GetUID(); - std::string loftShortName = GetShortShapeName(); - PNamedShape loft(new CNamedShape(TransformedShape, loftName.c_str(), loftShortName.c_str())); + TopoDS_Edge dome_edge1 = BRepBuilderAPI_MakeEdge(arc1.Value()).Edge(); + TopoDS_Edge dome_edge2 = BRepBuilderAPI_MakeEdge(arc2.Value()).Edge(); + + TopoDS_Vertex v1 = GetLastVertex(dome_edge2); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + + std::vector edges = {dome_edge1, dome_edge2, cylinder_edge}; + BuildTankWire(edges, wire); +} +void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const +{ + double cylinderRadius = m_cylinderRadius_choice2.get(); + double cylinderLength = m_cylinderLength_choice2.get(); + + const auto* isotensoid = m_domeType_choice2->GetIsotensoid_choice4().get_ptr(); + + double polarOpeningRadius = isotensoid->GetPolarOpeningRadius(); + std::vector x, r; + IsotensoidContour(cylinderRadius, polarOpeningRadius, 50, x, r); + double h = x.back() - x.front(); + + TColgp_Array1OfPnt array(1, x.size()); + for (size_t i = 0; i < x.size(); ++i) { + array.SetValue(i + 1, gp_Pnt(-x[i], 0.0, r[i])); + } + Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); + TopoDS_Edge dome_edge = BRepBuilderAPI_MakeEdge(bspline); + + TopoDS_Vertex v1 = GetFirstVertex(dome_edge); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + + std::vector edges = {dome_edge, cylinder_edge}; + BuildTankWire(edges, wire); +} + +TopoDS_Shape CCPACSHull::BuildShapeFromSimpleParameters() const +{ + BRepBuilderAPI_MakeWire wire; + + if (m_domeType_choice2->GetSpherical_choice1() || m_domeType_choice2->GetEllipsoid_choice2()) { + BuildTankWireEllipsoid(wire); + } + else if (m_domeType_choice2->GetTorispherical_choice3()) { + BuildTankWireTorispherical(wire); + } + else if (m_domeType_choice2->GetIsotensoid_choice4()) { + BuildTankWireIsotensoid(wire); + } + + gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); + TopoDS_Shape loftShape = BRepPrimAPI_MakeRevol(wire, ax).Shape(); + + tigl::CTiglTransformation transform = this->GetTransformationMatrix(); + TopoDS_Shape TransformedShape = transform.Transform(loftShape); + + return TransformedShape; +} + +PNamedShape CCPACSHull::BuildLoft() const +{ + + TopoDS_Shape loftShape; + std::string loftName = GetUID(); + std::string loftShortName = GetShortShapeName(); + + if (m_segments_choice1 && m_sections_choice1) { + loftShape = BuildShapeFromSegments(); + PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + SetFaceTraits(loft); + return loft; + } + else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { + + const tigl::generated::CPACSEmptyElementBase* spherical = m_domeType_choice2->GetSpherical_choice1().get_ptr(); + const tigl::generated::CPACSEllipsoidDome* ellipsoid = m_domeType_choice2->GetEllipsoid_choice2().get_ptr(); + const tigl::generated::CPACSTorisphericalDome* torispherical = + m_domeType_choice2->GetTorispherical_choice3().get_ptr(); + const tigl::generated::CPACSIsotensoidDome* isotensoid = m_domeType_choice2->GetIsotensoid_choice4().get_ptr(); + + loftShape = BuildShapeFromSimpleParameters(); + PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); return loft; } else { diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 447a0293f8..0bab7d49c9 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -25,6 +25,8 @@ #include "CTiglRelativelyPositionedComponent.h" #include "CCPACSConfiguration.h" +#include + namespace tigl { @@ -89,7 +91,7 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned // Build the loft PNamedShape BuildLoft() const override; - // Set the face traints + // Set the face traits void SetFaceTraits(PNamedShape loft) const; private: @@ -97,9 +99,16 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned std::string GetShortShapeName() const; TiglGetPointBehavior getPointBehavior{asParameterOnSurface}; - void IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, std::vector& r) const; + + TopoDS_Shape BuildShapeFromSegments() const; + TopoDS_Shape BuildShapeFromSimpleParameters() const; + + void BuildTankWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const; + void BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const; + void BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const; + void BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const; }; } // namespace tigl diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 4889d7ae32..8576768aa0 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -18,7 +18,7 @@ Simple fuselage - 1 + 0.5 1.0 @@ -40,11 +40,7 @@

Fuselage Section 2 - - - 0.5 - - + Fuselage Section 2 @@ -68,17 +64,25 @@ Fuselage Positioning 1 - -0.5 + 0. 90 0 fuselage_1Section1ID + + Fuselage Positioning 2 + 2. + 90 + 0 + fuselage_1Section1ID + fuselage_1Section2ID + Fuselage Positioning 3 - 3.1 + 5. 90 0 - fuselage_1Section1ID + fuselage_1Section2ID fuselage_1Section3ID @@ -100,7 +104,7 @@ Simple tank - -0.2 + 0.5 @@ -265,7 +269,7 @@ Test case for guide curves - 1.5 + 2.5 @@ -407,7 +411,7 @@ Test case for simple parametrization - -1 + 4. @@ -419,7 +423,7 @@ 1.0 - 10.0 + 2.0 @@ -432,7 +436,7 @@ 1.0 - 10.0 + 2.0 0.5 @@ -447,7 +451,7 @@ 1.0 - 10.0 + 2.0 2.0 @@ -463,7 +467,7 @@ 1.0 - 10.0 + 2.0 0.1 diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 16be8dc592..c78d4e03fb 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -151,13 +151,13 @@ TEST_F(FuselageTank, hull) EXPECT_EQ(hull->GetDefaultedUID(), "outerHull"); EXPECT_NO_THROW(hull->GetConfiguration()); - EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 1.34, 1e-2); + EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 2.54, 1e-2); EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Z(), -0.3, 1e-1); auto points = hull_with_guides->GetGuideCurvePoints(); EXPECT_EQ(points.size(), 24); - EXPECT_NEAR(points.at(1).X(), 2.75, 1e-2); + EXPECT_NEAR(points.at(1).X(), 3.75, 1e-2); EXPECT_NEAR(points.at(1).Y(), 0, 1e-5); EXPECT_NEAR(points.at(1).Z(), -0.24, 1e-2); From 04913812ec50fa2bb2a2f384fa3ca20cb59eb94b Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 23 May 2024 17:59:37 +0200 Subject: [PATCH 029/122] add some exception handling --- src/fuelTanks/CCPACSHull.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 52f45aa87a..e0ba6bbf03 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -199,8 +199,8 @@ void CCPACSHull::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNu double dx = x.back() - x.front(); for (auto& val : x) { - val -= dx; - } + val -= dx; + } } TopoDS_Shape CCPACSHull::BuildShapeFromSegments() const @@ -254,7 +254,17 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const if (ellipsoid) { axRatio = ellipsoid->GetHalfAxisFraction(); - h = R * axRatio; + if (axRatio < 0.0) { + LOG(WARNING) << "Half axis fraction (" << axRatio + << ") must be between 0 and 1! It will be set to 0."; + axRatio = 0.; + } + else if (axRatio > 1.0) { + LOG(WARNING) << "Half axis fraction (" << axRatio + << ") must be between 0 and 1! It will be set to 1."; + axRatio = 1.0; + } + h = R * axRatio; } gp_Dir dir(0.0, 1.0, 0.0); From ee5f65ba1461b5f2420bf0dbf7093109206c2f36 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 24 May 2024 07:25:56 +0200 Subject: [PATCH 030/122] remove spherical definition from CPACS, can be done via ellipsoid --- cpacs_gen_input/cpacs_schema.xsd | 22 --- cpacs_gen_input/test.html | 92 +++++++++ src/fuelTanks/CCPACSHull.cpp | 44 ++--- src/generated/CPACSDomeType.cpp | 172 ++++++---------- src/generated/CPACSDomeType.h | 38 ++-- src/generated/CPACSEmptyElementBase.cpp | 183 ------------------ src/generated/CPACSEmptyElementBase.h | 91 --------- .../TestData/simpletest-fuelTanks.cpacs.xml | 4 +- 8 files changed, 183 insertions(+), 463 deletions(-) create mode 100644 cpacs_gen_input/test.html delete mode 100644 src/generated/CPACSEmptyElementBase.cpp delete mode 100644 src/generated/CPACSEmptyElementBase.h diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index f4b7073f63..6645e41e41 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -34313,7 +34313,6 @@ The fuel tank volume type should also be used for the wing fuel tank - @@ -34322,27 +34321,6 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - Emtpy element - - - Base type for string nodes (including external data - attributes) - - - - - - - - - - - diff --git a/cpacs_gen_input/test.html b/cpacs_gen_input/test.html new file mode 100644 index 0000000000..9c2642d80a --- /dev/null +++ b/cpacs_gen_input/test.html @@ -0,0 +1,92 @@ + + + + + CPACS XSD Baumdiagramm + + + + + + + diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index e0ba6bbf03..e121cc2750 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -247,25 +247,20 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - const auto* spherical = m_domeType_choice2->GetSpherical_choice1().get_ptr(); - const auto* ellipsoid = m_domeType_choice2->GetEllipsoid_choice2().get_ptr(); + const auto* ellipsoid = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); - double R = cylinderRadius, h = cylinderRadius, axRatio = 1.0; + double R = cylinderRadius, h = cylinderRadius; - if (ellipsoid) { - axRatio = ellipsoid->GetHalfAxisFraction(); - if (axRatio < 0.0) { - LOG(WARNING) << "Half axis fraction (" << axRatio - << ") must be between 0 and 1! It will be set to 0."; - axRatio = 0.; - } - else if (axRatio > 1.0) { - LOG(WARNING) << "Half axis fraction (" << axRatio - << ") must be between 0 and 1! It will be set to 1."; - axRatio = 1.0; - } - h = R * axRatio; + double axRatio = ellipsoid->GetHalfAxisFraction(); + if (axRatio < 0.0) { + LOG(WARNING) << "Half axis fraction (" << axRatio << ") must be between 0 and 1! It will be set to 0."; + axRatio = 0.; + } + else if (axRatio > 1.0) { + LOG(WARNING) << "Half axis fraction (" << axRatio << ") must be between 0 and 1! It will be set to 1."; + axRatio = 1.0; } + h = R * axRatio; gp_Dir dir(0.0, 1.0, 0.0); @@ -291,7 +286,7 @@ void CCPACSHull::BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - const auto* torispherical = m_domeType_choice2->GetTorispherical_choice3().get_ptr(); + const auto* torispherical = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); double R = torispherical->GetDishRadius(); // Radius of the sphere (crown radius) double r = torispherical->GetKnuckleRadius(); // Radius of the torus (knuckle radius) @@ -329,7 +324,7 @@ void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - const auto* isotensoid = m_domeType_choice2->GetIsotensoid_choice4().get_ptr(); + const auto* isotensoid = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); double polarOpeningRadius = isotensoid->GetPolarOpeningRadius(); std::vector x, r; @@ -356,13 +351,13 @@ TopoDS_Shape CCPACSHull::BuildShapeFromSimpleParameters() const { BRepBuilderAPI_MakeWire wire; - if (m_domeType_choice2->GetSpherical_choice1() || m_domeType_choice2->GetEllipsoid_choice2()) { + if (m_domeType_choice2->GetEllipsoid_choice1()) { BuildTankWireEllipsoid(wire); } - else if (m_domeType_choice2->GetTorispherical_choice3()) { + else if (m_domeType_choice2->GetTorispherical_choice2()) { BuildTankWireTorispherical(wire); } - else if (m_domeType_choice2->GetIsotensoid_choice4()) { + else if (m_domeType_choice2->GetIsotensoid_choice3()) { BuildTankWireIsotensoid(wire); } @@ -390,11 +385,10 @@ PNamedShape CCPACSHull::BuildLoft() const } else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { - const tigl::generated::CPACSEmptyElementBase* spherical = m_domeType_choice2->GetSpherical_choice1().get_ptr(); - const tigl::generated::CPACSEllipsoidDome* ellipsoid = m_domeType_choice2->GetEllipsoid_choice2().get_ptr(); + const tigl::generated::CPACSEllipsoidDome* ellipsoid = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); const tigl::generated::CPACSTorisphericalDome* torispherical = - m_domeType_choice2->GetTorispherical_choice3().get_ptr(); - const tigl::generated::CPACSIsotensoidDome* isotensoid = m_domeType_choice2->GetIsotensoid_choice4().get_ptr(); + m_domeType_choice2->GetTorispherical_choice2().get_ptr(); + const tigl::generated::CPACSIsotensoidDome* isotensoid = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); loftShape = BuildShapeFromSimpleParameters(); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); diff --git a/src/generated/CPACSDomeType.cpp b/src/generated/CPACSDomeType.cpp index dabd8adf43..1f58c168c5 100644 --- a/src/generated/CPACSDomeType.cpp +++ b/src/generated/CPACSDomeType.cpp @@ -59,47 +59,36 @@ namespace generated void CPACSDomeType::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { - // read element spherical - if (tixi::TixiCheckElement(tixiHandle, xpath + "/spherical")) { - m_spherical_choice1 = boost::in_place(this); - try { - m_spherical_choice1->ReadCPACS(tixiHandle, xpath + "/spherical"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read spherical at xpath " << xpath << ": " << e.what(); - m_spherical_choice1 = boost::none; - } - } - // read element ellipsoid if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { - m_ellipsoid_choice2 = boost::in_place(this); + m_ellipsoid_choice1 = boost::in_place(this); try { - m_ellipsoid_choice2->ReadCPACS(tixiHandle, xpath + "/ellipsoid"); + m_ellipsoid_choice1->ReadCPACS(tixiHandle, xpath + "/ellipsoid"); } catch(const std::exception& e) { LOG(ERROR) << "Failed to read ellipsoid at xpath " << xpath << ": " << e.what(); - m_ellipsoid_choice2 = boost::none; + m_ellipsoid_choice1 = boost::none; } } // read element torispherical if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { - m_torispherical_choice3 = boost::in_place(this); + m_torispherical_choice2 = boost::in_place(this); try { - m_torispherical_choice3->ReadCPACS(tixiHandle, xpath + "/torispherical"); + m_torispherical_choice2->ReadCPACS(tixiHandle, xpath + "/torispherical"); } catch(const std::exception& e) { LOG(ERROR) << "Failed to read torispherical at xpath " << xpath << ": " << e.what(); - m_torispherical_choice3 = boost::none; + m_torispherical_choice2 = boost::none; } } // read element isotensoid if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { - m_isotensoid_choice4 = boost::in_place(this); + m_isotensoid_choice3 = boost::in_place(this); try { - m_isotensoid_choice4->ReadCPACS(tixiHandle, xpath + "/isotensoid"); + m_isotensoid_choice3->ReadCPACS(tixiHandle, xpath + "/isotensoid"); } catch(const std::exception& e) { LOG(ERROR) << "Failed to read isotensoid at xpath " << xpath << ": " << e.what(); - m_isotensoid_choice4 = boost::none; + m_isotensoid_choice3 = boost::none; } } @@ -110,21 +99,10 @@ namespace generated void CPACSDomeType::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - // write element spherical - if (m_spherical_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/spherical"); - m_spherical_choice1->WriteCPACS(tixiHandle, xpath + "/spherical"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/spherical")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/spherical"); - } - } - // write element ellipsoid - if (m_ellipsoid_choice2) { + if (m_ellipsoid_choice1) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/ellipsoid"); - m_ellipsoid_choice2->WriteCPACS(tixiHandle, xpath + "/ellipsoid"); + m_ellipsoid_choice1->WriteCPACS(tixiHandle, xpath + "/ellipsoid"); } else { if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { @@ -133,9 +111,9 @@ namespace generated } // write element torispherical - if (m_torispherical_choice3) { + if (m_torispherical_choice2) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/torispherical"); - m_torispherical_choice3->WriteCPACS(tixiHandle, xpath + "/torispherical"); + m_torispherical_choice2->WriteCPACS(tixiHandle, xpath + "/torispherical"); } else { if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { @@ -144,9 +122,9 @@ namespace generated } // write element isotensoid - if (m_isotensoid_choice4) { + if (m_isotensoid_choice3) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/isotensoid"); - m_isotensoid_choice4->WriteCPACS(tixiHandle, xpath + "/isotensoid"); + m_isotensoid_choice3->WriteCPACS(tixiHandle, xpath + "/isotensoid"); } else { if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { @@ -163,57 +141,37 @@ namespace generated ( ( // mandatory elements of this choice must be there - m_spherical_choice1.is_initialized() + m_ellipsoid_choice1.is_initialized() && // elements of other choices must not be there !( - m_ellipsoid_choice2.is_initialized() - || - m_torispherical_choice3.is_initialized() + m_torispherical_choice2.is_initialized() || - m_isotensoid_choice4.is_initialized() + m_isotensoid_choice3.is_initialized() ) ) + ( // mandatory elements of this choice must be there - m_ellipsoid_choice2.is_initialized() + m_torispherical_choice2.is_initialized() && // elements of other choices must not be there !( - m_spherical_choice1.is_initialized() - || - m_torispherical_choice3.is_initialized() + m_ellipsoid_choice1.is_initialized() || - m_isotensoid_choice4.is_initialized() + m_isotensoid_choice3.is_initialized() ) ) + ( // mandatory elements of this choice must be there - m_torispherical_choice3.is_initialized() + m_isotensoid_choice3.is_initialized() && // elements of other choices must not be there !( - m_spherical_choice1.is_initialized() + m_ellipsoid_choice1.is_initialized() || - m_ellipsoid_choice2.is_initialized() - || - m_isotensoid_choice4.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_isotensoid_choice4.is_initialized() - && - // elements of other choices must not be there - !( - m_spherical_choice1.is_initialized() - || - m_ellipsoid_choice2.is_initialized() - || - m_torispherical_choice3.is_initialized() + m_torispherical_choice2.is_initialized() ) ) == 1 @@ -222,92 +180,70 @@ namespace generated ; } - const boost::optional& CPACSDomeType::GetSpherical_choice1() const - { - return m_spherical_choice1; - } - - boost::optional& CPACSDomeType::GetSpherical_choice1() - { - return m_spherical_choice1; - } - - const boost::optional& CPACSDomeType::GetEllipsoid_choice2() const - { - return m_ellipsoid_choice2; - } - - boost::optional& CPACSDomeType::GetEllipsoid_choice2() - { - return m_ellipsoid_choice2; - } - - const boost::optional& CPACSDomeType::GetTorispherical_choice3() const + const boost::optional& CPACSDomeType::GetEllipsoid_choice1() const { - return m_torispherical_choice3; + return m_ellipsoid_choice1; } - boost::optional& CPACSDomeType::GetTorispherical_choice3() + boost::optional& CPACSDomeType::GetEllipsoid_choice1() { - return m_torispherical_choice3; + return m_ellipsoid_choice1; } - const boost::optional& CPACSDomeType::GetIsotensoid_choice4() const + const boost::optional& CPACSDomeType::GetTorispherical_choice2() const { - return m_isotensoid_choice4; + return m_torispherical_choice2; } - boost::optional& CPACSDomeType::GetIsotensoid_choice4() + boost::optional& CPACSDomeType::GetTorispherical_choice2() { - return m_isotensoid_choice4; + return m_torispherical_choice2; } - CPACSEmptyElementBase& CPACSDomeType::GetSpherical_choice1(CreateIfNotExistsTag) + const boost::optional& CPACSDomeType::GetIsotensoid_choice3() const { - if (!m_spherical_choice1) - m_spherical_choice1 = boost::in_place(this); - return *m_spherical_choice1; + return m_isotensoid_choice3; } - void CPACSDomeType::RemoveSpherical_choice1() + boost::optional& CPACSDomeType::GetIsotensoid_choice3() { - m_spherical_choice1 = boost::none; + return m_isotensoid_choice3; } - CPACSEllipsoidDome& CPACSDomeType::GetEllipsoid_choice2(CreateIfNotExistsTag) + CPACSEllipsoidDome& CPACSDomeType::GetEllipsoid_choice1(CreateIfNotExistsTag) { - if (!m_ellipsoid_choice2) - m_ellipsoid_choice2 = boost::in_place(this); - return *m_ellipsoid_choice2; + if (!m_ellipsoid_choice1) + m_ellipsoid_choice1 = boost::in_place(this); + return *m_ellipsoid_choice1; } - void CPACSDomeType::RemoveEllipsoid_choice2() + void CPACSDomeType::RemoveEllipsoid_choice1() { - m_ellipsoid_choice2 = boost::none; + m_ellipsoid_choice1 = boost::none; } - CPACSTorisphericalDome& CPACSDomeType::GetTorispherical_choice3(CreateIfNotExistsTag) + CPACSTorisphericalDome& CPACSDomeType::GetTorispherical_choice2(CreateIfNotExistsTag) { - if (!m_torispherical_choice3) - m_torispherical_choice3 = boost::in_place(this); - return *m_torispherical_choice3; + if (!m_torispherical_choice2) + m_torispherical_choice2 = boost::in_place(this); + return *m_torispherical_choice2; } - void CPACSDomeType::RemoveTorispherical_choice3() + void CPACSDomeType::RemoveTorispherical_choice2() { - m_torispherical_choice3 = boost::none; + m_torispherical_choice2 = boost::none; } - CPACSIsotensoidDome& CPACSDomeType::GetIsotensoid_choice4(CreateIfNotExistsTag) + CPACSIsotensoidDome& CPACSDomeType::GetIsotensoid_choice3(CreateIfNotExistsTag) { - if (!m_isotensoid_choice4) - m_isotensoid_choice4 = boost::in_place(this); - return *m_isotensoid_choice4; + if (!m_isotensoid_choice3) + m_isotensoid_choice3 = boost::in_place(this); + return *m_isotensoid_choice3; } - void CPACSDomeType::RemoveIsotensoid_choice4() + void CPACSDomeType::RemoveIsotensoid_choice3() { - m_isotensoid_choice4 = boost::none; + m_isotensoid_choice3 = boost::none; } } // namespace generated diff --git a/src/generated/CPACSDomeType.h b/src/generated/CPACSDomeType.h index 36f3a83edd..de6063dea3 100644 --- a/src/generated/CPACSDomeType.h +++ b/src/generated/CPACSDomeType.h @@ -22,7 +22,6 @@ #include #include #include "CPACSEllipsoidDome.h" -#include "CPACSEmptyElementBase.h" #include "CPACSIsotensoidDome.h" #include "CPACSTorisphericalDome.h" #include "CreateIfNotExists.h" @@ -61,37 +60,30 @@ namespace generated TIGL_EXPORT bool ValidateChoices() const; - TIGL_EXPORT virtual const boost::optional& GetSpherical_choice1() const; - TIGL_EXPORT virtual boost::optional& GetSpherical_choice1(); + TIGL_EXPORT virtual const boost::optional& GetEllipsoid_choice1() const; + TIGL_EXPORT virtual boost::optional& GetEllipsoid_choice1(); - TIGL_EXPORT virtual const boost::optional& GetEllipsoid_choice2() const; - TIGL_EXPORT virtual boost::optional& GetEllipsoid_choice2(); + TIGL_EXPORT virtual const boost::optional& GetTorispherical_choice2() const; + TIGL_EXPORT virtual boost::optional& GetTorispherical_choice2(); - TIGL_EXPORT virtual const boost::optional& GetTorispherical_choice3() const; - TIGL_EXPORT virtual boost::optional& GetTorispherical_choice3(); + TIGL_EXPORT virtual const boost::optional& GetIsotensoid_choice3() const; + TIGL_EXPORT virtual boost::optional& GetIsotensoid_choice3(); - TIGL_EXPORT virtual const boost::optional& GetIsotensoid_choice4() const; - TIGL_EXPORT virtual boost::optional& GetIsotensoid_choice4(); + TIGL_EXPORT virtual CPACSEllipsoidDome& GetEllipsoid_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveEllipsoid_choice1(); - TIGL_EXPORT virtual CPACSEmptyElementBase& GetSpherical_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveSpherical_choice1(); + TIGL_EXPORT virtual CPACSTorisphericalDome& GetTorispherical_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveTorispherical_choice2(); - TIGL_EXPORT virtual CPACSEllipsoidDome& GetEllipsoid_choice2(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveEllipsoid_choice2(); - - TIGL_EXPORT virtual CPACSTorisphericalDome& GetTorispherical_choice3(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveTorispherical_choice3(); - - TIGL_EXPORT virtual CPACSIsotensoidDome& GetIsotensoid_choice4(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveIsotensoid_choice4(); + TIGL_EXPORT virtual CPACSIsotensoidDome& GetIsotensoid_choice3(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveIsotensoid_choice3(); protected: CCPACSHull* m_parent; - boost::optional m_spherical_choice1; - boost::optional m_ellipsoid_choice2; - boost::optional m_torispherical_choice3; - boost::optional m_isotensoid_choice4; + boost::optional m_ellipsoid_choice1; + boost::optional m_torispherical_choice2; + boost::optional m_isotensoid_choice3; private: CPACSDomeType(const CPACSDomeType&) = delete; diff --git a/src/generated/CPACSEmptyElementBase.cpp b/src/generated/CPACSEmptyElementBase.cpp deleted file mode 100644 index d99a015dfe..0000000000 --- a/src/generated/CPACSEmptyElementBase.cpp +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CPACSDomeType.h" -#include "CPACSEmptyElementBase.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSEmptyElementBase::CPACSEmptyElementBase(CPACSDomeType* parent) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSEmptyElementBase::~CPACSEmptyElementBase() - { - } - - const CPACSDomeType* CPACSEmptyElementBase::GetParent() const - { - return m_parent; - } - - CPACSDomeType* CPACSEmptyElementBase::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSEmptyElementBase::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSEmptyElementBase::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - void CPACSEmptyElementBase::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read attribute externalDataNodePath - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { - m_externalDataNodePath = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataNodePath"); - if (m_externalDataNodePath->empty()) { - LOG(WARNING) << "Optional attribute externalDataNodePath is present but empty at xpath " << xpath; - } - } - - // read attribute externalFileName - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { - m_externalFileName = tixi::TixiGetAttribute(tixiHandle, xpath, "externalFileName"); - if (m_externalFileName->empty()) { - LOG(WARNING) << "Optional attribute externalFileName is present but empty at xpath " << xpath; - } - } - - // read attribute externalDataDirectory - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { - m_externalDataDirectory = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataDirectory"); - if (m_externalDataDirectory->empty()) { - LOG(WARNING) << "Optional attribute externalDataDirectory is present but empty at xpath " << xpath; - } - } - - // read simpleContent - if (tixi::TixiCheckElement(tixiHandle, xpath)) { - m_value = tixi::TixiGetElement(tixiHandle, xpath); - if (m_value.empty()) { - LOG(WARNING) << "Required element is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; - } - - } - - void CPACSEmptyElementBase::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write attribute externalDataNodePath - if (m_externalDataNodePath) { - tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataNodePath", *m_externalDataNodePath); - } - else { - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { - tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataNodePath"); - } - } - - // write attribute externalFileName - if (m_externalFileName) { - tixi::TixiSaveAttribute(tixiHandle, xpath, "externalFileName", *m_externalFileName); - } - else { - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { - tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalFileName"); - } - } - - // write attribute externalDataDirectory - if (m_externalDataDirectory) { - tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataDirectory", *m_externalDataDirectory); - } - else { - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { - tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataDirectory"); - } - } - - // write simpleContent - tixi::TixiSaveElement(tixiHandle, xpath, m_value); - - } - - const boost::optional& CPACSEmptyElementBase::GetExternalDataNodePath() const - { - return m_externalDataNodePath; - } - - void CPACSEmptyElementBase::SetExternalDataNodePath(const boost::optional& value) - { - m_externalDataNodePath = value; - } - - const boost::optional& CPACSEmptyElementBase::GetExternalFileName() const - { - return m_externalFileName; - } - - void CPACSEmptyElementBase::SetExternalFileName(const boost::optional& value) - { - m_externalFileName = value; - } - - const boost::optional& CPACSEmptyElementBase::GetExternalDataDirectory() const - { - return m_externalDataDirectory; - } - - void CPACSEmptyElementBase::SetExternalDataDirectory(const boost::optional& value) - { - m_externalDataDirectory = value; - } - - const std::string& CPACSEmptyElementBase::GetValue() const - { - return m_value; - } - - void CPACSEmptyElementBase::SetValue(const std::string& value) - { - m_value = value; - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSEmptyElementBase.h b/src/generated/CPACSEmptyElementBase.h deleted file mode 100644 index cb1ecd6028..0000000000 --- a/src/generated/CPACSEmptyElementBase.h +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDObject; - -namespace generated -{ - class CPACSDomeType; - - // This class is used in: - // CPACSDomeType - - /// @brief stringBaseType - /// - /// Base type for string nodes (including external data - /// attributes) - /// - class CPACSEmptyElementBase - { - public: - TIGL_EXPORT CPACSEmptyElementBase(CPACSDomeType* parent); - - TIGL_EXPORT virtual ~CPACSEmptyElementBase(); - - TIGL_EXPORT CPACSDomeType* GetParent(); - - TIGL_EXPORT const CPACSDomeType* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT virtual const boost::optional& GetExternalDataNodePath() const; - TIGL_EXPORT virtual void SetExternalDataNodePath(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetExternalFileName() const; - TIGL_EXPORT virtual void SetExternalFileName(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetExternalDataDirectory() const; - TIGL_EXPORT virtual void SetExternalDataDirectory(const boost::optional& value); - - TIGL_EXPORT virtual const std::string& GetValue() const; - TIGL_EXPORT virtual void SetValue(const std::string& value); - - protected: - CPACSDomeType* m_parent; - - boost::optional m_externalDataNodePath; - boost::optional m_externalFileName; - boost::optional m_externalDataDirectory; - std::string m_value; - - private: - CPACSEmptyElementBase(const CPACSEmptyElementBase&) = delete; - CPACSEmptyElementBase& operator=(const CPACSEmptyElementBase&) = delete; - - CPACSEmptyElementBase(CPACSEmptyElementBase&&) = delete; - CPACSEmptyElementBase& operator=(CPACSEmptyElementBase&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSEmptyElementBase = generated::CPACSEmptyElementBase; -using CCPACSDomeType = generated::CPACSDomeType; -} // namespace tigl diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 8576768aa0..28d1669db8 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -425,7 +425,9 @@ 1.0 2.0 - + + 1 + From 5b1b50fc8e75d5248130495ee5a4b98acce909bf Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 24 May 2024 09:44:12 +0200 Subject: [PATCH 031/122] restructure test XML; enrich warning information --- src/fuelTanks/CCPACSHull.cpp | 6 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 84 +++++++++++++++---- 2 files changed, 71 insertions(+), 19 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index e121cc2750..c04dfbb37d 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -253,11 +253,13 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const double axRatio = ellipsoid->GetHalfAxisFraction(); if (axRatio < 0.0) { - LOG(WARNING) << "Half axis fraction (" << axRatio << ") must be between 0 and 1! It will be set to 0."; + LOG(WARNING) << "Half axis fraction (" << axRatio << ") of hull \"" << GetName() << "\" (uID=\"" << GetUID() + << "\") must be between 0 and 1! It will be set to 0!"; axRatio = 0.; } else if (axRatio > 1.0) { - LOG(WARNING) << "Half axis fraction (" << axRatio << ") must be between 0 and 1! It will be set to 1."; + LOG(WARNING) << "Half axis fraction (" << axRatio << ") of hull \"" << GetName() << "\" (uID=\"" << GetUID() + << "\") must be between 0 and 1! It will be set to 1!"; axRatio = 1.0; } h = R * axRatio; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 28d1669db8..5d193b181a 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -22,8 +22,8 @@ 1.0 - 0.5 - 0.5 + 2.0 + 2.0 @@ -79,7 +79,7 @@ Fuselage Positioning 3 - 5. + 15. 90 0 fuselage_1Section2ID @@ -102,6 +102,7 @@ Simple tank + This is a simple tank build via sections and segments with internal structure 0.5 @@ -113,8 +114,8 @@ 1 - 0.3 - 0.3 + 1.2 + 1.2 @@ -198,8 +199,8 @@ 0.8 - 0.2 - 0.2 + 0.9 + 0.9 @@ -266,7 +267,7 @@ Simple tank 2 - Test case for guide curves + Test case of a simple tank via sections and segments with guide curves 2.5 @@ -278,8 +279,8 @@ 1 - 0.3 - 0.3 + 0.8 + 0.8 @@ -307,7 +308,7 @@ Section 2 - 0.5 + 1.0 @@ -322,7 +323,7 @@ Section 3 - 1 + 2 @@ -408,10 +409,10 @@ Simple tank 3 - Test case for simple parametrization + Test case for simple parametrization with ellipsoid domes - 4. + 5. @@ -434,8 +435,13 @@ Hull with ellipsoid dome - 0. + 0.5 + + 1 + 0.8 + 0.8 + 1.0 2.0 @@ -445,7 +451,40 @@ - + + Hull with ellipsoid dome + This hull has an invalid halfAxisFraction. It is used for testing of exeption handling. + + + 1 + + + 1 + 0.7 + 0.7 + + + 1.0 + 2.0 + + + + -0.2 + + + + + + + Simple tank 4 + Test case for simple parametrization + + + 9.5 + + + + Hull with torispherical dome @@ -461,7 +500,18 @@ - + + + + Simple tank 5 + Test case for simple parametrization + + + 13. + + + + Hull with isotensoid dome From 5ad20a6587f8250ce4993f51a99ce85fa67adb25 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 24 May 2024 11:31:24 +0200 Subject: [PATCH 032/122] align tests with modified XML test case --- src/fuelTanks/CCPACSHull.cpp | 14 +++++----- src/fuelTanks/CCPACSHull.h | 4 +-- .../TestData/simpletest-fuelTanks.cpacs.xml | 4 +-- tests/unittests/tiglTanks.cpp | 28 +++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index c04dfbb37d..7619a727b0 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -203,7 +203,7 @@ void CCPACSHull::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNu } } -TopoDS_Shape CCPACSHull::BuildShapeFromSegments() const +void CCPACSHull::BuildShapeFromSegments(TopoDS_Shape& loftShape) const { const auto& segments = m_segments_choice1.get(); TiglContinuity cont = segments.GetSegment(1).GetContinuity(); @@ -222,7 +222,7 @@ TopoDS_Shape CCPACSHull::BuildShapeFromSegments() const lofter.setMakeSolid(true); lofter.setMakeSmooth(smooth); - return lofter.Shape(); + loftShape = lofter.Shape(); } void CCPACSHull::BuildTankWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const @@ -349,7 +349,7 @@ void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const BuildTankWire(edges, wire); } -TopoDS_Shape CCPACSHull::BuildShapeFromSimpleParameters() const +void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const { BRepBuilderAPI_MakeWire wire; @@ -364,12 +364,12 @@ TopoDS_Shape CCPACSHull::BuildShapeFromSimpleParameters() const } gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); - TopoDS_Shape loftShape = BRepPrimAPI_MakeRevol(wire, ax).Shape(); + loftShape = BRepPrimAPI_MakeRevol(wire, ax).Shape(); tigl::CTiglTransformation transform = this->GetTransformationMatrix(); TopoDS_Shape TransformedShape = transform.Transform(loftShape); - return TransformedShape; + loftShape = TransformedShape; } PNamedShape CCPACSHull::BuildLoft() const @@ -380,7 +380,7 @@ PNamedShape CCPACSHull::BuildLoft() const std::string loftShortName = GetShortShapeName(); if (m_segments_choice1 && m_sections_choice1) { - loftShape = BuildShapeFromSegments(); + BuildShapeFromSegments(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); SetFaceTraits(loft); return loft; @@ -392,7 +392,7 @@ PNamedShape CCPACSHull::BuildLoft() const m_domeType_choice2->GetTorispherical_choice2().get_ptr(); const tigl::generated::CPACSIsotensoidDome* isotensoid = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); - loftShape = BuildShapeFromSimpleParameters(); + BuildShapeFromSimpleParameters(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); return loft; } diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 0bab7d49c9..edc29f3461 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -102,8 +102,8 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned void IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, std::vector& r) const; - TopoDS_Shape BuildShapeFromSegments() const; - TopoDS_Shape BuildShapeFromSimpleParameters() const; + void BuildShapeFromSegments(TopoDS_Shape& loftShape) const; + void BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const; void BuildTankWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const; void BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 5d193b181a..d28bd3b42a 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -109,7 +109,7 @@ - + Outer hull @@ -191,7 +191,7 @@ - + Inner hull diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index c78d4e03fb..750a5236e0 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -91,7 +91,7 @@ class FuselageTank : public ::testing::Test // hulls const tigl::CCPACSHulls& hulls = fuelTank->GetHulls(); - tigl::CCPACSHull* hull = &uidMgr.ResolveObject("outerHull"); + tigl::CCPACSHull* hull = &uidMgr.ResolveObject("genericTank1_outerHull"); tigl::CCPACSHull* hull_with_guides = &uidMgr.ResolveObject("genericTank2_outerHull"); tigl::CCPACSHull* hull_spheric = &uidMgr.ResolveObject("genericTank3_sphericalDome"); }; @@ -112,7 +112,7 @@ TEST_F(FuselageTank, genericFuelTanks) EXPECT_EQ(fuelTanks->GetGenericFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(fuelTanks->GetGenericFuelTank(uID)); EXPECT_EQ(fuelTanks->GetGenericFuelTankIndex(uID), 1); - EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 3); + EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 5); } TEST_F(FuselageTank, genericFuelTank) @@ -124,19 +124,19 @@ TEST_F(FuselageTank, genericFuelTank) TEST_F(FuselageTank, hulls) { EXPECT_EQ(hulls.GetHullsCount(), 2); - EXPECT_EQ(hulls.GetHull(1).GetDefaultedUID(), "outerHull"); - EXPECT_EQ(hulls.GetHull("outerHull").GetDefaultedUID(), "outerHull"); - EXPECT_EQ(hulls.GetHullIndex("outerHull"), 1); - EXPECT_EQ(hulls.GetHulls().at(0)->GetDefaultedUID(), "outerHull"); + EXPECT_EQ(hulls.GetHull(1).GetDefaultedUID(), "genericTank1_outerHull"); + EXPECT_EQ(hulls.GetHull("genericTank1_outerHull").GetDefaultedUID(), "genericTank1_outerHull"); + EXPECT_EQ(hulls.GetHullIndex("genericTank1_outerHull"), 1); + EXPECT_EQ(hulls.GetHulls().at(0)->GetDefaultedUID(), "genericTank1_outerHull"); } TEST_F(FuselageTank, hull) { EXPECT_EQ(hull->GetSectionCount(), 3); EXPECT_EQ(hull->GetSegmentCount(), 2); - EXPECT_NEAR(hull->GetVolume(), 0.41, 1e-2); - EXPECT_NEAR(hull->GetSurfaceArea(), 2.79, 1e-2); - EXPECT_NEAR(hull->GetCircumference(1, 0.5), 1.86, 1e-2); + EXPECT_NEAR(hull->GetVolume(), 6.57, 1e-2); + EXPECT_NEAR(hull->GetSurfaceArea(), 11.15, 1e-2); + EXPECT_NEAR(hull->GetCircumference(1, 0.5), 7.43, 1e-2); EXPECT_EQ(hull->GetSectionCount(), 3); EXPECT_NO_THROW(hull->GetSection(1)); @@ -148,18 +148,18 @@ TEST_F(FuselageTank, hull) EXPECT_NO_THROW(hull->GetSegment("outerHull_segment1")); EXPECT_THROW(hull->GetSegment(3), tigl::CTiglError); - EXPECT_EQ(hull->GetDefaultedUID(), "outerHull"); + EXPECT_EQ(hull->GetDefaultedUID(), "genericTank1_outerHull"); EXPECT_NO_THROW(hull->GetConfiguration()); - EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 2.54, 1e-2); + EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); - EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Z(), -0.3, 1e-1); + EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Z(), -1.2, 1e-1); auto points = hull_with_guides->GetGuideCurvePoints(); EXPECT_EQ(points.size(), 24); - EXPECT_NEAR(points.at(1).X(), 3.75, 1e-2); + EXPECT_NEAR(points.at(1).X(), 3.5, 1e-2); EXPECT_NEAR(points.at(1).Y(), 0, 1e-5); - EXPECT_NEAR(points.at(1).Z(), -0.24, 1e-2); + EXPECT_NEAR(points.at(1).Z(), -0.65, 1e-2); EXPECT_EQ(hull_with_guides->GetGuideCurveSegment("genericTank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); } From 9485ea079c2f7699de8ce5a60dd3deb098889137 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 24 May 2024 13:14:54 +0200 Subject: [PATCH 033/122] add exeptions --- src/fuelTanks/CCPACSHull.cpp | 45 +++++++++++++------ .../TestData/simpletest-fuelTanks.cpacs.xml | 8 ++-- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 7619a727b0..beefe49fe8 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -247,21 +247,14 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - const auto* ellipsoid = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); - double R = cylinderRadius, h = cylinderRadius; - double axRatio = ellipsoid->GetHalfAxisFraction(); - if (axRatio < 0.0) { - LOG(WARNING) << "Half axis fraction (" << axRatio << ") of hull \"" << GetName() << "\" (uID=\"" << GetUID() - << "\") must be between 0 and 1! It will be set to 0!"; - axRatio = 0.; - } - else if (axRatio > 1.0) { - LOG(WARNING) << "Half axis fraction (" << axRatio << ") of hull \"" << GetName() << "\" (uID=\"" << GetUID() - << "\") must be between 0 and 1! It will be set to 1!"; - axRatio = 1.0; + double axRatio = m_domeType_choice2->GetEllipsoid_choice1().get_ptr()->GetHalfAxisFraction(); + if (axRatio < 0.0 || axRatio > 1.0) { + throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of hull \"" + GetName() + "\" (uID=\"" + + GetUID() + "\") must be between 0 and 1!"); } + h = R * axRatio; gp_Dir dir(0.0, 1.0, 0.0); @@ -293,6 +286,17 @@ void CCPACSHull::BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const double R = torispherical->GetDishRadius(); // Radius of the sphere (crown radius) double r = torispherical->GetKnuckleRadius(); // Radius of the torus (knuckle radius) + if (R <= cylinderRadius) { + throw CTiglError("The dish radius (" + std::to_string(R) + ") of hull \"" + GetName() + "\" (uID=\"" + + GetUID() + "\") must be larger than the cylinder radius (" + std::to_string(cylinderRadius) + + ")!"); + } + if (r <= 0. || r >= cylinderRadius) { + throw CTiglError("The knuckle radius (" + std::to_string(r) + ") of hull \"" + GetName() + "\" (uID=\"" + + GetUID() + "\") must be larger than 0 and smaller than the cylinder Radius (" + + std::to_string(cylinderRadius) + ")!"); + } + double c = cylinderRadius - r; // Distance from the center to the center of the torus tube double h = R - sqrt((r + c - R) * (r - c - R)); // Height from the base of the dome to the top double rt = c * (1.0 + pow((R / r - 1), -1.0)); // Radius where the transition from sphere to torus occurs @@ -326,9 +330,13 @@ void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - const auto* isotensoid = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); + double polarOpeningRadius = m_domeType_choice2->GetIsotensoid_choice3().get_ptr()->GetPolarOpeningRadius(); + if (polarOpeningRadius <= 0 || polarOpeningRadius >= cylinderRadius) { + throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of hull \"" + GetName() + "\" (uID=\"" + + GetUID() + "\") must be larger than 0 and smaller than the cylinder radius (" + + std::to_string(cylinderRadius) + ")!"); + } - double polarOpeningRadius = isotensoid->GetPolarOpeningRadius(); std::vector x, r; IsotensoidContour(cylinderRadius, polarOpeningRadius, 50, x, r); double h = x.back() - x.front(); @@ -353,6 +361,15 @@ void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const { BRepBuilderAPI_MakeWire wire; + if (m_cylinderRadius_choice2.get() <= 0) { + throw CTiglError("The cylinder radius (" + std::to_string(m_cylinderRadius_choice2.get()) + ") of hull \"" + + GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than 0!"); + } + if (m_cylinderLength_choice2.get() <= 0) { + throw CTiglError("The cylinder length (" + std::to_string(m_cylinderLength_choice2.get()) + ") of hull \"" + + GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than 0!"); + } + if (m_domeType_choice2->GetEllipsoid_choice1()) { BuildTankWireEllipsoid(wire); } diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index d28bd3b42a..57b313c901 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -451,9 +451,8 @@ - - Hull with ellipsoid dome - This hull has an invalid halfAxisFraction. It is used for testing of exeption handling. + + Hull with cylindrical dome 1 @@ -468,8 +467,7 @@ 2.0 - - -0.2 + 0 From 220ff4cb2d23abf77d5d83e812c6c471915ea868 Mon Sep 17 00:00:00 2001 From: Alder Date: Sat, 25 May 2024 13:12:37 +0200 Subject: [PATCH 034/122] merge parametric tanks into tanks; hulls inherit scaling und rotation from genericTank --- bindings/python_internal/configuration.i | 1268 +- cpacs_gen_input/cpacs_schema.xsd | 68888 ++++++++-------- cpacs_gen_input/test.html | 184 +- src/common/tiglcommonfunctions.cpp | 3810 +- src/common/tiglcommonfunctions.h | 914 +- src/cpacs_other/CCPACSMaterialDefinition.cpp | 124 +- src/cpacs_other/CCPACSMaterialDefinition.h | 104 +- src/fuelTanks/CCPACSGenericFuelTank.cpp | 189 +- src/fuelTanks/CCPACSGenericFuelTank.h | 98 +- src/fuelTanks/CCPACSHull.cpp | 7 +- src/fuselage/CTiglFuselageConnection.cpp | 380 +- src/generated/CPACSDomeType.cpp | 500 +- src/generated/CPACSDomeType.h | 198 +- src/generated/CPACSGenericFuelTank.cpp | 596 +- src/generated/CPACSGenericFuelTank.h | 242 +- src/generated/CPACSHull.cpp | 956 +- src/generated/CPACSHull.h | 298 +- src/generated/CPACSMaterialDefinition.cpp | 806 +- src/generated/CPACSMaterialDefinition.h | 342 +- .../CTiglRelativelyPositionedComponent.cpp | 35 +- .../CTiglRelativelyPositionedComponent.h | 5 + .../TestData/simpletest-fuelTanks.cpacs.xml | 1234 +- tests/unittests/tiglTanks.cpp | 2 +- 23 files changed, 40613 insertions(+), 40567 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 87749fc715..9846c06d24 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -1,634 +1,634 @@ -/* -* Copyright (C) 2015 German Aerospace Center (DLR/SC) -* -* Created: 2015-11-22 Martin Siggel -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -%module (package="tigl3") configuration - -%include -%include -%include common.i -%include math_headers.i -%include TopoDS_headers.i -%include TopLoc_headers.i -%include Geom_headers.i - -%import geometry.i -%import core.i - -%{ -// All includes that are required for the wrapper compilation -#include "CCPACSConfiguration.h" -#include "CCPACSConfigurationManager.h" -#include "CTiglFusePlane.h" -#include "CCPACSWingProfile.h" -#include "generated/CPACSStandardProfile.h" //TODO: Replace with CCPACSStandardProfile, once it exists. -#include "CCPACSFuselageSection.h" -#include "CCPACSExternalObject.h" -#include "CTiglShapeCache.h" -#include "CTiglError.h" -#include "CCPACSWallPosition.h" -#include "CCPACSWingSegment.h" -#include "CCPACSFuselageSegment.h" -#include "CTiglWingConnection.h" -#include "CTiglFuselageConnection.h" -#include "CCPACSWingCell.h" -#include "CCPACSMaterialDefinition.h" -#include "generated/CPACSGenericSystem_geometricBaseType.h" -#include "CCPACSACSystems.h" -#include "CCPACSGenericSystem.h" -#include "CCPACSGenericSystems.h" -#include "CCPACSRotorBladeAttachment.h" -#include "generated/CPACSWingElement.h" -#include "CCPACSWingSectionElement.h" -#include "CCPACSWingSection.h" -#include "generated/CPACSGuideCurveProfileGeometry.h" -#include "CCPACSGuideCurveProfile.h" -#include "generated/CPACSSparSegment.h" -#include "CCPACSWingSparSegment.h" -#include "CCPACSWingRibsDefinition.h" -#include "CCPACSSkinSegment.h" -#include "CTiglWingChordface.h" -#include "CCPACSCrossBeamAssemblyPosition.h" -#include "CCPACSCrossBeamStrutAssemblyPosition.h" -#include "generated/CPACSCrossBeamStrutAssemblyPosition.h" -#include "CCPACSDoorAssemblyPosition.h" -#include "CCPACSLongFloorBeam.h" -#include "CCPACSLongFloorBeamPosition.h" -#include "CCPACSPressureBulkheadAssemblyPosition.h" -#include "generated/CPACSControlSurfaceOuterShapeTrailingEdge.h" -#include "generated/CPACSControlSurfacePath.h" -#include "generated/CPACSCutOutControlPoints.h" -#include "generated/CPACSControlSurfaceWingCutOut.h" -#include "generated/CPACSControlSurfaceSkinCutOutBorder.h" -#include "generated/CPACSControlSurfaceTracks.h" -#include "generated/CPACSControlSurfaceTrackType.h" -#include "generated/CPACSTrailingEdgeDevice.h" -#include "CTiglControlSurfaceTransformation.h" -#include "CCPACSTrailingEdgeDevice.h" -#include "CCPACSEnginePylons.h" -#include "CCPACSEnginePylon.h" -#include "CCPACSEnginePosition.h" -#include "generated/CPACSLateralCap_placement.h" -#include "generated/CPACSLateralCap.h" -#include "generated/CPACSBoundingElementUIDs.h" -#include "generated/CPACSStructuralWallElement.h" -#include "generated/CPACSStructuralWallElements.h" -#include "generated/CPACSWallPositionUIDs.h" -#include "generated/CPACSWallPosition.h" -#include "generated/CPACSWallPositions.h" -#include "generated/CPACSWallSegment.h" -#include "generated/CPACSWallSegments.h" -#include "generated/CPACSUIDSequence.h" -#include "CCPACSDucts.h" -#include "CCPACSDuctAssembly.h" -#include "CCPACSDuct.h" -#include "generated/CPACSFuselageFuelTanks.h" -#include "generated/CPACSGenericFuelTanks.h" -#include "generated/CPACSGenericFuelTank.h" -#include "generated/CPACSFuelTankVolume.h" -#include "CCPACSGenericFuelTanks.h" -#include "CCPACSGenericFuelTank.h" -#include "generated/CPACSHulls.h" -#include "CCPACSHulls.h" -#include "generated/CPACSHull.h" -#include "CCPACSHull.h" -#include "generated/CPACSHullStructure.h" -#include "CCPACSHullStructure.h" -#include "CCPACSFrame.h" - - -%} - -%feature("autodoc", "3"); - -%catch_exceptions() - -// rename file methods to python pep8 style -%rename("%(undercase)s", %$isfunction) ""; - -// wrap optional classes -%boost_optional(tigl::CCPACSWingCSStructure) -%boost_optional(tigl::generated::CPACSSkinSegments) -%boost_optional(tigl::generated::CPACSSkin) -%boost_optional(tigl::CCPACSStringersAssembly) -%boost_optional(tigl::CCPACSFramesAssembly) -%boost_optional(tigl::CCPACSCargoCrossBeamsAssembly) -%boost_optional(tigl::CCPACSCargoCrossBeamStrutsAssembly) -%boost_optional(tigl::CCPACSLongFloorBeamsAssembly) -%boost_optional(tigl::CCPACSPressureBulkheadAssembly) -%boost_optional(tigl::generated::CPACSCargoDoorsAssembly) -%boost_optional(tigl::ECPACSRibRotation_ribRotationReference) -%boost_optional(tigl::generated::CPACSWingRibCell) -%boost_optional(tigl::generated::CPACSCap) -%boost_optional(tigl::CCPACSWingRibsPositioning) -%boost_optional(tigl::CCPACSWingRibExplicitPositioning) -%boost_optional(tigl::generated::CPACSWeb) -%boost_optional(tigl::generated::CPACSSparCells) -%boost_optional(tigl::CCPACSGuideCurves) -%boost_optional(tigl::CCPACSPositionings) -%boost_optional(tigl::CCPACSWingComponentSegments) -%boost_optional(tigl::CCPACSWingRibsDefinitions) -%boost_optional(tigl::CCPACSWingSpars) -%boost_optional(tigl::generated::CPACSGuideCurve_continuity) -%boost_optional(tigl::CCPACSRectangleProfile) -%boost_optional(tigl::CCPACSStandardProfile) -%boost_optional(tigl::CCPACSWingProfileCST) -%boost_optional(tigl::CTiglTransformation) -%boost_optional(tigl::CCPACSRotorHinges) -%boost_optional(tigl::generated::CPACSRotorHub) -%boost_optional(tigl::TiglRotorHubType) -%boost_optional(tigl::generated::CPACSRotor_type) -%boost_optional(tigl::CCPACSFuselageStructure) -%boost_optional(tigl::generated::CPACSLinkToFileType_format) -%boost_optional(tigl::CCPACSWingCells) -%boost_optional(tigl::generated::CPACSAlignmentCrossBeam) -%boost_optional(tigl::generated::CPACSDoorAssemblyPosition_doorType) -%boost_optional(tigl::CCPACSWingSections) -%boost_optional(tigl::CCPACSWingSegments) -%boost_optional(tigl::CCPACSPositionings) -%boost_optional(tigl::CCPACSEnginePylons) -%boost_optional(tigl::CCPACSWingProfiles) -%boost_optional(tigl::CCPACSFuselageProfiles) -%boost_optional(tigl::CCPACSRotorProfiles) -%boost_optional(tigl::CCPACSCurveParamPointMap) -%boost_optional(tigl::CCPACSCurvePointListXYZ) - -// ---------------- Other ------------------------------// -%boost_optional(tigl::CCPACSEtaIsoLine) -%boost_optional(tigl::CCPACSMaterialDefinition) -%boost_optional(tigl::CCPACSEtaXsiPoint) -%boost_optional(tigl::CCPACSCurvePoint) - -%include "generated/CPACSXsiIsoLine.h" -%include "generated/CPACSEtaIsoLine.h" -%include "CCPACSEtaIsoLine.h" -%include "CCPACSXsiIsoLine.h" -%include "generated/CPACSEtaXsiPoint.h" -%include "CCPACSEtaXsiPoint.h" -%include "generated/CPACSCurvePoint.h" -%include "CCPACSCurvePoint.h" - -%include "generated/CPACSMaterialDefinition.h" -%include "CCPACSMaterialDefinition.h" -%include "generated/CPACSCap.h" - -// -------------- Fuselage Walls, Compartments -------------// -%boost_optional(tigl::generated::CPACSCompartments) -%include "generated/CPACSCompartments.h" -%include "generated/CPACSLateralCap_placement.h" -%boost_optional(tigl::generated::CPACSLateralCap) -%include "generated/CPACSLateralCap.h" - -%boost_optional(tigl::generated::CPACSBoundingElementUIDs) -%include "generated/CPACSBoundingElementUIDs.h" -%include "generated/CPACSStructuralWallElement.h" -%include "generated/CPACSStructuralWallElements.h" -%include "generated/CPACSWallPositionUIDs.h" -%include "generated/CPACSWallPosition.h" -%include "generated/CPACSWallPositions.h" -%include "generated/CPACSWallSegment.h" -%include "generated/CPACSWallSegments.h" -%boost_optional(tigl::generated::CPACSWalls) -%include "generated/CPACSWalls.h" - -// ----------------- Engines ---------------------------// -%boost_optional(tigl::CCPACSEngines) -%boost_optional(tigl::generated::CPACSEngineNacelle) -%boost_optional(tigl::CCPACSNacelleCowl) -%boost_optional(tigl::CCPACSNacelleCenterCowl) -%boost_optional(tigl::CCPACSEnginePositions) -%include "generated/CPACSEnginePositions.h" -%include "CCPACSEnginePositions.h" -%include "generated/CPACSEnginePosition.h" -%include "CCPACSEnginePosition.h" -%include "generated/CPACSNacelleCenterCowl.h" -%include "CCPACSNacelleCenterCowl.h" -%include "generated/CPACSNacelleSections.h" -%include "CCPACSNacelleSections.h" -%include "generated/CPACSRotationCurve.h" -%include "CCPACSRotationCurve.h" -%include "generated/CPACSNacelleGuideCurves.h" -%include "CCPACSNacelleGuideCurves.h" -namespace tigl { - class CCPACSNacelleCowl; -} -%include "generated/CPACSEngineNacelle.h" -%include "generated/CPACSNacelleCowl.h" -%include "CCPACSNacelleCowl.h" -%include "generated/CPACSEngine.h" -%include "generated/CPACSEngines.h" -%include "CCPACSEngines.h" - -// ---------------- Control surfaces ------------------ // -%boost_optional(tigl::generated::CPACSControlSurfaceTrackType_trackSubType) -%boost_optional(tigl::generated::CPACSTrackFairing) -%boost_optional(tigl::generated::CPACSTrackStrut2) -%boost_optional(tigl::generated::CPACSTrackStrut1) -%boost_optional(tigl::generated::CPACSTrackCar) -%boost_optional(tigl::generated::CPACSTrackStructure) -%boost_optional(tigl::generated::CPACSTrackActuator) -%boost_optional(tigl::generated::CPACSControlSurfaceWingCutOut) -%boost_optional(tigl::generated::CPACSControlSurfaceContours) -%boost_optional(tigl::generated::CPACSCutOutProfiles) -%boost_optional(tigl::generated::CPACSContourReference) -%boost_optional(tigl::generated::CPACSLeadingEdgeShape) -%boost_optional(tigl::generated::CPACSLeadingEdgeHollow) -%boost_optional(tigl::generated::CPACSCutOutControlPoints) -%boost_optional(tigl::generated::CPACSControlSurfaceSkinCutOutBorder) -%boost_optional(tigl::CCPACSTrailingEdgeDevices) -%boost_optional(tigl::CCPACSControlSurfaces) -%boost_optional(tigl::CPACSControlSurfaceWingCutOut) -%boost_optional(tigl::generated::CPACSControlSurfaceTracks) -%boost_optional(tigl::generated::CPACSCutOutControlPoints) - -namespace tigl -{ - class CCPACSWingCSStructure; -} -%include "generated/CPACSTrackSecondaryStructure.h" -%include "generated/CPACSTrackJointPositions.h" -%include "generated/CPACSTrackStruts.h" -%include "generated/CPACSTrackStructure.h" -%include "generated/CPACSTrackActuator.h" -%include "generated/CPACSControlSurfaceTrackType_trackSubType.h" -%include "generated/CPACSControlSurfaceTrackType_trackType.h" -%include "generated/CPACSControlSurfaceTrackType.h" -%include "generated/CPACSOuterCutOutProfile.h" -%include "generated/CPACSCutOutProfiles.h" -%include "generated/CPACSControlSurfaceSkinCutOut.h" -%include "generated/CPACSControlSurfaceTracks.h" -%include "generated/CPACSControlSurfaceContours.h" -%include "generated/CPACSContourReference.h" -%include "generated/CPACSLeadingEdgeShape.h" -%include "generated/CPACSLeadingEdgeHollow.h" -%include "generated/CPACSCutOutControlPoint.h" -%include "generated/CPACSCutOutControlPoints.h" -%include "generated/CPACSControlSurfaceSteps.h" -%include "generated/CPACSControlSurfaceHingePoint.h" -%include "generated/CPACSControlSurfaceSkinCutOutBorder.h" -%include "generated/CPACSCutOutControlPoints.h" -%include "generated/CPACSControlSurfacePath.h" -%include "CTiglControlSurfaceTransformation.h" -%include "CTiglControlSurfaceBorderCoordinateSystem.h" -%ignore ComponentSegment(const CCPACSControlSurfaceBorderTrailingEdge&); -%include "generated/CPACSControlSurfaceBorderTrailingEdge.h" -%include "CCPACSControlSurfaceBorderTrailingEdge.h" -%include "generated/CPACSControlSurfaceOuterShapeTrailingEdge.h" -%include "generated/CPACSControlSurfacePath.h" -%include "generated/CPACSControlSurfaceTracks.h" -%include "CPACSControlSurfaceWingCutOut.h" -%include "generated/CPACSTrailingEdgeDevice.h" -%ignore ComponentSegment(const CCPACSTrailingEdgeDevice&); -%ignore ComponentSegment(CCPACSTrailingEdgeDevice&); -%include "CCPACSTrailingEdgeDevice.h" -%include "generated/CPACSTrailingEdgeDevices.h" -%include "CCPACSTrailingEdgeDevices.h" -%include "generated/CPACSControlSurfaces.h" -%include "CCPACSControlSurfaces.h" - -// --------------- Fuselage structure -----------------// - -%apply double *OUTPUT { double* eta, double* xsi }; -%ignore tigl::CTiglStringerFrameBorderedObject; -%include "CTiglStringerFrameBorderedObject.h" -%include "generated/CPACSSkinSegment.h" -%include "CCPACSSkinSegment.h" -%include "generated/CPACSCargoDoorsAssembly.h" -%include "generated/CPACSPressureBulkheadAssembly.h" -%include "CCPACSPressureBulkheadAssembly.h" -%include "generated/CPACSLongFloorBeamsAssembly.h" -%include "CCPACSLongFloorBeamsAssembly.h" -%include "generated/CPACSCargoCrossBeamStrutsAssembly.h" -%include "CCPACSCargoCrossBeamStrutsAssembly.h" -%include "generated/CPACSCargoCrossBeamsAssembly.h" -%include "CCPACSCargoCrossBeamsAssembly.h" -%include "generated/CPACSAlignmentCrossBeam.h" -%include "generated/CPACSCrossBeamAssemblyPosition.h" -%include "CCPACSCrossBeamAssemblyPosition.h" -%include "generated/CPACSCrossBeamStrutAssemblyPosition.h" -%include "CCPACSCrossBeamStrutAssemblyPosition.h" -%include "generated/CPACSPressureBulkheadAssemblyPosition.h" -%include "CCPACSPressureBulkheadAssemblyPosition.h" -%include "generated/CPACSFramesAssembly.h" -%include "CCPACSFramesAssembly.h" -%include "generated/CPACSStringersAssembly.h" -%include "CCPACSStringersAssembly.h" -%include "generated/CPACSSkinSegments.h" -%include "generated/CPACSSkin.h" -%include "generated/CPACSFuselageStructure.h" -%include "CCPACSFuselageStructure.h" - - -%include "generated/CPACSWingSkin.h" -%include "CPACSRotor_type.h" -%include "TiglRotorHubType.h" -%include "CTiglRelativelyPositionedComponent.h" -%include "CTiglAttachedRotorBlade.h" -%include "CPACSRotorHubHinge_type.h" - -// --------------- Fuselage tanks -----------------// -%boost_optional(tigl::CCPACSGenericFuelTanks) -%boost_optional(tigl::generated::CPACSFuselageFuelTanks) -%boost_optional(tigl::generated::CPACSGenericFuelTanks) -%boost_optional(tigl::generated::CPACSFuelTankVolume) -%boost_optional(tigl::CCPACSHullStructure) - -namespace tigl { -class CCPACSFuselageSegments; -class CCPACSHulls; -} - -%include "generated/CPACSHullStructure.h" -%include "CCPACSHullStructure.h" -%include "generated/CPACSGenericFuelTanks.h" -%include "generated/CPACSFuelTankVolume.h" -%include "generated/CPACSGenericFuelTank.h" -%include "CTiglFuselageConnection.h" -%include "CCPACSFuselageSegment.h" -%include "CCPACSFuselageSegments.h" -%include "CCPACSGenericFuelTanks.h" -%include "CCPACSGenericFuelTank.h" -%include "generated/CPACSHulls.h" -%include "CCPACSHulls.h" -%include "generated/CPACSHull.h" -%include "CCPACSHull.h" -%include "generated/CPACSFuselageFuelTanks.h" -%include "generated/CPACSDomeType.h" - - -// -------------------- Wing Structure -------------------// - -namespace tigl { -class CCPACSWingCSStructure; -class CCPACSWingSparSegment; -class CCPACSWingRibsPositioning; -} -%include "generated/CPACSWingRibExplicitPositioning.h" -%include "CCPACSWingRibExplicitPositioning.h" -%include "generated/CPACSRibRotation.h" -%include "CCPACSWingRibRotation.h" -%include "generated/CPACSRibCrossingBehaviour.h" -%include "generated/CPACSWingRibsPositioning.h" -%include "CCPACSWingRibsPositioning.h" -%include "generated/CPACSWingRibCell.h" -%include "generated/CPACSWingRibCrossSection.h" -%include "CCPACSWingRibCrossSection.h" -%include "generated/CPACSWingRibsDefinition.h" -%include "CCPACSWingRibsDefinition.h" -%include "generated/CPACSSparPositionUIDs.h" -%include "CCPACSWingSparPositionUIDs.h" -%include "generated/CPACSSparCells.h" -%include "generated/CPACSWeb.h" -%include "generated/CPACSSparCrossSection.h" -%include "generated/CPACSSparPositions.h" -%include "generated/CPACSSparSegments.h" -%include "generated/CPACSSparSegment.h" -%include "CCPACSWingSparSegments.h" - -%apply double &OUTPUT { double& eta, double& xsi }; -%include "CCPACSWingSparSegment.h" -%include "CCPACSWingSparPositions.h" -%include "CTiglWingStructureReference.h" -%clear double& eta, double& xsi; - -%include "generated/CPACSWingSpar.h" -%include "CCPACSWingSpars.h" -%include "generated/CPACSWingRibsDefinitions.h" -%include "CCPACSWingRibsDefinitions.h" -%include "generated/CPACSCellPositioningSpanwise.h" -%include "CCPACSWingCellPositionSpanwise.h" -%include "generated/CPACSCellPositioningChordwise.h" -%include "CCPACSWingCellPositionChordwise.h" -%include "EtaXsi.h" -%include "generated/CPACSWingCell.h" -%include "CCPACSWingCell.h" -%include "generated/CPACSWingShell.h" -%include "CCPACSWingShell.h" -%template (WingComponentSegmentTemplate) tigl::CTiglAbstractSegment; -%include "generated/CPACSComponentSegment.h" - -%apply double &OUTPUT { double& eta, double& xsi, double& errorDistance}; -%include "CCPACSWingComponentSegment.h" -%clear double& eta, double& xsi, double& errorDistance; - -%include "generated/CPACSWingComponentSegmentStructure.h" -%include "CCPACSWingCSStructure.h" - -// -------------------- Wing -------------------// - -%include "generated/CPACSComponentSegments.h" -%include "CCPACSWingComponentSegments.h" -%include "generated/CPACSPositionings.h" -%include "CCPACSPositionings.h" -// We have to rename the enums since they collide with those from tigl.h -%rename(GuideCurve_C0) tigl::generated::C0; -%rename(GuideCurve_C1_from_previous) tigl::generated::C1_from_previous; -%rename(GuideCurve_C2_from_previous) tigl::generated::C2_from_previous; -%rename(GuideCurve_C1_to_previous) tigl::generated::C1_to_previous; -%rename(GuideCurve_C2_to_previous) tigl::generated::C2_to_previous; -%include "CPACSGuideCurve_continuity.h" -%include "generated/CPACSGuideCurve.h" -%include "generated/CPACSGuideCurves.h" -%include "CCPACSGuideCurve.h" -%include "CCPACSGuideCurves.h" -%include "generated/CPACSCst2D.h" -%include "ITiglWingProfileAlgo.h" -%include "generated/CPACSPosExcl0DoubleBase.h" -%include "generated/CPACSRectangleProfile.h" -%include "generated/CPACSStandardProfile.h" //TODO: Need to replace with implementation CCPACSStandardProfile.h, once it exists. -%include "CCPACSWingProfileCST.h" -%include "PTiglWingProfileAlgo.h" -%include "generated/CPACSFuselageElements.h" -%include "CCPACSFuselageSectionElements.h" -%include "generated/CPACSCurveParamPointMap.h" -%include "CCPACSCurveParamPointMap.h" -%include "generated/CPACSCurvePointListXYZ.h" -%include "CCPACSCurvePointListXYZ.h" -%include "generated/CPACSProfileGeometry.h" -%include "CCPACSWingProfile.h" -%include "CCPACSFuselageProfile.h" -%include "CTiglWingConnection.h" -%include "CTiglFuselageConnection.h" -%include "generated/CPACSWingElements.h" -%include "CCPACSWingSectionElements.h" -%include "generated/CPACSWingElement.h" -%include "CCPACSWingSectionElement.h" -%include "generated/CPACSFuselageElement.h" -%include "CCPACSFuselageSectionElement.h" -%include "generated/CPACSWingSection.h" -%include "CCPACSWingSection.h" -%include "generated/CPACSFuselageSection.h" -%include "CCPACSFuselageSection.h" -%include "generated/CPACSWingSections.h" -%include "CCPACSWingSections.h" -%include "generated/CPACSFuselageSections.h" -%include "CCPACSFuselageSections.h" -%include "generated/CPACSWingElements.h" -%include "CCPACSWingSectionElements.h" -%include "generated/CPACSFuselageElements.h" -%include "CCPACSFuselageSectionElements.h" -%include "generated/CPACSGuideCurveProfileGeometry.h" -%include "CCPACSGuideCurveProfile.h" -%include "generated/CPACSWingSegment.h" - -%template (WingSegmentTemplate) tigl::CTiglAbstractSegment; -%apply double &OUTPUT { double& eta, double& xsi }; -%include "CCPACSWingSegment.h" -%clear double& eta, double& xsi; - -%include "generated/CPACSFuselageSegment.h" -%template (FuselageSegmentTemplate) tigl::CTiglAbstractSegment; -%include "CCPACSFuselageSegment.h" -%include "generated/CPACSWingAirfoils.h" -%include "CCPACSWingProfiles.h" -%include "CTiglRelativelyPositionedComponent.h" -%include "generated/CPACSWing.h" - -%apply double& OUTPUT { double& mac_chord, double& mac_x, double& mac_y, double& mac_z }; -%apply bool& OUTPUT { double& onTop }; -%include "CCPACSWing.h" -%clear double &mac_chord, double &mac_x, double &mac_y, double &mac_z; -%clear bool& onTop; - -%include "generated/CPACSWings.h" -%include "CCPACSWings.h" -%include "generated/CPACSRotorHubHinge.h" -%include "CCPACSRotorHinge.h" -%include "generated/CPACSRotorBladeAttachment.h" -%include "CCPACSRotorBladeAttachment.h" -%include "generated/CPACSRotorHub.h" -%include "CCPACSRotorHub.h" -%include "generated/CPACSRotor.h" -%include "CCPACSRotor.h" -%include "generated/CPACSRotors.h" -%include "CCPACSRotors.h" -%include "generated/CPACSFuselageProfiles.h" -%include "CCPACSFuselageProfiles.h" -%include "generated/CPACSFuselage.h" -%include "CCPACSFuselage.h" -%include "generated/CPACSFuselages.h" -%include "CCPACSFuselages.h" -%include "TiglFarFieldType.h" -%include "generated/CPACSCellPositioningSpanwise.h" -%include "generated/CPACSCellPositioningChordwise.h" -%include "CCPACSWingCellPositionSpanwise.h" -%include "CCPACSWingCellPositionChordwise.h" -%include "generated/CPACSWingCell.h" -%include "CCPACSWingCell.h" -%include "generated/CPACSWingCells.h" -%include "CCPACSWingCells.h" -%include "generated/CPACSWingShell.h" -%include "CCPACSWingShell.h" -%include "CCPACSFarField.h" -%include "generated/CPACSLinkToFileType_format.h" -%include "generated/CPACSLinkToFile.h" -%include "generated/CPACSGenericGeometricComponent.h" -%include "CCPACSExternalObject.h" -%include "CTiglWingSegmentList.h" -%include "CTiglWingChordface.h" - -// ---- Engine Pylon -- // -%include "generated/CPACSEnginePylon.h" -%include "CCPACSEnginePylon.h" -%include "generated/CPACSEnginePylons.h" -%include "CCPACSEnginePylons.h" - -// ---------------- Ducts ------------------ // - -%boost_optional(tigl::CCPACSTransformation) -%boost_optional(tigl::CCPACSDucts) -%boost_optional(tigl::CPACSUIDSequence) -%include "generated/CPACSUIDSequence.h" -%include "CCPACSDucts.h" -%include "CCPACSDuctAssembly.h" -%include "CCPACSDuct.h" - -// CTiglUIDManager::GetGeometricComponent returns the interface type ITiglGeometricComponent -// In the target language, we want to get the concrete type back -%factory(tigl::ITiglGeometricComponent& tigl::CTiglUIDManager::GetGeometricComponent, - tigl::CCPACSFuselage, - tigl::CCPACSFuselageSegment, - tigl::CCPACSWing, - tigl::CCPACSWingSegment, - tigl::CCPACSWingComponentSegment, - tigl::CTiglWingChordface, - tigl::CCPACSExternalObject, - tigl::CCPACSGenericSystem, - tigl::CCPACSRotor, - tigl::CTiglAttachedRotorBlade, - tigl::CCPACSCrossBeamAssemblyPosition, - tigl::CCPACSCrossBeamStrutAssemblyPosition, - tigl::CCPACSDoorAssemblyPosition, - tigl::CCPACSLongFloorBeam, - tigl::CCPACSPressureBulkheadAssemblyPosition, - tigl::CCPACSWingCell, - tigl::CCPACSWingRibsDefinition, - tigl::CCPACSWingSparSegment, - tigl::CCPACSEnginePylon, - tigl::CCPACSTrailingEdgeDevice, - tigl::CCPACSDuct, - tigl::CCPACSDuctAssembly, - tigl::CCPACSGenericFuelTank, - tigl::CCPACSHull -); - -namespace tigl -{ -typedef std::map ShapeContainerType; -typedef std::map RelativeComponentContainerType; - -class CTiglUIDManager -{ -public: - CTiglUIDManager(); - bool IsUIDRegistered(const std::string& uid) const; - bool TryUnregisterObject(const std::string& uid); - void UnregisterObject(const std::string& uid); - bool HasGeometricComponent(const std::string& uid) const; - ITiglGeometricComponent& GetGeometricComponent(const std::string& uid) const; - CTiglRelativelyPositionedComponent* GetParentGeometricComponent(const std::string& uid) const; - const RelativeComponentContainerType& GetRootGeometricComponents() const; - void SetParentComponents(); - const ShapeContainerType& GetShapeContainer() const; - void Clear(); -}; -} // namespace tigl - -%include "CTiglShapeCache.h" -%include "generated/CPACSGenericSystem_geometricBaseType.h" -%include "generated/CPACSGenericSystem.h" -%include "CCPACSGenericSystem.h" -%include "generated/CPACSGenericSystems.h" -%include "CCPACSGenericSystems.h" -%include "generated/CPACSSystems.h" -%include "CCPACSACSystems.h" -%include "generated/CPACSRotorAirfoils.h" -%include "CCPACSRotorProfiles.h" -%include "CCPACSConfiguration.h" -%include "CCPACSConfigurationManager.h" -%include "CTiglFusePlane.h" -%include "generated/CPACSDoorAssemblyPosition_doorType.h" -%include "generated/CPACSDoorAssemblyPosition.h" -%include "CCPACSDoorAssemblyPosition.h" -%include "generated/CPACSLongFloorBeam.h" -%include "CCPACSLongFloorBeam.h" - -%clear double* eta, double* xsi; - -// ---------------------- Eta / Xsi Functions ---------------------- // - -%include "tigletaxsifunctions.h" +/* +* Copyright (C) 2015 German Aerospace Center (DLR/SC) +* +* Created: 2015-11-22 Martin Siggel +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +%module (package="tigl3") configuration + +%include +%include +%include common.i +%include math_headers.i +%include TopoDS_headers.i +%include TopLoc_headers.i +%include Geom_headers.i + +%import geometry.i +%import core.i + +%{ +// All includes that are required for the wrapper compilation +#include "CCPACSConfiguration.h" +#include "CCPACSConfigurationManager.h" +#include "CTiglFusePlane.h" +#include "CCPACSWingProfile.h" +#include "generated/CPACSStandardProfile.h" //TODO: Replace with CCPACSStandardProfile, once it exists. +#include "CCPACSFuselageSection.h" +#include "CCPACSExternalObject.h" +#include "CTiglShapeCache.h" +#include "CTiglError.h" +#include "CCPACSWallPosition.h" +#include "CCPACSWingSegment.h" +#include "CCPACSFuselageSegment.h" +#include "CTiglWingConnection.h" +#include "CTiglFuselageConnection.h" +#include "CCPACSWingCell.h" +#include "CCPACSMaterialDefinition.h" +#include "generated/CPACSGenericSystem_geometricBaseType.h" +#include "CCPACSACSystems.h" +#include "CCPACSGenericSystem.h" +#include "CCPACSGenericSystems.h" +#include "CCPACSRotorBladeAttachment.h" +#include "generated/CPACSWingElement.h" +#include "CCPACSWingSectionElement.h" +#include "CCPACSWingSection.h" +#include "generated/CPACSGuideCurveProfileGeometry.h" +#include "CCPACSGuideCurveProfile.h" +#include "generated/CPACSSparSegment.h" +#include "CCPACSWingSparSegment.h" +#include "CCPACSWingRibsDefinition.h" +#include "CCPACSSkinSegment.h" +#include "CTiglWingChordface.h" +#include "CCPACSCrossBeamAssemblyPosition.h" +#include "CCPACSCrossBeamStrutAssemblyPosition.h" +#include "generated/CPACSCrossBeamStrutAssemblyPosition.h" +#include "CCPACSDoorAssemblyPosition.h" +#include "CCPACSLongFloorBeam.h" +#include "CCPACSLongFloorBeamPosition.h" +#include "CCPACSPressureBulkheadAssemblyPosition.h" +#include "generated/CPACSControlSurfaceOuterShapeTrailingEdge.h" +#include "generated/CPACSControlSurfacePath.h" +#include "generated/CPACSCutOutControlPoints.h" +#include "generated/CPACSControlSurfaceWingCutOut.h" +#include "generated/CPACSControlSurfaceSkinCutOutBorder.h" +#include "generated/CPACSControlSurfaceTracks.h" +#include "generated/CPACSControlSurfaceTrackType.h" +#include "generated/CPACSTrailingEdgeDevice.h" +#include "CTiglControlSurfaceTransformation.h" +#include "CCPACSTrailingEdgeDevice.h" +#include "CCPACSEnginePylons.h" +#include "CCPACSEnginePylon.h" +#include "CCPACSEnginePosition.h" +#include "generated/CPACSLateralCap_placement.h" +#include "generated/CPACSLateralCap.h" +#include "generated/CPACSBoundingElementUIDs.h" +#include "generated/CPACSStructuralWallElement.h" +#include "generated/CPACSStructuralWallElements.h" +#include "generated/CPACSWallPositionUIDs.h" +#include "generated/CPACSWallPosition.h" +#include "generated/CPACSWallPositions.h" +#include "generated/CPACSWallSegment.h" +#include "generated/CPACSWallSegments.h" +#include "generated/CPACSUIDSequence.h" +#include "CCPACSDucts.h" +#include "CCPACSDuctAssembly.h" +#include "CCPACSDuct.h" +#include "generated/CPACSFuselageFuelTanks.h" +#include "generated/CPACSGenericFuelTanks.h" +#include "generated/CPACSGenericFuelTank.h" +#include "generated/CPACSFuelTankVolume.h" +#include "CCPACSGenericFuelTanks.h" +#include "CCPACSGenericFuelTank.h" +#include "generated/CPACSHulls.h" +#include "CCPACSHulls.h" +#include "generated/CPACSHull.h" +#include "CCPACSHull.h" +#include "generated/CPACSHullStructure.h" +#include "CCPACSHullStructure.h" +#include "CCPACSFrame.h" + + +%} + +%feature("autodoc", "3"); + +%catch_exceptions() + +// rename file methods to python pep8 style +%rename("%(undercase)s", %$isfunction) ""; + +// wrap optional classes +%boost_optional(tigl::CCPACSWingCSStructure) +%boost_optional(tigl::generated::CPACSSkinSegments) +%boost_optional(tigl::generated::CPACSSkin) +%boost_optional(tigl::CCPACSStringersAssembly) +%boost_optional(tigl::CCPACSFramesAssembly) +%boost_optional(tigl::CCPACSCargoCrossBeamsAssembly) +%boost_optional(tigl::CCPACSCargoCrossBeamStrutsAssembly) +%boost_optional(tigl::CCPACSLongFloorBeamsAssembly) +%boost_optional(tigl::CCPACSPressureBulkheadAssembly) +%boost_optional(tigl::generated::CPACSCargoDoorsAssembly) +%boost_optional(tigl::ECPACSRibRotation_ribRotationReference) +%boost_optional(tigl::generated::CPACSWingRibCell) +%boost_optional(tigl::generated::CPACSCap) +%boost_optional(tigl::CCPACSWingRibsPositioning) +%boost_optional(tigl::CCPACSWingRibExplicitPositioning) +%boost_optional(tigl::generated::CPACSWeb) +%boost_optional(tigl::generated::CPACSSparCells) +%boost_optional(tigl::CCPACSGuideCurves) +%boost_optional(tigl::CCPACSPositionings) +%boost_optional(tigl::CCPACSWingComponentSegments) +%boost_optional(tigl::CCPACSWingRibsDefinitions) +%boost_optional(tigl::CCPACSWingSpars) +%boost_optional(tigl::generated::CPACSGuideCurve_continuity) +%boost_optional(tigl::CCPACSRectangleProfile) +%boost_optional(tigl::CCPACSStandardProfile) +%boost_optional(tigl::CCPACSWingProfileCST) +%boost_optional(tigl::CTiglTransformation) +%boost_optional(tigl::CCPACSRotorHinges) +%boost_optional(tigl::generated::CPACSRotorHub) +%boost_optional(tigl::TiglRotorHubType) +%boost_optional(tigl::generated::CPACSRotor_type) +%boost_optional(tigl::CCPACSFuselageStructure) +%boost_optional(tigl::generated::CPACSLinkToFileType_format) +%boost_optional(tigl::CCPACSWingCells) +%boost_optional(tigl::generated::CPACSAlignmentCrossBeam) +%boost_optional(tigl::generated::CPACSDoorAssemblyPosition_doorType) +%boost_optional(tigl::CCPACSWingSections) +%boost_optional(tigl::CCPACSWingSegments) +%boost_optional(tigl::CCPACSPositionings) +%boost_optional(tigl::CCPACSEnginePylons) +%boost_optional(tigl::CCPACSWingProfiles) +%boost_optional(tigl::CCPACSFuselageProfiles) +%boost_optional(tigl::CCPACSRotorProfiles) +%boost_optional(tigl::CCPACSCurveParamPointMap) +%boost_optional(tigl::CCPACSCurvePointListXYZ) + +// ---------------- Other ------------------------------// +%boost_optional(tigl::CCPACSEtaIsoLine) +%boost_optional(tigl::CCPACSMaterialDefinition) +%boost_optional(tigl::CCPACSEtaXsiPoint) +%boost_optional(tigl::CCPACSCurvePoint) + +%include "generated/CPACSXsiIsoLine.h" +%include "generated/CPACSEtaIsoLine.h" +%include "CCPACSEtaIsoLine.h" +%include "CCPACSXsiIsoLine.h" +%include "generated/CPACSEtaXsiPoint.h" +%include "CCPACSEtaXsiPoint.h" +%include "generated/CPACSCurvePoint.h" +%include "CCPACSCurvePoint.h" + +%include "generated/CPACSMaterialDefinition.h" +%include "CCPACSMaterialDefinition.h" +%include "generated/CPACSCap.h" + +// -------------- Fuselage Walls, Compartments -------------// +%boost_optional(tigl::generated::CPACSCompartments) +%include "generated/CPACSCompartments.h" +%include "generated/CPACSLateralCap_placement.h" +%boost_optional(tigl::generated::CPACSLateralCap) +%include "generated/CPACSLateralCap.h" + +%boost_optional(tigl::generated::CPACSBoundingElementUIDs) +%include "generated/CPACSBoundingElementUIDs.h" +%include "generated/CPACSStructuralWallElement.h" +%include "generated/CPACSStructuralWallElements.h" +%include "generated/CPACSWallPositionUIDs.h" +%include "generated/CPACSWallPosition.h" +%include "generated/CPACSWallPositions.h" +%include "generated/CPACSWallSegment.h" +%include "generated/CPACSWallSegments.h" +%boost_optional(tigl::generated::CPACSWalls) +%include "generated/CPACSWalls.h" + +// ----------------- Engines ---------------------------// +%boost_optional(tigl::CCPACSEngines) +%boost_optional(tigl::generated::CPACSEngineNacelle) +%boost_optional(tigl::CCPACSNacelleCowl) +%boost_optional(tigl::CCPACSNacelleCenterCowl) +%boost_optional(tigl::CCPACSEnginePositions) +%include "generated/CPACSEnginePositions.h" +%include "CCPACSEnginePositions.h" +%include "generated/CPACSEnginePosition.h" +%include "CCPACSEnginePosition.h" +%include "generated/CPACSNacelleCenterCowl.h" +%include "CCPACSNacelleCenterCowl.h" +%include "generated/CPACSNacelleSections.h" +%include "CCPACSNacelleSections.h" +%include "generated/CPACSRotationCurve.h" +%include "CCPACSRotationCurve.h" +%include "generated/CPACSNacelleGuideCurves.h" +%include "CCPACSNacelleGuideCurves.h" +namespace tigl { + class CCPACSNacelleCowl; +} +%include "generated/CPACSEngineNacelle.h" +%include "generated/CPACSNacelleCowl.h" +%include "CCPACSNacelleCowl.h" +%include "generated/CPACSEngine.h" +%include "generated/CPACSEngines.h" +%include "CCPACSEngines.h" + +// ---------------- Control surfaces ------------------ // +%boost_optional(tigl::generated::CPACSControlSurfaceTrackType_trackSubType) +%boost_optional(tigl::generated::CPACSTrackFairing) +%boost_optional(tigl::generated::CPACSTrackStrut2) +%boost_optional(tigl::generated::CPACSTrackStrut1) +%boost_optional(tigl::generated::CPACSTrackCar) +%boost_optional(tigl::generated::CPACSTrackStructure) +%boost_optional(tigl::generated::CPACSTrackActuator) +%boost_optional(tigl::generated::CPACSControlSurfaceWingCutOut) +%boost_optional(tigl::generated::CPACSControlSurfaceContours) +%boost_optional(tigl::generated::CPACSCutOutProfiles) +%boost_optional(tigl::generated::CPACSContourReference) +%boost_optional(tigl::generated::CPACSLeadingEdgeShape) +%boost_optional(tigl::generated::CPACSLeadingEdgeHollow) +%boost_optional(tigl::generated::CPACSCutOutControlPoints) +%boost_optional(tigl::generated::CPACSControlSurfaceSkinCutOutBorder) +%boost_optional(tigl::CCPACSTrailingEdgeDevices) +%boost_optional(tigl::CCPACSControlSurfaces) +%boost_optional(tigl::CPACSControlSurfaceWingCutOut) +%boost_optional(tigl::generated::CPACSControlSurfaceTracks) +%boost_optional(tigl::generated::CPACSCutOutControlPoints) + +namespace tigl +{ + class CCPACSWingCSStructure; +} +%include "generated/CPACSTrackSecondaryStructure.h" +%include "generated/CPACSTrackJointPositions.h" +%include "generated/CPACSTrackStruts.h" +%include "generated/CPACSTrackStructure.h" +%include "generated/CPACSTrackActuator.h" +%include "generated/CPACSControlSurfaceTrackType_trackSubType.h" +%include "generated/CPACSControlSurfaceTrackType_trackType.h" +%include "generated/CPACSControlSurfaceTrackType.h" +%include "generated/CPACSOuterCutOutProfile.h" +%include "generated/CPACSCutOutProfiles.h" +%include "generated/CPACSControlSurfaceSkinCutOut.h" +%include "generated/CPACSControlSurfaceTracks.h" +%include "generated/CPACSControlSurfaceContours.h" +%include "generated/CPACSContourReference.h" +%include "generated/CPACSLeadingEdgeShape.h" +%include "generated/CPACSLeadingEdgeHollow.h" +%include "generated/CPACSCutOutControlPoint.h" +%include "generated/CPACSCutOutControlPoints.h" +%include "generated/CPACSControlSurfaceSteps.h" +%include "generated/CPACSControlSurfaceHingePoint.h" +%include "generated/CPACSControlSurfaceSkinCutOutBorder.h" +%include "generated/CPACSCutOutControlPoints.h" +%include "generated/CPACSControlSurfacePath.h" +%include "CTiglControlSurfaceTransformation.h" +%include "CTiglControlSurfaceBorderCoordinateSystem.h" +%ignore ComponentSegment(const CCPACSControlSurfaceBorderTrailingEdge&); +%include "generated/CPACSControlSurfaceBorderTrailingEdge.h" +%include "CCPACSControlSurfaceBorderTrailingEdge.h" +%include "generated/CPACSControlSurfaceOuterShapeTrailingEdge.h" +%include "generated/CPACSControlSurfacePath.h" +%include "generated/CPACSControlSurfaceTracks.h" +%include "CPACSControlSurfaceWingCutOut.h" +%include "generated/CPACSTrailingEdgeDevice.h" +%ignore ComponentSegment(const CCPACSTrailingEdgeDevice&); +%ignore ComponentSegment(CCPACSTrailingEdgeDevice&); +%include "CCPACSTrailingEdgeDevice.h" +%include "generated/CPACSTrailingEdgeDevices.h" +%include "CCPACSTrailingEdgeDevices.h" +%include "generated/CPACSControlSurfaces.h" +%include "CCPACSControlSurfaces.h" + +// --------------- Fuselage structure -----------------// + +%apply double *OUTPUT { double* eta, double* xsi }; +%ignore tigl::CTiglStringerFrameBorderedObject; +%include "CTiglStringerFrameBorderedObject.h" +%include "generated/CPACSSkinSegment.h" +%include "CCPACSSkinSegment.h" +%include "generated/CPACSCargoDoorsAssembly.h" +%include "generated/CPACSPressureBulkheadAssembly.h" +%include "CCPACSPressureBulkheadAssembly.h" +%include "generated/CPACSLongFloorBeamsAssembly.h" +%include "CCPACSLongFloorBeamsAssembly.h" +%include "generated/CPACSCargoCrossBeamStrutsAssembly.h" +%include "CCPACSCargoCrossBeamStrutsAssembly.h" +%include "generated/CPACSCargoCrossBeamsAssembly.h" +%include "CCPACSCargoCrossBeamsAssembly.h" +%include "generated/CPACSAlignmentCrossBeam.h" +%include "generated/CPACSCrossBeamAssemblyPosition.h" +%include "CCPACSCrossBeamAssemblyPosition.h" +%include "generated/CPACSCrossBeamStrutAssemblyPosition.h" +%include "CCPACSCrossBeamStrutAssemblyPosition.h" +%include "generated/CPACSPressureBulkheadAssemblyPosition.h" +%include "CCPACSPressureBulkheadAssemblyPosition.h" +%include "generated/CPACSFramesAssembly.h" +%include "CCPACSFramesAssembly.h" +%include "generated/CPACSStringersAssembly.h" +%include "CCPACSStringersAssembly.h" +%include "generated/CPACSSkinSegments.h" +%include "generated/CPACSSkin.h" +%include "generated/CPACSFuselageStructure.h" +%include "CCPACSFuselageStructure.h" + + +%include "generated/CPACSWingSkin.h" +%include "CPACSRotor_type.h" +%include "TiglRotorHubType.h" +%include "CTiglRelativelyPositionedComponent.h" +%include "CTiglAttachedRotorBlade.h" +%include "CPACSRotorHubHinge_type.h" + +// --------------- Fuselage tanks -----------------// +%boost_optional(tigl::CCPACSGenericFuelTanks) +%boost_optional(tigl::generated::CPACSFuselageFuelTanks) +%boost_optional(tigl::generated::CPACSGenericFuelTanks) +%boost_optional(tigl::generated::CPACSFuelTankVolume) +%boost_optional(tigl::CCPACSHullStructure) + +namespace tigl { +class CCPACSFuselageSegments; +class CCPACSHulls; +} + +%include "generated/CPACSHullStructure.h" +%include "CCPACSHullStructure.h" +%include "generated/CPACSGenericFuelTanks.h" +%include "generated/CPACSFuelTankVolume.h" +%include "generated/CPACSGenericFuelTank.h" +%include "CTiglFuselageConnection.h" +%include "CCPACSFuselageSegment.h" +%include "CCPACSFuselageSegments.h" +%include "CCPACSGenericFuelTanks.h" +%include "CCPACSGenericFuelTank.h" +%include "generated/CPACSHulls.h" +%include "CCPACSHulls.h" +%include "generated/CPACSHull.h" +%include "CCPACSHull.h" +%include "generated/CPACSFuselageFuelTanks.h" +%include "generated/CPACSDomeType.h" + + +// -------------------- Wing Structure -------------------// + +namespace tigl { +class CCPACSWingCSStructure; +class CCPACSWingSparSegment; +class CCPACSWingRibsPositioning; +} +%include "generated/CPACSWingRibExplicitPositioning.h" +%include "CCPACSWingRibExplicitPositioning.h" +%include "generated/CPACSRibRotation.h" +%include "CCPACSWingRibRotation.h" +%include "generated/CPACSRibCrossingBehaviour.h" +%include "generated/CPACSWingRibsPositioning.h" +%include "CCPACSWingRibsPositioning.h" +%include "generated/CPACSWingRibCell.h" +%include "generated/CPACSWingRibCrossSection.h" +%include "CCPACSWingRibCrossSection.h" +%include "generated/CPACSWingRibsDefinition.h" +%include "CCPACSWingRibsDefinition.h" +%include "generated/CPACSSparPositionUIDs.h" +%include "CCPACSWingSparPositionUIDs.h" +%include "generated/CPACSSparCells.h" +%include "generated/CPACSWeb.h" +%include "generated/CPACSSparCrossSection.h" +%include "generated/CPACSSparPositions.h" +%include "generated/CPACSSparSegments.h" +%include "generated/CPACSSparSegment.h" +%include "CCPACSWingSparSegments.h" + +%apply double &OUTPUT { double& eta, double& xsi }; +%include "CCPACSWingSparSegment.h" +%include "CCPACSWingSparPositions.h" +%include "CTiglWingStructureReference.h" +%clear double& eta, double& xsi; + +%include "generated/CPACSWingSpar.h" +%include "CCPACSWingSpars.h" +%include "generated/CPACSWingRibsDefinitions.h" +%include "CCPACSWingRibsDefinitions.h" +%include "generated/CPACSCellPositioningSpanwise.h" +%include "CCPACSWingCellPositionSpanwise.h" +%include "generated/CPACSCellPositioningChordwise.h" +%include "CCPACSWingCellPositionChordwise.h" +%include "EtaXsi.h" +%include "generated/CPACSWingCell.h" +%include "CCPACSWingCell.h" +%include "generated/CPACSWingShell.h" +%include "CCPACSWingShell.h" +%template (WingComponentSegmentTemplate) tigl::CTiglAbstractSegment; +%include "generated/CPACSComponentSegment.h" + +%apply double &OUTPUT { double& eta, double& xsi, double& errorDistance}; +%include "CCPACSWingComponentSegment.h" +%clear double& eta, double& xsi, double& errorDistance; + +%include "generated/CPACSWingComponentSegmentStructure.h" +%include "CCPACSWingCSStructure.h" + +// -------------------- Wing -------------------// + +%include "generated/CPACSComponentSegments.h" +%include "CCPACSWingComponentSegments.h" +%include "generated/CPACSPositionings.h" +%include "CCPACSPositionings.h" +// We have to rename the enums since they collide with those from tigl.h +%rename(GuideCurve_C0) tigl::generated::C0; +%rename(GuideCurve_C1_from_previous) tigl::generated::C1_from_previous; +%rename(GuideCurve_C2_from_previous) tigl::generated::C2_from_previous; +%rename(GuideCurve_C1_to_previous) tigl::generated::C1_to_previous; +%rename(GuideCurve_C2_to_previous) tigl::generated::C2_to_previous; +%include "CPACSGuideCurve_continuity.h" +%include "generated/CPACSGuideCurve.h" +%include "generated/CPACSGuideCurves.h" +%include "CCPACSGuideCurve.h" +%include "CCPACSGuideCurves.h" +%include "generated/CPACSCst2D.h" +%include "ITiglWingProfileAlgo.h" +%include "generated/CPACSPosExcl0DoubleBase.h" +%include "generated/CPACSRectangleProfile.h" +%include "generated/CPACSStandardProfile.h" //TODO: Need to replace with implementation CCPACSStandardProfile.h, once it exists. +%include "CCPACSWingProfileCST.h" +%include "PTiglWingProfileAlgo.h" +%include "generated/CPACSFuselageElements.h" +%include "CCPACSFuselageSectionElements.h" +%include "generated/CPACSCurveParamPointMap.h" +%include "CCPACSCurveParamPointMap.h" +%include "generated/CPACSCurvePointListXYZ.h" +%include "CCPACSCurvePointListXYZ.h" +%include "generated/CPACSProfileGeometry.h" +%include "CCPACSWingProfile.h" +%include "CCPACSFuselageProfile.h" +%include "CTiglWingConnection.h" +%include "CTiglFuselageConnection.h" +%include "generated/CPACSWingElements.h" +%include "CCPACSWingSectionElements.h" +%include "generated/CPACSWingElement.h" +%include "CCPACSWingSectionElement.h" +%include "generated/CPACSFuselageElement.h" +%include "CCPACSFuselageSectionElement.h" +%include "generated/CPACSWingSection.h" +%include "CCPACSWingSection.h" +%include "generated/CPACSFuselageSection.h" +%include "CCPACSFuselageSection.h" +%include "generated/CPACSWingSections.h" +%include "CCPACSWingSections.h" +%include "generated/CPACSFuselageSections.h" +%include "CCPACSFuselageSections.h" +%include "generated/CPACSWingElements.h" +%include "CCPACSWingSectionElements.h" +%include "generated/CPACSFuselageElements.h" +%include "CCPACSFuselageSectionElements.h" +%include "generated/CPACSGuideCurveProfileGeometry.h" +%include "CCPACSGuideCurveProfile.h" +%include "generated/CPACSWingSegment.h" + +%template (WingSegmentTemplate) tigl::CTiglAbstractSegment; +%apply double &OUTPUT { double& eta, double& xsi }; +%include "CCPACSWingSegment.h" +%clear double& eta, double& xsi; + +%include "generated/CPACSFuselageSegment.h" +%template (FuselageSegmentTemplate) tigl::CTiglAbstractSegment; +%include "CCPACSFuselageSegment.h" +%include "generated/CPACSWingAirfoils.h" +%include "CCPACSWingProfiles.h" +%include "CTiglRelativelyPositionedComponent.h" +%include "generated/CPACSWing.h" + +%apply double& OUTPUT { double& mac_chord, double& mac_x, double& mac_y, double& mac_z }; +%apply bool& OUTPUT { double& onTop }; +%include "CCPACSWing.h" +%clear double &mac_chord, double &mac_x, double &mac_y, double &mac_z; +%clear bool& onTop; + +%include "generated/CPACSWings.h" +%include "CCPACSWings.h" +%include "generated/CPACSRotorHubHinge.h" +%include "CCPACSRotorHinge.h" +%include "generated/CPACSRotorBladeAttachment.h" +%include "CCPACSRotorBladeAttachment.h" +%include "generated/CPACSRotorHub.h" +%include "CCPACSRotorHub.h" +%include "generated/CPACSRotor.h" +%include "CCPACSRotor.h" +%include "generated/CPACSRotors.h" +%include "CCPACSRotors.h" +%include "generated/CPACSFuselageProfiles.h" +%include "CCPACSFuselageProfiles.h" +%include "generated/CPACSFuselage.h" +%include "CCPACSFuselage.h" +%include "generated/CPACSFuselages.h" +%include "CCPACSFuselages.h" +%include "TiglFarFieldType.h" +%include "generated/CPACSCellPositioningSpanwise.h" +%include "generated/CPACSCellPositioningChordwise.h" +%include "CCPACSWingCellPositionSpanwise.h" +%include "CCPACSWingCellPositionChordwise.h" +%include "generated/CPACSWingCell.h" +%include "CCPACSWingCell.h" +%include "generated/CPACSWingCells.h" +%include "CCPACSWingCells.h" +%include "generated/CPACSWingShell.h" +%include "CCPACSWingShell.h" +%include "CCPACSFarField.h" +%include "generated/CPACSLinkToFileType_format.h" +%include "generated/CPACSLinkToFile.h" +%include "generated/CPACSGenericGeometricComponent.h" +%include "CCPACSExternalObject.h" +%include "CTiglWingSegmentList.h" +%include "CTiglWingChordface.h" + +// ---- Engine Pylon -- // +%include "generated/CPACSEnginePylon.h" +%include "CCPACSEnginePylon.h" +%include "generated/CPACSEnginePylons.h" +%include "CCPACSEnginePylons.h" + +// ---------------- Ducts ------------------ // + +%boost_optional(tigl::CCPACSTransformation) +%boost_optional(tigl::CCPACSDucts) +%boost_optional(tigl::CPACSUIDSequence) +%include "generated/CPACSUIDSequence.h" +%include "CCPACSDucts.h" +%include "CCPACSDuctAssembly.h" +%include "CCPACSDuct.h" + +// CTiglUIDManager::GetGeometricComponent returns the interface type ITiglGeometricComponent +// In the target language, we want to get the concrete type back +%factory(tigl::ITiglGeometricComponent& tigl::CTiglUIDManager::GetGeometricComponent, + tigl::CCPACSFuselage, + tigl::CCPACSFuselageSegment, + tigl::CCPACSWing, + tigl::CCPACSWingSegment, + tigl::CCPACSWingComponentSegment, + tigl::CTiglWingChordface, + tigl::CCPACSExternalObject, + tigl::CCPACSGenericSystem, + tigl::CCPACSRotor, + tigl::CTiglAttachedRotorBlade, + tigl::CCPACSCrossBeamAssemblyPosition, + tigl::CCPACSCrossBeamStrutAssemblyPosition, + tigl::CCPACSDoorAssemblyPosition, + tigl::CCPACSLongFloorBeam, + tigl::CCPACSPressureBulkheadAssemblyPosition, + tigl::CCPACSWingCell, + tigl::CCPACSWingRibsDefinition, + tigl::CCPACSWingSparSegment, + tigl::CCPACSEnginePylon, + tigl::CCPACSTrailingEdgeDevice, + tigl::CCPACSDuct, + tigl::CCPACSDuctAssembly, + tigl::CCPACSGenericFuelTank, + tigl::CCPACSHull +); + +namespace tigl +{ +typedef std::map ShapeContainerType; +typedef std::map RelativeComponentContainerType; + +class CTiglUIDManager +{ +public: + CTiglUIDManager(); + bool IsUIDRegistered(const std::string& uid) const; + bool TryUnregisterObject(const std::string& uid); + void UnregisterObject(const std::string& uid); + bool HasGeometricComponent(const std::string& uid) const; + ITiglGeometricComponent& GetGeometricComponent(const std::string& uid) const; + CTiglRelativelyPositionedComponent* GetParentGeometricComponent(const std::string& uid) const; + const RelativeComponentContainerType& GetRootGeometricComponents() const; + void SetParentComponents(); + const ShapeContainerType& GetShapeContainer() const; + void Clear(); +}; +} // namespace tigl + +%include "CTiglShapeCache.h" +%include "generated/CPACSGenericSystem_geometricBaseType.h" +%include "generated/CPACSGenericSystem.h" +%include "CCPACSGenericSystem.h" +%include "generated/CPACSGenericSystems.h" +%include "CCPACSGenericSystems.h" +%include "generated/CPACSSystems.h" +%include "CCPACSACSystems.h" +%include "generated/CPACSRotorAirfoils.h" +%include "CCPACSRotorProfiles.h" +%include "CCPACSConfiguration.h" +%include "CCPACSConfigurationManager.h" +%include "CTiglFusePlane.h" +%include "generated/CPACSDoorAssemblyPosition_doorType.h" +%include "generated/CPACSDoorAssemblyPosition.h" +%include "CCPACSDoorAssemblyPosition.h" +%include "generated/CPACSLongFloorBeam.h" +%include "CCPACSLongFloorBeam.h" + +%clear double* eta, double* xsi; + +// ---------------------- Eta / Xsi Functions ---------------------- // + +%include "tigletaxsifunctions.h" diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index 6645e41e41..bd999c422e 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -1,34444 +1,34444 @@ - - - - - - - - - - - - CPACS root element - - - - - Version - - V3.3 - - Date - - 2020-06-03 - - - - 1. Overview - - The Common Parametric Aircraft Configuration Scheme (CPACS) is an XML-based data format for describing aircraft configurations and their corresponding data. - This XML-Schema document (XSD) serves two purposes: (1) it defines the CPACS - data structure used in the XML file (e.g., aircraft.xml) and - (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., Tixi or - XML tools in Eclipse) parses the XSD and XML files and validates whether the data set defined by the user (or tool) conforms to the given structure defined by the schema. - - - - This documentation explains the elements defined in CPACS and its corresponding data types. - Data types can either be simple types (string, double, boolean, etc.) or - complex types (definition of attributes and sub-elements to build a hierarchical - structure). In addition, the sequence of the elements and their occurrence is documented. - To link the XML file to the XSD file, the header of the XML file should specify the path of the schema file. - An example could look like this: - <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - - CPACS is an open source project published by the German Aerospace Center (DLR e.V.). For further information please visit www.cpacs.de. - - - - - 2. Data hierarchy - - CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. - For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. - - - - - - - 3. Coordinate Systems - - Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. - The CPACS coordinate system is the coordinate system identified by TIGL, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. - Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. - The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. - The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. - - - - Axis - - - Direction - - - Description - - - - x - tailwards - from nose to tail - - - y - spanwise - from symmetry plane to the right wingtip - - - z - upwards - from landing gear to tip of vertical tailplane - - - The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. - - - - The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. - - - - The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. - - - - The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. - - - - Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. - - - - 4. Units - - There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: - - - [m] - Position, Distance - - - [m^2] - Area - - - [m^3] - Volume - - - [kg] - Mass - - - [s] - Time - - - [K] - Temperature - - - or in derived units, e.g.: - - - [N] - Force - - - [Nm] - Moment - - - [W] - Power - - - [J] - Energy - - - The only non SI unit used throughout CPACS is the angle in degrees [°]. - For the sake of an intuitive use the angles are given in degrees rather than in radian [rad]. - - - [°] - Angle - - - - - - 5. Splitting up a CPACS dataset into several files - - To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <externaldata> - <path>file:://airfoils</path> - <filename>NACA0010.xml</filename> - <filename>NACA2412.xml</filename> - </externaldata> - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> - Such an external file would look like: - <?xml version="1.0" encoding="utf-8"?> -<airfoil uID="NACA0010"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> -</airfoil> - The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), then it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). - For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given: - - Absolute local path: "file:///tmp" or "file:///c:/windows/tmp" - Relative local direcotry: "file://relativeDirectory" or "file://../anotherRelativeDirectory" - Remote net ressource: "http://www.someurl.de" - - A CPACS dataset with external files, being loaded by a special library like the TIVA XML Interface TIXI, shall collect all its external datafiles and build up a single tree from them. A validation against this schema is only possible for such a single tree file; the <externaldata>nodes are not recognized by it. To preserve the information, necessary to split the file up into external files again later, externaldata information is maintained within three attributes of the former external top node: - - externalFileName - Name of the file where the external data shall be saved - externalDataDirectory - Directory of the external data file. Its content is analogous to the <externaldata>'s <path>node described above. - externalDataNodePath - XPATH of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPATH in the outer external file. If, e.g., in the example above the <pointList>node would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. - - The single tree for the example above would look like: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> - </airfoil> - ... - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> - - - - 6. UIDs and references - - The CPACS-dataset often uses references between nodes. Typically, these - references define connections between elements which are located somewhere else in the hierarchical dataset (e.g. a wing is connected to a - fuselage; a specific engine is connected to a pylon; etc.). These connections are defined by - unique identifiers (uID) which are specified as attributes. Thus, there are elements which can be referenced via a uID attribute, e.g. a fuselage: - <fuselage uID="ATTAS_fuselage">... - - as well as elements which refer to the former, e.g. a wing pointing to its geometrical parent: - <wing uID="e382bf5j"> - <name>ATTAS main wing</name> - <parentUID isLink="True">ATTAS_fuselage</parentUID> - ... - Such referencing elements must carry the isLink="True" attribute. - - Since uIDs are only used to link nodes within the XML file, no naming convention is required. UIDs, however, must be unique! - Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), - uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element - to convey human-readable meanings. - - - - 7. Symmetry - - Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). Hence, some parts offer the option to set a symmetry attribute for them, like: - <wing symmetry="x-z-plane">... - This attribute explains that the whole part with all its subnodes is symmetric to the given plane. Possible planes are: - x-y-plane - x-z-plane - y-z-plane - none - inherit - - By default, the symmetry of a component is inherited from its parent. If e.g. a wing is symmetrically defined, a pylon will also have a symmetry by default. - This symmetry inheritance can be broken, by explicitly deleting the symmetry with symmetry="none". - - - - - UIDs, references and symmetry - - All nodes, e.g. parentUID, in CPACS that refer to a component that holds symmetry attribute, e.g. wing, have to carry the symmetry attribute as well. - The symmetry attribute may take three values: symm, def, full: - - - def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. - - symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) - - full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) - - - <wing uID="ATTAS_main_wing" symmetry="x-z-plane"> - ... - <segments> - <segment uID="ATTAS_main_wing_innersegment"> - ... - In the example above, to refer to the "other" side of the wing on must use the definition as such: - <loadcase> - ... - <segments> - <segment> - <segmentUID isLink="True" symmetry="symm">ATTAS_main_wing_inner_segment</segmentUID> - <strip>... - - - - 8. Vectors and arrays - - For large data sets (e.g. increments of aerodynamic coefficients due to control surface deflections) it is advantageous - to map them via vectors and arrays instead of using a sequence of nodes for each data value. Therefore vectors and arrays are defined as semicolon-separated lists in CPACS. Via the documentation (derived from the XSD) of the corresponding nodes it has to be checked whether it is a vector or an array. - - Vector - The vector is meant as a one-dimensional-array. In such a node, the values are given in a semicolon separated list: - <angleOfAttack>0.;1.5;3.;4.5;6;7.5;9.</angleOfAttack> - - Array - - As for vectors, multi-dimensional arrays provide values in a semicolon separated list. An array is always preceded by a sequence of vectors, containing the dimensions and index values. Which vectors of an array are dimensioning is specified in the respective documentation of the array. - - <altitude>1000.;2000.;3000.</altitude> <!-- vector element --> - <incrementMaps> - <incrementMap uID="incMap_b3ac2"> - <controlSurfaceUID>InnerWingFlap</controlSurfaceUID> - <controlParameters>-1;-0.5;0;1</controlParameters> <!-- vector element --> - <!-- array of dimension length(altitude) x length(controlParameters): --> - <dcl>11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34.</dcl> - - - - Values for cl increments: - - - - Control parameter = -1 - Control parameter = -0.5 - Control parameter = 0 - Control parameter = 1 - - - Altitude = 1000m - 11. - 12. - 13. - 14. - - - Altitude = 2000m - 21. - 22. - 23. - 24. - - - Altitude = 3000m - 31. - 32. - 33. - 34. - - - - - - - - - - 9. Control Parameters - - Control parameters are abstract parameters, linking a generic floating point value to a certain status of a control device - (e.g. control surface, landing gear, suction system, brake parachute, ...). For control surfaces, such a data pair (control parameter - and control surface deflection status) is called a <step> and the ordered list of all steps for a control surface forms its deflection - <path>. - The control parameter values for each step are arbitrary floating point values. However, it is strongly recommended to use - values between -1. and +1., or between 0. And +1. (depending on the type of control surface). The smallest and the largest value implicitly - define the maximum deflection limits. It is mandatory, that the value “0.” is within the specified range, as this value is treated as - undeflected and used to specify a “clean” aircraft configuration (e.g. used in the clean aero performance map). It is recommended, but not - mandatory to specify a <step> with a <controlParameter> of 0. Consequently, no <controlParameter> must be used twice within - a single <path> definition. Deflection values between two specified steps are handled by linear interpolation. - The following example shows the usage of control parameters within a control surface deflection path definition: - <controlSurfaces> - <trailingEdgeDevices> - <trailingEdgeDevice uID="InnerWingFlap"> - ... - <path> - ... - <steps> - <step> - <controlParameter>-1</controlParameter> - <hingeLineRotation>-20.</hingeLineRotation> - </step> - <step> - <controlParameter>-0.5</controlParameter> - <hingeLineRotation>-10.</hingeLineRotation> - </step> - <step> - <controlParameter>0</controlParameter> - <hingeLineRotation>0.</hingeLineRotation> - </step> - <step> - <controlParameter>1</controlParameter> - <hingeLineRotation>5.</hingeLineRotation> - </step> - </steps> - ... - - - - - 10. Atmosphere - - At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). - Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) - It covers temperature, pressure, density, speed of sound, dynamic viscosity and kinematic viscosity with respect to altitude. - In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. - For details, see ISA manual, section 2.3, page E-viii f. - ISA covers a range from -5000 m to 80000 m. - Temperature offsets are introduced on top of the definitions in the ISA manual (which does not cover such variations). The offset model - is based upon the idea that the pressure at a fixed geopotential altitude is independent from temperature offset (pressure altitude). - The temperature offset changes only the density (following rho = p / Gas Constant / T) (and viscosity, of course) - - - - CPACS 3.3 - - Release in June 2021 - - Revision of the mission definition including parameter lapses within segments (compatibility break) - Revision of the point performance definition (compatibility break) - Revision of performance requirements (compatibility break) - Revision of landing gears (compatibility break) - Revision of control surface tracks definition (compatibility break) - Load analysis: Revision of flightLoadCasesType (compatibility break) - Load analysis: Revision of aeroCasesType (compatibility break) - Load analysis: loadEnvelopesType relocated and envelope simplified to a single uID-Sequence (compatibility break) - Load analysis: Replaced dynamicAircraftModel elements by loadApplicationPointSets (compatibility break) - Flight dynamics: Group flightPerformance, flyingQualities and trim under flightDynamics parent node (compatibility break) - Introduced a configuration node to describe aircraft and payload configurations - Fuselage profiles: Introduced rectangle and super ellipse as standard profiles - Fuselage profiles: Added vector to specify curve parameters for profiles with kinks - Internal structure: Added standard profiles to profile based structural elements - Internal structure: Added ribPosts element to wingRibCrossSectionType - Internal structure: Upper and lowerCap now optional in sparCellType - Internal structure: Stringers and frames can reference sections - MassBreakdown: Set mass inertia Jxy, Jxz and Jyz optional - MassBreakdown: Added mMiscellaneous element - MassBreakdown: Added fuselage walls - Added flight envelope to aircraft global element - Added new base types: doubleVectorBaseType, posIntVectorBaseType, doubleArrayBaseType - Added 'none' and 'inherit' to list of symmetry flags - Set mapType attribute of vector and array elements to optional (requires TiXI>=3.1) - AeroMaps: Defined angleOfSideslip as input and added distinction between minimum and maximum angleOfAttack in aeroLimitMaps (compatibility break) - AeroMaps: Added missing singular incrementMap element to incrementMaps in aeroLimitsMap (compatibility break) - AeroMaps: Adopted the camelCase style for damping derivatives (compatibility break) - Introduced common nomenclature for speeds and altitudes (compatibility break) - Control distributors are set to optional - Added instructions for superposition of control surface deflections - Further elaboration of development standards - General improvements of the documentation - - - - - CPACS 3.2 - - Release in February 2020 - - Replaced tool-specific elements with xsd:any element and strict schema request for validation - UIDs adapted to type xsd:ID and xsd:IDREF - UIDs optional for transformationType and pointTypes - Replaced xsd:sequence elements with xsd:all elements where possible - CpacsVersion element set to optional - GuideCurves are now optional for nacelleCowlType - Documentation adaptions - - - - - CPACS 3.1 - - Release in August 2019 - - Redefinition of aeroPerformanceMaps - Added nodes for detailed engine pylons and nacelles - Added nodes to model generic walls - Extension of material definition - Added fuselage compartment definition - Added fuselage fuel tank definition - Explicit wing stringer definition integrated into wing stringer definition - RelativeDeflections renamed to control parameters - Control distributors modified to only have a single command input vector - "cpacsVersion" restricted to current schema version - Code cleanup - Cpacs_schema.xml removed - Documentation adaptions - - - - - CPACS 3.0 - - Release in Jul 2018 - - New component segment definition; this is affecting all structural components of wings - Renamed angleOfYaw into angleOfSideslip - Fixes in documentation - Made all uID attributes required - Minor fixes in choices and typos - Added nodes for the geometry of generic system components - Added performance requirements for aircraft models - Redefined the whole mission definition including point performances - Made link to missionUID in trajectory optional - Added new parameters to enginePerformanceMap - Relocated mFixedLeadingEdge and mFixedTrailingEdge within the massBReakdown structure - Changed aeroPerformanceMap to use altitude and standard atmosphere instead of reynolds number - Added an optional local direction for guide curves and an illustration image - Announced toolspecifics definitions as deprecated; will be removed from CPACS in next release and should be managed in separate namespace by tool maintainers - Added an option for aerodynamic performance maps of elastic aircraft - Enabled the definition of multiple aeroPerformanceMaps - Enabled the use of spar points for rib placement and rib points for spar placement - Added explicit stringer definitions for wing cells - All issues for this release can be found online - https://github.com/DLR-LY/CPACS/issues - - - - - CPACS 2.3.1 - - Release in Jul 2016 - - CPACS 2.3.1 is a beta release, all parameters may be subject to change. - Added a branch for the definition of design studies. - Added thermal properties for materials. - Revised the definition of flights/flightplans. - Added an airline definition. - Added structure for skid gear components. - Changed the units for material density to SI units. - Revised the top level fleets node and put it into the new airline node. - All issues for this release can be found online - https://github.com/DLR-LY/CPACS/issues - - - - - CPACS 2.3 - - Release in Nov 2015 - CPACS 2.3 is the fourth public release of CPACS. Major changes include: - - Included vector notation for weight and balance. - Included flight system and flight dynamic information. - Included top level aircraft requirements. - Included a prototype for detailed nacelle geometries. - Included structural mounts. - Extended aero data set for loads. - Extended the mass breakdown. - Updated the symmetry definition, please take a look at the documentation point 5 and 6. - All issues for this release can be found online - https://github.com/DLR-LY/CPACS/issues - - - - - CPACS 2.2.1 - - Release in Feb 2015 - - CPACS 2.2.1 is a beta release, all parameters may be subject to change. - Included preliminary definition of guidecurves. - Included additional means to describe the wing structure. - Included preliminary fuselage fuel tanks. - Included preliminary load envelope. - Included preliminary flight performance and flight qualities. (flight dynamics will follow) - Updated toolspecifics - Updated uncertainty definition - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.2 - - Release in May 2014 - - CPACS 2.2 is the third public release of CPACS. Major changes include - Additions and changes to the loadCaseType. - Included additional genericGeometricEntities for bellyfairings etc. - The mass breakdown is extended for a more detailed fuselage strucuture. - Steadiness information on the geometry is excluded from CPACS 2.2. CPACS 2.3 will include optional guidelines for smoother surfaces. - Uncertainties can now be specified (CPACS 2.2alpha doubleBaseType, CPACS 2.2 also in vector notations) - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.1 - - Release in May 2013 - - CPACS 2.1 is the second public release of CPACS. Most of the implementation was already included in CPACS 2.01 - included fuselage structure and cabin definition - all data is defined according to the CPACS coordinate system. That is the initial coordinate system in which geometries are defined. Therefore, it can but must not meet your body axis. - the mass breakdown is extended for a more detailed wing strucuture - profiles can now be included based on a two-dimensional class shape transformation. The old parametrization will still be available. TIGL will learn CST asap. - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.01 - - Release in Nov 2012 - - CPACS 2.01 is an internal release for the VAMP project. It is the testbed for CPACS 2.1 - included fuselage structure - additions to the load case definition - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.0 - - Release in Mar 2012 - - CPACS 2.0 is the first public release - large impacts on the documentation - all issues can be found online - http://code.google.com/p/cpacs/issues/list - compatible with TIGL 2.0 - excluded fuselage structure, reintegration in CPACS 2.1 - - - - - CPACS 1.6 - - Release in Jul 2011 - - Thanks for the input on the documentation to Felix Dorbath, Till Pfeiffer, Alexander Koch, Falk Heinecke and Tom Otten - preliminary added enginePylons - deleted seatAssemblyPositionType - updated toolspecific blocks from handbook aero and cpacs mass updater - added weight and balance definition - added loads reference axis and dynamic aircraft model - added wing documentation - added weights documentation - added fleet documentation - added paramam toolspecific documentation - added wing tank definition - changed some names in the massBreakdown - deleted old loadCaseDefinitions - no more plural element for loadAnalyses - shifted groundforces to groundloadcases, this will need an update - added noseLandingGear - mainLandingGear can now have plural SideStruts - - - - - CPACS 1.5 - - Release in Feb 2011 - - uID for transformation - extended stringUIDBaseType with optional attribute isLink - all elements xxxUID are now of Type stringUIDBaseType - added new material definition from FA to distinguish between diffent material types - changed fuselage structure definition due to input from BK - changed rib definition in cells in component segments - cleaned up material definition in component segments - added cpacsVersion information to the header and updates types - added area and length to the loadCase reference on wing strips - added wingFuselageAttachment - - - - - CPACS 1.4 - - Release in Nov 2010 - - Geometry definition for engine and nacelle added - Trailing Edge Devices, Leading Edge Devices and Spoilers added - Rotorcraft added, similar to aircraft - Splitted up multiple Point Types - sparCell added uID - new inline Documentation introduced in CPACS type - - - - - CPACS 1.3 - - Release in Aug 2010 - - Fuel definition added - Introduced component segments for the wing structure - Mission definition was updated - VSAero toolspecific data updated - - - - - CPACS 1.2 - - Release in May 2010 - - Fuselage Structure Elements are updated following the input from BK - - stringers>arbitrary additional parameters: yBezugAtStartX, zBezugAtStartX, yBezugAtEndX, zBezugAtEndX - paxCrossBeams additional parameters: startX, endX - cargoCrossBeams additional parameters: startX, endX - paxCrossBeamStruts additional parameters: startX, endX - cargoCrossBeamStruts additional parameters: startX, endX - structure>pressureBulkhead: positionX instead of positionZ - reinforcementNumberVertical: number of vertical reinforcements - reinforcementNumberHorizontal: number of horizontal reinforcements - maxFlectionDepth: max camber of pressure bulkhead - reinforcementNumber: number of reinforcements rear pressure bulkhead - sheetProperties: definition of sheet properties - innerRadius: inner radius of the pressure bulkhead - - Dummy Wingbox element is included. This definition needs further enhancements - - cpacs>vehicles>aircraft>model>fuselage>fuselage>structure - Wingbox: - xStart: start of the wingbox area - xEnd: end of the wingbox area - zStart: upper limit of the wingbox area - - Damping Derivaties are added in the form of dcfxdp, dcfxdq, dcfxdr, dcfydp, etc. The data will be stored in the model/global/aeroperformaneMap under a new dampingDerivatives element. Unit is deg/sec. - StructureProfiles are defined in the profiles element. They are referenced in structuralElements for several entities such as stringer, frame etc. Currently they are referenced via 'structuralProfileUID' for name consistency it should be either only 'structure' or only 'structural' - Control Commmands. The chain between pilot inputs and controlsurface deflections is now closed. - - Parameters located at cpacs\vehicles\aircraft\model\systems - cockpitControl: links from pilotInput to commandCase - commandCase: links from commandCase to controlDistributor or controlFunction - controlDistributor links to the controlSurface - controlLaws includes controlModes automatic and manual - controlModes contain controlFunctions - - TraFuMo toolspecific data added - - - - - CPACS 1.1 - - Release in Feb 2010 - - Fleets model added. The fleets modeling from CATS is introduced to CPACS 1.1 - Reference changed. The reference type in wingSegmentStripCoefficientsType was changed from referenceType to pointType - - - - - - - - - - - - - - - - - - - - - - - - - CPACS header - - - Header type, containing CPACS dataset description - - - - - - - - - - - Name of CPACS dataset - - - - - Description of CPACS dataset - - - - - - Creator of initial CPACS dataset - - - - - - Timestamp of initial CPACS dataset creation - - - - - - Version of initial CPACS dataset - - - - - - CPACS version that the dataset is valid to. The element is optional, since data sets - can be valid for several CPACS versions. However, we strongly recommend to assign data sets to a - specific CPACS version as far as possible, especially since some tools and libraries (e.g. TiGL) - require this specification. - - - - - - - - - - - - - - - updatesType - - - Updates type, containing update data for the CPACS - dataset - - - - - - - - - - - - - - - - - - - - - complexBaseType - - - Base type for complex nodes (including external data - attributes) - - - - - - - - - - - - - - - stringBaseType - - - Base type for string nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - stringUIDBaseType - - - This is the base type that links to other components. It should always contain a UID. - This node has an additional attribute isLink that will be used if a stringBaseType refers to a uID. TIXI can then - perform automatic validation for the existence of the referenced uID. - Furthermore this node contains an additional attribute symmetry. The symmetry attribute may take three values: symm, def, full - def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. - symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) - full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) - - - - - - - - - - - - - - - - - - - - - - - - - - stringVectorBaseType - - - - Base type for string vector nodes - The vector base type can include optional uncertainty - information. The description of uncertainties is placed in - addtional attributes. First, it is described by an attribute that - describes the type of uncertainty function called functionName. - The functionName attribute includes the tag name of the - distribution function which is listened in the table shown below. - Each uncertainty function is further describes by a set of - parameters that are described in the table below. - If the uncertainty values change for the elements of - the vector than the attribute may be written as a list of values - separated by semicolons - DEPRECATED: As of CPACS - version 3.3, the mapType - attribute is set to optional to ensure the compatibility of older data sets. - However, since the type is uniquely defined via the XSD, the attribute is superfluous - and will therefore be completely omitted in the next major release (Note: requires - TiXI >= 3.3). Please contact the CPACS team - if for any reason you see a long-term need for the mapType - attribute. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vector with semicolon separated values of type double - - - - Any entries of type double separated by semicolons are permitted, e.g.: - -<doubleVectorTest>123.456;+123.456;-1.234e56;-.45E-6;NaN</doubleVectorTest> - - -<doubleVectorTest>123.456</doubleVectorTest> - - -<doubleVectorTest>123.456,+1234.456</doubleVectorTest> - - -<doubleVectorTest>123.456;mainWingUID</doubleVectorTest> - - -<doubleVectorTest>123.456;1234.4E 56;-1.234e5.6</doubleVectorTest> - - - - - - - - - - - - - - - - - - - doubleVectorConstraintBaseType - - - - Base type for double vectors including a relational operator attribute indicating valid constraint region. - The doubleVectorConstraintBaseType extends the doubleVectorBaseType and thus inherits all its attributes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vector with semicolon separated positive integer values - - - - Any positive integer values separated by semicolons are permitted, e.g.: - -<intVectorTest>0;1;2;3;4;5</intVectorTest> - - -<intVectorTest>1</intVectorTest> - - -<intVectorTest>0,1,2,3,4,5</intVectorTest> - - -<intVectorTest>0.;1.;2.</intVectorTest> - - -<intVectorTest>-1;0;1</intVectorTest> - - - - - - - - - - - - - - - - - - - stringArrayBaseType - - - Base type for string array nodes (including maptype - array attribute) - DEPRECATED: As of CPACCS version 3.3, the mapType attribute is set to optional to ensure the compatibility of older data records. However, since the type is uniquely defined via the XSD, the attribute is superfluous and will therefore be completely omitted in future versions. - - - - - - - - - - - - - - - - - Array with semicolon separated values of type double - - - - In CPACS arrays are used to exchange values - in full-factorial parameter spaces, for example to describe the aerodynamic coefficients depending - on Mach number and altitude. - - Thus, the dimensions of the array are spanned by the input vectors. See the following - example where two input vectors are defined. For clarification the entries of the array result from - the multiplication of the index values of the corresponding input vectors: - -<inputVector1>1;2;3</inputVector1> -<inputVector2>4;5;6;7</inputVector2> - - -<array>4;5;6;7;8;10;12;14;12;15;18;21</array> - - Any entries of type double separated by semicolons are valid, e.g.: - -<doubleArrayTest>123.456;+123.456;-1.234e56;-.45E-6;NaN;0</doubleArrayTest> - - -<doubleArrayTest>123.456</doubleArrayTest> - - -<doubleArrayTest>123.456,+1234.456</doubleArrayTest> - - -<doubleArrayTest>123.456;mainWingUID</doubleArrayTest> - - -<doubleArrayTest>1234.4E 56;-1.234e5.6</doubleArrayTest> - - - Please note that the syntax of arrays in the current CPACS - version correspond exactly to the syntax of vectors. There is no special character indicating - the dimensions. Thus, the input vectors have to be determined from the documentation of the - corresponding elements and splitting of the one-dimensional vector has to be done manually. - - - - - - - - - - - - - - - - - - - doubleBaseType - - - - Base type for double nodes (including external data - attributes) - The double base type can include optional uncertainty - information. The description of uncertainties is placed in - addtional attributes. First, it is described by an attribute - that describes the type of uncertainty function called - functionName. The functionName attribute includes the tag name - of the distribution function which is listened in the table - shown below. Each uncertainty function is further describes by a - set of parameters that are described in the table below. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - doubleConstraintBaseType - - - - Base type for double nodes including a relational operator attribute indicating valid constraint region - The doubleConstraintBaseType extends the doubleBaseType and thus inherits all its attributes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - timeConstraintBaseType - - - - Base type for time nodes including a relational operator attribute indicating valid constraint region - The timeConstraintBaseType extends the timeBaseType and thus inherits all its attributes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - integerBaseType - - - Base type for integer nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - booleanBaseType - - - Base type for boolean nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - dateTimeBaseType - - - Base type for dateTime nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - timeBaseType - - - Base type for time nodes (including external data attributes) - This time type is based on the xsd:time definition. - "To specify a time zone, you can either enter a time in UTC time by adding a "Z" behind the time - like this: 09:30:10Z - or you can specify an offset from the UTC time by adding a positive or negative time behind the time - like this: - 09:30:10-06:00 - or - 09:30:10+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) - - - - - - - - - - - - - - - - - - - dateBaseType - - - Base type for date nodes (including external data attributes). - This date type is based on the xsd:date definition. - "To specify a time zone, you can either enter a date in UTC time by adding a "Z" behind the date - like this: 2002-09-24Z - or you can specify an offset from the UTC time by adding a positive or negative time behind the date - like this: - 2002-09-24-06:00 - or - 2002-09-24+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) - - - - - - - - - - - - - - - - - - - - - - Positionings of the wing. - - - Positionings type, containing all the positionings of - the wing sections. - - - - - - - - - - - - - - - - - - - Positioning of the wing section - - - - The positionings describe an additional translation of - sections. Basically, the positioning is a vector having the - length 'length' and an orientation that is described by the - parameters 'sweepAngle' and 'dihedralAngle'. If the 'sweepAngle' - and the 'dihedralAngle' are set to zero (or left blank) the - positioning vector equals the positive y-axis of the coordinate - system (in case of a positive 'length'). - If the parameter 'fromSectionUID' is set, the - positioning describes the translation between the 'from' towards - the 'to' section. If the parameter 'fromSectionUID' is left - blank the orgin of the positioning vector is the origin of the - parent coordinate syste. - The orgin of the section coordinate system is the - position which is described by the positioning vector PLUS the - translation which is described in the section. - Please note: If the orgin of the positioning vector is - defined by using another section, i.e. fromSection is defined, - the orgin of this vector equals the end of the positioning - vector of the previous section. This means that the section - translation of the from-section has no influence on the - positioning of the to-section. Therefore the total translation, - which is described by positionings, is the sum of the current - positioning and all positionings that are defined 'before'. - - An example for this is given at positioning 3 and 4 at - the picture below. Please note, that any other combination of - positionings would be possible. - Application of the sweepangle does not lead to a - rotation of the section. Application of the dihedral does not - lead to a rotation of the section. - - - - - - - - - - - - - - Name of the positioning. - - - - - Description of the positioning. - - - - - - Distance between inner and outer section - (length of the positioning vector). - - - - - Sweepangle between inner and outer section. - This angle equals a positive rotation of the positioing vector - around the z-axis of the wing coordinate system. - - - - - - Dihedralangle between inner and outer section. - This angle equals a positive rotation of the positioing vector - around the x-axis of the wing coordinate system - - - - - - Reference to starting section of the - positioning vector. If missing, the positioning is made from the - orgin of the wing coordinate system. - - - - - Reference to ending section (section to be - positioned) of the positioning vector. - - - - - - - - - - - - - - Transformation - - - Transformation type, containing a set of - transformations. The order of the transformations is scaling - -> rotation -> translation, and they are executed in this - order. Any of them can be omitted; it will be replaced by its - defaults. - Transformations are always executed relative to the - child not the parent. I.e. a scaling does not have an influence - on the parent item. For example in the outer geometry of a wing - the element scaling does not influence the section. Scaling does - also not effect rotation and translation. - - - - - - - - - - Scaling data default: 1,1,1. Those parameters - describe the scaling of the x-, y-, and z-axis. - - - - - - Rotation data default: 0,0,0. The rotation - angles are the three Euler angles to describe the orientation of - the coordinate system. The order is allways xyz in CPACS. - Therefore the first rotation is around the x-axis, the second - rotation is around the rotated y-axis (y') and the third - rotation is around the two times rotated z-axis (z''). - - - - - - Translation data default: 0,0,0. Translations - can either be made absolute in the global coordinate system - (absGlobal), absolute in the local Coordinate system (absLocal) - or relative (relative), normalized with the maximum dimensions - of the parent. - - - - - - - - - - - - - - 2D transformation - - - - - - - - - - - - - Scaling of the structural profile - - - - - - rotation around z-axis of profile definition - - - - - - translation of profile definition - - - - - - - - - - - - - - - Point: x,y,z - - - Point type, containing an xyz data triplet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - Point: x - - - Point type, containing a x data. - - - - - - - - - - X-Component - - - - - - - - - - - - - - Point: y - - - Point type, containing a y data. - - - - - - - - - - Y-Component - - - - - - - - - - - - - - Point: z - - - Point type, containing a z data. - - - - - - - - - - Z-Component - - - - - - - - - - - - - - Point: x,y - - - Point type, containing an xy data doublet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - - - - - - - - - - Point: x, z - - - Point type, containing an xz data doublet. - - - - - - - - - - X-Component - - - - - Z-Component - - - - - - - - - - - - - - Point: y, z - - - Point type, containing an yz data doublet. - - - - - - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - Point: x,y,z - - - Point type, containing an obligatory xyz data triplet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - Point with global/local reference - - - PointAbsRel type, containing an xyz data triplet. Each - of the components is optional. The refType attribute defines, - whether coordinates are absolute in the global ccordinate system - [absGlobal], absolute in the parent element's local coordinate - system [absLocal]. If the object does not have a - parent, only [absGlobal] is permitted. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - - - - - - - - - Point with constraints - - - Point constraint type, containing an xyz data triplet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - List of 3D points, kept in three relative coordinate - vecors (rX, rY, rZ) - - - - This set of vectors contains an ordered list of points - for rX, rY, and rZ coordinates in the form of stringBased - Vectors. The x, y and z vector elements with the same index - specify a 3D point relative to a geometric segment. - - - - - - - - - - - - - - - - - - - - Vector of rX coordinates. Relative - circumferential coordinate on wing / fuselage profile - - - - - - Vector of rY coordinates. Relative span - coordinate along a segment - - - - - Vector of rZ coordinates. Relative coordinate - normal to the linear strake (normalised with chordlength / - diameter c*) - - - - - - - - - - - - - List of points - - - PointList type, containing an ordered list of points - - - - - - - - - - - Data point - - - - - - - - - - - - - List of points in x,y - - - PointList type, containing an ordered list of points - - - - - - - - - - - Data points in x-y-space. - - - - - - - - - - - - - List of 3D points, kept in three coordinate vecors (x, - y, z) - - - - This set of vectors contains an ordered list of points - for x, y and z coordinates in the form of stringBased Vectors. - The x, y and z vector elements with the same index specify a 3D - point. - - - - - - - - - - - Vector of x coordinates - - - - - Vector of y coordinates - - - - - Vector of z coordinates - - - - - - - - - - - - - Maps points (actually the index in the point list) to a curve parameter. - - - - Which parameters are allowed depends on the context. - For exampple in a wing profile, values between -1 and 1 are valid. - - - - - - - - - - - List of indices of points to be mapped. Each index must be in the range [1, npoints]. - - - - - List of parameters on the curve, that is mapped to the points defined by their index. - - - - - - - - - - - - - A curve that interpolates a list of points. - - - - The curve interpolates the list of points, typically with a b-spline. - In theory, the interpolation is somewhat ambiguous as it is not defined at which - curve parameter a point will be interpolated. - - To solve is ambiguity, an optional parameter map can be defined - that maps point indices with curve parameters. - - Kinks can also be modeled by populating the "kinks" array with the - indices of points that should be on a kink. As an example, look at the following image: - - - - - In this example, the kinks array will be "3;7". - Optionally, the parameters of the kinks can be set in the parameter map. - The whole profile looks as follows: - - -<pointList> - <x>...</x> - <y>...</y> - <z>...</z> - <kinks>3;7</kinks> - <parameterMap> - <pointIndex>3;5;7</pointIndex> - <paramOnCurve>0.2;0.5;0.8</paramOnCurve> - </parameterMap> -</pointList> - - - - - - - - - - - - Indices of points at which the curve has a kink. Each index is in the range [1, npoints]. - - - - - - Map between point index and curve parameter. - - - - - - - - - - - - - List of 2D points, kept in two coordinate vecors (x, y) - - - - This set of vectors contains an ordered list of points - for x and y coordinates in the form of stringBased Vectors. - The x and y vector elements with the same index specify a 2D - point. The coordinates of the x vector of [0, 1]. - - - - - - - - - - - Vector of x coordinates - - - - - Vector of y coordinates - - - - - - - - - - - - - Point in eta and xsi coordinates - - - Point described by eta-xsi coordinates. - Can be either segment or component segment coordinates. - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta-xsi values are considered to be in segment - eta-xsi coordinates; if it points to a componentSegment, - then componentSegment eta-xsi coordinates are used. - - - - - - - - - - - - - Relative height at eta, xsi position - - - Point described by eta-xsi and a relative height coordinate. - Can be either segment or component segment coordinates. - If relHeight is not given, the point has no offset from the eta-xsi plane - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative height position. - relHeight is relative to the local airfoil thickness. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta-xsi values are considered to be in segment - eta-xsi coordinates; if it points to a componentSegment, - then componentSegment eta-xsi coordinates are used. - - - - - - - - - - - - - Positive double values larger than 0 - - - - - - - - - - - - - - - - - List of uIDs - - - - - - - - - - - Reference to a uID - - - - - - - - - - - - - - - - UIDGroupDefinitionType - - - - - - - - - - - - - - - - - - - - - - - - - - - UIDGroupDefinitionsType - - - - - - - - - - - - - - - - - - - - - - - Actuator attachment - - - - - - - - - - - - - Relative spanwise position of the actuator. - Eta refers to the dimensions of the control surface. - - - - - - - - - - - - - - - - - Definition of the position and material properties of - the control surface actuator attachment. - - - - Definition of the position and material properties of - the control surface actuator attachment. - Please refer to the picture below for the definition - of the parameters: - - - - - - - - - - - - - - Definition of the relative chordwise position - of the parent actuator attachment. Xsi refers to the parents - dimensions. - - - - - Definition of the relative height position of - the parent actuator attachment. relHeight refers to the parents - dimensions. - - - - - Definition of the material properties of the - actuator attachment at the parent. - - - - - - - - - - - - - actuatorFuselageWingAttachmentType - - - - - - - - - - - - - - - - - - - - - - - actuatorFuselageWingType - - - - - - - - - - - - - Reference to the actuator. - - - - - Definition of the actuator to fuselage - attachment. - - - - - Definition of the actuator to wing attachment. - - - - - - - - - - - - - - - Definition of the position and material properties of - the parent actuator attachment. - - - - Definition of the position and material properties of - the parent actuator attachment. - Please refer to the picture below for the definition - of the parameters: - - - - - - - - - - - - - - Definition of the relative chordwise position - of the parent actuator attachment. Xsi refers to the parents - dimensions. - - - - - Definition of the relative height position of - the parent actuator attachment. relHeight refers to the parents - dimensions. - - - - - Definition of the material properties of the - actuator attachment at the parent. - - - - - - - - - - - - - actuatorsFuselageWingType - - - - - - - - - - - - - Definition of one actuator (e.g. trim actuator - of an HTP) of the attachment. - - - - - - - - - - - - - aeroPerformanceMapRCType - - - AeroPerformanceMapRC type, containing a perfomance map - with aerodynamic data. Array order is: angleOfAttack min->max - then angleOfSideslip then altitude then machNumber - - - - - - - - - - Atmospheric model and temperature offset - - - - - Mach number - - - - - Altitude - - - - - Sideslip angle - - - - - Angle of attack - - - - - Name and version of the tool used to compute - the aerodynamic performance - - - - - Modeling level of the methods used to compute - the aerodynamic performance. The higher the analysisLevel, the - higher the quality of the results. Possible use of - analysisLevel: 0- 9 = Statistical models, 10-19 = Analytic - models, 20-29 = Lifting line method, 30-39 = Panel method, 40-49 - = Panel-BL-coupled method, 50-59 = Full potential method, 60-69 - = Full potential-BL coupled method, 70-79 = CFD euler method, - 80-89 = CFD euler-bl coupled method, 99-99 = CFD RANS method, - >=100 = Experimental data. - - - - - - - - - - - - - - - - - - - - aeroPerformanceMapsRCType - - - aeroPerformanceMapsRC type, containing multiple - aeroPerformanceMapRC nodes for different cases - - - - - - - - - - - - - - - - - - - aeroPerformanceType - - - aeroPerformance type, containing perfomance maps with - aerodynamic data of an airfoil. - - - - - - - - - - Aerodynamic performance map of the full - configuration - - - - - Aerodynamic performance maps of isolated - fuselages - - - - - Aerodynamic performance maps of isolated wings - - - - - - Aerodynamic performance maps of control - surfaces - - - - - Aerodynamic performance maps of isolated - airfoils - - - - - - - - - - - - - aeroelasticDivergenceType - - - AeroelasticDivergence type, containing the results from - aeroelastic analysis - - - - - - - - - - - - - - - - - - - aeroelasticStaticMaxDisplacementType - - - AeroelasticStaticMaxDisplacement type, containing the - Maximum static displacement from aeroelastic analysis - - - - - - - - - - Maximum translation - - - - - Maximum rotation - - - - - - - - - - - - - Aeroelasticity - - - Aeroelastics type, containing the results from - aeroelastic analysis - - - - - - - - - - - - - - - - - - - - Results from several analysis - modules connected to CPACS - - - AircraftAnalyses type, containing detailed analysis - data of the aircraft - Within this element results from analysis modules are - stored that rely to the overall definition of the aircraft. These - include e.g. aerodynamic data or loadCases - For further documentation please refer to the - respective elements. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Global data - - - AircraftGlobal type, containing global data of the - aircraft - - - - - - - - - - - designRange equals the full payload max - range, i.e. point B in payload range - diagramm - - - - - - - - - - - - - - - - - - - Aircraft model - - - - The aircraftModelType contains the geometric aircraft - model and associated data. - Elements specifying the geometry of the aircraft are fuselages, - wings, - engines (referenced via uID), - enginePylons, landingGear, - systems (to some extend) and genericGeometryComponents. - - Other elements are dedicated to additional data associated to this aircraft model. Brief and concise analysis results are stored - in the global node. The analysis node contains - extensive results from multidisciplinary analysis modules. - In the current CPACS version requirements only refer to the aircraft performance and are therefore specified in the - performanceRequirements node. - - - - - - - - - - - - Name of the aircraft model - - - - - - Description of the aircraft model - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aircraft - - - - The aircraftType contains a list of aircraft models. - - - Note: Since there is no distinction between plural and singular in English, aircraft - refers to plural form, while a single aircraft itself is referened as model. - - - - - - - - - - - - - - - - - - - - - airfoilAeroPerformanceType - - - airfoilAeroPerformance type, containing perfomance maps - with aerodynamic data of an airfoil. - - - - - - - - - - Reference to the uID of the analysed airfoil - - - - - - References used for the calculation of the - force and moment coefficients of the airfoil (in the airfoil - axis system!) - - - - - Calculated aerodynamic performance maps of the - airfoil - - - - - - - - - - - - - airfoilsAeroPerformanceType - - - airfoilsAeroPerformance type, containing - airfoilsAeroPerformance - - - - - - - - - - - - - - - - - - - airframeMaintenanceCostType - - - - - - - - - - - - - - - - - - - - - - - airlineType - - - Describes a specific airline and their fleet - - - - - - - - - - Name of the airline - - - - - Description of the airline - - - - - - - - - - - - - - - - Airlines - - - Contains a list of different airlines - - - - - - - - - - - - - - - - - - - airportCompatabilityGlobalType - - - - - - - - - - - - - - - - - - - - - - - - - - airportType - - - Airport type, containing data of an airport - - - - - - - - - - Name of airport - - - - - Description of airport - - - - - IATA 3-letter-code - - - - - ICAO 4-letter-code - - - - - Position in degrees north - - - - - Position in degrees east - - - - - Airport elevation - - - - - - - - - - - - - - - Airports - - - Airports type, containing data of the airports - - - - - - - - - - - - - - - - - - - - alignmentCrossBeamType - - - - - - - - - - - - - Offset in direction of extrusion, first side - (absolute value) - - - - - Offset in direction of extrusion, second side - (absolute value) - - - - - Rotation around local x axis (extrusion axis) - - - - - - Translation along local y axis (perpendicular - to extrusion axis) - - - - - Translation along local z axis (perpendicular - to x ynd y axes) - - - - - - - - - - - - - - alignmentFloorPanelType - - - - - - - - - - - - - Offset from seat rail 1 reference Position in - local y direction (in plane of panel, absolute value) - - - - - - Offset from seat rail 2 refernce position in - local y direction (in plane of panel, absolute value) - - - - - - Offset from seat rail 1 refernce position in - local z direction (in plane of panel, absolute value)) - - - - - - - - - - - - - - - alignmentStringFrameType - - - - - - - - - - - - - Rotation around local x axis (extrusion axis) - - - - - - Translation along local y axis (perpendicular - to extrusion axis) - - - - - Translation along local z axis (perpendicular - to x ynd y axes) - - - - - - - - - - - - - - alignmentStructMemberType - - - - - - - - - - - - - Offset in direction of extrusion (absolute - value) - - - - - Rotation around local x axis (extrusion axis) - - - - - - Translation along local y axis (perpendicular - to extrusion axis) - - - - - Translation along local z axis (perpendicular - to x ynd y axes) - - - - - - - - - - - - - - atmosphericModelType - - - Defines the the athmospheric model which should be used. - Currently there is only a single option which is ISA for ICAO Standard - atmosphere (ISA) from 1993. For more details on atmospheric - models, please refer to documentation of the <CPACS> root - element. - - - - - - - - - - Atmospheric model (e.g. ISA for ICAO Standard - atmosphere (ISA) from 1993). - - - - - - - - - - - - Offset from temperature of the atmospheric model [K]. - For more details on atmospheric models, please refer to documentation - of the <CPACS> root element. - - - - - - - - - - - - - Attachment pin of the wing-fuselage-attachment. - - - - Attachment pin of the wing-fuselage-attachment. - - - - - - - - - - - - - Definition which translation degrees of - freedom are blocked. Default x=0 (free); y=1 (blocked); z=1 - (blocked). - - - - - - - - - - - - - - - - Definition of attachment pins for the wing-fuselage - attachment. - - - Definition of attachment pins for the wing-fuselage - attachment. - - - - - - - - - - - - - - - - - - - Axle - - - Geometric description and material properties of the - landing gear axle - - - - - - - - - - Length of the axle. For a single wheel, the length is equal to the distance between the center of the piston and the center of the wheel. For two wheels, the length is equal to the distance between the centers of the wheels with the axis being centered w.r.t. to the Piston. - - - - - Axle shaft properties - - - - - Number of wheels attached to this axle - - - - - Defines the side of the first wheel (inboard or outboard; inboard corresponds to the negative y-direction or in flight direction left) for odd number of wheels on this axis. Each additional wheel is the added on the opposite site of the previous wheel. - - - - - - - - - - - - Properties of the wheel(s) attached to this axle. If more than one wheel is attached, all wheels on a single axis have the same properties. - - - - - - - - - - - - - - Definition of the landing gear wheel. - - - The center plane of the wheel is located on the end point of the axle. - - - - - - - - - - Wheel radius - - - - - With of the wheel - - - - - Brake: false = - not braked; true = braked. - - - - - - - - - - - - - - beamCrossSectionType - - - beamCrossSectionType, containing the beam geometrical - properties - - - - - - - - - - - - - - - - - - - - - - - - beamStiffnessType - - - globalBeamStiffnessType, containing the beam - stiffnesses such as EA, EI - - - - - - - - - - - - - - - - - - - - - - - - - - blockedDOFType - - - - - - - - - - - - - - - - - - - - - - - Bogie - - - Geometric description and material properties of the - landing gear axle bogie (including the axle configuration) - - - - - - - - - - Length of the bogie - - - - - Tilt angle of the bogie in airborne conditions - - - - - - - - - - - - - - - - Bogie axle assembly - - - Description of an axle installed on the bogie and its - relative position to it - - - - - - - - - - - Relative position of the axle to the bogie (if more than one axle is defined; 0 = forward end of bogie; 1 = rear end of bogie) - - - - - - - - - - - - - - - - - - - Bogie axle assemblies - - - - A list of axles that are attached to the bogie - and their relative position to it - - - - - - - - - - - - - - - - - - - - cabGeometryType - - - cabGeometry provides the geometry of the cabin in terms - of constant height contour lines. The lines all share a common - x-vector. The vectors yZ[N] provide the lateral contour at - Z-coordinate provided in the vector z. The number of contour - lines can differ and is given by the length of the vector z - - - - - - - - - - - - - x-coordinates for all contour lines, relative - to cabin origin. - - - - - z-coordinate of contour lines. Contour lines - are constant z, so each entry in this vector belongs to a single - contour line. - - - - - - - - - - - - - - - cabinAisleType - - - aisles has as many entries as there are aisles in the - cabin. In a normal single aisle there are two aisles: the cabin - aisle and the aisle leading to the cockpit. - - - - - - - - - - - - Provides the longitudinal coordinates. The - number of coordinates can be chosen as appropriate, the minimum - number is two. The coordinates are relative to the cabin origin. - - - - - - Provides the center points of the aisle. The - y-vector has to have same length as the x-vector. The aisle - stretches equally left and right of the provided y-coordinate. - - - - - - the width of the aisle at floor level at each - y-coordinate. - - - - - - - - - - - - - - cabinAislesType - - - - - - - - - - - - - - - - - - - - - - cabinDoorType - - - doors describe all doors of the cabin. They are linked - to a structural door description. The cabin door is usually equal - in size to the door, but does not need to be. The structural door - might describe a wider cut-out, while the cabin door is primarily - intended for evacuation modeling and cabin layout. In order to - obtain a 3-dimensional door representation, the local cabin - geometry shall be used. - - - - - - - - - - - - - Number of passengers this door adds to the - overall exit capacity limit of the aircraft. - - - - - This is the forward x-coordinate of the door - relative to the cabin origin. - - - - - the door sill height relative to cabin origin. - - - - - - The width of the door in x-direction. - - - - - - the effective height of the door. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cabinDoorsType - - - - - - - - - - - - - - - - - - - - - - cabinFloorElementType - - - floorElement describes objects like monuments or other - installations inside the cabin. - - - - - - - - - - - - - - - - - - - - - - - forward center coordinate of object relative - to cabin origin. - - - - - center y-coordinate relative to cabin origin. - - - - - - length of the object - - - - - length of the object - - - - - length of the object - - - - - - - - - - - - - - - cabinFloorElementsType - - - - - - - - - - - - - - - - - - - - - - cabinSeatElementType - - - seats describe all seats inside the aircraft. They are - – strictly speaking – also objects mounted on the floor, hence - floor objects. But the specific characteristics of seats justify - a differentiation between seats and other objects on the floor. - Seats are seat group, for example a triple seat. Therefore they - have multiple seats. - - - - - - - - - - - - Number of seats - - - - - - - - - - - - - - - - x-coordinate relative to cabin origin. - - - - - - y-coordinate relative to cabin origin. - - - - - - delta-y-coordinate of the individual seat - center points from the y-coordinate of the seat object. This is - important to locate passengers. It is assumed that seats have no - angle. - - - - - length of the seat group. - - - - - width of the seat group. - - - - - height of the seat group. - - - - - - - - - - - - - - - - - cabinSeatElementsType - - - - - - - - - - - - - - - - - - - - - - cabinSpaceType - - - spaces describe areas in the cabin that need to be - clear for use as emergency area. Depending on the type of area, - it can have a height limit. The spaces are required for - downstream cabin design, for example to describe an empty cabin. - - - - - - - - - - - - - x-coordinates. These describe an area, so they - are not monotonous ascending. - - - - - y-coordinates at given x-coordinates. Warning: - x-y do not represent a function as single x-positions can have - multiple y-coordinates. Hence, no interpolation is possible. - - - - - - the height above the floor that is required to - be empty of any objects. - - - - - - - - - - - - - - cabinSpacesType - - - - - - - - - - - - - - - - - - - - - - Cap - - - - SparCap type, containing the cross section area of the - spar cap and the material properties. - Pleas find below a picture where all spar cross - section parameters as well as the orientation refereneces for - the material definition can be found: - - - - - - - - - - - - - - Area of the cap - - - - - - - - - - - - - - cargoCrossBeamStrutsAssemblyType - - - CargoCrossBeamStrutsAssembly type, containing cargo - crossBeam strut assemblys - - - - - - - - - - - - - - - - - - - cargoCrossBeamsAssemblyType - - - CargoCrossBeamsAssembly type, containing cargo - crossBeam assemblys - - - - - - - - - - - - - - - - - - - cargoDoorsAssemblyType - - - CargoDoorsAssembly type, containing cargo door - assemblys - - - - - - - - - - - - - - - - - - - Chordwise positioning of wing cells. - - - CellPositioningChordwise defines the chordwise direction of a wing cell either in two xsi - (xsi1 at innerBorder and xsi2 at outerBorder) coordinates, via referencing a spar-uID or via a - contour coordinate in chordwise direction. - - - - - - - - - - - Relative chordwise position of the inner - end. - - - - - Relative chordwise position of the outer - end. - - - - - - Reference to a spar as chordwise border. - - - - - - Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. - - - - - - - - - - - - - Spanwise positioning of wing cells. - - - CellPositioningSpanwise defines the chordwise direction of a wing cell either in two eta - (eta1 at leadingEdge and eta2 at trailingEdge) coordinates, via referencing a rib-uID or via a contour - coordinate in chordwise direction. - - - - - - - - - - - Relative spanwise position of the forward - end. - - - - - Relative spanwise position of the rear end. - - - - - - - - RibNumber is the reference to the rib number - of the rib set which is referenced by 'ribDefinitionUID'. - - - - - - Reference to a ribDefinition set. The single - rib of this ribDefinition set is defined by using 'ribNumber'. - - - - - - - Spanwise contour coordinate as spanwise border. 0 equals root, 1 equals tip. - - - - - - - - - - - - - centerFuselageAssemblyType - - - CenterFuselageAssembly type, containing wing box - assemblys - - - - - - - - - Choise between diffent center fuselage - modelling options - - - - Simplified center fuselage definition (rigid - body) - - - - UID of first frame in rigid center fuselage - area - - - - - UID of last frame in rigid center fuselage - area - - - - - UID of start stringer to define center - fuselage area - - - - - UID of end stringer to define center fuselage - area - - - - - - Detailled low wing center fuselage definition - (draft definition) - - - - - - Detailled high wing center fuselage definition - (draft definition) - - - - - - - - - - - - - - - centerFuselageAreasAssemblyType - - - centerFuselageAreasAssembly type, containing center - fuselage area assembly - - - - - - - - - - - - - - - - - - - centerFuselageHighWingConfiguration - - - - - - - - - - - - - - - - - - - - - - centerFuselageKeelbeamType - - - CenterFuselage / Keelbeam definition between mainframe1 - und mainframe3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageLateralPanelsType - - - CenterFuselage / lateral Panel definition between - mainframe2 und mainframe3 - - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageLongFloorBeamConnectionType - - - CenterFuselage / Long. floor beam connection - - - - - - - - - - - - - - - - - - - - - centerFuselageLowWingConfiguration - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageMainFramesType - - - CenterFuselage / main frame definition, containing - mainframe and pressure Bulkhead definitions - - - - - - - - - - - - - - - - - - - - - - - - centerFuselagePressureFloorType - - - CenterFuselage / pressure floor definition between - mainframe2 und mainframe3 - - - - - - - - - - - - - - - - - - - - - - - - centerFuselagePressureFloorType - - - CenterFuselage / side box definition between mainframe2 - und mainframe3 - - - - - - - - - - - - - - - - - - - - - certificationCasesType - - - - - - - - - - - - - - - - - - - - - - chargesCostType - - - - - - - - - - - - - - - - - - - - - - - - - - cockpitControlType - - - single cockpitControl is defined by a pilotInput and a - commandOutput. The commandOutput is linked to the commandCase - - - - - - - - - - - - - - - - - - - - - - - - - cockpitControlsType - - - Cockpit controls type, containing the cockpit controls - - Some controls are mandatory, others can be added via - cockpitControl elements - - - - - - - - - - - - - - - - - - - - - - commandCaseCommandType - - - single commandCaseCommand can either hold a - controlFunction or a controlDistributor - - - - - - - - - - - - - - - - - - - - - - - commandCaseType - - - single commandCase Containing several - commandCaseCommands - - - - - - - - - - - - - - - - - - - - - - commandCasesType - - - plural Element for commandCase, some fixed dp, dq, dr - and dx, dy, dz - - - - - - - - - - - - - - - - - - - - - - - - - componentCostType - - - - - - - - - - - - - - - - - - - - - - Load envelope - - - List of load cases defining a load envelope - - - - - - - - - - - Name - - - - - Description - - - - - UID of the corresponding point set - - - - - - List of uIDs defining the loads envelope - - - - - - - - - - - - - componentSegmentPathType - - - - - - - - - - - - - Definition of hingePoint of the - componentSegment. The hingePoint is used as reference point for - the deflection definition. - - - - - Definition of the orientation of the hinge - line with three Euler-rotation angles. The hinge line is - oriented along the global y-axis if all rotations are 0. - - - - - - Definition of all steps of the deflection - path. - - - - - - - - - - - - - componentSegmentStepType - - - - - - - - - - - - - The control parameter is used to reference the - state of a control device, e.g. in the load - case description. Can have any value and is NOT limited to the - range of -1 to 1. - - - - - Translation along the x-, y- and z-Coordinate - of the rotated hinge coordinate system. - - - - - Rotation around the hinge line. - - - - - - - - - - - - - - componentSegmentStepsType - - - - - - - - - - - - - Definition of one step of the deflection path. - - - - - - - - - - - - - - ComponentSegment of the wing. - - - - Within componentSegments the wing structure, the - control surfaces, the wing fuel tanks and the - wingFuselageAttachment is defined by using relative coordinates. - - A componentSegment is defined in the same way as - segments: from one cross section (sections->elements) to - another. Compared to segments one componentSegment can can start - and end at elements that are not consecutive. Therefore that one - componentSegment can be the combination of several segments. - Each wing has at least one componentSegment (from root to tip). - The maximal number of componentSegments equals the number of - segments (each segment is defined as one componentSegment). - This also implies that each segment can only be part of one componentSegment. - - In principal a componentSegment can combine any number - of segments. But if in one section two elements are defined, the - componentSegment has to start/end there as no well-defined - relative coordinats can be defined if steps in the wing occure. - - An example for wing componentSegments can be found in - the picture below: - - - - Within componentSegments a relative spanwise - coordinate (eta) and a relative chordwise coordinate (xsi) is - defined. Those coordinates are used for the definition of e.g. - wing structures and control surfaces. there are two types of eta xsi coordinates. - Segment (eta, xsi) coordinates define the relative local coordinate system for a segment ranging from (0,0) to (1,1). - - - - - - The eta xsi coordinates for a component segment are based on the segment eta xsi planes. - As a reference length for the component segment eta coordinate the - mid chord lines of all the segments are used. - The beginning of this line at from-element equals eta = 0, while the end of this line - at the to-element equals eta = 1. All wing positions that lie on the same - element (segment border) have the same eta coordinate. The points inbetween - two elements are defined by the iso xsi lines of the segment eta xsi space. - An example for the definition of the relative axes can - be found in the picture below: - - - - - In order to calculate the global coordinates of a component segment eta xsi point - one first has to calculate the eta point on the xsi iso line of (xsi=0.5), - and then walk along the iso eta lineof the segment. - - An example for determining the a component - eta xsi point can be found in the picture below: - - - - - - - - - - - - - - - - - - - - - - - - Name of the wing componentSegment. - - - - - - - Description of the componentSegment. - - - - - - - Reference to the element from which the - componentSegment shall start. - - - - - - - Reference to the element from which the - componentSegment shall end. - - - - - - - - - Description of deflection path of - componentSegments (e.g. used for - trimmable HTPs). - - - - - - - - - - - - - - - - - - - ComponentSegments of the wing. - - - ComponentSegments type, containing all the - componentSegments of the wing. - - - - - - - - - - - - - - - - - - - compositeLayerType - - - CompositeLayer type, conatining data of a composite - layer - - - - This type defines single composite layers by - giving a ply thickness, ply reference angle and a materialUID. - - - - - - - - Name of layer - - - - - Description of layer - - - - - Thickness of layer - - - - - Angle of layer in degree - - - - - Material UID of the layer - - - - - - - - - - - - - compositeType - - - Composite type, conatining data of a composite - - - - - Within this type individual stackings of - composites can be introduced by defining an offset and a set of - composite layers. The order of the composite layers defines the - stacking order. - - - - - - - Name of composite - - - - - Description of composite - - - - - offset of the laminate. The reference plane of - the laminate is the arithmetic mean of the laminate thickness. - - - - - - - - - - - - - - - - compositesType - - - - - - - - - - - - - - - - - - - - - - connectivitiesType - - - - - - - - - - - - - - - - - - - - - - connectivityType - - - - - - - - - - - - - - - - - - - - - - - - - - Constraints - - - - Constraint settings for the point performance definition - - - - - - - - - - - Calibrated airspeed [m/s] - - - - - - - Mach number [-] - - - - - - - Climb angle [deg] - - - - - - - Rate of climb [m/s] - - - - - - - Rate of turn [deg/s] - - - - - - Thrust setting for derated engine as fraction of max. thrust (e.g.: for powered descents, deceleration not at IDLE, manoevres) - - - - - - - Rate of velocity [m/s^2] - - - - - - - Duration [s] - - - - - - - Angle of attack [deg] - - - - - - - Constant altitude [m] - - - - - - - - - - - - - - Constraint - - - - - Specification of performance constraints. - - Constraints allow vectors of double values to define parameter lapses within a mission segment. The example below illustrates this by means of an exemplary climb profile of a conventional airliner, in which multiple physical and regulatory speed constraints are simultaneously specified over several altitudes (e.g., to account for the crossover altitude): - <endCondition> - <positionGeo> - <altitude relationalOperator="ge" uID="altClimb">10058.4</altitude> <!-- FL330 --> - </positionGeo> -</endCondition> -<constraint> - <referenceEndConditionUID>altClimb</referenceEndConditionUID> - <endConditionRatio>0.0;0.303</endConditionRatio> <!-- FL0, FL100 --> - <continuitySetting>discrete</continuitySetting> - <CAS relationalOperator="le">128.61;154.33</CAS> <!-- 250 [kt], 300 [kt]--> - <machNumber relationalOperator="le">0.78;0.78</machNumber> - <prioritySetting>velocity</prioritySetting> -</constraint> - - - From FL0 until FL100, the vehicle should fly at a velocity less than or equal to CAS = 250 kt or M = 0.78. In this first segment at low altitudes, the constraint on CAS is triggered. - - - From FL100 until FL330, the vehicle should fly at a velocity less than or equal to CAS = 300 kt or M = 0.78. In this second segment, the vehicle starts by increasing velocity until 300 kt, the constraint on maximum machNumber triggers from the crossover altitude onwards - - - - - - - - - - - - - Reference to the uID of the segment end condition variable - - - - - - - Vector indicating the ratios of the constraintSettings profile with respect to the provided referenceEndCondition, ranging from 0 to 1. If this vector is defined, the provided constraintSettings are expected to be vectors with the same length providing ratio-value pairs. Example: for referenceEndCondition <range><z> (i.e.: flown distance in z direction of the segment), a vector of <CAS> and <machNumber> is provided to define a climb profile. - - - - - - Defines how to interpret the parameter lapses within the segment: discrete steps (C0 continuity) or linear interpolation (C1 continuity) - - - - - - - - - - - - - - - Calibrated airspeed within the - segment - - - - - - - Mach number within the segment - - - - - - - Climb angle within the segment - - - - - - - Climb angle within the segment - - - - - - - Specific excess power within the segment - (e.g.: for defining minimum SEP to - remain after step climbs have been - performed). - - - - - - - Altitude difference of each step climb - - - - - - - - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] - - - - - - - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] - - - - - - - - Rate of turn within the segment - - - - - - - Thrust setting for derated engine as - fraction of max. Thrust (e.g.: for - powered descents, deceleration not at - IDLE, manoevres). - - - - - - - Rate of velocity within the segment - - - - - - - Load factor experienced during segment - - - - - - - Constant altitude for the segment. - - - - - - - priority setting indicating which - constraint is preferred within the - segment - - - - - - - - - - - - - - - - - - - - - - Airfoil definition of an control surface at the - inner/outer border. - - - - Optional definition of the exact airfoil shape at the - inner/outer border of the control surface. - The airfoil shape is defined via referencing to the - airfoilUID. As the leading and trailing edge point is fix due to - the outer shape definition of the control surface the airfoil - can only be rotated around the x-axis (axis going from leading - to trailing edge of the inner/outer border of the control - surface). Scaling in x-direction is also defined by the outer - shape, wherefore only scaling in y and z direction is allowed. - - - - - - - - - - - - Reference to the airfoil uID. - - - - - - Rotation around an axis, going from the - leading edge point to the trailing edge point of the inner/outer - border of the control surface. Defaults to 90°, which is - equivalent to perpendicular on the control surface middle plane. - - - - - - Scaling of the airfoil in spanwise direction - (not used for 2D airfoils). - - - - - Scaling in thickness direction of the airfoil. - - - - - - - - - - - - - - controlDistributorType - - - - single controlDistributor bundling several - controlElements - Within some analyses, it might occur that overlapping control element settings are specified. In this case, - it is assumed that a cumulative setting is built by summing up the individual settings. As the behavior of these settings - is not necessarily linear, a certain order of summation has to be followed: - - (1) The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. - (2) With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. - (3) All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. - (4) With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. - (5) During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. - - - - - - - - - - - - - - Vector of command inputs. The minimum and maximum value is given by the lowest and highest entry of the vector, respectively. - - - - - - - - - - - - - - - controlDistributorsType - - - plural Element for controlDistributor - - - - - - - - - - - - - - - - - - - controlElementType - - - Single controlElement linking the inputs of a controlDistributor via a gain - table to a contol device by using its uID. Controls can be ControlSurfaces and in the - future thrust. - - - - - - - - - - UID of the control device, e.g. a control surface. It is not allowed to reference another control distributor. - - - - - Vector of control device states resulting from the input commands. It must be of the same length as the inputCommands element. - The minimum and maximum values are defined according to the minimum and maximum values of the input commands. - - - - - - - - - - - - - controlElementsType - - - plural Element for controlElement - - - - - - - - - - - - - - - - - - - controlFunctionType - - - single controlFunction containing the controller's - parameters - - - - - - - - - - - - - - - - - - - - - - - - - - controlFunctionsType - - - plural Element for controlFuntion - - - - - - - - - - - - - - - - - - - controlLawModeType - - - Control Laws type, containing the aircraft's control - law mode - - - - - - - - - - - - - - - - - - - controlLawModesType - - - Control Laws type, containing the aircraft's control - law modes - - - - - - - - - - - - - - - - - - - controlLawsType - - - Control Laws type, containing the aircraft's control - laws - - - - - - - - - - - - - - - - - - - - Definition of an actuator of the control surface, that - is not placed within a track. - - - Definition of an actuator of the control surface, that - is not placed within a track. - - - - - - - - - - Reference to the actuator (actuator definition - currently not available in CPCAS, status 1.6). - - - - - - - - - - - - - - - - Definition of actuators of the control surface, that - are not placed within a track. - - - Definition of actuators of the control surface, that - are not placed within a track. - - - - - - - - - - - - - - - - - - - Airfoil definition of an control surface between inner - and outer border. - - - - Optional definition of the exact airfoil shape between - the inner and outer border of the control surface. - The airfoil shape is defined via referencing to the - airfoilUID. As the leading and trailing edge point is fix due to - the outer shape definition of the control surface the airfoil - can be rotated around the x-axis (axis going from leading to - trailing edge of the control surface) and around the z-axis - (normal axis on the control surface middle plane). Scaling in - x-direction is also defined by the outer shape, wherefore only - scaling in y and z direction is allowed. - - - - - - - - - - - Relative spanwise coordinate (eta) of the - control surface, where the leading edge of the airfoil is - placed. - - - - - Reference to the airfoil uID. - - - - - - Rotation around an axis, going from the - leading edge point to the trailing edge point of the control - surface. Defaults to 90°, which is equivalent to perpendicular - on the control surface middle plane. - - - - - Rotation of the airfoil around the control - surface middle plane normal direciotn. Reference point is the - most forward point of the airfoil. Defaults to 90°, which is - equivalent to the airfoilplacement in flight direction (along - wings-x axis). - - - - - Scaling of the airfoil in spanwise direction - (not used for 2D airfoils). - - - - - Scaling in thickness direction of the airfoil. - - - - - - - - - - - - - - Inner/outer border of the control surface. - - - - Definition of the inner/outer border of the control - surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - In addition, optionally, the airfoil shape of the - control surface can be defined closer. For the leading edge - devices 'hollow'. If an exact control surface airfoil definition - should be used, outerShape->airfoils can be used. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - Relative spanwise inner/outer position of the - leading edge of the control surface. - - - - - Relative spanwise inner/outer position of the - trailing edge of the control surface. Defaults to 'etaLE'. - - - - - - Relative chordwise inner/outer position of - the trailing edge of the control surface. Reference is eta/xsi - from the parent. - - - - - - - - - - - - - - - - - - - - - - - Inner/outer border of the control surface. - - - - Definition of the inner/outer border of the control - surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - In addition, optionally, the airfoil shape of the - control surface can be defined closer. For the - spoiler'relHeightLE' is used. If an exact control surface - airfoil definition should be used, outerShape->airfoils can - be used. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - Relative spanwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - Relative spanwise inner/outer position of the - trailing edge of the control surface. Reference is eta/xsi from - the parent. Defaults to 'etaLE'. - - - - - Relative chordwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - Relative chordwise inner/outer position of the - trailing edge of the control surface. Reference is eta/xsi from - the parent. - - - - - - Defines the relative high of lowest point of - the spoiler leading edge, relative to the airfoil height of the - parent at this position. See picture below. - - - - - - - - - - - - - - - - Inner/outer border of the control surface. - - - - Definition of the inner/outer border of the control - surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - In addition, optionally, the airfoil shape of the - control surface can be defined closer. For the trailing edge - device this is done at 'leadingEdgeShape', for the spoiler - 'relHeightLE' is used and for the leading edge devices 'hollow'. - If an exact control surface airfoil definition should be used, - outerShape->airfoils can be used. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - Relative spanwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - Relative spanwise inner/outer position of the - trailing edge of the control surface. Reference is eta/xsi from - the parent. Defaults to 'etaLE'. - - - - - Relative chordwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - - - - - - - - - - - - Optional definition of the exact airfoil shape of the - control surface. - - - - - - - - - - - - - - - - - - - - - - This type contains a vector of deflection values for a - single control surface - - - - - 0. General overview - - In this type, a vector of deflections of a single - control surface is specified. - - - - 1. - <controlSurfaceUID> - (mandatory) - - - A reference to a control surface from the aircraft - model - - - - 2. - <controlParameters> - (mandatory) - - - A vector of controlParameters of the selected - control surface (with respect to the defined deflection path). - - - - - - - - - - - - - - Reference to a control surface - - - - - - Control parameters of the control surface - - - - - - - - - - - - - - This type contains a list of control surfaces and their - deflection vectors - - - - - 0. General overview - - In this type, a list of control surfaces is defined. - - - - - 1. - <controlSurface> - (mandatory) - - - One of these nodes per deflected control surface is - required here. - - - - - - - - - - - - - - - - - - - - - - controlSurfaceHingeMomentMapType - - - controlSurfaceHingeMomentMap type, containing a moment - map with aerodynamic data for a control surface. Array order is: - controlParameters min->max then angleOfAttack then angleOfSideslip - then reynoldsNumber then machNumber. AngleOfAttack, angleOfSideslip, - reynoldsNumber and machNumber are taken from the basic - performance map one level above. - - - - - - - - - - Reference to the control surface - - - - - - Control parameters of the control surface - - - - - - - - - - - - - - - - - - - - controlSurfaceHingeMomentMapsType - - - controlSurfaceHingeMomentMapsType type, containing the - aerodynamic moment maps for one or more control surfaces. - - - - - - - - - - - - - - - - - - - - controlSurfaceHingePointType - - - - The deflection path of a control surface is described - with respect to two hinge points - one at the inner border of - the control surface and one at the outer border of the control - surface. Those two points are defined using the xsi and relative - height coordinates of the parent. Therefore those points can also - lay outbound of the control surface. Those two points defined - the hinge line, which is a straight line between the two points. - - An example can be found below: - - - - - - - - - - - - - - Relative chordwise coordinate (xsi) of the - hinge line point. Reference is the parent chord. - - - - - - Relative height of the hinge line point. - Reference is the parent airfoil height. - - - - - Optional absolute translation of the hinge point. - This can be used to move the hinge points outside of the wing shape. - - - - - - - - - - - - - Outer shape definition of the control surface. - - - - - Definition of the outer shape of the leading edge - control surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - - - - - - - - - Outer shape definition of the spoiler control surface. - - - - - Definition of the outer shape of the control surface. - - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - - - - - - - - - Outer shape definition of the control surface. - - - - - Definition of the outer shape of the trailing Edge - control surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - - - - - - - - - Definition of the deflection path of the control - surface. - - - - The deflection path of a control surface is described - with respect to two hinge points - one at the inner border of - the control surface and one at the outer border of the control - surface. Those two points are defined using the xsi and relative - height coordinates of the parent. Therefore those points can also - lay outbound of the control surface. Those two points defined - the hinge line, which is a straight line between the two points. - - The deflection path of the control surface is defined - within the hinge line coordinat system. This is defined as - follows: The x-hinge coordinate equals the wing x-axis. The - y-hinge coordinate equals the hinge line axis (see above; - positive from inner to outer hinge point). The z-hinge line is - perpendicular on the x-hinge and y-hinge coordinate according to - the right hand rule. The rotation of the control surface is - defined as rotation around the positive y-hinge line. - - The deflection of the is defined in any number of - steps. The deflection of the control surface is done as follows: - First the x-deflection at the inner and outer border; afterwards - the z-deflection of the inner and outer border; last the - y-deflection of the inner border. The y-deflection is only - defined at the inner border, as it is identical to the outer - border. If no values for the outer border deflection are given, - they default to the values of the inner border. - An example can be found below: - - - - - - - - - - - - - - - - - - - - - - - - - controlSurfacePerformanceMapType - - - ControlSurfacePerformanceMap type, containing a delta - performance map with aerodynamic data for a control surface. Array - order is: relativeDeflection min->max then angleOfAttack then - angleOfSideslip then altitude then machNumber. AngleOfAttack, - angleOfSideslip, altitude and machNumber are taken from the - basic performance map one level above. - - - - - - - - - - Reference to the control surface - - - - - - Relative deflection of the control surface - - - - - - - - - - - - - - - - - - - - controlSurfacePerformanceMaps - - - controlSurfacePerformanceMaps type, containing the - aerodynamic delta performance maps for one or more control - surfaces. - - - - - - - - - - - - - - - - - - - Border type for the inner and outer border of a wing - cut out - - - - Maybe applied to specifiy inner and outer border of - the cutout either via eta or rib references - - - - - - - - - - - - - - - Link to a rib definition - - - - - - Rib number in the corresponding - ribDefinitionUID - - - - - - - Spanwise location of the border at the - leading edge of the cut out - - - - - Spanwise location of the border at the - trailing edge of the cut out - - - - - - - - - - - - - - Cut out of the parents upper/lower skin due to a - control surface. - - - - Optional. Definition of the skin cut out due to a - control surface. The cut out of the skin can either be defined - by referencing to a spar uID or by defining the relative chord - values (xsi) of the cut at the inner and outer border of the - control surface. The xsi value is based on the parents chord. - For leading edge devices additional parameters can be defined. - - An example for wing cut outs can be found in the - picture below: - - - - - - - - - - - - - - - Xsi value of the inner border, where the cut - out begins. - - - - - Xsi value of the outer border, where the cut - out begins. - - - - - - Reference to a spar, defining the skin cut - out. - - - - - - - - - - - - - controlSurfaceStepType - - - - The deflection path of the control surface is defined - within the hinge line coordinat system. This is defined as - follows: The x-hinge coordinate equals the wing x-axis. The - y-hinge coordinate equals the hinge line axis (see above; - positive from inner to outer hinge point). The z-hinge line is - perpendicular on the x-hinge and y-hinge coordinate according to - the right hand rule. The rotation of the control surface is - defined as rotation around the positive y-hinge line. - - The deflection of the is defined in any number of - steps. The deflection of the control surface is done as follows: - First the x-deflection at the inner and outer border; afterwards - the z-deflection of the inner and outer border; last the - y-deflection of the inner border. The y-deflection is only - defined at the inner border, as it is identical to the outer - border. If no values for the outer border deflection are given, - they default to the values of the inner border. - An example can be found below: - - - - - - - - - - - - - - The control parameter links a generic floating point value to - a certain status of a control device (e.g. control surface, landing gear, suction - system, brake parachute, ...). See the documentation of the global CPACS-Element for - further information. - - - - - - Translation of the inner hinge line point - within the hinge line coordinate system. Defaults to zero. Not - allowed for spoilers! - - - - - Translation of the outer hinge line point - within the hinge line coordinate system. Defaults to the values - of the inner hinge line point. Not allowed for spoilers! - - - - - - Positve rotation around the hinge line, - heading from the inner to the outer border. Defaults to zero. - - - - - - - - - - - - - - Definition of the steps of the control surface - deflection path. - - - - List of steps. - - - - - - - - - - - - - - - - - - - - Control surface tracks (mechnaical link between control - surface and parent). - - - - A track generally describes the structural connection between a control surface and a wing (or parent element). For example, a track can be a flap track, a revolute joint connecting an aileron or spoiler, or the kinematics of slats on a wing. - The spanwise position of the track is defined by - etaPosition, which refers to the control surface dimensions. - - The structural properties of the track (e.g. - materials) are defined in trackStructure. - If an actuator is included into the the track, a - reference is given in actuator. - The principal kinematic of the track is defined by - setting the trackType and trackSubType. Please refer to the - tables below for setting the trackType and trackSubType - parameter. Note, those tables are not final - they are extended - continuously. - - - - Trailing edge track types - - - trackType - picture - description - trackSubType - picture - description - - - 1 - - - - - - Revolute joint; no actuators; the revolute joint is on TED hinge line. - 1 - - - - - - Revolute attached at the wings rear spar and the TEDs front spar respectively the load - carrying ribs of the TED. - - - 2 - - - - - - Revolute joint; dropped hinge; linear or rotary actuator (subtype-dependent) included. - The drive strut (if any) is defined as strut1. - 1 - - - - - - Box beam design as wing attachment; rotary drive attached at wing rear spar. - - - - - - 2 - - - - - - Wing attachment at wing rear spar; rotary drive attached at wing rear spar - - - - - - 3 - - Track mounted inside the fuselage at wing root. - - - 3 - - - - - - Upside-down, forward link in conjunction with a straight track on a fixed structure - as aft. support; including rotary drive. - 1 - - - - - - Wing attachment using a box beam design where track is mounted; rotary actuator mounted - at the wing rear spar. - - - - - - 2 - - Track mounted inside the fuselage at wing root. - - - 4 - - - - - - Straight and sloped track on a fixed structure as forward support and an upright link as - aft. support; linear or rotary actuator (subtype-dependent) included. - 1 - - - - - - Wing attachment using a box beam design where the track is mounted; rotary actuator at - the wing rear spar. - - - - - - 2 - - - - - - Wing attachment using a box beam design where track is mounted; rotary actuator mounted - on the track. - - - - - - 3 - - Track mounted inside the fuselage at wing root. - - - - - - - - - - - - - - Relative chordwise position of the track. Eta - refers to the control surface. - - - - - Type of the track. Please refer to the remarks - of the controlSrufaceTrackTypeType for details. - - - - - - - - - - - - - - - - Type of the track. Please refer to the remarks - of the controlSrufaceTrackTypeType for details. - - - - - - - - - - - - - - - - - - - - - - - - - - Control surface tracks (mechnaical link between control - surface and parent). - - - - - - - - - - - - - - - - - - - - - - Cut out of the parents structure due to a control - surface. - - - - Optional. Definition of the parents structure cut out - due to a control surface. The cut out is split into three parts: - cut out of the upper and lower skin and the definition of an - profile conecting the cut out of the upper and lower skin. - - An example for wing cut outs can be found in the - picture below: - - - - In the default configuration the cut out is as wide as - the control surface. If additional spacing is necessary inner - and outer border may be set. - - - - - - - - - - - - - - - - - - - - - - - - - controlSurfacesType - - - Definition of the outer shape, structure and deflection - of all control surfaces (flaps, slats, soiler, ailerons...) of - the wing. - - - - - - - - - - - - - - - - - - - - - costAirConditioningSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costAutomaticFlightSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costAuxilaryPowerUnitsType - - - - - - - - - - - - - - - - - - - - - - - - - costBleedAirSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costCommunicationSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costComponentsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costDeIcingSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costElectricalSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costEnginePylonsType - - - - - - - - - - - - - - - - - - - - - - - - - costEquippedEnginesType - - - - - - - - - - - - - - - - - - - - - - - - - costFireProtectionSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costFixedEmergencyOxygenSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - - costFlightControlSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costFuelSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costFurnishingElementsType - - - - - - - - - - - - - - - - - - - - - - - - - - - costFurnishingsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costFuselagesType - - - - - - - - - - - - - - - - - - - - - - - - - costHydraulicSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costInstrumentSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costLandingGearType - - - - - - - - - - - - - - - - - - - - - - - - - costLightingSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costNacellesType - - - - - - - - - - - - - - - - - - - - - - - - - costNavigationSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costPowerUnitsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costWaterInstallationSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costWingsType - - - - - - - - - - - - - - - - - - - - - - - - - - - crashLoadCasesType - - - - - - - - - - - - - - - - - - - - - - crashLoadcaseType - - - CrashLoadcase type, containing a crash loadcase - - - - - - - - - - - - - Optional start of crash section: Default: - first frame of model - - - - - Optional end of crash section: Default: last - frame of model - - - - - Initial velocities - - - - - Initial rotations around axes, roll, pitch, - yaw - - - - - Initial rotational velocities aroud axes - - - - - - Definition of reference point to consider - rotation - - - - - AccelerationFields, usually gravity in z - - - - - - Definition of impact Surface for crash - simulation - - - - - - - - - - - - - - - - - - - - - - - crewCostType - - - - - - - - - - - - - - - - - - - - - - - - crossBeamAssemblyPositionType - - - CrossBeamAssemblyPosition type, containing the position - of a crossBeam assembly - - - - - - - - - - UID of profile based structural element to be - used as crossbeam - - - - - UID of the frame to which the crossbeam is - attached - - - - - Referenze z position of the crossbeam - - - - - - - - - - - - - - - - crossBeamStrutAssemblyPositionType - - - CrossBeamStrutAssemblyPosition type, containing a - crossBeam strut assembly position - - - - - - - - - - UID of profile based structural element to be - used as crossbeam strut - - - - - UID of the frame to which the crossbeam strut - is attached - - - - - UID of the crossbeam to which the crossbeam - strut is attached - - - - - Referenze y position of the strut at the - crossbeam intersection - - - - - angle of the strut in global yz plane - - - - - - - - - - - - - - - - cruiseRollerType - - - - - - - - - - - - - Definition of the position of the mid point of - the roll of the cruise roller. - - - - - Definition of the attachment of the cruise - roller to the parent of the flap. This is the track on which the - roll rolls during retracted flap position - - - - - Definition of the attachment of the cruise - roller to the flap. - - - - - Degree of freedom that is blocked by the - cruise roller if the flap is in retracted position. Positive = - cruise roller blockes bending in the direction of the upper skin - of the parent. Negative = cruise roller blockes bending in the - direction of the lower skin of the parent. - - - - - - - - - - - - - - cruiseRollersType - - - - - - - - - - - - - Definition of one cruise rollers/mid-span - stops. - - - - - - - - - - - - - cst2DType - - - - - - - - - - - A 2D impelmentation for Class shape - transformations. For more details look at AIAA Journal of Aircraft - Vol.45 No.1 2008 - - - - - The psi vector for definition of the class and - shape function, i.e. the points at which the CST functions will - be evaluated - - - - - N1 for the class function for the upper side - of the profile - - - - - N2 for the class function for the upper side - of the profile - - - - - B Coefficients for the Bernstein polynominal - on the upper side - - - - - N1 for the class function for the lower side - of the profile - - - - - N2 for the class function for the lower side - of the profile - - - - - B Coefficients for the Bernstein polynominal - on the lower side - - - - - Optionally, the trailingEdgeThickness of the - profile - - - - - - - - - - - - - - - - - - - - - - - curvePointType - - - Point on a curve in normalized curve coordinates. - The referenceUID must reference a one-dimensional curve such as spars. - - - - - - - - - - Relative position on the referenced line/curve. - - - - - This reference uID determines the reference curve. - If it points to a spar, then the eta value is considered to be a spar coordinate - between start (eta=0) and end (eta=1) of the spar. - - - - - - - - - - - - - cutLoadIntegrationPointsType - - - cutLoadIntegrationPoints are defined in a vector - notation, due to the high amounts of data. Usually they well be - defined inbetween the ribs. Each point must have an id. - Optionally it is possible to rotate the orientation within a - cutloadIntegrationPoint to obtain meaningful results. The - orientation is optional and relative to the CPACS coordinate - system - - - - - - - - - - - - - - - - - - - - - - - - - Additional definition of the leading edge cut out. - - - - - Optional. Definition of additional parameters, - describing the shape of the parents leading edge of the cut out - due to leading edge devices. - The parameters are described in the picture below: - - - - - - - - - - - - - - - Relative height of the most forward position of - the parents leading edge, relative to the airfoil height without - cut out. - - - - - Relative chordwise position of the most - forward position of the parents leading edge, relative to the - parents chord without cut out. - - - - - - - - - - - - - cutOutControlPointsType - - - - - - - - - - - - - - - - - - - - - - - Definition of cut out profiles. - - - - Optional, the exact shape between the upper and lower - skin cut out can be given by using cutOutProfiles. In general - cut out profiles are open profiles and not closed profiles as - e.g. wing airfoils. The placement, scaling and (partly) rotation - of the cut out profiles is fixed as the beginning and ending - point of the profile is fixed as can be seen in the two pictures - below. - - - - - - - - - - - - - - - - - Reference to the profile uID. Profiles should - be linked in profiles/structuralProfiles - - - - - Relative spanwise position of the cut out - profile. The eta coordinate refers to the control surface and - desribes the cut out profile at the leading edge of the control - surface. - - - - - Rotation of the airfoil around the control - surface middle plane normal direciotn. Reference point is the - most forward point of the airfoil. Defaults to 90°, which is - equivalent to the airfoilplacement in flight direction (along - wings-x axis). - - - - - - - - - - - - - Definition of cut out profiles. - - - - - - - - - - - - - - - - - - - - - - - - cutOutType - - - CutOut type, containing cut-outs - - - - - - - - - - Name of the cut out element - - - - - - Description of the cut out element - - - - - - Width of the cut element (absolute value) - - - - - - Height of the cut element (absolute value) - - - - - - Fillet radius of the cut element (absolute - value) - - - - - UID of a structural element that reinforces - the cut out - - - - - - - - - - - - - - Damping derivatives for positive and negative rotation - rates - - - - - 0. General overview - - This type contains the damping derivatives. They are - split up into those derivatives for positive rotation rates, - and those for negative rotation rates. - - - - 1. <positiveRates> (optional) - - Damping derivatives, calculated by positive rotation - rates. - - - - 2. <negativeRates> (optional) - - Damping derivatives, calculated by negative rotation - rates. - - - - - - - - - - - - - - - - - - - - - - - - deckType - - - Deck type, containing the data of a deck - - - - - - - - - - Name of the deck - - - - - Description of the deck - - - - - - The starting point of the deck/cabin. In a - conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object - defined by “parentUID”, which should be the fuselage. - - - - - - The starting point of the deck/cabin. In a - conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object - defined by “parentUID”, which should be the fuselage. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - decksType - - - Decks type, containing the decks of the fuselage - - - - - - - - - - - - - - - - - - - - deltaTemperatureType - - - - - - - - - - - - - - - - - - - - - - - - - - - - Design masses - - - The design mases are requerments wich can com form the - TLARs - - - - - - - - - - Take off mass - - - - - Zero Fuel mass - - - - - Maximum landing mass - - - - - Maximum ramp mass (the maximum weight - authorised for the ground handling) - - - - - - - - - - - - - Design parameter definition - - - Contains a the values of a parameter and its uid as reference. - - - - - - - - - - - - - - - - - - - - - - Design parameters list - - - Contains a list of all design parameters. - - - - - - - - - - - - - - - - - - - - Design space definition - - - Contains the definition of the design space. - - - - - - - - - - - - - - - - - - - - - - - Design study definitions - - - Contains the data of design studies definitions. - - - - - - - - - - - - - - - - - - - - directOperatingCostType - - - - - - - - - - - - - - - - - - - - - - - - - - - - divergenceCaseType - - - DivergenceCase type, containing a case for aeroelastic - divergence analysis - - - - - - - - - - Mach number of divergence case - - - - - - Divergence stagnation pressure - - - - - - - - - - - - - - divergenceCasesType - - - DivergenceCases type, containing the cases for - aeroelastic divergence analysis - - - - - - - - - - - - - - - - - - - doorAssemblyPositionType - - - DoorAssemblyPosition type, containing the position of a door - assembly - - - - - - - - - - - - optional definition of door type (restricted to pax, - service, emergency, cargo) - - - - - - - - - - - - - - - UID of the door element - description - - - - - UID of the forward door frame - - - - - UID of the backward door frame - - - - - UID of the stringer at the upper door - edge - - - - - UID of the stringer at the lower door - edge - - - - - Lower height of the door with respect to the floor. - (Information necessary for boarding and evacuation analysis not - necessarily linked to structures) - - - - - Minimum widh of the door element. (Information - necessary for boarding and evacuation analysis not necessarily - linked to structures) - - - - - Minimum height of the door element. (Information - necessary for boarding and evacuation analysis not necessarily - linked to structures) - - - - - Door on right side of the fuselage = 1; on the left = - -1. (Information necessary for boarding and evacuation analysis not - necessarily linked to structures) - - - - - - - - - - - - - - doorCutOutType - - - CutOut type, containing cut-outs - - - - - - - - - - Name of door cutout element - - - - - Description of door cutout - element - - - - - Fillet radius of door cutout - element - - - - - Reference UID to the description of a DSS (door - surround structure) - - - - - - - - - - - - - - doorSurroundStructurePositionType - - - DoorSurroundStructurePosition type, containing the position of a - door surround structure - - - - - - - - - - - - number of bays effected by DSS in front of - door - - - - - number of bays effected by DSS in behind of - door - - - - - number of bays effected by DSS - - - - - number of bays effected by DSS - - - - - - - - - - - - - - doorSurroundStructuresAssemblyType - - - doorSurroundStructuresAssembly type, containing - dorrSurroundStructure definitions - - - - - - - - - - - - - - - - - - - doorsType - - - Doors type, containing doors - - - - - - - - - - - - - - - - - - - driveSystemType - - - DriveSystem Type, defining a drive system (combination - of transmissions/gearboxes and shafts and their links to engines - and rotors) of a rotorcraft model. - - - - - - - - - - - - - - - - - - - - - driveSystemsType - - - DriveSystems Type, containing all the drive systems - (combination of transmissions/gearboxes and shafts and their - links to engines and rotors) of a rotorcraft model. - - - - - - - - - - - - - - - - - - - dynamicAircraftModelAnalysisType - - - - - - - - - - - - - - - - - - - - - - dynamicAircraftModelCoordinatesType - - - - - - - - - - - - - - - - - - - - - - - - - Emissivity map, containing the diffuse emissivity of a material at different spectral lengths. - - - The emissivity of a material can vary with the spectral wave length. - The vectors diffuseEmissivity and waveLength must have the same size to be valid. - The data should be linearly interpolated. - - - - - - - - - - - Wave length in [m] - - - - - Diffuse emissivity of the material - - - - - - - - - - - - - engineAnalysisType - - - - - - - - - - - - - Thrust at takeoff - - - - - Fan pressure ratio at takeoff - - - - - - Bypass ratio at takeoff - - - - - overall pressure ratio at takeoff - - - - - - Maximum rotations per second, shaft 1 - - - - - - Maximum rotations per second, shaft 2 - - - - - - Design tip relative mach number (FAN) - - - - - - DryMass of engine - - - - - - - - - - - - - - Definition of global geometry parameters of the engine - fan. - - - - - - - - - - - - - Inner radius of the fan. - - - - - Outer radius of the fan. - - - - - - - - - - - - - Definition of the global engine geometry. - - - - All engine geometry definitions refer to the engine - coordinate system. The engine coordinate system has its orgine - in the middle of the fan plan. The positive x-axis is heading to - the rear, the positive z-axis to the top and the y-axis - according to the right hand rule. - - - - - - - - - - - length of engine - - - - - diameter of engine - - - - - dProp - - - - - Chordlength of a fan blade - - - - - - - - - - - - - - - - - engineGlobalType - - - EngineGlobal type, containing global engine data - - - - - - - - - - - Concept of engine - - - - - - - - - - - - - - - Year of first certification - - - - - - Rotation direction of the engine if looking at - it from the front, i.e. from propeller/fan to exhaust - - - - - - - - - - - - - - Hub to tip ratio - - - - - Number of rotor blades of fan - - - - - - Number of outlet guiding vanes - - - - - - Rotor stator spacing (relative to chordlength) - - - - - - - - - - - - - - Definition of one engine mount. - - - - - - - - - - - - - Name of the engine mount. - - - - - Description of the engine mount. - - - - - - position of the engine mount refering to the - engine coordinate system. - - - - - - UID of the engine mount. - - - - - - - - - - - - List of all engine mounts. - - - - - - - - - - - - - - - - - - - - - - Definition of the engine nacelle type. - - - - The engine nacelle is currently located together with - the engine. It gives a simple description of the outer shell of - the engine. All values are defined according to the base area, - center point of the fan(i.e. negative values can occur in the - definition) In most cases there will be a bypass engine. For - non-bypass or mixed engines ignore the bypass nozzle. For further - information on the geometric setup, please refer to the picture - below. - - - - - - - - - - - - - - - - - - - - - - - - - - - - enginePerformanceMapType - - - EnginePerformanceMap type, containing a perfomance map - with engine data - - - - - - - - - - - - - - Flight Level - - - - - Mach number - - - - - Absolute thrust [N] - - - - - Fuel mass flow - - - - - Speed at core engine nozzle - - - - - - Total temperature at core engine nozzle - - - - - - Mass flow through core engine nozzle - - - - - - Speed at bypass nozzle - - - - - Total temperature at bypass nozzle - - - - - - Mass flow through bypass nozzle - - - - - - Percent of n1Max, shaft 1 - - - - - Percent of n2Max, shaft 2 - - - - - Fan pressure ratio - - - - - Fan efficiency - - - - - Turbine entry total temperature - - - - - - Emission index Carbon Monoxide - - - - - - Emission index Nitrogen Oxide - - - - - - Emission index Sulfur Oxide - - - - - - Emission index Soot - - - - - Emission index unburned hydrocarbon - - - - - - air density at core outlet 8 - - - - - - air density at bypass outlet 18 - - - - - - area at core outlet - - - - - area at bypass outlet - - - - - - - - - - - - - - enginePerformanceMapsType - - - - - - - - - - - - - - - - - - - - - - enginePositionType - - - EnginePosition type, containing data for a single - engine - - - - - - - - - - Name of the engine - - - - - Description of the engine - - - - - Reference to the used engine - - - - - - Component, to which the engine is mounted - - - - - - - - - - - - - - - - - - - - - - - - - - - Engine references - - - EnginePositions type, containing a reference to the - used engines and their positions at the configuration - - - - - - - - - - - - - - - - - - - Definition of one engine pylon. - - - - - - - - - - - - - Name of the engine pylon. - - - - - Description of the engine pylon. - - - - - - UID of the parent (normaly wing or fuselage). - - - - - - - - - - - - UID of the engine pylon. - - - - - - - - - - - - - - - - - - - - - - - Engine pylons - - - - - - - - - - - - - - - - - - - - - - Definition of the engine spinner geometry. - - - - - - - - - - - - - Most forward x-position of the spinner. - - - - - - X-position of the spinner base. - - - - - - Radius of the spinner at the base position. - - - - - - - - - - - - - - engineType - - - Engine type, containing engine data. - - - - - - - - - - Name of engine - - - - - Description of engine - - - - - Scaling of engine take-off thrust - - - - - - - - - - - - - - - - - - - Engines - - - Engines type, containing complete engine configurations - - - - - - - - - - - - - - - - - - - - etaIsoLineType - - - Iso line described by point of the same eta coordinate. - Can be either segment or component segment coordinates. - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta value is considered to be in segment - eta coordinate; if it points to a componentSegment, - then componentSegment eta coordinate is used. - - - - - - - - - - - - - fleetType - - - Each fleet can be divided into sub fleet groups - - - - - - - - - - Name of fleet - - - - - Description of the fleet - - - - - Description of sub-fleets. - - - - - - - - - - - - - - flightAnalysisType - - - - - - - - - - - - - - - - - - - - - - - Flight dynamics - - - - - - - - - - - - - - - - - - - - - - - - Linear model parameters - - - - - - - - - - - - - - - - - - - - - - - - - - Trim result - - - - - - - - - - - Mach number - - - - - - - True airspeed - - - - - - - Angle of attack - - - - - - - Altitude - - - - - - - - - - - - - - Load case - - - This node defines the load case - - - - - - - - - - - Name of the load case - - - - - - - Description of the load case - - - - - - - - - - - - - - - - - Load case specification - - - Input values defining a load case - - - - - - - - - - - Environment - - - - - - - Altitude above sea level - - - - - - - Mach number - - - - - - - UID of the aerodynamic loads (aeroCase) - - - - - - - - Controller description. Note: Since there is no controller description in CPACS yet, the expected content of this string element has to be defined individually for each project. - - - - - - - - - - - UID referencing the mass state of aircraft for this load case - - - - - - - - - - - - - - Flight load cases - - - - - - - - - - - - - - - - - - - - - - Flight loads - - - Loads resulting from the load case analysis - - - - - - - - - - - - - - - - - - - - - Load conditions - - - Inertia load conditions acting on the aircraft - - - - - - - - - - - Description - - - - - - - Safety factor applied on the loads - - - - - - - - Rotational rates around centre of gravity - - - - - - - Enumeration flag stating the typ of the load - case (i.e. limit or ultimate loads) - - - - - - - - - - - - - Angle of sideslip [deg] - - - - - - - Angle of attack [deg] - - - - - - - - - - - - - - - - Flight point definition for load case analysis - - - Description of the aircraft's flight state for - this load case. - - - - - - - - - - - - Environmental conditions - - - - - - - Altitude above sea level - - - - - - - Mach number - - - - - - - - - - - - - - Accelerations - - - Translational or rotational accelerations acting - on the aircraft - - - - - - - - - - - Rotational accelerations acting around aircraft centre of gravity [deg/s^2] - - - - - - - - - - - - - Load factors - - - - - - - - - - - - - - Load factor in x-direction - - - - - - - Load factor in y-direction - - - - - - - Load factor in z-direction - - - - - - - - - - - - - - Load case superposition - - - List of uIDs referencing load cases that are superimposed to the current load case - - - - - - - - - - - - UID reference to another load case to be superimposed - - - - - - - - - - - - - - Gust definition - - - The coordinate system of the gust corresponds to the CPACS coordinate system. - - - - - - - - - - Parameters describing the shape of the gust - - - - - - - - - - - - - - - - - Angle between gust and vehicle [deg] (e.g., 0deg: from right to left; 90 deg: downwards; 180deg: from left to right; 270/-90deg: upwards) - - - - - - - Gust length: length of ramp or gradient distance of 1-cos gust - - - - - - - Gust velocity - - - - - - - - - - - - - - Flight path - - - Definition of a flight path by points of longitude, latitude and a descriptive waypoint code. - - - - - - - - - - Vector of waypoint codes. If waypoint codes are not available put empty items into the waypoint string - - - - - Vector of waypoint latitude values in [deg] - - - - - Vector of waypoint longitude values in [deg] - - - - - Indicates the type of the way point. - - - - - - - - - - - - - - - - - - - - Performance case - - - - - - - - - - - - - - Name - - - - - - - Description - - - - - - - UID of flight performance requirement - - - - - - - - - - - - - - - - - - - - - - - Performance cases - - - List of performance cases - - - - - - - - - - - - - - - - - - - - Results of the landing analysis - - - - - - - - - - - - - Determined landing distance. - - - - - - Determined ground phase distance. - - - - - - - - - - - - - - Results of the take-off analysis - - - - - - - - - - - - - Main element containing the results for - take-off calculations optimized for min-imum liftoff speed - VLOFmin. - - - - - Main element containing the results for - take-off calculations optimized for min-imum safety speed V2min. - - - - - - - - - - - - - - flightPointType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Flight systems - - - - - - - - - - - - - - - - - - - - - - flightType - - - Flight type, containing data of a scheduled flight - - - - - - - - - - MissionUID for the flights mission definition - - - - - ModelUID of the aircraft appointed to perform the flight - - - - - Departure day of the flight - - - - - Time of departure - the time is defined as SOBT (Scheduled Off-Block Time) / STD (Scheduled Time of Departure) - - - - - Arrival day of the flight - - - - - Time of arrival - the time is defined as SIBT (Scheduled In-Block Time) / STA (Scheduled Time of Arrival) - - - - - Reference to the operating airline of a flight - - - - - - - - - - - - - - - Flights - - - Flighs type, containing all flight definitions - - - - - - - - - - - - - - - - - - - - floorPanelAssemblyPositionType - - - FloorPanelAssemblyPosition type, containing a floor - panel assembly position - - - - - - - - - - x coordinate of the begin of the floor panel - (absolute value) - - - - - x coordinate of the end of the floor panel - (absolute value) - - - - - UID of the first long. floor beam to be - connected to the floor panel - - - - - UID of the second long. floor beam to be - connected to the floor panel - - - - - UID of structural sheet element used for the - floor panel - - - - - - - - - - - - - - - floorPanelsType - - - FloorPanels type, containing floor panel definitions - - - - - - - - - - - - - - - - - - - - Flying qualities - - - Provides a list of flying qualities cases - - - - - - - - - - - - - - - - - - - - - Flying qualities case - - - - - - - - - - - - - Name - - - - - Description - - - - - Aircraft Class; Class 1 small light aircraft; - Class 2 medium weight aircraft, low to medium maneuverability; - Class 3 large, heavy aircraft, low to medium maneuverability; - Class 4 high maneuverability aircraft - - - - - Flight Phase Category; Category A Non-terminal - flight phases requiring maneuvering, precision tracking, or - precise flight-path control (e.g. air-to-air combat, terrain - following). Category B Non-terminal Flight Phases with gradual - maneuvers and without precision tracking, although accurate - flight-path control may be required (e.g. climb, cruise). - Category C Terminal Flight Phases are normally accomplished - using gradual maneuvers and usually require accurate flight-path - control (takeoff, approach and landing). - - - - - main element containing longitudinal transfer - functions - - - - - main element containing lateral directional - transfer functions - - - - - main element containing characteristic - parameters of the handling qualities criteria - - - - - - main element containing handling qualities - ratings - - - - - - - - - - - - - - fqCharParametersType - - - - - - - - - - - - - static margin [-] - - - - - main element containing characteristic - parameter of phugoid damping - - - - - main element containing characteristic - parameters of short period mode criteria - - - - - main element containing characteristic - parameters of roll oscillation criterion - - - - - coupling of roll and spiral mode: normal = no - coupling of roll and spiral mode coupled = coupling of roll and - spiral mode - - - - - main element containing characteristic - parameters of lateral eigenvalues - - - - - main element containing characteristic - parameters of effective roll time constant criterion - - - - - - main element containing characteristic - parameters of roll performance criterion - - - - - - - - - - - - - fqEiglatType - - - - - - - - - - - - - natural frequency of dutch roll mode [rad/s] - - - - - - damping of dutch roll mode [-] - - - - - - roll time constant [s] - - - - - time to double of spiral mode [s] - - - - - - ratio of bank to sideslip angle [-] - - - - - - natural frequency of coupled rollspiral motion - [rad/s] - - - - - damping ratio of coupled roll-spiral motion - - - - - - product of roll-spiral damping and natural - frequency [rad/s] - - - - - handling qualities level of roll time constant - - - - - - handling qualities level of roll spiral mode - - - - - - - - - - - - - - fqLateralType - - - - - - - - - - - - - numerator of transfer function roll control - surface deflection to bank angle - - - - - numerator of transfer function roll control - surface deflection to yaw rate - - - - - numerator of transfer function roll control - surface deflection to sideslip angle - - - - - numerator of transfer function roll control - surface deflection to bank angle of reduced 4th order system - - - - - - numerator of transfer function roll control - surface deflection to sideslip angle of reduced 4th order system - - - - - - numerator of transfer function yaw control - surface deflection to yaw rate - - - - - numerator of transfer function yaw control - surface deflection to sideslip angle - - - - - numerator of transfer function roll stick - input to roll rate - - - - - numerator of transfer function roll stick - input to yaw rate - - - - - numerator of transfer function roll stick - input to bank angle - - - - - numerator of transfer function roll stick - input to sideslip angle - - - - - numerator of transfer function pedal input to - roll rate - - - - - numerator of transfer function pedal input to - yaw rate - - - - - numerator of transfer function pedal input to - bank angle - - - - - numerator of transfer function pedal input to - sideslip angle - - - - - denominator of lateral motion - - - - - - denominator of lateral motion of reduced 4th - order system - - - - - - - - - - - - - fqLongitudinalType - - - - - - - - - - - - - numerator of transfer function pitch stick - input to pitch rate - - - - - numerator of transfer function pitch control - surface deflection to pitch angle - - - - - numerator of transfer function pitch stick - input to pitch angle - - - - - numerator of transfer function pitch stick - input to angle of attack - - - - - numerator of transfer function pitch stick - input to vertical load factor - - - - - denominator of longitudinal motion - - - - - - - - - - - - - - fqPhugoidType - - - - - - - - - - - - - damping ratio of phugoid mode [-] - - - - - - time to double amplitude of unstable phugoid - mode [s] - - - - - - - - - - - - - fqRatingsType - - - - - - - - - - - - - handling qualities level of phugoid damping - - - - - - handling qualities level of C* criterion - - - - - - main element containing handling qualities - levels of short period mode - - - - - main element containing handling qualities - levels of roll oscillation criterion - - - - - main element containing handling qualities - levels of lateral eigenvalues - - - - - handling qualities level of effective roll - time constant - - - - - handling qualities level of roll performance - - - - - - - - - - - - - - fqRollPerfType - - - - - - - - - - - - - time to reach critical bank angle [s] - - - - - - critical bank angle that has to be reached - [deg] - - - - - - - - - - - - - fqRoloscType - - - - - - - - - - - - - ratio of oscillatory component of the roll - rate to the average roll rate [-] - - - - - phase angle of dutch roll oscillation in - sideslip [deg] - - - - - phase angle between roll rate and sideslip in - dutch roll mode [deg] - - - - - ratio of first minimum roll rate to first - maximum [-] - - - - - handling qualities level of ratio of - oscillatory component of roll rate to average roll rate - - - - - - - - - - - - - - fqShortPeriodType - - - - - - - - - - - - - steady state normal acceleration change with - angle of attack [g/rad] - - - - - short period natural frequency of reduced - order system [rad/s] - - - - - short period damping ratio of reduced order - system [-] - - - - - equivalent pitch time delay of reduced order - system [s] - - - - - handling qualities level of CAP criterion - - - - - - - - - - - - - - fqTreffType - - - - - - - - - - - - - effective roll time constant [s] - - - - - - time where tangent of bank angle step response - is placed [s] - - - - - - - - - - - - - frameType - - - frame type, containing frame definition (V1.5+) - - - - - - - - - - - - - - - - - - - - - framesAssemblyType - - - FramesAssembly type, containing frames assembly - - - - - - - - - - - - - - - - - - - - freePathType - - - - - - - - - - - - - - - - - - - - - - - mass - - - - - - - - - - - - - - - - - - - - - - Fuels - - - fuelType containing data for fuels - Can be used as a catalog for different (liquid) fuel - types - - - - - - - - - - - - - at 15deg C - - - - - - - - - - - - - - - - - - - - Fuels - - - fuelType containing data for fuels - - - - - - - - - - - - - - - - - - - fuselageAeroPerformanceType - - - fuselageAeroPerformance type, containing perfomance - maps with aerodynamic data of a fuselage. - - - - - - - - - - Reference to the uID of the analysed fuselage - - - - - - References used for the calculation of the - force and moment coefficients of the fuselage (in the fuselage - axis system!) - - - - - Calculated aerodynamic performance maps of the - fuselage - - - - - - - - - - - - - fuselageCutOutType - - - fuselageCutOut type, containing a fuselage cutout - definition - - - - - - - - - - Name of the cutout - - - - - Description of the cutout - - - - - X position of the cutout center point - - - - - - Y offset of the cutout reference point - - - - - - Z offset of the cutout reference point - - - - - - Angle in degrees of the vector pointing from - the cutout reference point to the cutout center point, measured - relative to the direction of the fuselage z axis. - - - - - - Coordinates of the unit vector defining the - direction of extrusion - - - - - Coordinates of the unit vector defining the - y-axis of the local cutout coordinate system. Must be normal to - the orientationVector. - - - - - This value is used to define the width of the - cutout - - - - - This value is used to define the height of the - cutout - - - - - This value is used to define the width of the - cutout - - - - - This value is used to define the height of the - cutout - - - - - Fillet radius of the cut element (absolute - value) - - - - - Cutout type. Determines the type of the cutout - and how it is treated by the tools. Possible values: - ("window"|"door"|"ramp") - - - - - - - - - - - - - - - - - - - - - - - - - - fuselageCutOutsType - - - fuselageCutOuts type, containing fuselage cutouts - - - - - - - - - - - - - - - - - - - - fuselageElementType - - - FuselageElement type, containing fuselage element data - - - - - - - - - - - Name of fuselage element - - - - - Description of fuselage element - - - - - - Reference to a fuselage profile - - - - - - - - - - - - - - - - fuselageElementsType - - - FuselageElements type, containing the elements of a - fuselage section - - - - - - - - - - - - - - - - - - - List of fuel tanks - - - - - - - - - - - - - The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. -The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - - - - fuselageProfilesType - - - FuselageProfiles type, containing fuselage profile - geometries. See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - - - fuselageSectionType - - - FuselageSection type, containing fusleage section and - element data - - - - - - - - - - Name of fuselage section - - - - - Description of fuselage section - - - - - - - - - - - - - - - - - fuselageSectionsType - - - FuselageSections type, containing fuselage sections - - - - - - - - - - - - - - - - - - - - fuselageSegmentType - - - FuselageSegment type, containing data of a fuselage - segment - - - - - - - - - - Name of fuselage segment - - - - - Description of fuselage segment - - - - - - Reference to element from which the segment - shall start - - - - - Reference to element at which the segment - shall end - - - - - Optional and additional guidecurves to shape - the outer geometry. - - - - - - - - - - - - - - fuselageSegmentsType - - - FuselageSegments type, containing fuselage segment - definitions (from sections and elements) - - - - - - - - - - - - - - - - - - - fuselageStructureType - - - FuselageStructure type, containing data of the fuselage's - structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fuselageType - - - - Fuselage type, containing all data related to a - fuselage - - - - - - - - - - - - - - - Name of fuselage - - - - - - - Description of fuselage - - - - - - - UID of part to which the fuselage is - mounted (if any) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fuselagesAeroPerformanceType - - - fuselagesAeroPerformance type, containing - fuselagesAeroPerformance - - - - - - - - - - - - - - - - - - - Fuselages - - - Fuselages type, containing the fuselages of the - configuration - - - - - - - - - - - - - - - - - - - This type contains a vector of deflection values for a - single gear - - - - - 0. General overview - - In this type, a vector of deflections of a single - gear is specified. - - - - 1. - <gearUID> - (mandatory) - - - A reference to a gear from the aircraft model - - - - - 2. - <controlParameters> - (mandatory) - - - A vector of control parameters of the selected - gear - - - - - - - - - - - - - Reference to a gear - - - - - Control parameters of the gear - - - - - - - - - - - - - - This type contains a list of gears and their deflection - vectors - - - - - 0. General overview - - In this type, a list of gears is defined. - - - - - 1. - <gear> - (mandatory) - - - One of these nodes per deflected gear is required - here. - - - - - - - - - - - - - - - - - - - - - - stringerFramePositionType - - - stringerFramePosition type, containing individual - stringer / frame postion definition (CPACS V2.1+) - - - - - - - - - - - - - - - - - - - - - Continuity definition for profile extrusion: - 0= C0 (allows sharp edges, default), 2= C2 (defines curvature - continuity) - - - - - - - - - - - - - Definition of interpolation between different - profiles: 0= no interpolation 1= interpolation of strcutural - profile - - - - - - - - - - - - - - - - - - - - - - generalStructuralMemberType - - - - - - - - - - - - - - - - - - - - - - - - generalStructuralMembersAssemblyType - - - generalStructuralMembersAssembly type, containing - structural member assemblys - - - - - - - - - - - - - - - - - - - genericCostType - - - - - - - - - - - - - - - - - - - - - - - - genericGeometricComponentType - - - - In some cases additional geometric components need to - be linked to a CPACS, but these components are not yet handled by - CPACS explicitly. For example, a belly fairing and/or external - tanks. - A generic geometric component may be applied to include - such a geometry from an external file (preferably STEP) in the - context of the overall aircraft. - - - - - - - - - - - - - - Name of genericGeometricComponent - - - - - - Description of genericGeometricComponent - - - - - - UID of part to which the component is mounted - (if any) - - - - - - - - - - - - - - - - - - - - - - - - - - - Generic geometric components - - - - - - - - - - - - - - - - - - - - - - mass - - - genericMassType, describing mass, inertia and CoG data. - - - - - - - - - - - name - - - - - description - - - - - parentUID - - - - - mass value - - - - - mass loaction values (x,y,z) - - - - - - mass orientation values - - - - - - - - - - - - - - - genericSystemsType - - - Node for geometrical layout of system components - based on simple geometric shapes - - - - - - - - - - - - - - - - - - - Generic system type containing describing the basic dimensions of a system component using simple geometric shapes - - - - The generic base types must be one of the following cone|sphere|cube|cylinder. The origin of the shapes is at the center of volume for cube, sphere and cylinder. Since the cone is constructued from a cylindric shape, its origin is at the same location as the origin of the basic cylinder, although not any longer the center of volume due to scaling of one side. While cube and sphere are symmetrical in all three axis, cylinder and cone are standing upright in the direction of cpacs z-axis. The tip of the cone is located in direction of the positive z-axis. The figure below illustrates the default position and orientation of the different shapes. Note that the cube, cylinder and sphere were moved along the x-axis for demonstration by 2, 4 and 6 meters respectively. - For spheres the default diameter is 1m. Cubes have a length of 1m in all three dimensions. Cylinders have a length of 1m and a diameter of 1m for the circular cross section. The cone is a cylinder with the top face scaled down to zero. - - - - - - - - - - - - - - - Name of the system component. - - - - - Description of the system component. - - - - - Enum for selecting the basic shape of the - component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - geographicPointConstraintType - - - Geographic point constraint, containing a longitude, latitude, altitude data triplet. - - - - - - - - - - Longitude coordinate 0-360 - - - - - Latitude coordinate 0-360 - - - - - Altitude in meters - - - - - - - - - - - - - geographicPointType - - - Geographic point type, containing a longitude, latitude, altitude data triplet. - - - - - - - - - - Longitude coordinate 0-360 - - - - - Latitude coordinate 0-360 - - - - - Altitude in meters - - - - - - - - - - - - - - airfoilAeroPerformanceType - - - airfoilAeroPerformance type, containing perfomance maps - with aerodynamic data of an airfoil. - - - - - - - - - - References used for the calculation of the - force and moment coefficients - - - - - Calculated aerodynamic performance maps of the - full configuration - - - - - - - - - - - - - globalBeamPropertiesType - - - globalBeamPropertiesType, containing the global beam - properties such as EA, EI, mass - - - - - - - - - - - - - - - - - - - - - - - - - - - Ground load Cases - - - - - - - - - - - - - - - - - - - - - - guideCurveProfileGeometryType - - - - A guide curve profile is defined by a profile name, an - optional description and a 3-dimensional relative pointlist with - all three coordinates mandatory. For typical profiles, one of - the coordinate vectors contains only "0" entries. All point - coordinates are transferred to the global coordinate system. - First and last point may, but need not to, be identical. - - The points have to be ordered in a mathematical - positive sense. - A profile can be symmetric. In that case the profile - is interpreted as being not closed and will be closed by - mirroring it on the symmetry plane. - Curves have to go continuously over the whole wing or - fuselage - Connection of guide curves from segment to segment - - - - - - - - Please note, currently it is not possible to apply any - means of class based transformation in the description. However, - this may be an addition for the future. - - - - - - - - - - - Name of profile - - - - - Description of profile - - - - - - - - - - - - - - - - - - - - - - - - - - guideCurveProfilesType - - - Guide Curve Profiles type. This type is used to - describe guide curves that enable designers to create a geometry - that deviates from a standard loft. - - - - - - - - - - - - - - - - - - - - Guide Curve Type - - - - A guide curve may be used to alter the shape of the - outer geometry and "guide" the loft. - The guide curve profiles are defined in the guideCurveProfileGeometryType. - Their use on wing and fuselage components is illustrated in the image below. - - - - - - - - - - - - - - - Name of guide curve - - - - - Description of guide curve - - - - - Reference to a guide curve profile - - - - - - For the first segment fromGuideCurveUID is not - a valid entry! For the first guideCurve - fromRelativeCircumference must be applied! fromGuideCurveUID is - exclusive. - - - - - - Reference to the previous guide curve from - which this guide curve shall start. - - - - - - Continuity definition for geometry - generation. Possible options: C0, C1 from previous, C2 from - previous, C1 to previous, C2 to previous - - - - - - - - - - - - - - - - - - - Reference to the relative circumference - position from which the guide curve shall start. Valid values - are in the interval -1.0...1.0. - - - - - - Tangent at first point - - - - - - - - The relative circumference - position at which the guide curve shall end. Valid values - are in the interval -1.0...1.0. - - - - - - Tangent at last point - - - - - - Local direction along which the relative x-coordinates of - the guide curve points are defined. For the wing the default is - the wing's local x-axis, for the fuselage its the fuselage's local z-axis. - - - - - - - - - - - - - - - Guide Curves Type - - - Guide Curve type. This type is used to describe guide - curves that enable designers to create a geometry that deviates - from a standard loft. - - - - - - - - - - - - - - - - - - - hingeMomentsMapType - - - hingeMomentsMap type, containing a hinge moments map - with aerodynamic data. Array order is: angleOfAttack min->max - then angleOfSideslip then reynoldsNumber then machNumber. - All coefficients in the aeroperformanceMap relate to - the CPACS coordinate system. See documentation of the - CPACS-Element for further information. - - - - - - - - - - Name of the AeroPerformanceMap. - - - - - - Description of the AeroPerformanceMap. - - - - - - Mach number - - - - - Reynolds Number - - - - - Sideslip angle - - - - - Angle of attack - - - - - - - - - - - - - - htpFwdInterfaceDefType - - - Definition of the interface of forward HTP attachment - - - - - - - - - - Definition of the forward HTP attachment - interface - - - - relative width of reinforcement at fwd HTP - attachment, between 0.0 and 1.0 - - - - - relative width of plate at fwd HTP attachment - (only applicable for Type1 model), between 0.0 and 1.0, smaller - than htpPlateWidth - - - - - UID of panel element at HTP forward attachment - in x-direction (shell elements) - - - - - UID of panel element at HTP forward attachment - in z-direction (shell elements) - - - - - UID of reinforcements for panel element at HTP - forward attachment in z-direction (beam elements) - - - - - - UID of the element to fix HTP to fuselage - (beam elements) - - - - - - - - - - - - - - htpInterfaceDefType - - - Definition of the interface of HTP - - - - - - - - - Definition of the HTP interface - - - - - UID of the fuselage frame at the forward HTP - attchment - - - - - - UID of the fuselage frame at the backward HTP - attchment - - - - - - maximum HTP deflection (nose up in - degrees) - - - - - - maximum HTP deflection (nose down in - degrees) - - - - - - angle of the reinforcements at backward HTP - attchment - (in degrees) - - - - - - Defines area (absolute) in x-direction around - htpFrame2UID where the HTP attachmentpoint has correct position - ==> check and potentially warning message - - - - - Defines area (absolute) in y-direction around - the - outer edge of htpFrame2UID where the HTP attachmentpoint has correct - y-position ==> check and potentially warning - message - - - - - - Defines allowed z-position for rear HTP - attachment - relativ to total frame height ==> check and potentially warning - message ==> check and potentially warning - message - - - - - - Definition of HTP structural - elements - - - - - - Definition of HTP forward attachment to - structure - - - - - - - - - - - - - - - htpStructElemDefType - - - definition of structural elements in HTP attachment - - - - - - - - - - Definition of tailplane attachment area - (Standard Configuration) - - - - UID of structural element for HTP front - crossbeams - - - - - UID of structural element for HTP rear - crossbeams - - - - - UID of structural element for HTP diagonal - beams - - - - - UID of structural element for HTP side beams - - - - - - UID of structural element for upper HTP cutout - reinforcement beams, also used for lower cutout reinforcement, - when not explicitely defined - - - - - UID of structural element for lower HTP cutout - reinforcement beams (optional) - - - - - - - - - - - - - - indirectOperatingCostType - - - - - - - - - - - - - - - - - - - - - - interConnectionStrutAttachmentType - - - - - - - - - - - - - Definition of the position of the attachment - joint in relative coordinates. - - - - - Material settings of the attachment. - - - - - - - - - - - - - - interconnectionStrutType - - - - - - - - - - - - - uID of control surface where this flap is - attached to by the interconnection strut. - - - - - Material settings of the strut (if strut is - moddeled as a simple strut). - - - - - Definition of the attachment on this control - surface. - - - - - Definition of the attachment on the other - control surface - - - - - Free path in positive (tensil) and negative - (compression) direction before interconnection strut blocks. - - - - - - - - - - - - - - - interconnectionStrutsType - - - - - - - - - - - - - Definition of one interconnection strut. - - - - - - - - - - - - - - intercostalPositionType - - - intercostalPosition type, containing the position of intercostals - in DSS - - - - - - - - - - - - UID of the frame at which intercostal - starts - - - - - UID of the forward door frame - - - - - UID of the door - - - - - non-dimensional value ranging between 0 and 1 - - - - - - UID of profileBasedStructuralElement used for - intercostal - - - - - - - - - - - - - - IntercostalsAssemblyType - - - IntercostalsAssembly type, containing intercostal - definitions - - - - - - - - - - - - - - - - - - - structuralElementsConnectionsType - - - StructuralElementsConnections type, containing - connections between structural elements - - - - - - - - - - Flag for automatic generation of interface - definitions (draft version) - - - - - - - - - - - - - - - landingGearInterfaceDefinitionsType - - - CenterFuselage landing gear interface definitions - - - - - - - - - - - - - - - - - - - - - - - - - - keelbeamType - - - HighWingCenterFuselage / Keelbeam definition between - mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lateralPanelsType - - - HighWingCenterFuselage / lateral Panel definition - between mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - - - - - longFloorBeamConnectionType - - - HighWingCenterFuselage / Long. floor beam connection - - - - - - - - - - - - - - - - - - - - - centerFuselageMainFramesType - - - High wing main frame definition, containing mainframe - UIDs - - - - - - - - - - - - - - - - - - - - - - - pressureFloorType - - - High Wing Center Fuselage / pressure floor definition - between mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - - sideboxType - - - HighWingCenterFuselage / side box definition between - mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - Landing gear position safety margins - - - LandingGearPositionSafetyMargins type, containing the - safety margins of the gear due to its position - - - - - - - - - - Safety margin for landing gear x position - regarding tail clearance at takeoff pitch angle - - - - - - Safety margin for landing gear x position to - avoid tail dropping down during touchDown and ground maneuvering - - - - - - Safety margin for landing gear y position to - avoid wing tip dropping down during ground maneuvering - - - - - - Safety margin for landing gear y position - regarding wingtip or engine nacelle clearance at a certein roll - angle - - - - - - - - - - - - - Landing gears - - - Contains a list of landing gears. - - - - - - - - - - - - - - - - - - - Landing gears - - - LandingGear type, containing the definition of nose, - main and skid gears. - - - - - - - - - - - - - - - - - - - - - Trailing edge device of the wing. - - - A leadingEdgeDevice (LED) is defined via its outerShape - relative to the componentSegment. The WingCutOut defines the area - of the skin that is removed by the LED. Structure is similar to - the wing structure. The mechanical links between the LED and the - parrent are defined in tracks. The deflection path is described - in path. Additional actuators, that are not included into a - track, can be defined in actuators. - Leading and trailing edge are defined by the outer - shape of the wing segments, i.e. the trailing edge of a - trailingEdgeDevice is the trailing edge of the wing. This is also - valid for kinks that are present in the wing but not explicitly - modeled in the control surface. - The edges of the control surface within the wing are a - straight line in absolute coordinates! Hence, there needs to be a - straight connection between the eta-wise outer and inner points - of the edge that is within the wing in absolute coordinates. - - - - - - - - - - - Name of the leading edge device. - - - - - - Description of the leading edge device. - - - - - - UID of the parent of the LED. The parent is - the componentSegment, where it is attached to. - - - - - - - - - - - - - - - - - - - - - Definition of the wings leading edge devices. - - - - Definition of the wings leading edge devices. - - - - - - - - - - - - - - - - - - - - Optional definition of the airfoil inner shape of - leading edge devices (LED). - - - - All parameters are optional. For the definition of the - parameters, please refer to the picture below. Parameters from - the outer border default to the parameters of the inner border. - - - - - - - - - - - - - - - Relative height of the most forward point of - the LED's rear part, based on the airfoil height of the parent - at this position. Optional. - - - - - Relative chordwise position of the most - forward point of the LED's rear part, based on the chord of the - parent at this position. Optional. - - - - - - - - - - - - - Optional definition of the leading edge shape of - trailing edge devices (TED). - - - - All parameters are optional. For the definition of the - parameters, please refer to the picture below. Parameters from - the outer border default to the parameters of the inner border. - - - - - - - - - - - - - - - Relative height of the leading edge of the TED, - based on the airfoil height of the parent at this position. - Optional. - - - - - Relative chordwise upper skin position, of the - border, where the airfoil of the TED is equivalent of the - airfoil from the parent. Measured from the rear to the front (0 - = TED trailing edge; 1 = TED leading edge). Values form the - outer border default to the value of the inner border. Optional. - - - - - - Relative chordwise lower skin position, of the - border, where the airfoil of the TED is equivalent of the - airfoil from the parent. Measured from the rear to the front (0 - = TED trailing edge; 1 = TED leading edge). Values form the - outer border default to the value of the inner border. Optional. - - - - - - - - - - - - - - linerType - - - Liner type, containing liner data - - - - - - - - - - Type of liner - - - - - - - - - - - - - % of fan diameter - - - - - % of fan diameter - - - - - - - - - - - - - linkToFile - - - Please provide a link to the additional file that shall - be loaded by the TIGL library. Furthermore it is necessary to - provide the format attribute so that the file type can be - identified. Several CAD formats provide multiple endings, and - hence, this measure seems necessary. - - - - - - - - - - - - - - - - - - - - - - - - - Load analysis - - - - - - - - - - - - - - - - - - - - - - - loadBreakdownType - - - - - - - - - - - - - - - - - - - - - - - - - - Load cases - - - - - - - - - - - - - - - - - - - - - - - - - loadReferenceAxisPointType - - - - - - - - - - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative height position. - relHeight is relative to the local airfoil thickness. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta-xsi values are considered to be in segment - eta-xsi coordinates; if it points to a componentSegment, - then componentSegment eta-xsi coordinates are used. - - - - - - - - - - - - - - loadReferenceAxisPointsType - - - - - - - - - - - - - - - - - - - - - - Load envelopes - - - The loads envelope is the results of the loadsAnalysis - and lists those loadcases that are limiting for the design - - - - - - - - - - - - - - - - - - - - - logFloorBeamPositionType - - - longFloorBeamPosition type, containing individual - position definition - - - - - - - - - - UID of structural element - - - - - UID of crossbeam to which the long. beam is - attached - - - - - y position of long. beam - - - - - - Continuity definition for profile extrusion: - 0= C0 (allows sharp edges, default), 2= C2 (defines curvature - continuity) - - - - - - - - - - - - - Definition of interpolation between different - profiles: 0= no interpolation 1= interpolation of strcutural - profile - - - - - - - - - - - - - - - - - - - - - - longFloorBeamType - - - longFloorBeam type, containing a long. floor beam - definition - - - - - - - - - - - - - - - - - - - - longFloorBeamsAssemblyType - - - longFloorBeamsAssembly type, containing long. floor - beam assemblys - - - - - - - - - - - - - - - - - - - mAirConditioningType - - - - - - - - - - - - - Air conditioning mass description - - - - - - - - - - - - - - mAutomaticFlightSystemType - - - - - - - - - - - - - Automatic flight system mass description - - - - - - - - - - - - - - mAuxillaryPowerUnitType - - - - - - - - - - - - - Auxillary power unit masse description - - - - - - - - - - - - - - mBellyFairingsType - - - - - - - - - - - - - - - - - - - - - - - mBleedAirSystemType - - - - - - - - - - - - - Bleed air system mass description - - - - - - - - - - - - - - mBulkCargoType - - - - - - - - - - - - - - - - - - - - - - mBulkCargosType - - - - - - - - - - - - - - - - - - - - - - - mBulkheadsType - - - - - - - - - - - - - - - - - - - - - - - mCabinFloorsType - - - - - - - - - - - - - - - - - - - - - - - mCabinLightingsType - - - - - - - - - - - - - - - - - - - - - - - mCargoFloorsType - - - - - - - - - - - - - - - - - - - - - - - mCargoLiningsType - - - - - - - - - - - - - - - - - - - - - - - mCargoLoadingsType - - - - - - - - - - - - - - - - - - - - - - - Cargo masses - - - - - - - - - - - - - Cargo masses description - - - - - Cargo mass description - - - - - - - - - - - - - - - - mCarriagesType - - - - - - - - - - - - - - - - - - - - - - - mCarryOnType - - - - - - - - - - - - - - - - - - - - - - mCarryOnsType - - - - - - - - - - - - - - - - - - - - - - - mCateringsType - - - - - - - - - - - - - - - - - - - - - - - mCellsType - - - - - - - - - - - - - - - - - - - - - - - mCockpitLightingsType - - - - - - - - - - - - - - - - - - - - - - - mCommunicationType - - - - - - - - - - - - - Communication mass description - - - - - - - - - - - - - - mComponentSegmentType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mComponentSegmentsType - - - - - - - - - - - - - - - - - - - - - - - mControlSurfaceSupportType - - - - - - - - - - - - - - - - - - - - - - - - - mControlSurfaceSupportsType - - - - - - - - - - - - - - - - - - - - - - - mCrewMembersType - - - - - - - - - - - - - - - - - - - - - - - mCrewSeatsType - - - - - - - - - - - - - - - - - - - - - - - mDeIcingType - - - - - - - - - - - - - De-icing mass description - - - - - - - - - - - - - mDocumentsToolsType - - - - - - - - - - - - - - - - - - - - - - - mDoorsType - - - - - - - - - - - - - - - - - - - - - - - mElectricalDistributionType - - - - - - - - - - - - - Electrical distribution mass description - - - - - - - - - - - - - - mElectricalGenerationType - - - - - - - - - - - - - Electrical generation mass description - - - - - - - - - - - - - - mEmergencyEquipmentsType - - - - - - - - - - - - - - - - - - - - - - - mEmergencyOxygenSystemsType - - - - - - - - - - - - - - - - - - - - - - - mEmptyULDType - - - - - - - - - - - - - - - - - - - - - - mEmptyULDsType - - - - - - - - - - - - - - - - - - - - - - - mEngineControlType - - - - - - - - - - - - - Engine control mass description - - - - - - - - - - - - - - mEquippedEnginesType - - - - - - - - - - - - - - Equipped engines mass description - - - - - - - - - - - - - - - mExtLightingsType - - - - - - - - - - - - - - - - - - - - - - - mFireProtectionType - - - - - - - - - - - - - Fire protection mass description - - - - - - - - - - - - - - mFixedGalleysType - - - - - - - - - - - - - - - - - - - - - - - mFixedLeadingEdgeType - - - - - - - - - - - - - - - - - - - - - - mFixedLeadingEdgesType - - - - - - - - - - - - - - - - - - - - - - - - mFixedTrailingEdgeType - - - - - - - - - - - - - - - - - - - - - - - - mFixedTrailingEdgesType - - - - - - - - - - - - - - - - - - - - - - - mFlightControlsType - - - - - - - - - - - - - Flight controls mass description - - - - - - - - - - - - - - mFloorCoveringsType - - - - - - - - - - - - - - - - - - - - - - - mFramesType - - - - - - - - - - - - - - - - - - - - - - - - - mFreshWaterSystemsType - - - - - - - - - - - - - - - - - - - - - - - mFuelSystemType - - - - - - - - - - - - - Fuel system mass description - - - - - - - - - - - - - - Fuel mass - - - - - - - - - - - - - Fuel mass description - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Furnishing mass description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mFuselageStructureType - - - - - - - - - - - - - Fuselage structure mass description - - - - - - - - - - - - - - - - - - - - - - - - - - mWallsType - - - - - - - - - - - - - - - - - - - - - - - mFuselagesStructureType - - - - - - - - - - - - - Fuselages structure mass description - - - - - - - - - - - - - - - mHydraulicDistributionType - - - - - - - - - - - - - Hydraulic distribution mass description - - - - - - - - - - - - - - mHydraulicGenerationType - - - - - - - - - - - - - Hydraulic generation mass description - - - - - - - - - - - - - - mIFESystemsType - - - - - - - - - - - - - - - - - - - - - - - mInstrumentPanelType - - - - - - - - - - - - - Instrument panel mass description - - - - - - - - - - - - - - mInsulationsType - - - - - - - - - - - - - - - - - - - - - - - mIntegratedModularAvionicsType - - - - - - - - - - - - - Integrated modular avionics mass description - - - - - - - - - - - - - - mInterGasSystemType - - - - - - - - - - - - - Inter gas system mass description - - - - - - - - - - - - - - mLandingGearSupportsType - - - - - - - - - - - - - - - - - - - - - - - mLandingGearsType - - - - - - - - - - - - - - Landing Gears mass description - - - - - - - - - - - - - - - - mLavatoriesType - - - - - - - - - - - - - - - - - - - - - - - mLiningsType - - - - - - - - - - - - - - - - - - - - - - - mMainGearsType - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Manufacturer empty mass description - - - - - - - - - - - - - - - - - - mMillitarySystemsType - - - - - - - - - - - - - Millitary systems mass description - - - - - - - - - - - - - - mMiscellaneousType - - - Miscellaneous masses must only specify componenent masses for which NO DEDICATED ELEMENT EXISTS in the mass breakdown list! - - - - - - - - - - - - - - - - - - - mMoveableLeadingEdgeType - - - - - - - - - - - - - - - - - - - - - - - - mMoveableLeadingEdgesType - - - - - - - - - - - - - - - - - - - - - - - mMoveableTrailingEdgeType - - - - - - - - - - - - - - - - - - - - - - - - mMoveablesType - - - - - - - - - - - - - - - - - - - - - - - - mNavigationType - - - - - - - - - - - - - Navigation mass description - - - - - - - - - - - - - - mNoseGearsType - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Operator items mass description - - - - - - - - - - - - - - - - - - - - - mOverheadBinsType - - - - - - - - - - - - - - - - - - - - - - - mPartStowDoorsType - - - - - - - - - - - - - - - - - - - - - - - mPassengerType - - - - - - - - - - - - - - - - - - - - - - mPassengersType - - - - - - - - - - - - - - - - - - - - - - - Passengers masses - - - - - - - - - - - - - Passanger masses Description - - - - - - Passanger mass Description - - - - - - - - - - - - - - Payload mass - - - - - - - - - - - - - Payload mass description - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Power units mass description - - - - - - - - - - - - - - - - - - - - mPylonAttachmentsType - - - - - - - - - - - - - - - - - - - - - - - mPylonsType - - - - - - - - - - - - - - Pylons mass description - - - - - - - - - - - - - - - mRibType - - - - - - - - - - - - - - - - - - - - - - mRibsType - - - - - - - - - - - - - - - - - - - - - - - mSeatsType - - - - - - - - - - - - - - - - - - - - - - - mShellType - - - - - - - - - - - - - - - - - - - - - - - - - mShellsType - - - - - - - - - - - - - - - - - - - - - - - - mSkinPanelsType - - - - - - - - - - - - - - - - - - - - - - - mSkinsType - - - - - - - - - - - - - - - - - - - - - - - mSparsType - - - - - - - - - - - - - - - - - - - - - - - mSpecialStructuresType - - - - - - - - - - - - - - - - - - - - - - - mSpoilersType - - - - - - - - - - - - - - - - - - - - - - - mStringersType - - - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Structure mass description - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Systems mass description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mTrailingEdgeDeviceType - - - - - - - - - - - - - - - - - - - - - - - - mTrailingEdgeDevicesType - - - - - - - - - - - - - - - - - - - - - - - mULDContentType - - - - - - - - - - - - - - - - - - - - - - mULDContentsType - - - - - - - - - - - - - - - - - - - - - - - mVacuumWasteSystemsType - - - - - - - - - - - - - - - - - - - - - - - mWasteWaterSystemsType - - - - - - - - - - - - - - - - - - - - - - - mWindowsType - - - - - - - - - - - - - - - - - - - - - - - mWingBoxType - - - - - - - - - - - - - - - - - - - - - - - - - mWingStructureType - - - - - - - - - - - - - Wing structure mass description - - - - - - - - - - - - - - - mWingsStructureType - - - - - - - - - - - - - Wings structure mass description - - - - - - - - - - - - - - - Main actuator - - - - Definition of the landing gear main actuator. - - - - - - - - - - - Reference to the main actuator uID of the - landing gear - - - - - - - - - - - - - - Main landing gear - - - List of main gears - - - - - - - - - - - - - - - - - - - mainStrutInterfaceDefinitionsType - - - HighWingCenterFuselage main strut interface definitions - - - - - - - - - - - - - - - - - - - - - - mainStrutFuselageAttachmentType - - - HighWingCenterFuselage / main strut attachment to - fuselage frame and stringer - - - - - - - - - - - - - reference to the structural element that comprises this connection. - - - - - - - - - - - - - - maintenanceCostType - - - - - - - - - - - - - - - - - - - - - - - - Mass breakdown - - - - - 1. General - - - The - massBreakeDown - is subdivided in - designMasses - , - fuel - , - payload - and - mOME - (operating empty mass). - - - designMass - - The design masses contain the overall values for - mTOM and so forth. These should be listed as specified by the - TLAR or found from initial sizing. - - fuel - and - payload - - The fuel and payload nodes should contain maximum - values, i.e. full fuel tanks, all passengers on board and full - cargo holding. These values may exceed the maximum allowable - take-off mass as the actual loading of the aircraft should be - specified in the weight and balance section of the aircraft. - - - mOEM - - - The operation empty mass structure is based on the Airbus Mass - Standard brake down [AIRBUS MASS STANDARD 2008]. The - operator’s mass empty (OME) is defined by the sum of the - following component masses: - - operator’s items - manufacturer’s mass empty (MME) - - - - - - - 2. massDescription - - - Each sub component has the following - massDescription - which include a: - - Name - Description - parentUID - Mass value - Mass location - Mass orientation - Mass Inertia. - - - - The - massdescription - can be found at the - designMasses - direct under each item. At the - fuel - , - payload - and - mOME - under massDescription in each item and sub item. - - Concerning symmetry please note that any item - referenced by its UID, e.g. wingUID, accounts for the complete - component, e.g. right and left side. Hence for these items - their complete mass needs to be specified. If the mass of - geometricallly symmetrical components is different, please use - the symmetry modifyers for UIDs: _symm and _mirror. See also - the overall CPACS definition section on symmetry - - - - - - - - - - - - - - - - - - - - - - - - - Fuel Mass Fraction - - - Describing the mass fraction considered for a mission segment sequence - - - - - - - - - - Reference to the segment from which the fuel fraction should be considered - - - - - Reference to the segment to which the fuel fraction should be considered - - - - - Float value of the mass fraction defined as - fraction = m_end / m_start - - - - - - - - - - - - - massInertiaType - - - massInertiaType - - - - - - - - - - - - - - - - - - - - - - - - massInertiaVectorType - - - - - - - - - - - - - - - - - - - - - - - - - - - materialDefinitionForProfileBasedPointType - - - MaterialDefinitionForProfileBased type, containing a - material definition (Reference to material and thickness) for - profile based objects, addition point reinforcements - - - - - - - - - - uID of the profile point to which the - additional stiffness shall be applied. - - - - - uID of a material definition. - - - - - - cross sectional area of additional long. - stiffener at strctural element point - - - - - optional auxiliary parameter for special use - (no physical meaning) - - - - - optional auxiliary parameter for special use - (no physical meaning) - - - - - - - - - - - - - Definition of the properties of the structural - profile sheet - - - MaterialDefinitionForProfileBased type, containing a - material definition (Reference to material and thickness) for - profile based objects. - - - - - - - - - - - UID of the sheet to which the material - properties shall be applied - - - - - - Predefined ID of the sheet of a standard profile - - - - - - - - - - - - - - - - - - Length of the sheet of a standard profile [m] - - - - - - - - - uID of a composite definition. - - - - - - Orthoropy direction of the composite. - - - - - - Scaling factor of the composite thickness. - - - - - - - - uID of a material definition. - - - - - - Absolute thickness of the material [m] - - - - - - - - - - - - - - - - Material Definition - - - MaterialDefinition type, containing a material - definition (Reference to material and thickness) - - - - - - - - - choice between composite / isotropic material - definition - - - - - uID of a composite definition. - - - - - - Orthotropy direction of the composite. - - - - - - Scaling factor of the composite thickness. - Absolute thicknesses are defined in each composite material - seperatly - - - - - - - uID of a material definition. - - - - - - Absolute thickness of the material. - - - - - - - - - - - - - - - Material - - - - Definition of the material properties for one of the following - material types: - - isotropic materials - anisotropic 2D and 3D materials - orthotropic 2D and 3D materials - - The nonemclature is adopted from [1] to define the material properties in an orthotogonal 1-2-3 - coordinate system. This may be illustrated by the stresses of a three-dimensional cube: - - - - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - - - - - - - - - - - - Name of the material - - - - - Description of the material - - - - - Material density [kg/m^3] - - - - - - - - - - - - - - - - - Reference temperature for thermal expansion - coefficient [K] - - - - - - - - - - - - - - - - - Isotropic material properties - - - - Defines the material properties for an isotropic material. Note that the shear modulus G - is defined in terms of the elastic modulus E and the Poisson's ratio nu as: - - - - Specifying a value for all three properties E, G and nu therefore results in an overdetermined material definition and must be avoided. - - - - - - - - - - - - Young's modulus [N/m^2] - - - - - - - Shear modulus [N/m^2] - - - - - - - Poisson's ratio - - - - - - - Thermal expansion coefficient [1/K] - - - - - - - Thermal conductivity of the material in - [W/(m*K)] - - - - - - - Allowable stress for tension [N/m^2] - - - - - - - Allowable stress for compression [N/m^2] - - - - - - - Allowable stress for shear [N/m^2] - - - - - - - Allowable strain for tension - - - - - - - Allowable strain for compression - - - - - - - Allowable strain for shear - - - - - - - Yield strength, tension [N/m^2] - - - - - - - Yield strength, compression [N/m^2] - - - - - - - Plastification curves for isotropic - materials incl. element elimination - - - - - - - Optional knockdown factor for fatiuqe - (defaults to 1) - - - - - - - Fatigue behaviour of the material - - - - - - - Damage tolerance behaviour of the - material - - - - - - - - - - - - - - - Anisotropic material properties for 2D materials - - - - - Defines the material properties for a linear anisotropic material in the plane stress state (i.e., shell). The stress-strain relationship is defined as: - - - - The terminology of this complex type refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. - - - - - - - - - - - - Coefficient 11 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 12 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 13 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 22 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 23 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 33 of reduced stiffness matrix [N/m^2] - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal expansion coefficient in material direction - 12 [1/K] - - - - - Thermal conductivity of the material in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 2 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 3 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 [N/m^2] - - - - - - Allowable stress for compression in material direction 1 [N/m^2] - - - - - - Allowable stress for tension in material direction 2 [N/m^2] - - - - - - Allowable stress for compression in material direction 2 [N/m^2] - - - - - - Allowable stress for shear [N/m^2] - - - - - - Allowable strain for tension in material direction 1 - - - - - Allowable strain for compression in material direction 1 - - - - - - Allowable strain for tension in material direction 2 - - - - - Allowable strain for compression in material direction 2 - - - - - - Allowable strain for shear - - - - - - - - - - - - - - Orthotropic material properties for 2D materials - - - - - Defines the material properties for an orthotropic material in the plane stress state (i.e., shell). The strain-stress relationship is defined as: - - - - Inverting the strain-stress relation and introducing thermal expansion yields: - - - - with: - - - - The terminology refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - - - - - - - - - - - - Young's modulus in material direction 1 [N/m^2] - - - - - Young's modulus in material direction 2 [N/m^2] - - - - - Shear modulus in material in 2-3 plane [N/m^2] - - - - - Shear modulus in material in 3-1 plane [N/m^2] - - - - - Shear modulus in material in 1-2 plane [N/m^2] - - - - - Poisson's ratio - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal conductivity of the material in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 2 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 - [N/m^2] - - - - - Allowable stress for compression in material - direction 1 [N/m^2] - - - - - Allowable stress for tension in material direction 2 - [N/m^2] - - - - - Allowable stress for compression in material - direction 2 [N/m^2] - - - - - Allowable stress for shear [N/m^2] - - - - - - Allowable strain for tension in material direction 1 - - - - - - Allowable strain for compression in material - direction 1 - - - - - Allowable strain for tension in material direction 2 - - - - - - Allowable strain for compression in material - direction 2 - - - - - Allowable strain for shear - - - - - - - - - - - - - - Anisotropic material properties for 3D materials - - - - - Defines the material properties for a linear anisotropic material in three spatial directions (i.e., solid). The stress-strain relationship is defined as: - - - - The terminology of this complex type refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. - - - - - - - - - - - - Coefficient 11 of stiffness matrix [N/m^2] - - - - - Coefficient 12 of stiffness matrix [N/m^2] - - - - - Coefficient 13 of stiffness matrix [N/m^2] - - - - - Coefficient 14 of stiffness matrix [N/m^2] - - - - - Coefficient 15 of stiffness matrix [N/m^2] - - - - - Coefficient 16 of stiffness matrix [N/m^2] - - - - - Coefficient 22 of stiffness matrix [N/m^2] - - - - - Coefficient 23 of stiffness matrix [N/m^2] - - - - - Coefficient 24 of stiffness matrix [N/m^2] - - - - - Coefficient 25 of stiffness matrix [N/m^2] - - - - - Coefficient 26 of stiffness matrix [N/m^2] - - - - - Coefficient 33 of stiffness matrix [N/m^2] - - - - - Coefficient 34 of stiffness matrix [N/m^2] - - - - - Coefficient 35 of stiffness matrix [N/m^2] - - - - - Coefficient 36 of stiffness matrix [N/m^2]2] - - - - - Coefficient 44 of stiffness matrix [N/m^2]] - - - - - Coefficient 45 of stiffness matrix [N/m^2] - - - - - Coefficient 46 of stiffness matrix [N/m^2] - - - - - Coefficient 55 of stiffness matrix [N/m^2] - - - - - Coefficient 56 of stiffness matrix [N/m^2] - - - - - Coefficient 66 of stiffness matrix [N/m^2] - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal expansion coefficient in material direction - 3 [1/K] - - - - - Thermal expansion coefficient affecting strain in material direction - 23 [1/K] - - - - - Thermal expansion coefficient affecting strain in material direction - 31 [1/K] - - - - - Thermal expansion coefficient affecting strain in material direction - 12 [1/K] - - - - - Thermal conductivity of the material in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 2 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 3 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 - [N/m^2] - - - - - Allowable stress for compression in material - direction 1 [N/m^2] - - - - - Allowable stress for tension in material direction 2 - [N/m^2] - - - - - Allowable stress for compression in material - direction 2 [N/m^2] - - - - - Allowable stress for tension in material direction 3 - [N/m^2] - - - - - Allowable stress for compression in material - direction 3 [N/m^2] - - - - - Allowable stress for shear in 2-3 plane [N/m^2] - - - - - Allowable stress for shear in 3-1 plane [N/m^2] - - - - - - Allowable stress for shear in 1-2 plane [N/m^2] - - - - - Allowable strain for tension in material direction 1 - - - - - - Allowable strain for compression in material - direction 1 - - - - - Allowable strain for tension in material direction 2 - - - - - - Allowable strain for compression in material - direction 2 - - - - - Allowable strain for tension in material direction 3 - - - - - - Allowable strain for compression in material - direction 3 - - - - - Allowable strain for shear in 2-3 plane - - - - - - Allowable strain for shear in 3-1 plane - - - - - - Allowable strain for shear in 1-2 plane - - - - - - - - - - - - - - - Orthotropic material properties for 3D materials - - - - - Defines the material properties for an elastic orthotropic material in three spatial directions (i.e., solid). The strain-stress relationship is defined as: - - - - Note that nuij is related to nuji by: - - - - The terminology refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - - - - - - - - - - - - Young's modulus in material direction 1 [N/m^2] - - - - - Young's modulus in material direction 2 [N/m^2] - - - - - Young's modulus in material direction 3 [N/m^2] - - - - - Shear modulus in the 2-3 plane [N/m^2] - - - - - Shear modulus in the 3-1 plane [N/m^2] - - - - - - Shear modulus in the 1-2 plane [N/m^2] - - - - - Poisson's ratio in in 2-3 plane - - - - - Poisson's ratio in in 3-1 plane - - - - - Poisson's ratio in in 1-2 plane - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal expansion coefficient in material direction - 3 [1/K] - - - - - Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] - - - - - Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 - [N/m^2] - - - - - Allowable stress for compression in material - direction 1 [N/m^2] - - - - - Allowable stress for tension in material direction 2 - [N/m^2] - - - - - Allowable stress for compression in material - direction 2 [N/m^2] - - - - - Allowable stress for tension in material direction 3 - [N/m^2] - - - - - Allowable stress for compression in material - direction 3 [N/m^2] - - - - - Allowable stress for shear in 2-3 plane [N/m^2] - - - - - - Allowable stress for shear in 3-1 plane [N/m^2] - - - - - Allowable stress for shear in 1-2 plane [N/m^2] - - - - - - Allowable strain for tension in material direction 1 - - - - - - Allowable strain for compression in material - direction 1 - - - - - Allowable strain for tension in material direction 2 - - - - - - Allowable strain for compression in material - direction 2 - - - - - Allowable strain for tension in material direction 3 - - - - - - Allowable strain for compression in material - direction 3 - - - - - Allowable strain for shear in 1-3 plane - - - - - - Allowable strain for shear in 1-3 plane - - - - - - Allowable strain for shear in 1-2 plane - - - - - - - - - - - - - - Materials - - - Materials type, containing material and composite data. - A material describes the properties of a certain material. - Several materials can be combined within one composite. - - - - - - - - - - - - - - - - - - - - - Mission definitions - - - - Specifies missions for performance evaluation of aircraft. - As the topmost element of the hierarchical mission definition, individual missions are grouped together - in the missions node. Here, segmentBlocks - are referenced. These again link to a list of segments. - - - - - - - - - - - - - - - - - - - - - - Setting default and specific performance maps to be used for a model - - - - - - - - - - Default performance map which is used if no other performance map - is assigned through the specificPerformanceMap node - - - - - List of specific performance maps used on dedicated mission segments - - - - - - - - - - - - - - End condition - - - - - Specifies the end conditions for a segment or segment block (e.g.: an altitude or velocity). If a phase has no endCondition, it will base its endCondition on the segmentBlock settings (e.g.: it is the cruise segment, retrieving its total length based on the length of the segmentBlock minus all other segment lengths avaible within the segmentBlock). - - - - - - - - - - - - - - Calibrated airspeed [m/s] - - - - - - - - - - - - - - Mach number - - - - - - - - - - - - - - - - Global coordinate in xyz coordinates - - - - - - - - - - - - - - Global coordinate in geographic - coordinates (longitude, latitude, - altitude) - - - - - - - - - - - - - - Runway - - - - - - - - - - - - - - - - MassFraction ending the segment - - - - - - - - - - - - - - Fuel mass fraction ending the - segment, as remaining fuel mass with - respect to initial segment fuel mass - - - - - - - - - - - - - - Remaining absolute fuel ending the - segment - - - - - - - - - - - - - - Consumed fuel mass ending the - segment - - - - - - - - - - - - - - - - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] - - - - - - - - - - - - - - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] - - - - - - - - - - - - - - - Flown distance in the segment (x, y, z) - - - - - - - - - - - - - - - Duration of the segment [hh:mm:ss] - - - - - - - - - - - - - - UTC time at end of mission - - - - - - - - - - - - - - - Specific excess power at the end of the - segment - - - - - - - - - - - - - - Rate of climb ending the segment - - - - - - - - - - - - - - Achieved flightPathAngle ending the segment - - - - - - - - - - - - - - - - - - - - - Mission block constraints - - - Definition of constraints for the mission segment block - - - - - - - - - - - - - - - - - - - - Segment block - - - A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). - - - - - - - - - - Name - - - - - Description - - - - - - Segment direction. Either 'outbound' or 'inbound'. Only needed for radiusOfAction kind of missions. - - - - - - - - - - - - - - - - Specifies to which type of mass the segment fuel mass - should be added (blockFuel = designFuel + additionalFuel; Total fuel requirement - = blockFuel + reserveFuel; designFuel = the fuel of the segmentBlock is part of the design mission) - - - - - - - - - - - - - - - - Number of repetitions of this segment block, e.g. to perform repeated holding patterns - - - - - - - - - - - - - - - Segment blocks - - - A list of segment blocks. A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). - - - - - - - - - - - - - - - - - - - Segment - - - Definition of a mission segment which can be used to define missions. - - - - - - - - - - Name - - - - - Description - - - - - Type of the mission segment (takeOff, clime, cruse, ...) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Indication whether the distance flown during the segment is to be taken into account in the segmentBlock's distance calculation. - - - - - - Environmental conditions. If the environmentalCondition is not provided at segment level, the conditions of the - previous segment are inherited (this inhertance can continue until the startCondition, where the initial - environmentalConditions are provided). - - - - - - - Fuel mass - - - - - - - - - - - - - - - - - - - - Mission segment constraints - - - Contains a set of constraints for the segment - - - - - - - - - - - - - - - - - - - Mission segments - - - A collection of mission segments which can be reused to define missions. - - - - - - - - - - - - - - - - - - - Start conditions - - - Conditions which define the start of a mission - - - - - - - - - - - Calibrated airspeed at the start of the mission [m/s] - - - - - Mach number at the start of the mission - - - - - - - Global coordinate at the start of the mission in xyz coordinates - - - - - Global coordinate at the start of the mission in geographic coordinates (longitude, latitude, altitude) - - - - - - UID of the runway at which the - mission starts - - - - - - - - Flight heading at the start of the mission, in compassAngle with reference to true North - - - - - - UTC time at start of mission - - - - - - - - - - - - - - Mission - - - Contains a list of segmentBlock uID's forming the mission along with additional mission information. - - - - - - - - - - Name - - - - - Description - - - - - - - List of segmentBlock uID's forming the mission. Segments must first be grouped in segmentBlocks to be assigned to a mission. - - - - - - - - - - - - - - - Missions - - - A list of missions. - - - - - - - - - - - - - - - - - - - Monetary values - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - nacelleProfilesType - - - Nacelle profiles type, containing nacelle profile geometries. - See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - nacelleSectionType - - - - - - - - - - - - - - - - - - - - - - - - - - nacelleSectionsType - - - - - - - - - - - - - - - - - - - - - - Noise - - - - - - - - - - - - - FAR approach noise level - - - - - FAR sideline noise level - - - - - FAR take-off noise level - - - - - - - - - - - - - Nose landing gears - - - List of nose gears - - - - - - - - - - - - - - - - - - - Operating empty mass - - - - - - - - - - - - - Operating empty mass description - - - - - - - - - - - - - - - - operationalCaseType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - operationalCasesType - - - - - - - - - - - - - - - - - - - - - - outerCutOutProfileType - - - - - - - - - - - - - - - - - - - - - - - Parameter definition for design studies. - - - Contains a name for the design parameter to give semantic meaning to parameters used in design studies. - - - - - - - - - - - Name of parameter - - - - - - - - - - - - - - Container for parameter definitions - - - Contains a of the design parameter definitions. - - - - - - - - - - - - - - - - - - - - paxCrossBeamStrutsAssemblyType - - - PaxCrossBeamStrutsAssembly type, containing pax - crossBeam strut assemblys - - - - - - - - - - - - - - - - - - - paxCrossBeamsAssemblyType - - - PaxCrossBeamsAssembly type, containing pax crossBeam - assemblys - - - - - - - - - - - - - - - - - - - paxDoorsAssemblyType - - - PaxDoorsAssembly type, containing pax door assemblys - - - - - - - - - - - - - - - - - - - - payloadGlobalType - - - - - - - - - - - - - - - - - - - - - - - Flight performance requirements - - - Contains a list of flight performance requirements - - - - - - - - - - - - - - - - - - - - Flight performance requirement - - - - - - - - - - - - - Name of the performance case - - - - - Description of the performance case - - - - - Requirement classification based on the MoSCoW method (must, should, could or wont) - - - - - - - - - - - - - - - Reference to the considered weightAndBalance case - - - - - The UID of the mission to be flown - - - - - List of point performance uIDs constraining the mission - - - - - - - - - - - - - - - - Selection of performance maps - - - - - - - - - - Engine performance map selection - - - - - Aerodynamic performance map selection - - - - - - - - - - - - - Performance requirements - - - - - - - - - - - - - - - - - - - - - - - - - - performanceTargetsGlobalType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Piston - - - - Geometric description and material properties of the - landing gear piston. The figure below shows the condition of the - uncompressed piston, where the length of the exposed part is the - sum of the maxSpringDeflection - and the compressedExternalLength: - - - - - - - - - - - - - - - Length of the piston - - - - - - Maximum spring deflection of the piston (difference between minimum and maximum deflection) - - - - - Length of the piston that remains outside of the main strut in fully compressed state - - - - - - - - - - - - - - plasticityCurvePointType - - - - - - - - - - - - - Tangent modulus [N/m^2] - - - - - True stress [N/m^2] - - - - - - - - - - - - - Points on plasticity curve of material - (min. 1 point) - - - - - - - - - - - - pointPerformanceType - - - Specific performance settings for the point performance calculation (e.g.: a cruise Mach number) - - - - - - - - - - Name - - - - - Description - - - - - - - Defines at which part of the mission - the point performance should be - considered - after indicated segment - of the mission as defined in - performanceCase - - - - - - - Defines at which part of the mission - the point performance should be - considered - at the defined - massFraction within the mission as - defined in performanceCase - (mCurrent/mTO) - - - - - - - Defines at which part of the mission - the point performance should be - considered - at the defined - fuelFraction within the mission as - defined in performanceCase - (mFuelCurrent/mFuelTO) - - - - - - - - Indicates the type of point performance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Point performance definitions - - - List of point performance definitions - - - - - - - - - - - - - - - - - - - pressureBulkheadAssemblyPositionType - - - PressureBulkheadAssemblyPosition type, containing a - pressure bulkhead assembly position - - - - - - - - - - Frame to which bulkhead is attached to - - - - - - UID of bulkhead element desription - - - - - - - - - - - - - - - pressureBulkheadAssemblyType - - - PressureBulkheadAssembly type, containing pressure - bulkhead assemblys - - - - - - - - - - - - - - - - - - - pressureBulkheadType - - - PressureBulkhead type, containing data of a pressure - bulkhead - - - - - - - - - - Name of the pressure bulkhead structural - element - - - - - Description of the pressure bulkhead - structural element - - - - - UID of structural sheet element used for the - bulkhead - - - - - Choice between flat and curved bulkhead types - - - - - additional data for flat (forward) pressure - bulkhead - - - - Number of vertical reinforcements on flat - bulhhead - - - - - UID of structural elements used as vertical - reinforcements - - - - - Number of horizontal reinforcements on flat - bulhhead - - - - - UID of structural elements used as - horizontal reinforcements - - - - - - additional data for curved (rear) pressure - bulkhead - - - - Radius of bulkhead calotte in the plane of - the adjacent frame - - - - - maximum flection of the pressure bulkhaed - calotte - - - - - Number of radial reinforcements (equally - distributed) on curved bulhhead - - - - - UID of structural elements used as radial - reinforcements on curved bulkheads - - - - - - - - - - - - - - - - pressureBulkheadsType - - - PressureBulkheads type, conteining pressure bulkheads - - - - - - - - - - - - - - - - - - - - Structural elements based on profiles - - - - - Short description - - The ProfileBasedStructuralElement type containins the - data of a structural element, that are based on 2-dimensional profiles. - There are three approaches to model profile based structural elements: - - by specifying global beam properties - by referencing a structuralProfile2D element - by choosing one of the prescribed standard profiles - - - - - - 1. Global beam properties - - In the section globalBeamProperties the properties - of the structural profile in an equivalent beam representation - are defined. - - - - 2. Structural 2D profile - - The structuralProfileUID element refers to the uID of the structuralProfile2D element. - As described in the corresponding documentation, this profile is defined by several points in the x-y-space. - Two points always form a sheet. - The properties of each sheet are defined in the sheetProperties element. - The orthotropy direction of composite materials equals the sheets' x-axis. - The orthotropy direction angle equals a positive rotation around the sheets' z-axis as indicated in the picture below (part 3), which shows an example of a wing stringer.: - - - - - - - 3. Standard structural 2D profile - - Instead of referencing a structuralProfile2D element, it is also possible to select a predefined standard profile. - These profiles are listed in the figure below. - Under sheetProperties, only the standardProfileSheetID (equals S1, S2, ...) must now be specified along with a corresponding length. - - - - - - - - - - - - - - - - Name of the profile based structural element - - - - - - Description of the profile based structural - element - - - - - Choice between global beam properties and sheet properties - - - - - - Choice between general profile element - description (referencing a structuralProfile) and predefined - standard profiles - - - - Definition based on structuralProfile - definition - - - - Reference to the structural profile profile - uID - - - - - - Reference point in structural profile - definition for structural element definition - - - - - - - Standard Profile Type, see picture below for - further information. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - structuralElementType - - - profileBasedStructuralElements type, containing a list - of profile based structural elements - - - - - - - - - - - - - - - - - - - profileGeometryType - - - - A profile is defined by a profile name, an optional - description and a 3-dimensional pointlist with all three - coordinates mandatory. For typical profiles, one of the - coordinate vectors contains only "0" entries. All point - coordinates are transferred to the global coordinate system. The - points have to be ordered in a mathematical positive sense. - Normalized coordinates are not required. First and last point - may, but need not to, be identical. Hence, it is possible to - include "open" profiles. However, the trailing edge position of - the upper and lower point need to be identical. No crooked - trailing edges are possible. - Example 1: For a conventional wing, the airfoil - coordinates are defined in x and z with all the y-coordinates - set to "0". The points have to be ordered from the trailing edge - along the lower side to the leading edge and then along the - upper side back to the trailing edge. - Example 2: For a fuselage, the coordinates are - typically given in y and z with x set to "0". Starting point of - the profile sould be the lowest point (typically in the symmetry - plane), then upwards on the positive y-side up to the highest - point (again, typically in the symmetry plane). Depending on, - whether the fuselage shall be specified with symmetry condition - or not, the profile either ends there, or continues on the - negative y-side back down to the lowest point. - Alternatively, it is possible to specify the - coordinates of a profile via the CST (class function /shape - function transformation technique) notation. Please see the - cst2DType for further information. - A profile can be symmetric. In that case the profile - is interpreted as being not closed and will be closed by - mirroring it on the symmetry plane. - - - - - - - - - - - Name of profile - - - - - Description of profile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - profileGeometry2DType - - - - A profile is defined by a profile name, an optional - description and a 2-dimensional pointlist with both - coordinates mandatory. All point coordinates are transferred - to the global coordinate system depending on the context they - are used in. The points have to be ordered in a mathematical - positive sense. The x-coordinates of the profile has to be - normalized between 0 and 1. First and last point - may, but need not to, be identical. Hence, it is possible to - include "open" profiles. However, the trailing edge position of - the upper and lower point need to be identical. No crooked - trailing edges are possible. - Example 1: For a conventional nacelle profile, the airfoil - coordinates are defined in x and y. The points have to be ordered - from the trailing edge along the lower side to the leading - edge and then along the upper side back to the trailing edge. - When used for a nacelle the profile axis align - with the global axes as follows: - +x_profile -> +x_global; - +y-profile -> -z_global - Example 2: For a fuselage, the coordinates are - also given in x and z with x as the normalized fuselage height. - Starting point of the profile sould be the lowest point - (typically in the symmetry plane), then upwards on the positive x-side up to the highest - point (again, typically in the symmetry plane). Depending on, - whether the fuselage shall be specified with symmetry condition - or not, the profile either ends there, or continues on the - negative x-side back down to the lowest point. - Alternatively, it is possible to specify the - coordinates of a profile via the CST (class function /shape - function transformation technique) notation. Please see the - cst2DType for further information. - A profile can be symmetric. In that case the profile - is interpreted as being not closed and will be closed by - mirroring it on the symmetry plane. - - - - - - - - - - - Name of profile - - - - - Description of profile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Profiles - - - Profiles type, containing profile geometries - - - - - - - - - - - - - - - - - - - - - - - - - - Attachment of the pylon to the parent. - - - - - - - - - - - - - Material properties of the attachment. - - - - - - Link to the structural profile of the - attachment. - - - - - - UID of the attachment. - - - - - - - - - - - - Attachments of the pylon to the parent. - - - - - - - - - - - - - - - - - - - - - - - Structural properties of the pylon box (ribs, upper, - lower and side panels). - - - - - - - - - - - - - - - - - - - UID of the pylon box. - - - - - - - - - - - - Definition of one pylon pin. - - - - - - - - - - - - - First element (parentAttachmentUID, engineUID - or uID of a pylon structure. - - - - - Second element (parentAttachmentUID, engineUID - or uID of a pylon structure. - - - - - Position of the pylon pin related to the pylon - coordinate system. - - - - - - Blocked DOFs. Referes to the rotated - coordinate system that is defined in 'orientation'. - - - - - - - - UID of the pin. - - - - - - - - - - - - Definition of pylon pins. - - - - - - - - - - - - - - - - - - - - - - Definition of a rib set. - - - - RibDefinitionType, containing the definition for ribs. - Ribs are defined in sets of one or more ribs. The positions of - the rib, as well as the orientation of the ribs are defined in - 'ribPositioing'. The cross section properties, as e.g. - materials, are defined in 'ribCrossSection'. - - - - - - - - - - - Name of the rib set. - - - - - Description of the rib set. - - - - - - - - - - - - - - - - - Structural properties of all tibs of the engine pylon - box. - - - - - - - - - - - - - - - - - - - - - - pylonRibsPositioningType - - - - Within the ribsPositioning type the position and the - orientation of the ribs of the rib set are defined. - The forward and the rear beginning of the rib set is - defined using relDepthStart and relDepthEnd. The orientation of - the ribs is defined in ribRotaton. The number of ribs of the - current rib set is either defined by ribNumber or by spacing. - - - - - - - - - - - - relDepthStart defines the forward location of - the beginning of the rib set. 0 equals the forward end of the - pylon box, while 1 equals the rear end of the pylon box. - - - - - - relDepthEnd defines the rear end. 0 equals the - forward end of the pylon box, while 1 equals the rear end of the - pylon box. - - - - - Ribs can be rotated in the side view. The - defaults to 90°, which equals an orientation along the pylons - z-axis. The angle is meassured around the positive y-direction - of the pylon. - - - - - - The spacing of the ribs defines the distance - between two ribs, measured along the pylons x-axis. First rib - is placed at relDepthStart. - - - - - RibNumber defines the number of ribs in this - ribSet. First rib is at relDepthStart along the pylons x-axis, - last rib is at relDepthEnd. The spacing is constant. - - - - - - - - RibCrossingBehaviour can either be "cross" or - "end". If it is end then ribs will end it they intersect - another rib. It it is cross ribs are placed uncut. - - - - - - - - - - - - - - - - - - - - - Structural properties of a pylon shackle. - - - - - - - - - - - - - Material properties of the shackle. - - - - - - Link to the structural profile of the shackle. - - - - - - - UID of the shackle. - - - - - - - - - - - - Structural properties of pylon shackles (for pylon to - parent attachment), if existing. - - - - - - - - - - - - - - - - - - - - - - - Structural properties of the pylon shells. - - - - - - - - - - - - - - UID of the structural profile. - - - - - - Material settings. - - - - - - UID of the structure. - - - - - - - - - - - - Definition of the load carrying structure of the engine - pylon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - Structural properties of struts (drag struts, upper - links and tangent links), if existing. - - - - - - - - - - - - - - - - - - - - - - - - radiativeForcingType - - - - - - - - - - - - - - - - - - - - - - - - - - - - recurringCostType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Reference values - - - Reference type, containing the reference values of the - aircraft model - - - - - - - - - - Reference area (typically planform area) - - - - - - Reference length (typically Mean Aerodynamic - Chord MAC). In CPACS, only one reference length exists (and is - used, e.g. for all three moment coefficients. Coordinates given - relative to MAC shall always use this length as MAC. - - - - - - Moment reference point (in global coordinate - system). The x-coordinate is typically chosen same as of the - leading edge of the wing in the spanwise section having a - chordlength identical to MAC. Coordinates given as %MAC shall - always use this x-coordinate and length (e.g. 0%MAC = x, 100%MAC - = x + length). The y coordinate is typically 0. The z coordinate - is often chosen either as 0., or as z of fueselage nose or as z - of middle of center fuselage part. - - - - - - - - - - - - - requirementType - - - - - - - - - - - - - - - - - - - - - - - RibIdentificationType, defining one rib. - - - - - - - - - - - - - UID of the rib definition set. - - - - - - Number of the rib of the rib definition set. - - - - - - - - - - - - - - Definition of the rib rotation - - - The rotation around z describes the rotation around the - wings midplane normal axis. The defaults to 90°. The reference - for the 'zero-angle' of the z-rotation is defined in - ribRotationReference. - - - - - - - - - - RotationReference defines the reference for - the z-rotation it is either sparUID, „LeadingEdge“, - „TrailingEdge“, "globalX", "globalY" or "globalZ". - If it is not defined the rotation reference is - the eta-axis (=leading edge, that is projected on the wings - y-z-plane). A z-rotation angle of 90 degrees means, that the rib - is perpendicular on the ribRotationReference (e.g. spar, leading - edge...). The rib itself is always straight, and the rotation - is defined with respect of the intersection point of the rib - with the ribRotationReference. - - - - - The rotation around z describes the rotation - around the wings midplane normal axis. The defaults to 90°. The - reference for the 'zero-angle' of the z-rotation is defined in - ribRotationReference. - - - - - - - - - - - - - rivetJointAreaAssemblyPositionType - - - RivetJointAreaAssemblyPosition type, containing a rivet - joint area assembly position - - - - - - - - - - - - - - - - - - - - - rivetJointAreasAssemblyType - - - RivetJointAreasAssembly type, containing rivet joint - area assemblys - - - - - - - - - - - - - - - - - - - rivetType - - - Rivet type, containing a rivet - - - - - - - - - - Name of the rivet type - - - - - Description of the rivet type - - - - - - Tensile Strength of the rivet type - - - - - - Shear Strength of the rivet type - - - - - - - - - - - - - - - rivetsType - - - Rivets type, containing rivets - - - - - - - - - - - - - - - - - - - rotorAirfoilsType - - - RotorAirfoils type, containing rotor airfoil - geometries. See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - - rotorBladeAttachmentType - - - RotorBladeAttachment type, defining the elements used - to attach one or more rotor blades to the rotor head. - - - - - - - - - - Name of the blade attachment. - - - - - - Description of the blade attachment. - - - - - - - The azimuthAngles element is used to specify - a list of discrete azimuth angles (in deg) at which instances - of attached blades are to be created. The number of blades will - equal to the number of elements of the vector. E.g. - <azimuthAngles>0;90;180;270</azimuthAngles> for a - four blade rotor with equal equiangularly distributed blades. - The transformation of the respective rotor blade corresponds to - a rotation by azimuthAngle around the z axis of the rotor - coordinate system in mathematically positive sense of rotation. - - - - - - If only the number of blades is specified, - the attached blades will be distributed equiangularly and the - first blade will be attached at azimuth angle 0. (Formula: - azimuthAngle[i] = i*360deg/numberOfBlades, - i=0..numberOfBlades-1) - - - - - - Definition of all hinges used to attach the - rotor blade. - - - - - UID of the rotorBlade which should be attached - to the rotor hub. - - - - - - - - - - - - - - rotorBladeAttachmentsType - - - RotorBladeAttachments type, containing all hinges and - blade UIDs attached to the current rotor hub. - - - - - - - - - - - - - - - - - - - rotorBladesType - - - - RotorBlades type, containing all the rotor blade - gometry definitions of an rotorcraft model. - Rotor blade geometries are defined using the same data - structure as wings (wingType). But in order to be compatible - with the other rotor blade related types (e.g. rotorType, - rotorHubType, rotorHubHingeType) there are some additional - conventions/requirements regarding the definition and - orientation of rotorBlade geometries: - - Rotor blades should be positioned relative to the - global z-axis the way they will be positioned to the rotor - shaft (when blade azimuth=0deg). - The global x-axis should be used as radial axis - (usually the quarter chord line of the rotor blade coincides to - a great extent with the x-axis of the rotor blade coordinate - system). - All sections should be positioned in the positive - x halfspace. - Segments should connect sections with ascending x - coordinates. - Airfoils defined in the rotorAirfoils node should - be used instead airfoils from the wingAirfoils node. - - - - - - - - - - - - - - - - Rotor blade geometries are defined using the - same data structure as wings (wingType). But in order to be - compatible with the other rotor blade related types (e.g. - rotorType, rotorHubType, rotorHubHingeType) there are some - additional conventions/requirements regarding the definition and - orientation of rotorBlade geometries: see remarks. - - - - - - - - - - - - - - rotorHubHinge type, containing a rotor hub hinge - (flap/leadLag/pitch). - - - - RotorHubHinge type, containing a rotor hub hinge - (flap/leadLag/pitch) of a rotorcraft model. - - - - - - - - - - - Name of the hinge. - - - - - Description of the hinge. - - - - - - Hinge type. Possible values: "flap", "pitch" - "leadLag". This is used to define the rotation axis of the hinge - (flap = y-axis in blade cs, pitch = x-axis in blade cs, lead-lag - = z-axis in blade cs). - - - - - - - - - - - - The angle (in deg) at which the hinge is in - neutral position. This element is normally used to define - precone or prelag angles of the attached blade. Defaults to 0. - - - - - - Static stiffness of the hinge in (N/m) for - linear hinges and (N.m/deg) for angular hinges. Default value: - +inf (statically rigid hinge) - - - - - Dynamic stiffness of the hinge in (N/m) for - linear hinges and (N.m/deg) for angular hinges. Default value: - +inf (statically rigid hinge) - - - - - Damping of the hinge in (N/(m/s)) for linear - hinges and (N.m/(deg/s)) for angular hinges. Default value: +inf - - - - - - - - - - - - - - - rotorHubHingesType - - - RotorHubHinges type, defining hinges used to attach a - rotor blade to the rotor head. - - - - - - - - - - Definition of a flap, lead-lag or pitch hinge. - - - - - - - - - - - - - - rotorHubType - - - RotorHub type, containing definitions for the rotor hub - and attached hinges and blades. - - - - - - - - - - Name of the rotor hub. - - - - - Description of the rotor hub. - - - - - - Rotor head type. Possible values: "semiRigid", - "rigid", "articulated", "hingeless" - - - - - - - - - - - - - Rotor blade attachments are used to define how - many rotor blades are attached at which azimuth positions of the - rotor hub and the used hinges. - - - - - - - - - - - - - - Rotor type, containing a rotor (main rotor, tail rotor, - fenestron, propeller,...) of an rotorcraft model. - - - - Rotor type, containing a rotor (e.g. main rotor, tail - rotor, fenestron, propeller,...) definition of a rotorcraft - model. - The position and attitude of the rotor is defined - using the transformation element. The following image shows the - CPACS conventions for the orientation of rotors and rotor axis - systems: - - - - - The origin coincides with the center of rotation. - - The z-axis corresponds to the axis of rotation - and thus coincides with the rotor shaft centerline. It Points - in the main thrust direction of the rotor (usually upwards for - a main rotor, forwards for a propeller). - The x-axis points from nose to tail (usually - rearwards for main and tail rotors, upwards for a propeller). - - The y-axis completes the right-handed orthogonal - coordinate system. - - Rotor hub attributes, hinges and references to - attached rotor blades are defined in the rotorHub element. - - - Note that rotor blade geometries are only referenced and not - defined in the child nodes of the rotor element. Refer to the - documentation of rotorBladesType ( - Empty#T/rotorBladesType - ) and wingType ( - Empty#T/wingType - ) for information on the definition of rotor blade geometries. - - The following figure shows the transformations to be - applied to rotorBlade geometries to visualize them in the rotor - frames for a given state (each rotor: rotorAzimuth given, each - hinge: hingeDeflection given): - - - - - - - - - - - - - - Name of the rotor. - - - - - Description of the rotor. - - - - - UID of the part to which the rotor is mounted - (if any). The parent of the rotor can e.g. be the fuselage. In - each rotorcraft model, there is exactly one part without a - parent part (The root of the connection hierarchy). - - - - - - Rotor type. Possible values: "mainRotor" - (default), "tailRotor", "fenestron" or "propeller".. - - - - - - - - - - - - - - Nominal value of the angular rotation speed in - rotations per minute (rpm). - - - - - Transformation (scaling, rotation, - translation). This element is used to define the position and - attitude of the rotor relative to the global or the parent - component's axis system. Note that an anisotropical scaling - transformation should not be applied to the rotor. - - - - - - The rotorHub element contains the definition - of the rotor hub type and number and azimuth angles of the - attached blades and their hinges. The rotor hub position and - attitude coincides with the rotor axis system's origin and z - axis. - - - - - - - - - - - - - - - - - - - - - - - - - rotorcraftAnalysesType, results from several analysis - modules connected to CPACS - - - RotorcraftAnalyses type, containing detailed analysis - data of the rotorcraft - Within this element results from analysis modules are - stored that rely to the overall definition of the rotorcraft. - These include e.g. aerodynamic data or loadCases - For further documentation please refer to the - respective elements. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rotorcraftGlobalType - - - RotorcraftGlobalType type, containing global data of - the rotorcraft - - - - - - - - - - Number of passenger seats - - - - - Cargo transport capacity [kg] - - - - - - Cruise Mach Number - - - - - Configuration of the rotorcraft: - standard(single main rotor, single tail rotor) / tandem / - coaxial/intermeshing / sideBySide/tiltRotor/tiltWing - - - - - - - - - - - - - - massBreakdownType - - - - - 1. General - - - The - massBreakeDown - is subdivided in - designMasses - , - fuel - , - payload - and - mOME - (operating empty mass). - - - designMass - - The design mass is a description from TLARs and can - be understand as design criteria. - - fuel - and - payload - - The fuel and payload mass are the maximum masses - which can be achieved. Full fuel tanks, all passengers on - board and full cargo holding. - - mOEM - - - The operation empty mass structure is based on the Airbus Mass - Standard brake down [AIRBUS MASS STANDARD 2008]. The - operator’s mass empty (OME) is defined by the sum of the - following component masses: - - operator’s items - manufacturer’s mass empty (MME) - - - - - - - 2. massDescription - - - Each sub component has the following - massDescription - which include a: - - Name - Description - parentUID - Mass value - Mass location - Mass orientation - Mass Inertia. - - - - That - massdescription - can be found at the - designMasses - direct under each item. At the - fuel - , - payload - and - mOME - under massDescription in each item and sub item. - - - - For the clean up the - mOME - there is consisting a script witch is programmed in Matlab but - also as standalone vision available. Setting for that tool can - be done under - toolspesifics/cmu - . - - - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Manufacturer empty mass description - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Group mass of hierarchy level 1 - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Group mass of hierarchy level 2 - - - - - - - - - - - - - - - Operating empty mass - - - - - - - - - - - - - Operating empty mass description - - - - - - - - - - - - - - - - rotorcraftModelType - - - RotorCraftModel type, containing a complete rotorcraft - model (Geometry and all specific data). The rotorcraftModelType - is basically a copy of the aircraftModelType with the following - additional elements: rotors, rotorBlades, driveSystems. - Furthermore the folowing elements have been adapted for - rotorcraft: global and analyses (aeroPerformance and - massBreakdown). - - - - - - - - - - Name of rotorcraft model - - - - - Description of rotorcraft model - - - - - - - - - - - - - - - - - - - - - - - - - - Rotorcraft - - - Rotorcraft type, containing all the rotorcraft models. - - Most of the extensions used in the rotorcraft type have - been defined as part of the work in the DLR project RIDE - (Rotorcraft Integrated Design and Evaluation, 2009-2012). - Therefore some of the definitions and conventions are tightly - coupled to the RIDE toolchain and tools. Further generalization - and assimilation of these parts to the definitions for fixed-wing - aircraft is planned for the near future. - - - - - - - - - - - - - - - - - - - rotorsType - - - Rotors type, containing all the rotors (mainRotors, - tailRotors, fenestrons, propellers, ...) of an rotorcraft model. - - - - - - - - - - - - - - - - - - - - runwayILSType - - - RunwayILS type, containing ILS data of a runway - - - - - - - - - - - Position of the localizer antenna - - - - - - - Position of the glide slope antenna - - - - - - Angle of the glide path - - - - - - - - - - - - - - runwayType - - - Runway type, containing data of a runway - - - - - - - - - - Name of runway - - - - - Description of runway - - - - - Position in degrees north - - - - - Position in degrees east - - - - - Threshold elevation - - - - - Runway heading - - - - - Takeoff run available - - - - - Landing distance available - - - - - Conditions of the runway - - - - - - - - - - - - - - - runwaysType - - - Runways type, containing data of the airport's runways - - - - - - - - - - - - - - - - - - - - seatModuleType - - - SeatModule type, containing data of a seat module - - - - - - - - - - - Name of the seat module - - - - - Description of the seat module - - - - - - Number of seats in the seat module, e.g 1, 2 - or 3 - - - - - Total width of the seat module - - - - - - seat module mass (optional, use of data to be - clarified) - - - - - seat module mass CoG (optional, use of data to - be clarified) - - - - - - - - - - - - - - seatModulesType - - - SeatModules type, containing seat modules - - - - - - - - - - - - - - - - - - - shaftLinkedComponentsType - - - ShaftLinkedComponents type, containing UIDs of engines, - transmissions and rotors linked by a shaft. - - - - - - - - - - - UID of a linked engine. - - - - - UID of a linked transmission shaft input. - - - - - - UID of a linked transmission shaft output. - - - - - - UID of a linked rotor. - - - - - - - - - - - - - - shaftType - - - Shaft type defining a shaft used as a link between - drive system components. - - - - - - - - - - - - - - - - - - - - - - shaftsType - - - Shafts type, containing all the shafts of a drive - system. - - - - - - - - - - - - - - - - - - - sheet3DType - - - - - - - - - - - - - - - - - - - - - - - - - - sheetBasedStructuralElementType - - - sheetBasedStructuralElementType type, sheet definition - for use in fuselage/structure - - - - - - - - - - Material definition of the skin segment - (Material, thickness, (lay-up)) - - - - - - - - - - - - - - sheetBasedStrcuturalElementsType - - - sheetBasedStrcuturalElementsType, containing sheet - based structural element definitions - - - - - - - - - - - - - - - - - - - sheetList3DType - - - - - - - - - - - - - - - - - - - - - - List of sheets, connecting 2-dimensional profile - points. - - - SheetList type, containing a list of sheets. Each sheet - combines two points to one sheet. - - - - - - - - - - - - - - - - - - - sheetPointsType - - - - - - - - - - - - - - - - - - - - - - sheetType - - - Sheet type, containing connection data of a sheet - - - - - - - - - - - Name of sheet within the profile definition - - - - - - Description of sheet within the profile - definition - - - - - Point from which the sheet definition starts - start - - - - - Continuity definition for profile geometry - generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines - tangential continuity), 2= C2 (defines curvature continuity) - 2=all - - - - - - - - - - - - - - Definition of an orientation vector at P1 - - - - - - Point at which the sheet definition ends - - - - - - Continuity definition for profile geometry - generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines - tangential continuity), 2= C2 (defines curvature continuity) - 2=all - - - - - - - - - - - - - - Definition of an orientation vector at P2 - - - - - - - - - - - - - - - singleGenericMassType - - - - - - - - - - - - - - - - - - - - - - Skid landing gears - - - List of skid gears - - - - - - - - - - - - - - - - - - - fuselagePanelType - - - FuselagePanel type, panel of the fuselage between - stringers/ frames (new in V1.5) - - - - - - - - - - UID of sheetBasedStructuralElement used for - the panel - - - - - UID of frame at start of the skin segment - - - - - - UID of frame at end of the skin segment - - - - - - UID of stringer at start of the skin segment - - - - - - UID of stringer at end of the skin segment - - - - - - - - - - - - - - - fuselageSkinSegmentType - - - FuselageSkinSegment type, containing material on skin - over circumference - - - - - - - - - - - - - - - - - - - skinType - - - Containing data defining the skin - - - - - - - - - - Default UID of sheetBasedStructuralElement - used for the fuselage skin not covered by individual panels - - - - - - - - - - - - - - - Spar cell of the spar. - - - - Within spar cells a special area of the spar is - defined where different cross section and material properties - shall be defined. - The area of the spar is defined by using the - parameters 'fromEta' and 'toEta'. The definition of the caps, - webs and rotation is equivalent to the cross section definition - of the complete spar. - - - - - - - - - - - Beginning (= inner border) of the spar cell. - - - - - - Ending (= outer border) of the spar cell. - - - - - - Upper Cap - - - - - - Lower Cap - - - - - - Web 1 - - - - - - Web 2 - - - - - - The angle between the wing middle plane and - web 1 [deg]. Default is 90 degrees. Positive rotation is around the - spar axis heading along with the positive eta-axis. - - - - - - - - - - - - - - - SparCells of current spar. - - - sparCells are an optional Element. They are defined via - the etaCoordinates and define a region of special cross section - and material properties. - - - - - - - - - - - - - - - - - - - Definition of the spar cross section. - - - - Spar type, containing the cross section definition of - a spar. The spar middle point is defined by the intersection of - the wing middle plane and web1. This equals the coordinate - defined within the sparPosition. - Please find below a picture where all spar cross - section parameters as well as the orientation refereneces for - the material definition can be found: - - - - - - - - - - - - - - - - - - - The angle between the wing middle plane and - web1. Default is 90 degrees. Positive rotation is around the - intersection axis of the spar and the wing middle plane. The - positive heading of this axis is inline with the positive - heading of the componentSegment eta-axis. - - - - - - - - - - - - - Spar position on the wing - - - - sparPositionType, a sparPostion defines a location - within the componentSegment where a spar in mounted. Eta and xsi - are relative to the componentSegment. - Please find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - As an alternative to the relative eta coordinate it is - possible to specify an elementUID so that the spar position is - relative to the outer geometry, e.g. kink, of the wing. - - - - - - - - - - - - Defines a spar position on an existing rib using a relative xsi coordinate - to determine the chord wise position on that rib - - - - - Defines a spar position using relative eta/xsi coordinates - - - - - - - - - - - - - - sparPositionUIDs of the spar. - - - - sparPositionType, a sparPostion defines a location - within the componentSegment where a spar in mounted. Those - positions are combined to spars by using a list of spar position - uIDs. The order of the sparPositionUIDs must be the same as the - order of the points on the real spar (from root to tip or from - tip to root). - Pleas note: orientation of a spar must be allways - outbound or allways inbound. A zigzag spar orientation where - e.g. the spar starts at the root, goes to the tip and goes back - to another point at the root is not allowed. - Pleas find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - - - - - - - - - - - List of spar position uIDs. - - - - - - - - - - - - - - Spar definition points on the wing. - - - - sparPositionType, a sparPostion defines a location - within the componentSegment where a spar in mounted. Eta and xsi - are relative to the componentSegment. - Please find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - - - - - - - - - - - - - - - - - - - - SparSegments (=spars) of the wing. - - - SparSegmentType, each spar is defined by multiple - sparPositions that are referenced via their uID. The spar cross - section is defined in 'sparCrossSection'. - - - - - - - - - - Name of the spar segment (=spar). - - - - - - Description of the spar segment (spar). - - - - - - - - - - - - - - - - - Spar segments of the wing. - - - sparSegmentsType, containing multiple sparSegment - (=spars) of the wing. - - - - - - - - - - - - - - - - - - - Specific heat map, containing the specific heat capacity of a material at different temperatures. - - - The specific heat of a material can vary with the temperature. The vectors specificHeat and temperature - must have the same size to be valid. The data should be linearly interpolated. - - - - - - - - - - - Temperature in [K] - - - - - Specific heat capacity of the material in [J/(kg*K)] - - - - - - - - - - - - - Specific performance map - - - - Applying a specific performance map to selected mission segments. In addition to the obligatory defaultPerformanceMapUID at least a segmentUID or pointPerformanceUID must be given. - - - - - - - - - - - UID of performance map to be used for mission segments - - - - - - - List of all mission segment UIDs to which the performance map is to be applied - - - - - List of point performance UIDs to which the performance map is to be applied - - - - - - List of point performance UIDs to which the performance map is to be applied - - - - - - - - - - - - - - specificPerformanceMapsType - - - Collection of all assignments of specific performance maps to selected mission segments - - - - - - - - - - - - - - - - - - - Spoilers of the wing. - - - A spoiler is defined via its outerShape relative to the - componentSegment. The WingCutOut defines the area of the upper - skin that is removed by the spoiler. Structure is similar to the - wing structure. The mechanical links between the spoiler and the - parrent are defined in tracks. The deflection path is described - in path. Additional actuators, that are not included into a - track, can be defined in actuators. - - - - - - - - - - Name of the spoiler. - - - - - Description of the spoiler. - - - - - - UID of the parent of the spoiler. The parent - is the componentSegment, where the spoiler is attached. - - - - - - - - - - - - - - - - - - - - - Definition of the wings spoilers. - - - Definition of the wings spoilers. - - - - - - - - - - - - - - - - - - - State parameter definition - - - Contains the values of a parameter and its uid as reference. - - - - - - - - - - - - - - - - - - - - - - - - State parameters list - - - Contains a list of all state parameters. - - - - - - - - - - - - - - - - - - - - stiffnessType - - - - - - - - - - - - - - - - - - - - - - - - - - - stringerFramePositionType - - - - Description of individual stringer / frame postions - - - - - - - - - - - - - - UID of profile based structural element - - - - - - - x position in absolute value - - - - - - UID reference to a fuselageSectionElement - - - - - - - y coordinate of reference system - - - - - - z coordinate of reference system - - - - - - angle definition to calculate intersection - with loft - - - - - - Continuity definition for profile extrusion: - 0= C0 (allows sharp edges, default), 2= C2 (defines curvature - continuity) - - - - - - - - - - - - - Definition of interpolation between different - profiles: 0= no interpolation 1= interpolation of strcutural - profile - - - - - - - - - - - - - - - - - - - - - - arbitraryStringerType - - - ArbitraryStringer type, containing stringer definition - (CPACS V1.5+) - - - - - - - - - - - - - - - - - - - - stringersAssemblyType - - - StringersAssembly type, containing an assembly of - stringers (new V1.5) - - - - - - - - - - - - - - - - - - - Structural elements - - - structuralElements Type, containing the different structural - elements - - - - - - - - - - - - - - - - - - - - - - - - - - - structuralMountType - - - - - - - - - - - - - - If this value is set to true then only the end points of the intersection shall be included as nodes in the model. - - - - - - The UID for the first connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. - - - - - - Optional counter to specify numbered items, e.g. ribs in a ribSet. - - - - - - The UID for the second connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. - - - - - - Optional counter to specify numbered items, e.g. ribs in a ribSet. - - - - - - - - - - - - - - - structuralProfile3DType - - - - - - - - - - - - - - - - - - - - - - - - - - 2-dimensional cross sections of structural profiles. - - - - - StructureProfile type, containing data of a structure - profile cross sections. The cross section profile is defined by - several points (->pointList) in the x-y-space. Two points are - combined to one sheet (->sheetList) by using the pointUIDs. - - This profile is defined by several points in the - x-y-space. Allways two points are combined to one sheet. The - properties of each sheet are defined in the 'sheetProperties' - section by referencing on the sheetUID and the material - properties. The orthotropy direction of composite materials equals - the x-sheet axis. The orthotropy direction angle equals a positive - rotation around the z-sheet axis as indicated in the picture below - (part 3.), where a wing stringer is defined as an example: - - - - - - - - - - - - - - - Name of the structure profile. - - - - - - Description of the structure profile. - - - - - - List of structural profile points, only x and - y. - - - - - - - - - - - - - - - Definition cross sections of structural profiles. - - - - Structuralprofiles type, containing cross section - information of structural profiles. - - - - - - - - - - - - - - - - - - - - Geometric description and material properties of a strut - - - - - - - - - - Length of the strut - - - - - - - - - - - - - - Design study parameters and results - - - - Contains optimization data such as definitions of design parameters and design studies. - - - - - - - - - - - - - - - - - - - - - - - - - subFleetType - - - Each fleet can be divided into sub fleet groups - - - - - - - - - - Name of fleet - - - - - Description of the fleet - - - - - A ; separated list of all tailsign strings - - - - - - - - - - - - - - subFleetsType - - - Contains a list of different sub fleets - - - - - - - - - - - - - - - - - - - subLoadType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Systems - - - - Systems type, containing the aircraft's control system - data - Please see the attached picture for further - documentation - - - - - - - - - - - - - - Node for geometrical layout of system components - based on simple geometric shapes - - - - - - Cockpit controls, e.g. stickRoll, pedals - - - - - - Different commandCases that are commanded, - e.g. roll, accelerate - - - - - Control Distributors, deliver inputs to the - control actuators. E.g. different angles of different ailerons. - - - - - - Control laws, for regulated actuation - - - - - - - - - - - - - - tailplaneAttachmentAreaType - - - tailplaneAttachmentArea type, containing dat on - fuselage - structure to attach tailplaine - - - - - - - - - - Definition of tailplane attachment area - (Standard - Configuration) - - - - - type of tailplane attachment: Currently - restricted to - 'Type1' and 'Type2' (see documentation) - - - - - - - - - - - - - - Definitions of VTP interface - - - - - - Definitions of VTP interface - - - - - - - - - - - - - - - takeoffPerformanceParametersType - - - - - - - - - - - - - Take-off distance at liftoff speed VLOF. - - - - - - Take-off distance at safety speed V2. - - - - - - Optimal speed Velev at point of initiating - take-off rotation by elevator deflection for a minimum take-off - distance. - - - - - Optimal rotation speed VR for a mini-mum - take-off distance - - - - - Liftoff speed VLOF. - - - - - Safety speed V2. - - - - - Take-off decision speed V1 - - - - - Minimum control speed ground VMCG. - - - - - - Flight path angle being achieved at V2 with - one engine failure in 400 ft height above ground. This is the - result of a post trim calculation using the deter-mined V2. If - the trim calculation fails the entry is set to -90. - - - - - - - - - - - - - - Structural properties of the tangent links, if - existing. The tangent links do connect the engine pylon with the - engine to carry the thrust forces. - - - - - - - - - - - - - - - - - - - - - - simpleConnectionType - - - SimpleConnection type, containing a simple connection - - - - - - - - - - - Can be each structural member (skinSegment, - stringer, frame, paxCrossBeam, cargoCrossBeam, - paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, - floorPanel, seatModule) - - - - - Can be each structural member (skinSegment, - stringer, frame, paxCrossBeam, cargoCrossBeam, - paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, - floorPanel, seatModule) - - - - - - - - - - - - - - - simpleConnectionsType - - - SimpleConnections type, containing simple connections - - - - - - - - - - - - - - - - - - - - topologyEntriesType - - - - - - - - - - - - - - - - - - - - - - topologyEntryType - - - A topology entry is used to combine the dynamic aicraft - models of several components, e.g. wing and fuselage. By default - these will be stiff. If desired stiffness and rotation with - respect to the CPACS coordinate system may be specified. - - - - - - - - - - - - - - - - - - - - - - - totalOperatingCostType - - - - - - - - - - - - - - - - - - - - - - - - trackActuatorType - - - - - - - - - - - - - Reference to the uID of the actuator of the - track. - - - - - Definition of the material properties of the - actuator to track attachment. - - - - - - - - - - - - - - wingSparsType - - - Spars type, a spar is defined by sparSegments that - stretch between multiple sparPositions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Definition of the struts of a control surface track. - - - - Definition of the struts of a control surface track. - - - - - - - - - - - - - - - - - - - - Definition of a strut of a control surface track. - - - - Definition of a strut of a control surface track. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Specification of joint coordinates. - - - - Specification of joint coordinates. - - - - - - - - - - - - - - - - - - - - Set of joint coordinates - - - - Definition of a set of joint coordinates. - - - - - - - - - - - Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - - - - - - - - Joint coordinates - - - - Definition of a joint coordinates. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Trailing edge device of the wing. - - - A trailingEdgeDevice (TED) is defined via its - outerShape relative to the componentSegment. The WingCutOut - defines the area of the skin that is removed by the TED. - Structure is similar to the wing structure. The mechanical links - between the TED and the parrent are defined in tracks. The - deflection path is described in path. Additional actuators, that - are not included into a track, can be defined in actuators. - - Leading and trailing edge are defined by the outer - shape of the wing segments, i.e. the trailing edge of a - trailingEdgeDevice is the trailing edge of the wing. This is also - valid for kinks that are present in the wing but not explicitly - modeled in the control surface. - The edges of the control surface within the wing are a - straight line in absolute coordinates! Hence, there needs to be a - straight connection between the eta-wise outer and inner points - of the edge that is within the wing in absolute coordinates. - - - - - - - - - - - Name of the trailing edge device. - - - - - - Description of the trailing edge device. - - - - - - UID of the parent of the TED. The parent can - either be the uID of the componentSegment of the wing, or the - uID of another TED. In the second case this TED is placed within - the other TED (double slotted flap). In this way n-slotted TEDs - can be created. - - - - - - - - - - - Definition of cruise rollers/mid-span stops. - Those features are small rolls at the leading edge of a flap - that keep the flap within the bending wing at cruise - configuration. - - - - - Definition of interconnection struts. Those - struts connect two neighbouring flaps and are load carrying in - case of an actuator of flap track failour. - - - - - Definiton of z-couplings. Those elements - couple two neighbouring flaps in z-direction. - - - - - - - - - - - - - - - Definition of the wings trailing edge devices. - - - - Definition of the wings trailing edge devices. - - - - - - - - - - - - - - - - - - - - Trajectories - - - - - - - - - - - - - - - - - - - - - - trajectoryGlobalType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - trajectoryType - - - - - - - - - - - - - - - - - - - - - - - - - - - transmissionGearRatioType - - - TransmissionGearRatio type, defining the ratio of - output rotation velocity to input rotation velocity. - - - - - - - - - - - - - - - - - - - - transmissionShaftInputType - - - TransmissionShaftInput type, defining a shaft input for - a transmission. - - - - - - - - - - - - - - - - - - - - transmissionShaftInputsType - - - TransmissionShaftInputs type, defining the shaft inputs - of a transmission. - - - - - - - - - - - - - - - - - - - transmissionShaftOutputType - - - TransmissionShaftOutput type, defining a shaft output - for a transmission. - - - - - - - - - - - - - - - - - - - - - transmissionShaftOutputsType - - - TransmissionShaftOutputs type, defining the shaft - outputs of a transmission. - - - - - - - - - - - - - - - - - - - transmissionType - - - Transmission type, defining a transmission/gearbox. - - - - - - - - - - - - - - - - - - - - - - - - - transmissionsType - - - Transmissions type, containing all the - transmissions/gearboxes of a rotorcraft model. - - - - - - - - - - - - - - - - - - - - - - - - - - - updateType - - - Update type, containing a datablock for each update of - the CPACS dataset - - - - - - - - - - Description of Modification of CPACS data - - - - - - Creator of CPACS modification - - - - - - Timestamp of CPACS modification - - - - - - New version number of CPACS dataset after - modification - - - - - CPACS version that the dataset is valid to - - - - - - - - - - - - - - Structural properties of the upper links, if existing. - The upper links do connect the upper forward part of the pylon - box with the forward wing attachment. - - - - - - - - - - - - - - - - - - - - - - variableSegmentType - - - - Containing the definition of variable segments for a segment block - - - - - - - - - - - defines uID of the segment having variable conditions - - - - - defines which condition(s) are variable within the segment (must be one of the defined - endConditions for the segmentBlock) - - - - - - - - - - - - - - - - - - - - List of segments that are allowed to be varied within a mission optimization. - - - - Provides a list of segments having variable conditions within the segmentBlock. - Example: a segmentBlock containing takeOff, climb, cruise, decent, landing segments has a cruise segment for which the range is variable. - The range of this segment is then to be calculated using the range defined for the segmentBlock while concerning the known ranges of all - other segments within the segmentBlock. - This concept needs to be practically tested. Does it suffice to mention (a list of) segments that are free to change to fit the overall block constraints? What happens if a segment is variable, though it has some constraints? When to define a segment as variable (climb until endPosition z, then endPosition x should be left free. Is the segment then variable? Probably not.). Somehow the 'free' segment should be in between fully defined segments (i.e.: a cruise+descent in between endPosition z == ICA and endPosition z == 0 for landing to define max range. How to define this exactly?) - - - - - - - - - - - - - - - - - - - Vehicles - - - - The vehiclesType contains all vehicle-specific - data. - This includes the vehicle itself (i.e. aircraft - and rotorcraft). Furhtermore, components - (e.g. engines, structuralElements, etc.) - as well as physical properties of materials and - fuels can be predefined for easy and consistent reuse via - uID-references. - - - - - - - - - - - - - - - - - - - - - - - - - - - - vtpFrameDefType - - - Definition of the individual VTP attachments - - - - - - - - - - Definition of tailplane attachment area - (Standard Configuration) - - - - UID of the fuselage frame at this VTP - attchment - - - - - Flag for option for VTP attachment between - defined FrameUID and the next one - - - - - UID of panel element at VTP attachment (shell - elements) - - - - - UID of structural element at VTP attachment - (base, beams) - - - - - UID of structural element at VTP attachment - (horizontal, beams) - - - - - UID of structural element at VTP attachment - (radial, beams) - - - - - - - - - - - - - - vtpInterfaceDefType - - - Definition of the interface of the VTP - - - - - - - - - Definition of the VTP interface - - - - - Definition of the VTP attachment frames and - their - reinforcement - - - - - - Defines area for valid x-position of VTP (just - used - if attachmentpoint is directly based on frame) ==> check and - potentially warning message - - - - - - Definition of the max. distance between - fuselage and - the defined VTP pins ==> check and potentially warning - message - - - - - - Definition of reinforcement area at VTP frame - positions (relative coordinate, smaller than - 1.0) - - - - - - Definition of vertical reinforcements at VTP - frame - positions (relative coordinate, smaller than - 1.0) - - - - - - value to change from horizontal to radial - reinforcements for VTP frame plates - - - - - - UID of elements to connect VTP pins with - fuselage - (beam elements) - - - - - - - - - - - - - - - webType - - - - SparWeb type, containing the cross section area of the - spar web and the material properties. - Pleas find below a picture where all spar cross - section parameters as well as the orientation refereneces for - the material definition can be found: - - - - - - - - - - - - - - Material definition of the spar web. - - - - - - relPos ranges from 0 to 1 It defines the - position of the web relative to the caps (see picture below).. - - - - - - - - - - - - - - weightAndBalanceCaseType - - - WeightAndBalanceCase type, containing weight and - balance data for one case - - - - - - - - - - - - - - - - - - - - - - - - weightAndBalanceFuelInTankType - - - - - - - - - - - - - - - - - - Ranges from 0 for empty tank to 1 - - - - - - - - - - - - - - weightAndBalanceFuelInTanksType - - - - - - - - - - - - - - - - - - - - - - weightAndBalanceFuelType - - - - - - - - - - - - - - - - - - - - - - - - - weightAndBalancePayloadType - - - - - - - - - - - - - - - - - - - - - - - - - - Weight and balance - - - WeightAndBalance type, containing weight and balance - datasets - - - - - - - - - - - - - - - - - - - - weightAndBalancemCargosType - - - For a higher ganularity it is possible to add more - information on the actual Cargo that are included in the - operational case. Please note that the information needs to be - identical with the massBreakdown. Hence, only links via uIDs can - be specified. - - - - - - - - - - - - - - - - - - - - - - weightAndBalancemPaxxType - - - For a higher ganularity it is possible to add more - information on the actual Pax that are included in the - operational case. Please note that the information needs to be - identical with the massBreakdown. Hence, only links via uIDs can - be specified. - - - - - - - - - - - - - - - - - - - - - - windowAssemblyPositionType - - - WindowAssembly type, containing an the position of a - windows assembly - - - - - - - - - - UID of the window element to be used - - - - - - x position of window elemment on global x axis - - - - - - z position of window elemment refernce point - - - - - - angle around global x axis to define window - position with respect to positionX and postionZ - - - - - - - - - - - - - - - windowsAssemblyType - - - WindowsAssembly type, containing an assembly of windows - - - - - - - - - - - - - - - - - - - - windowsType - - - Windows type, containing windows - - - - - - - - - - - - - - - - - - - - wingAeroPerformanceType - - - wingAeroPerformance type, containing perfomance maps - with aerodynamic data of a wing. - - - - - - - - - - Reference to the uID of the analysed wing - - - - - - References used for the calculation of the - force and moment coefficients of the wing (in the wing axis - system!) - - - - - Calculated aerodynamic performance maps of the - wing - - - - - - - - - - - - - wingAirfoilsType - - - WingAirfoils type, containing wing airfoil geometries. - See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - Cell of the wing - - - - A cell defines a special region of the wing. Within - this region skin and stringer properties can be defined that - differer from the properties of the rest of the wing. In general - a cell is defined by defining four borders – the cell leading - and trailing edge and the inner border and the outer border. - Those borders can either be defined by using eta/xsi coordinates - or by referencing to spars and ribs. Mixed definitions (e.g. - forward border is defined due to a spar, side borders due to eta - coordinates) is allowed. In general a cell is quadrilateral. But - if e.g. the spar, which is used for the definition of the - trailing edge, has a kink, the cell can have more than four - corners. - The cell leading and trailing edge (= forward and rear - border) can either be defined by referencing to a spar - (->sparUID) or by the defining the xsi (=relative chord) - coordinates of the border (xsi1 = inner end; xsi2 = outer end). - - The cell inner and outer border can either be defined - by referencing to a rib (->ribDefinitionUID and ribNumber) or - by the defining the eta (=relative spanwise) coordinates of the - border (eta1 = forward end; eta2 = rear end). - Some examples for wing cells can be found in the - picture below: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cells of the wing. - - - WingCells type, containing all the cells of the wing. - - - - - - - - - - - - - - - - - - - - Structure of the wing - - - wingComponentSegmentStructure type, containing the - whole structue (skins, ribs, spars...) of the wing. - - - - - - - - - - - - - - - - - - - - - - - Element of the section. - - - - Within elements the airfoils of the wing are defined. - Each section can have one or more elements. Within each element - one airfoil have to be defined. If e.g. the wing should have a - step at this section, two elements can be defined for the two - airfoils. - Mathematically spoken a element is a coordinate system - that is translated, rotated and scaled relative to the section - coordinate system. This transformation parameters are defined - withing the transformation section. The wirfoil, which is linked - by using the parameter airfoilUID is directly 'copied' in the - element coordinate system. If e.g. the airfoil is defined from 0 - to 1 in x-direction and the total scaling of the elements x-axis - equals 3.5 the wing chord is 3.5 m long. - An example for wing element can be found in the - picture below: - - - - - - - - - - - - - - Name of the wing element. - - - - - Description of the wing element. - - - - - - Reference to a wing airfoil. - - - - - - - - - - - - - - - - Elements of the wing. - - - WingElements type, containing the elements of a wing - section. - - - - - - - - - - - - - - - - - - - Border of the fuel tank (either rib or spar). - - - - - - - - - - - - - - Spar uID of the bordering spar. - - - - - - - UID of the rib set of the bordering rib. - - - - - - RibNumber of the rib set of the bordering - rib. - - - - - - - - - - - - - - Definition of the geometry of the wing fuel tank by - defining a continouse list of borders. - - - - - - - - - - - - - - - - - - - - - - Definition of one wing fuel tank. - - - - - - - - - - - - - Name of the wing fuel tank. - - - - - - Description of the wing fuel tank. - - - - - - - - - - - - - - - - - Definition of different volumes of the fuel tank. - - - - - - - - - - - - - - Theoretical volume if material thicknesses - (ribs, spars, skins, stringers) and systems (fuel pumps, - pipes...) are neglected. - - - - - - - Usable fuel volume aircraft operations. - - - - - - Total real fuel tank volume. - - - - - - - - Factor between the usalbe fuel volume and - the real fuel volume. - - - - - Factor between the real fuel volume and the - theoretical optimum fuel volume. - - - - - - - - - - - - - - - List of wing fuel tanks. - - - - - - - - - - - - - - - - - - - - - - Definition of the wing-fuselage attachment - - - - Definition of the wing-fuselage attachment. The area - of the fuselage attachment (resp. center wing box, CWB) is - defined by defining one resp. two ribs from the rib definition. - If one rib is defined (rib1) the CWB goes from the closer end of - the componentSegment (e.g. wing symetry plane) to the defined - rib. If two ribs are defined (rib1 and rib2), the CWB is between - both ribs. - Additionally attachment pins can be defined. At those - positions the wing is attached to the fuselage. This can be e.g. - used for defining the wing-attachment of high wing - configurations, HTPs or VTPs. - - - - - - - - - - - Definition of first (=inner) rib of the - fuselage attachment. - - - - - Definition of the second (=outer) rib of the - fuselage attachment. Optional. Only to be used if attachment is - defined over two ribs. - - - - - Definition of position, orientation, materials - and blocked DOFs of attachment pins. - - - - - Definition of actuators (e.g. trim actuator of - an HTP) of the attachment. - - - - - - - - - - - - - Definition of the wing-fuselage attachment. - - - Definition of the wing-fuselage attachment - - - - - - - - - - - - - - - - - - - wingInterfaceDefinitionsType - - - CenterFuselage high wing interface definitions - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageMainFramesType - - - High wing main frame definition, containing mainframe - UIDs - - - - - - - - - - - - - - - - - - - - - wingInterfaceSupportStrutType - - - wingInterfaceSupportStrut type, containing support - strut definition - - - - - - - - - - Name of support strut. - - - - - Type description: lateral or longitudinal - support strut. - - - - - - - - - - - - - - - - - - wingInterfaceSupportStrutsAssemblyType - - - wingInterfaceSupportStrutsAssembly type, containing - support struts assembly - - - - - - - - - - - - - - - - - - - - Definition of the cell of the intermediateStructure - - - - - IntermediateStructure: - It defines the filling materials between the upper and - lower shell (e.g. honeycombe structures in a smeared - representation). IntermediateStructure is optional.The position - of the intermediateStructure is defined in so called cells (= - special areas on the wing). Default is no intermediateStructure. - - Material Definition of intermediateStructure: - - The material of the intermediateStructure is reference - by 'material'. The material orientation is defined by 'rotX' and - 'rotZ'. 'rotZ' is defined equivalent to the stringer angle resp. - the skin orthotropyDirection. 'rotX' equals a positive rotation - around the wings x-axis, while a rotation of zero is equivalent - to the wing middle plane. - A picture to clarify the reference direction of rotZ - (equivalent to orthothropy direction of the wing) can be found - in the picture below: - - - - Position definition by using cells: - A cell defines a special region of the wing. Within - this region the cell properties are defined. In general a cell - is defined by defining four borders – the cell leading and - trailing edge and the inner border and the outer border. Those - borders can either be defined by using eta/xsi coordinates or by - referencing to spars and ribs. Mixed definitions (e.g. forward - border is defined due to a spar, side borders due to eta - coordinates) is allowed. In general a cell is quadrilateral. But - if e.g. the spar, which is used for the definition of the - trailing edge, has a kink, the cell can have more than four - corners. - The cell leading and trailing edge (= forward and rear - border) can either be defined by referencing to a spar - (->sparUID) or by the defining the xsi (=relative chord) - coordinates of the border (xsi1 = inner end; xsi2 = outer end). - - The cell inner and outer border can either be defined - by referencing to a rib (->ribDefinitionUID and ribNumber) or - by the defining the eta (=relative spanwise) coordinates of the - border (eta1 = forward end; eta2 = rear end). - Some examples for wing cells can be found in the - picture below: - - - - - - - - - - - - - - - - - - Reference to the material of the intermediate - structure. - - - - - 'rotX' equals a positive rotation around the - wings x-axis, while a rotation of zero is equivalent to the wing - middle plane direction. - - - - - 'rotZ' is defined equivalent to the stringer - angle resp. the skin orthotropyDirection. - - - - - - - - - - - - - - IntermediateStructure cells - - - Definition of the intermediateStructure of the - componentSegment of the wing. - - - - - - - - - - - - - - - - - - - Definition of a ribCell - - - RibCells are optional elements. They are defined via a - fromRib and a toRib. The enumeration is within the ribSet. - RibNumber 1 starts at etaStart. - - - - - - - - - - Defines the beginning of the ribCell. The - enumeration is within the ribSet. - - - - - Defines the ending of the ribCell. The - enumeration is within the ribSet. - - - - - WING: The Rotation along the x describes a - rotation around a line, that is defined by the intersection of - the rib with the wing middle plane (orientated from leading to - trailing edge). This angle defaults to 90° which means, that the - rib is perpendicular on the wings middle plane. PYLON: The - Rotation along the z describes a rotation around the pylons - z-axis (= rotation in top view). This angle defaults to 90° - which means, that the rib is perpendicular to the pylons x-axis. - - - - - - The orthotropyDirection is defined as rotation - around the ribs z-axis. The rib coordinate system is defined as - follows: x-axis is from leading to trailingeEdge of the - componentSegment in the direction of the rib elongation. z-axis - is normal to the rib in the direction of positive eta. y is - defined by right hand rule. Rotation is around the z-axis. Zero - degrees are at the x-axis positive direction. - - - - - - - - - - - - - - - - - Cross section properties of a wing rib - - - wingRibCrossSectionType, containing the definition of - ribsCrossSection - - - - - - - - - - The orthotropyDirection is defined as rotation - around the ribs z-axis. The rib coordinate system is defined as - follows: x-axis is from leading to trailingeEdge of the - componentSegment in the direction of the rib elongation. z-axis - is normal to the rib in the direction of positive eta. y is - defined by right hand rule. Rotation is around the z-axis. Zero - degrees are at the x-axis positive direction. - - - - - - WING: The Rotation along the x describes a - rotation around a line, that is defined by the intersection of - the rib with the wing middle plane (orientated from leading to - trailing edge). This angle defaults to 90° which means, that the - rib is perpendicular on the wings middle plane. The rotation - angle is defined at the intersection point of the rib with the - ribReference line. The rib itself is allways straight and not - twisted. PYLON: The Rotation along the z describes a rotation - around the pylons z-axis (= rotation in top view). This angle - defaults to 90° which means, that the rib is perpendicular to - the pylons x-axis. - - - - - - - - Post element definition applied to all vertical intersections with spars - - - - - - - - - - - - - Explicit positioning of a wing rib - - - - Use this type for an explicit positioning of a rib. As opposed to - ribsPositioning, this defines a single rib connecting a specified start - and end point. - - - - - - - - - - - - - Defines the start of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the start of the rib defined by a point on a reference curve - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the beginning of the rib using a specific sparPosition. - - - - - - - - - Defines the end of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the end of the rib given by a point on a reference curve - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the end of the rib using a specific sparPosition. - - - - - - - - Defines the forward beginning of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - RibEnd defines the backward ending of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - - - - - - - - wingRibPointType - - - - The wingRibPointType is used to define reference points on ribs. - It can be used for rib set definitions (wingRibsPositioningType) as - well as explicit rib definitions (wingRibExplicitPositioningType). - - - - - - - - - - - - The UID of the rib definition. Can be a reference to nodes - of either wingRibsPositioningType or wingRibExplicitPositioningType. - - - - - - - For references of type wingRibsPositioningType this node indicates the rib number of the rib set. - If not given it defaults to 1. - - - - - - - Normalized xsi coordinate of the rib point which is measured along the rib - from the start point [0] towards the end point [1]. - - - - - - - - - - - - - - Definition of a set of ribs - - - - RibDefinitionType, containing the definition for ribs. - Ribs are defined in sets of one or more ribs. The positions of - the rib, as well as the orientation of the ribs are defined in - 'ribPositioing'. The cross section properties, as e.g. - materials, are defined in 'ribCrossSection'. - - - - - - - - - - - Name of the rib set - - - - - Description of the rib set - - - - - - - - - - - - - - - - - - - - Wing ribs - - - RibDefinitions type, containing the definition of all - ribs of the wing. - - - - - - - - - - - - - - - - - - - Positioning of a set of wing ribs - - - - The ribsPositioning type allows the definition of a set - of ribs which is distributed over a specified spanwise area. - The positions of the ribs are defined by placing the - ribs on a reference line on the wing (ribReference). The inner - and the outer beginning of the rib set is defined using etaStart - and etaEnd. The position of the forward and rear end of the ribs - is defined by ribStart and ribEnd. The orientation of the ribs - is defined in ribRotation. The number of ribs of the current rib - set is either defined by ribNumber or by spacing. - Three examples how ribs can be placed on the wing are - illustrated in the picture below. For more detailed information, - please refer to the description of each parameter. - - - - - - - - - - - - - - - - Defines the start of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the start of the rib by a point on a reference curve, - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the beginning of the rib using a specific sparPosition - - - - - - - - - Defines the end of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the end of the rib defined by a point on a reference curve - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the end of the rib using a specific sparPosition - - - - - - - - Defines the forward beginning of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - Defines the backward ending of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - - The spacing of the ribs defines the distance between two ribs, - measured on the - ribReferenceLine. First rib is placed at etaStart. - - - - - - - Defines the number of ribs in this ribSet. First rib is at - etaStart on the - referenceLine, last rib is at etaEnd. The spacing is constant on the - ribReferenceLine. - - - - - - - - The ribReference is the reference line for the computation of the rib set spacing. - It can either be a sparUID or "trailingEdge" or "leadingEdge" - - - - - - - - RibCrossingBehaviour can either be 'cross' or 'end'. If it is set to'end' the ribs - of this rib set will end at the intersection with another rib. - If it is set to - 'cross' the ribs of this rib set will continue at the intersection - with another rib. - - - - - - - - - - - - - - - - - - - - - - Section of the wing. - - - - WingSection type, containing a wing section. The - sections contains elements, where the airfoils are defined. For - the definition of a wing at least two sections (root and tip) - have to be defined, but any number greater than 2 is also - possible. - Mathematically spoken a section is a coordinate system - that is translated, rotated and scaled relative to the wing - coordinate system. This transformation parameters are defined - withing the transformation section. - In addition to the translation, which is defined in - the transformation part, the section can be translated by using - the positionings vectors (wing->positiongs). Translation of - the positionings vectors is added to the translation of the - section. - An example for wing sections can be found in the - picture below: - - - - - - - - - - - - - - Name of wing the wing section. - - - - - - Description of the wing section. - - - - - - - - - - - - - - - - - Sections of the wing. - - - WingSections type, containing all the sections of the - wing. - - - - - - - - - - - - - - - - - - - Segment of the wing. - - - - A segment defines which two wing elements (=cross - sections) are linked to one wing segment. - An example for wing segments can be found in the - picture below: - - - - - - - - - - - - - - Name of wing the wing segment. - - - - - - Description of the wing segment. - - - - - - Reference to the element from which the - segment shall start. - - - - - Reference to the element at which the segment - shall end. - - - - - Optional and additional guidecurves to shape - the outer geometry. - - - - - - - - - - - - - - Segments of the wing. - - - WingSegments type, containing all the segments of the - wing. - - - - - - - - - - - - - - - - - - - Shells of the wing - - - Within the wingShellType the upper and lower skin of a - and the skin stringers are defined. At 'skin' and 'stringer' the - skin and stringer properties of the complete componentSegment are - defined. If different skin or stringer properties should be - defined in a special region of the wing this can be done within - 'cells'. - If the stringer should not be defined explicite, they - can be defined implizite by defining an equivalent material layer - and using a composite as material. - - - - - - - - - - - - - - - - - - - - - - Material properties of the wing skin. - - - - The wingSkinType describes the material properties of - the wing. - For composites materials: the positive z-direction is - from the outer side to the inner side. - For composites materials: the reference axis for the - orthotropyDirection is defined by the two leading edge points of - the 'from'- and the 'to'-element of the componentSegment - definition. The angle between the reference axis and the - orthotropyDirection equals the rotation around the z-reference - axis. For details, please refer to the picture below: - - - - - - - - - - - - - - - Material properties of the wing skin. - - - - - - - - - - - - - - Wing spars - - - - Spars type, a spar is defined by sparSegments that - stretch between multiple sparPositions. The spar definition is - very flexible in CPACS. Spars can start and end at any position - of the wing, spars can have kinks at any position of the wing - and spars can cross each other or merge. - At first the spar points (->sparPositions) have to - be defined. Spar points are defined using the relative - coordinates eta and xsi. Spar points do lay on wing middle - plane. - Two or more spar points are connected to on spar - segment (->sparSegments). Each spar segment can be seen as - one spar. The spar geometry between two spar points is defined - as a direct/straight connection in global coordinate system - and not in eta xsi coordinates of the component segment. - One spar point can be used by more than one spar, if - e.g. two spars are merging. The detailed cross section of the - spar is also defined with sparSegments. - Pleas find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - - - - - - - - - - - - - - - - - - - - - Definition of the wing stringers. - - - - Within the wingStringerType wing stringers are - defined. The stringer are defined by referencing on the - stringerStructureUID, where the shape and material settings of - one single stringer is defined. In addition the orientaion and - the stringer pitch have to be defined: - One stringer intersects the point at the given xsi and - eta position. - - - - Alternatively, an exlicit stringer definition can be - applied if the stringers shall be tapered. - - - - - - - - - - - - - This is the simple and default stringer - definition - - - - The pitch describes the distance between to - adjacent stringers in the plane rectangular to the stringer - elongation direction. - - - - - - Stringer angle: the reference axis for the - stringer angle is defined by the two leading edge points of - the 'from'- and the 'to'-element of the componentSegment - definition. The angle between the reference axis and the - stringers equals the rotation around the z-reference axis. For - details, please refer to the picture below. - - - - - - If the reference of the stringer angle shall - be different from the default implementation then this - parameter may be set. Allowed values include: leadingEdge, - trailingEdge and globalY. Furthremore, it is possible to - provide the UID of a spar. - - - - - - This is the explicit stringer definition. - Please note that for a consistent definition two out of the - possible three elements innerBorder (xsiLE, xsiTE), outerBorder - (xsiLE, xsiTE) and stringer angle (and angle reference) must be - defined. Any combination of two of the three is valid - - - - - The number of stringers; default is 0 - - - - - - Stringer angle: the reference axis for the - stringer angle is defined by the two leading edge points of - the 'from'- and the 'to'-element of the componentSegment - definition. The angle between the reference axis and the - stringers equals the rotation around the z-reference axis. For - details, please refer to the picture below. - - - - - - If the reference of the stringer angle shall - be different from the default implementation then this - parameter may be set. Allowed values include: leadingEdge, - trailingEdge and globalY. Furthremore, it is possible to - provide the UID of a spar. - - - - - Inner border xsi coordinate at the leading - edge of the stringer definition - - - - - Outer border xsi coordinate at the leading - edge of the stringer definition - - - - - Inner border xsi coordinate at the trailing - edge of the stringer definition - - - - - Outer border xsi coordinate at the trailing - edge of the stringer definition - - - - - - - - - - - - - - - wingStructuralMountsType - - - - - - - - - - - - - - - - - - - - - - Wing type, containing all a lifting surface (wing, HTP, - VTP, canard...) of an aircraft model. - - - - Wing type, containing all a lifting surface (wing, - HTP, VTP, canard...) of an aircraft model. - Position of the wing: The position of the wing is - defined using the transformation parameters. Using those - parameters, the wing coordinate system is translated, rotated - and scaled. - Definition of the wings outer shape: The outer shape - of the wing is defined by airfoils that are placed within the 3D - space. Two airfoils are combined to one wing segment within the - segments. For the definition of the positions of the airfoils, - differnt sections are defined. Within each section one or more - elements are defined. The airfoil shape is defined within the - elements. If the wings outer shape should e.g. have a step it is - possible to define two different airfoils in one section by - using two elements. In most cases each section will only include - one element. Positionings are vectors that are used for an - additional translation of the sections by using 'user friendly - paramaters' as e.g. sweep and dihedral. Please note, the first - positioning may be non-zero. Often it will be zero just to - locate the wing at the position stated by the translation, but - this is not necessary. Finally the wing segments are defined by - combining two consecutive elements. A more detailed description - is given within the different parameters. - Definition of control surfaces, wing structures, wing - fuel tank and wing fuselage attachment: those parts are defined - within componentSegments. Please refer to the documentation - there. - - - - - - - - - - - - - - Name of the wing. - - - - - Description of the wing. - - - - - UID of part to which the wing is mounted (if - any). The parent of the wing can e.g. be the fuselage. In each - aircraft model, there is exactly one part without a parent part - (The root of the connection hierarchy). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The two elements that where the structural connection - is placed. - - - - - - - - - - - - - Element uID of the element of the CURRENT - componentSegment where the structural connection is placed. - - - - - - Element uID of the element of the second - componentSegment where the structural connection is placed. - - - - - - - - - - - - - - Two spars that are structurally connected. - - - - - - - - - - - - - Spar uID of the CURRENT componentSegment. - - - - - - Spar uID of the second componentSegment. - - - - - - - - - - - - - - wingWingAttachmentType - - - Definition of the structural connection between two - wings resp. two componentSegments. Note: All structural - connections between two wings/componetSegments have to be defined - using wingWingAttachments. The wingWingAttachment has only be - defined in one of the two componentSegments, that are connected. - - - - - - - - - - - UID of the componentSegment, that is connected - with the current one. - - - - - - - Defines if the upper shell of the current - componentSegment is structurally connected to the upper or lower - shell of the second componentSegment. Can have the values - 'upperShell' or 'lowerShell'. - - - - - Defines if the lower shell of the current - componentSegment is structurally connected to the upper or lower - shell of the second componentSegment. Can have the values - 'upperShell' or 'lowerShell'. - - - - - - - - - - - - - wingWingAttachmentsSparsType - - - - - - - - - - - - - - - - - - - - - - List of wingWingAttachments. - - - - - - - - - - - - - - - - - - - - - - wingsAeroPerformanceType - - - wingsAeroPerformance type, containing - wingsAeroPerformance - - - - - - - - - - - - - - - - - - - Wings - - - Wings type, containing all the lifting surfaces (wings, - HTPs, VTPs, canards...) of an aircraft model. - - - - - - - - - - - - - - - - - - - xsiIsoLineType - - - Iso line described by point of same xsi coordinate. - Can be either segment or component segment coordinates. - - - - - - - - - - Relative spanwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta value is considered to be in segment - eta coordinate; if it points to a componentSegment, - then componentSegment eta coordinate is used. - - - - - - - - - - - - - zCouplingType - - - - - - - - - - - - - Reference to the control surface that is - connected to this controll surface by the z-coupling.. - - - - - - Material of the movable part of the - z-coupling. - - - - - Definition of the attachment of the z-coupling - to this control surface. - - - - - Definition of the attachment of the z-coupling - to the other control surface. - - - - - - - - - - - - - - zCouplingsType - - - - - - - - - - - - - Definiton of one z-coupling. - - - - - - - - - - - - - - damTolBehaviourType - - - - - - - - - - - - - Damage tolerance law, Walker approach - - - - - Damage tolerance law, Forman approach - - - - - - - - - - - - - fatigueStressBasedBrownMillerType - - - - - - - - - - - - - Parameter sigma_f [N/m^2] - - - - - Parameter b [-] - - - - - Parameter epsilon_f [-] - - - - - Parameter c [-] - - - - - - - - - - - - - damTolWalkerType - - - - - - - - - - - - - Fracture toughness KIc [Pa m^0.5] - - - - - Parameter C0 [m/cycle] - - - - - Parameter m [-] - - - - - Parameter gamma [-] - - - - - - - - - - - - - damTolFormanType - - - - - - - - - - - - - Parameter Kc [Pa m^0.5] - - - - - Parameter C2 [m/cycle] - - - - - Parameter m2 [-] - - - - - - - - - - - - - - - - - The compartment defines an enclosed volume within the fuselage. It is defined by a set of border geometries. This could be pressureBulkheads, walls or floors and they are referred by their uIDs. The volume is closed with the fuselage skin. The geometry tool has to check, if the compartment definition gives a closed geometry. - - - - - - - - - - - The compartment defines an enclosed volume in the - fuselage. It is defined by a set of border geometries. - This could be pressureBulkheads, walls or floors and - they are referenced by their uIDs. The volume is closed - with the fuselage skin. The geometry tool has to check, - if the compartment definition gives a closed geometry. - - - - - - - - - Compartment geometry uIDs list. - - - - - - - Name of the compartment. - - - - - - - Description of the compartment. - - - - - - - Ideal design volume of the compartment. - - - - - - - - - - - - - - - - - - - - - - - UIDs of 2d structural fuselage elements - (e.g., pressure bulkheads, walls or - floors). The compartment will be - enclosed with the fuselage skin - - - - - - - - - - - - - - fatigueBehaviourType - - - - - - - - - - - - - Fatigue law, stress based Brown Miller approach [N/m^2] - - - - - - - - - - - - - plasticityCurvesType - - - - - - - Plastification curve incl. element elimination (isotropic - materials). The data may be used to describe the plastic behavior of isotropic - materials in non-linear analysis, such as crash simulations. The input is defined - according to the needs of Material 103 (single stress strain option) in the - PAM-CRASH explicit Finite Element code, but can also be used for equivalent material - laws in alternative simulation environment (see PAM-CRASH Solver Reference Manual., - Material 103). - - - - - - - - - - - - - - - - This type describes the plasticity curve of isotropic - materials - - - - ... - - Plastification curve incl. element elimination - (isotropic materials) - - Plastification curve incl. element elimination (isotropic - materials) The data may be used to describe the plastic behavior of - isotropic materials in non-linear analysis, such as crash - simulations. The input is defined according to the needs of Material - 103 (single stress strain option) in the PAM-CRASH explicit Finite - Element code, but can also be used for equivalent material laws in - alternative simulation environment (see PAM-CRASH Solver Reference - Manual., Material 103) - Source: PAM-CRASH V2010 - Notes Manual - - - - - - - - - - - - Name of the post failure definition - - - - - - - Description of the post failure - definition - - - - - - - Strain rate for following plastcity - curve [1/s] - - - - - - - - - - plasticEliminationStrain [-]; Plastic - strain for element elimination during - the non-linear analysis - - - - - - - - - - - - - - - - Definition of wall positions to place - walls inside fuselage. - - - - - - - List of wall segments. - - - - - - - - - - - - Definition of wall positions to place walls inside fuselage. - - - - - - - Wall position definition specifying a point in the fuselage to be connected to a wall segment. - - - - - - - - - - - - - - Wall segment definition. - - - - - - - - - - Definition of a wall position to place walls inside fuselage. - - - - - - - UID of a bulkhead determining the - x-coordinate of the position with the given - y- and z-coordinates. - - - - - - - UID of a wall segment determining the - x-coordinate of the position with the given - y- and z-coordinates. - - - - - - - UID of fuselage section determining the - x-coordinate of the position with the given - y- and z-coordinates. - - - - - - Absolute x-coordinate of wall position in fuselage coordinate system. - - - - - - Absolute y-coordinate of wall position in fuselage coordinate system. - - - - - Absolute z-coordinate of wall position in fuselage coordinate system. - - - - - - - - - - - - Defines extrusion direction. Rotation angle - around fuselage x-axis of extrusion direction. A - value of 0deg means fuselage z-axis as extrusion - direction. Default: 0.0deg. - - - - - - - - - - - - - - By default, the wall is only extruded in positive direction. If doubleSidedExtrusion is true, the wall is additionaly extruded in negative direction as well. Default: false. - - - - - Rotates the first edge of the wall segment so that it is adjacent with the structural element defined in the first wall position (bulkhead, fuselage section or another plane wall). Default: false. - - - - - Rotates the last edge of the wall segment so that it is adjacent with the structural element defined in the last wall position (bulkhead, fuselage section or another plane wall). Default: false. - - - - - - A list of uIDs referencing other - structural/geometric elements that shall serve - as a boundary of the wall element. Possible - references are floor, wall or - genericGeometryComponent. A major requirement is - that the referenced element has an intersection - with the wall for at least the distance between - two wall positions. So that a full geometric - face of the wall is bounded by it. Neighbouring - wall faces that are not completely bounded by - the reference element are not affected. - - - - - - - Reference to the structural property definition - of this wall segment. - - - - - - - List of wall position uIDs that are used for - this wall segment. At least two positions must - be defined (for start and end position of wall). - If more than two positions are referenced here, - the wall is constructed out of several planar - faces that connect two consecutive positions - (Note: Order of position uIDs defines - connectivity). - - - - - - - - - - - A list of uIDs referencing other structural/geometric - elements that shall serve as a boundary of the wall - element. Possible references are floor, wall or - genericGeometryComponent. A major requirement is that - the referenced element has an intersection with the wall - for at least the distance between two wall positions. So - that a full geometric face of the wall is bounded by it. - Neighbouring wall faces that are not completely bounded - by the reference element are not affected. - - - - - - - - - UID referencing another - structural/geometric element that shall - serve as a boundary of the wall element. - Possible references are floor, wall or - genericGeometryComponent. - - - - - - - - - - - - - - - Structural wall reinforcement definition specifying physical properties of a fuselage wall segment. - - - - - - - - - - - - - - Reference to a sheet element definition specifying the physical properties of the wall's shell. - - - - - Reinforcements running along the position polygon of the wall positions. - - - - - Reinforcements running in lateral/radial direction in the wall segment plane. - - - - - Reinforcement at inner side of wall. This is either, depending on the extrusion direction flag, the edge of the wall that connects the positions ("positiveDirection") or the edge of the wall where the wall intersects with the fuselage skin in the opposite direction of the extrusion direction. - - - - - - Reinforcement at outer side of wall. The outer side of the wall is defined as the edge of the wall at the intersection of the wall with the fuselage skin running along the main direction of the wall. - - - - - - - Lateral caps are the reinforcements of - the wall at the edges lateral to the - main direction of the wall. These caps - can be either defined at start, end, - start and end or at all wall positions - according to the placement flag. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Reference to wall position uID. - - - - - - - - - - - - nacelleCowlType - - - - Describes the cowl geometry for nacelles - using sections positioned around the - rotational center of the engine. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - nacelleCenterCowlType - - - - Describes the curve for defining rotational center of the engine. - - - - - - - - - - - - - - - - - - - - - - Aerodynamic performance - - - - The aerodynamic coefficients and derivatives are stored in aerodynamic maps. Individual maps can be used to - gather the aerodynamic characteristics for specific boundary conditions. - - - - - - - - - - - - - - - - - - - - - Aerodynamic map - - - - - The aeroMap contains aerodynamic coefficients and derivatives for a specific set of aerodynamic - and configurative boundary conditions. - - The aeroMap allows for the simultaneous specification of multiple - controlDevice settings. - In this case, it is assumed that a cumulative setting is built by summing up the individual settings. The correct - sequence of this summation is described in the controlDistributorType documentation. - - - - - - - - - - - - Name - - - - - Description - - - - - - - - - - - - - - - - - - - - Boundary conditions - - - Specification of boundary conditions. - - - - - - - - - - - - - - Offset from temperature of the - atmospheric model [K]. For more details - on atmospheric models, please refer to - documentation of the <CPACS> root - element. - - - - - - - Configuration settings - - - - - - - - - - - - - - Control elements - - - Specification of control element settings. Control elements can be controlDistributors - or individual control devices, such as control surfaces or landing gears. - - - - - - - - - - - - - - - - - - - - Control element - - - Specification of an control element setting. A control element can be a controlDistributor - or an individual control device, such as a control surface or a landing gear. - - - - - - - - - - - Reference to the uID of a control device, e.g. a control surface or a landing gear - - - - - Control parameter of the control device - - - - - - - Reference to a control distributor uID - - - - - Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - - - - - - - - Aerodynamic coefficients and derivatives - - - - - Description - - The aeroPerformanceMap contains a map - with aerodynamic data of the complete aircraft in the form of - nondimensional coefficients. The force coefficients in - i-direction (ci) - are nondimensionalized by dynamic pressure and reference area, - the moment coefficients (cmi) by dynamic pressure, reference - area and reference length. - - All coefficients in the aeroPerformanceMap relate to - the aerodynamic coordinate system which is deducted from the CPACS coordinate system by - the transformations of angle of attack and angle of yaw. See the documentation of the - CPACS element for further details. - - The dependend parameters of the aeroPerformanceMap are altitude, - machNumber, angleOfSideslip and - angleOfAttack. These elements are vectors of equal length, where values - with identical indices belong together. The solution vectors ci and - cmi have the same length as the input vectors. Shown below is an example where - with 10 values per vector: - - <altitude mapType="vector">12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02</altitude> -<machNumber mapType="vector">0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2</machNumber> -<angleOfSideslip mapType="vector">0;0;0;0;0;2;2;2;2;2</angleOfSideslip> -<angleOfAttack mapType="vector">-2;0;2;4;6;-2;0;2;4;6</angleOfAttack> -<cd mapType="vector">0.056;0.094;0.132;0.17;0.208;0.072;0.11;0.148;0.186;0.224</cd> -<cs mapType="vector">0.;0.;0.;0.;0.;0.01;0.015;0.02;0.025;0.03</cs> -<cl mapType="vector">-0.1;0.04;0.18;0.32;0.46;-0.08;0.03;0.14;0.25;0.36</cl> - - The aerodynamic coefficients for altitude=1200m, machNumber=0.2, - angleOfSideslip=0° and angleOfAttack=6° can be found at the 5th index: - cd=0.208, cs=0 and cl=0.46. - - - - - - - - - - - - - - - Altitude [m] - - - - - - - Mach number - - - - - - - Sideslip angle [deg] - - - - - - - Angle of attack [deg] - - - - - - - Drag coefficient in aerodynamic - coordinates - - - - - - - Coefficient of the side force vector in - aerodynamic coordinates (perpendicular - to lift and drag) - - - - - - - Lift coefficient in aerodynamic - coordinates - - - - - - - - - - - - - - - - - - - Increment maps for aerodynamic coefficients - - - - - - - - - - - - - - - - - - - Increment map from aerodynamic coefficients - - - The increment map is composed of two-dimensional arrays. The first dimension is given by the - length of the input vectors of the baseline aeroPerformanceMap and the second dimension by the vector of relative - deflections (or command inputs) of control surfaces (or control distributors). An example is described in the <CPACS> - root element. - - - - - - - - - - - - Reference to the uID of a control device, e.g. a control surface or a landing gear - - - - - Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - Reference to a control distributor uID - - - - - Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - Increment of drag coefficient in aerodynamic coordinates - - - - - Increment of coefficient of the side force vector in aerodynamic coordinates (perpendicular to lift and drag) - - - - - Increment of lift coefficient in aerodynamic coordinates - - - - - Increment of cmd - - - - - Increment of cms - - - - - Increment of cml - - - - - - - - - - - - - - Aerodynamic limitations - - - - This map explicitly specifies limitations of a vehicle in terms of angles of attack and sideslip angles. - All vectors, i.e. altitude, machNumber, - angleOfSideslip and angleOfAttack, must have the - same length. To avoid redundancy with the aeroPerformanceMap, this type does not contain - any aerodynamic coefficients. - Since angleOfSideslip and angleOfAttack - are closely interdependent for a given machNumber and altitude - combination, a positive and negative maximum angleOfAttack is defined for a given combination of - machNumber, altitude and - angleOfSideslip. The limits of angleOfSideslip - can be determined by evaluating the nominal decrease of angleOfAttack values or by - agreeint with the data supplier that the minimum and maximum value of the angleOfSideslip - vector corresponds with physical limits. - In order to avoid data redundancy, the operational limits should not reflect the extrema of aerodynamic - coefficients as these can be extracted from the performanceMap via interpolation. - Note: In future CPACS versions, a revision of the aeroLimitsMap - will be targeted, since operational limits are not a purely aerodynamic issue. - - - - - - - - - - - - Altitude [m] - - - - - - - Mach number - - - - - - - Angle of sideslip - - - - - - - - - - - - - - - - Increment maps for limitation values due to movable device deflections - - - Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control - surfaces or landing gears). - - - - - - - - - - - - - - - - - - - Increment maps for limitation values due to movable device deflections - - - Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control - surfaces or landing gears). - - - - - - - - - - - - Reference to the uID of a control device, e.g. a control surface or a landing gear - - - - - Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - Reference to a control distributor uID - - - - - Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - Reference to an increment map of the aeroPerformanceMap - - - - - - Increments of the vehicle operation limits - - - - - - - - - - - - - - Damping derivatives for positive and negative rotation rates - - - - - 0. General overview - - This type contains the damping derivatives. They are - split up into those derivatives for positive rotation rates, - and those for negative rotation rates. - - - - 1. <positiveRates> (optional) - - Damping derivatives, calculated by positive rotation - rates. - - - - 2. <negativeRates> (optional) - - Damping derivatives, calculated by negative rotation - rates. - - - - - - - - - - - - - - - - - - - - - - - Damping derivatives - - - This type contains aerodynamic performance maps with - the damping derivatives. The derivatives are calculated using - rotational rates [rad/s], normalized by: - Rate*ReferenceLength/flow speed. The rotations are performed - around the global axis directions with the aircraft model's - global reference point as origin. The damping derivative - performance maps are vectors of the same length as the input - vectors of the baseline aerodynamic performance maps, consisting of - semicolon separated values. - - - - - - - - - - - Change of cd by normalized roll rate - - - - - Change of cd by normalized pitch rate - - - - - Change of cd by normalized yaw rate - - - - - Change of cs by normalized roll rate - - - - - Change of cs by normalized pitch rate - - - - - Change of cs by normalized yaw rate - - - - - Change of cl by normalized roll rate - - - - - Change of cl by normalized pitch rate - - - - - Change of cl by normalized yaw rate - - - - - Change of cmd by normalized roll rate - - - - - Change of cmd by normalized pitch rate - - - - - Change of cmd by normalized yaw rate - - - - - Change of cms by normalized roll rate - - - - - Change of cms by normalized pitch rate - - - - - Change of cms by normalized yaw rate - - - - - Change of cml by normalized roll rate - - - - - Change of cml by normalized pitch rate - - - - - Change of cml by normalized yaw rate - - - - - - - - - - - - - Vehicle operation limit - - - Vehicle operation limit defined by sets of minimum and maximum angleOfSideslip - and minimum and maximum angleOfAttack for a given altitude and Mach number. - This might be, e.g., a safety margin to the angle of attack at maximum lift or the flight - attitude a fighter aircraft is capable to fly in stalled conditions. The corresponding aerodynamic coefficients must - be extracted from the aeroPerformanceMap. - - - - - - - - - - Minimum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] - - - - - Maximum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] - - - - - - - - - - - - - Operation Limit Increments - - - Changes of the deltas of operation limit angles with respect to the corresponding increment aeroPerformanceMaps. - Values are specified as an array with same indices like the corresponding increment map. - - - - - - - - - - Minimum delta angle of attack [deg] - - - - - Maximum delta angle of attack [deg] - - - - - - - - - - - - - Toolspecific data - - - - This type contains a list of tools each specifying some basic tool information as well as the actual toolspecific part. - - The toolspecific elements must be defined in a separate namespace which can be specified and linked with the corresponding XSD file - in the CPACS header: - <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd" - xsi:schemaLocation="http://www.cpacs.de/myTool pathToToolspecificSchemaFile/toolspecific_myTool.xsd"> - - A simple example could look like this: - <toolspecific> - <tool> - <name>myToolName</name> - <version>1.2.3</version> - <myTool xmlns="http://www.cpacs.de/myTool" schemaVersion="1.0"> - <parentElement> - <childElement1>stringValue</childElement1> - <childElement2>1.0</childElement2> - </parentElement> - </myTool> - </tool> -</toolspecific> - - - - - - - - - - - - - - - - - - - - Tool identification - - - - Tool information as described in the toolspecificType. - - - - - - - - - - - - Name of the tool - - - - - - - Version of the tool - - - - - - - Wildcard for the root element of a toolspecific namespace - - - - - - - - - - - - - - Global analysis information - - - - - - - - - - - - - - - - - - - - - - - Load application points - - - - Multiple sets of scattered load application points can be defined. However, no specific information about the corresponding loads (e.g. whether aerodynamic or structural loads are involved) or mesh topologies are specified here, as such assumptions are tool-specific. - - - - - - - - - - - - - - - - - - - - - Load application point set - - - - - A point set contains discrete spatial points at which loads are applied (e.g., aerodynamic or structural loads). A typical procedure in CPACS is as follows: - - - - Reference a wing, fuselage or control surface by its uID using the componentUID node. - Define a reference axis through the above component with the loadReferenceLine element to specify where a load distribution shall be applied. - Compute the intersections with (e.g.) ribs of the referenced component (wing, fuselage or control surface) and write the results into loadApplicationPoints. This procedure results from common practice where the forces in structural analyses are typically introduced at structural elements such as ribs and spars. With respect to preliminary aircraft design a two-dimensional load distribution is preferred. However, an arbitrary distribution of the load application points is possible (without the intersection of structural elements with a reference axis in the previous step), for example to define discrete load distributions on the wing surface in streamwise and spanwise direction. - Specify the location and orientation of cut loads in the cutLoadIntegrationPoints element and the corresponding connectivity information in the connectivities node. - - - - - - - - - - - - - - - - - UID of a wing, fuselage or control surface - - - - - - - Reference axis (line) for load distribution - - - - - - - List of points at which load vectors are - applied to - - - - - - - List of points at which cut loads are applied to - - - - - - - Specification of connectivity properties between points - - - - - - - - - - - - - - - Vehicle configurations - - - - List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) - - - - - - - - - - - - - - - - - - - - - Vehicle configurations - - - - List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) - - - - - - - - - - - - Name - - - - - - - Description - - - - - - - - - Deck configurations - - - - - - - - - - - - - - - Internal pressure of a deck - - - - - - - - - - - Internal pressure of a fuselage, deck or compartment - - - - - - - - - - - - - - Cabin pressure - - - - Internal pressure of a fuselage, deck or compartment - - - - - - - - - - - - UID of a fuselage, deck or compartment - - - - - - - Internal pressure [Pa] - - - - - - - - - - - - - - Load set - - - A set of forces and moments - - - - - - - - - - - Description - - - - - - - UID of load application point set (analysis/global/loadApplicationPoints) - - - - - - - Force in x-direction [N] - - - - - - - Force in y-direction [N] - - - - - - - Force in z-direction [N] - - - - - - - Moment around x-axis [Nm] - - - - - - - Moment around y-axis [Nm] - - - - - - - Moment around z-axis [Nm] - - - - - - - Nodal displacement in x-direction [m] - - - - - - - Nodal displacement in y-direction [m] - - - - - - - Nodal displacement in z-direction [m] - - - - - - - Nodal rotation around x-axis [deg] - - - - - - - Nodal rotation around y-axis [deg] - - - - - - - Nodal rotation around z-axis [deg] - - - - - - - Load brake-down - - - - - - - - - - - - - - - Load sets - - - - A list of load sets - - - - - - - - - - - - - - - - - - - - - Aerodynamic load cases - - - - Combines a set of aerodynamic load cases - - - - - - - - - - - - - - - - - - - - Aerodynamic load case - - - - Specification of an aerodynamic load case - - - - - - - - - - - - Name - - - - - - - Description - - - - - - - - - - - - - - - - - - Specification - - - - Specification of the vehicle properties and dynamics - - - - - - - - - - - Altitude - - - - - - - Mach number - - - - - - - Angle of sideslip [deg] - - - - - - - - Angle of attack [deg] - - - - - - - Target lift coefficient - - - - - - - - Normalized roll rate [rad/sec]. It is specified around the global x-axis - with the aircraft model's global reference point as origin and - nondimensionalized by: pStar = p * reference length / flow speed. - - - - - - - Normalized pitch rate [rad/sec]. It is specified around the global y-axis - with the aircraft model's global reference point as origin and - nondimensionalized by: qStar = q * reference length / flow speed. - - - - - - - Normalized yaw rate [rad/sec]. It is specified around the global z-axis - with the aircraft model's global reference point as origin and - nondimensionalized by: rStar = r * reference length / flow speed. - - - - - - - - Reference to a weight and balance description - - - - - - - - - - - - Aerodynamic loads - - - - Description of the aerodynamic loads - - - - - - - - - - - - Angle of attack [deg] - - - - - - - Angle of sideslip [deg] - - - - - - - - - - - - - - - - Aerodynamic loads of components - - - - Specification of the aerodynamic loads of components - - - - - - - - - - - - - - - - - - - - Aerodynamic data of components - - - - Aerodynamic data of individual components of the aircraft (e.g. control surface loads and hinge moments) - - - - - - - - - - - - Reference to a component uID - - - - - - - - - - - - - - - Aerodynamic loads of the vehicle - - - - Description of the aerodynamic loads of the vehicle - - - - - - - - - - - - - - - - - - - - - Aerodynamic coefficients - - - - A set of aerodynamic coefficients in the aerodynamic coordinate system - - - - - - - - - - - - Drag coefficient in aerodynamic - coordinates - - - - - - - Coefficient of the side force vector in - aerodynamic coordinates (perpendicular - to lift and drag) - - - - - - - Lift coefficient in aerodynamic - coordinates - - - - - - - Aerodynamic moment around d-axis of the aerodynamic coordinate system - - - - - - - Aerodynamic moment around s-axis of the aerodynamic coordinate system - - - - - - - Aerodynamic moment around l-axis of the aerodynamic coordinate system - - - - - - - - - - - - - - - Drag contributions - - - - The drag contributions relate to different physical mechanisms. The sum of the contributions does not have to be equal to the total drag. - - - - - - - - - - - - Drag contributions due to the displacement of the flow around a component. Zero for irrotational two-dimensional flows. - - - - - - - Drag contributions due to shear forces on surfaces - - - - - - - Drag contributions due to friction - - - - - - - Drag contributions due to energy loss through vortex structures caused by the pressure difference between the upper and lower sides of three-dimensional lifting surfaces. - - - - - - - Drag contributions due to mixing of streamlines between airframe components (e.g., interaction between wing and fuselage or pylon and wing). - - - - - - - Drag contributions due to energy dissipation in shock waves - - - - - - - Drag contributions due to trimmed aircraft configuration - - - - - - - - - - - - - - Aerodynamic coefficients breakdown - - - - - Breakdown of the total aerodynamic coefficients into contributions - from the various vehicle componenents. A detailed breakdown is only specified - for the wing. Other components, such as the fuselage, are more generically - referred to as otherComponents. Since - the sum of the contributions within a breakdown must equal the total - coefficients, the remaining contributions must be listed in - remainingContributions. - - - The remainingContributions cannot be defined alone. Either the - definition of a wing, otherComponents - or both together is valid and can be combined with remainingContributions. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of the wings - - - - Contains a list of wings for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a wing - - - - - Describes the contributions of a specific wing to the total aerodynamic coefficients of a vehicle - - - It is obligatory to reference a wing via its uID and to provide its - coefficients. The breakdown of the coefficients comprises the segments - and remainingContributions. The latter must only be specified if segments - is given. - - - - - - - - - - - - - Reference to a wing uID - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of wing segments - - - - Contains a list of wing segments for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a wing segment - - - - - Describes the contributions of a specific wing segment to the total aerodynamic coefficients of a wing - - - It is obligatory to reference a segment via its uID and to provide its - coefficients. The breakdown of the coefficients comprises the strips - and remainingContributions. The latter must only be specified if strips - is given. - - - - - - - - - - - - - Reference to a wing segment uID - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of strips within a wing segment - - - - Contains a list of strips within a wing segment for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a strip within a wing segment - - - - - Describes the contributions of a specific strip within a wing segment to the total aerodynamic coefficients of a wing segment - - - The strip extends spatially between two eta coordinates (i.e., from an inner border to an outer border). - In order to avoid redundancy, the inner border (denoted as from) is always identical to the outer border of the previous strip (denoted by to). - Accordingly, only the to-border can be specified explicitly, while the from-border equals implicitly either to 0 - (for the first strip) or the toSegmentEta value of the previous element. The toSegmentEta of the last strip - must be equal to 1! - - - It is obligatory to provide the coefficients of the strip. The breakdown comprises the chordwiseParts - and remainingContributions. The latter must only be specified if the breakdown into chordwiseParts - is given. This breakdown is optional. If it is specified, but the sum of all chordwiseParts does not match the strip coefficients, one or more remainingContributions may be applied - to ensure consistency (sum of all chordwiseParts + sum of all remainingContributions must be equal to total strip coefficients). - - - - - - - - - - - - - Spanwise coordinate eta in the segment coordinate system to define the end of the strip - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a chrordwise part within a wing segment strip - - - - Contains a list of chordwise parts within a wing segment strip for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a chordwise part within a within a wing segment strip - - - - - Describes the contributions of a specific par within a wing segment to the total aerodynamic coefficients of a wing segment strip - - - A chordwisePart aescribes the contributions of a specific chordwise part within a wing strip - to the total aerodynamic coefficients of this strip. It extends spatially between the two eta - positions of the parent strip (see strip documentation) and four xsi positions in the segment coordinate system. - As with the parent stips, only the trailing border (..ToSegmentXsi) of a chordwisePart is defined, while the leading border always equals the trailing border of the preceding chordwisePart (or 0 for the first part). - To account for oblique trailing borders (e.g., to match the aileron on a tapered wing) two different toSegmentXsi positions can be defined, one at the inner border (innerBorderToSegmentXsi) and one at the outer border (innerBorderToSegmentXsi) of the parent strip. - The innerBorderToSegmentXsi and outerBorderToSegmentXsi of the last chordwisePart must be equal to 1. - - - - - - - - - - - - - Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the inner eta border - - - - - - - Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the outer eta border - - - - - - - - - - - - - - - - Remaining contributions to aerodynamic coefficients - - - - This node lists the remaining contributions which were not specified so that the sum of the coefficients are equal to the total coefficients. - - - - - - - - - - - - - - - - - - - - Remaining contribution to aerodynamic coefficients - - - - This node lists a remaining contribution which was not specified so that the sum of the coefficients are equal to the total coefficients. - - - - - - - - - - - - Name - - - - - - - Description - - - - - - Type (numerical/unspecified): "numerical", for example, describes rounding errors to clearly - separate them from other effects currently labeld as "unspecified". - The latter usually summarizes physical effects such as viscosity and should be further described via "description". - The approach is currently being tested in practice in order to derive a robust definition of categories in the future. - - - - - - - - - - - - - - - - - - - - - - - - Reference values for aerodynamic coefficients - - - - Specification of reference values for aerodynamic coefficients. - - - - - - - - - - - - Reference area - - - - - - - Reference lengt - - - - - - - Reference point - - - - - - - Reference translation - - - - - - - Reference rotation - - - - - - - - - - - - - - Aerodynamic contributions of the components - - - - Contains a list of components for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a component - - - - Describes the contributions of a specific component to the total aerodynamic coefficients - - - - - - - - - - - - Reference to a component - - - - - - - - - - - - - - - Atmospheric model - - - Available options: ISA. See documentation of <CPACS> root element for further details. - - - - - - - - - - - - - - - - - - Flight Envelopes - - - - Specification of flight envelopes - - - - - - - - - - - - - - - - - - - - - Flight Envelope - - - - Specification of a flight envelope - - - - - - - - - - - - Offset from temperature of the atmospheric model [K] - - - - - - - - - - - - - - - Flight envelope speed - - - - Specification of the V-speed - - - - - - - - - - - - - Vector with altitudes - - - - - - - Vector with True Airspeeds - - - - - - - - - - - - - - Speed designators - - - - Provides an enumerated list of V-speeds as defined by regulations. - - - - - - - - - - - Design maneuvering speed - - - - - - - Design speed for maximum gust intensity - - - - - - - Design cruise speed, used to show compliance with gust intensity loading - - - - - - - Design diving speed, the highest speed planned to be achieved in testing - - - - - - - Designed flap speed - - - - - - - Stall speed or minimum steady flight speed for which the aircraft is still controllable - - - - - - - Stall speed or minimum flight speed in landing configuration - - - - - - - Stall speed or minimum steady flight speed for which the aircraft is still controllable in a specific configuration - - - - - - - Minimum control speed - - - - - - - Never exceed speed - - - - - - - Maximum operating limit speed - - - - - - - - - - - - - Landing gear base - - - - Base type for landing gears (i.e. nose gear, main gear and skid gear). - An example of a nose and main gear is shown below: - - - - - - - - - - - - - - Name - - - - - Description - - - - - UID of the parent component. If set, the position of the main strut is defined relative to the parent coordinate system. - - - - - - - - - Total length of landing gear, equals the distance from the middle of the bogie/axles to the axis of rotation of the pintle strut. Distance is measured while landing gear is fully extended and in airborne condition (i.e., if a spring is present, the totalLength includes the springDeflectionLength) - - - - - Static suspension travel means the positive distance between the total length in airborne condition and the reduced length due to compression on the ground. - - - - - Compressed suspension travel means the positive distance between the total length in airborne condition and the maximum reduced length due to maximum compression on the ground (e.g., landing shock). - - - - - - - Transformation with respect to the uppermost point of the main strut. From this point the landing gear is oriented in negative z-direction by default. - - - - - - - - - - - - - - - - - - - - - - - - - Landing gear control parameters - - - - Parameters of a landing gear control such as extraction or steering. - - - - - - - - - - - - Retraction angle of the main landing - gear. Equals a rotation around the - global z-axis in degrees. 0 = retraction - to the front; 90 = retraction to the - left; 180 = retraction to the rear; 270 - = retraction to the right. - - - - - - - - Distance of the center of rotation to the top of the main strut - for retracting and extending the landing gear. I.e., a value of - 0 means that the landing gear will rotate around the upper end - of the main strut during retraction. If this value is greater - than 0, the center of rotation is shifted by this value above - the main strut end point (translation along the main strut axis). - - - - - - - - - - - - - - Landing gear control functions - - - - - A list of functions which can be addressed by the controlDistributor. - - - - - - - - - - Extension path - - - - - Steering path - - - - - Braking state - - - - - - - - - - - Braking function - - - - - Describes the braking state of the landing gear. - - - - - - - - - - Control parameter indicating that the brake is set - - - - - Control parameter indicating that the brake is released - - - - - - - - - - - - Steering path - - - - - Describes the steering path of the landing gears via a list of steps. - - - - - - - - - - Step within the steering path - - - - - - - - - - - - Steering step - - - - - Describes a step with the steering path of the landing gear. - - - - - - - - - - Step type (centered, fullBackboard or fullStarboard) - - - - - - - - - - - - Control parameter - - - - - Steering angle [deg] - - - - - - - - - - - Extension path - - - - - Describes the extension path of the landing gears via a list of steps. - - - - - - - - - - Step within the extension path - - - - - - - - - - - - Extension step - - - - - Describes a step with the extension path of the landing gear. Make sure to provide a least one step with stepType=extracted! - - - - - - - - - - Step type (retracted or extracted) - - - - - - - - - - - - Control parameter - - - - - Extension angle of the main strut [deg] - - - - - - - - - - - Assembly of landing gear components - - - - - Describes an assembly of the various landing gear components - - - - - - - - - - - - Main strut - - - - - - - - - - Drag strut (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) - - - - - - - - - - - Pintle strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) - - - - - Pintle strut (one or two pintle struts are supported) - - - - - - - - Side strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) - - - - - - - - - - - - Strut assembly - - - Geometric description, spatial placement and specification of material parameters - - - - - - - - - - Strut properties - - - - - The starting point of the support strut must connect to the main strut. This element specifies the relative position on the main strut (0 -> top end, 1 -> bottom end). - - - - - - - - - - - - End position in absolute coordinates. Coordinates are relative to parent if it has a parentUID reference (otherwise global). - - - - - End position in eta/xsi/relHeight coordinates - - - - - End position as a relative position on another strut of this landing gear - - - - - - Attachment to an aircraft wing or fuselage component - - - - - Reference to an actuator uID - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Strut properties - - - - - Geometric description and material properties - of a strut - - - - - - - - - - - - - (Outer) radius of the strut - - - - - - Material of the strut - - - - - Inner radius of the strut - - - - - - - - Reference to structural element for a more - detailed cross section definition - - - - - - - - - - - - - - - - Definition of the wing attachment - - - - - Definition of the wing attachment, if - attached to the wing. The definition - includes the position of the landing gear as - well as the information to which spars resp. - supportBeam the gear is attached. - - - - - - - - - - - - UID of the second spar, where the landing gear is attached to. Only used, if the landing gear is attached between two spars. - - - - - - UID of a set of ribs (ribDefinition) - - - - - Number of the rib in the rib set (ribDefinition) - - - - - - - - UID of the structural mount - - - - - - - - - - - - - - - Main landing gear support beam - - - - Definition of the main landing gear support beam, if a - support beam is used for the attachment. The defintion includes - cross section properties as well as the position of the support - beam. - - - - - - - - - - - - - - - - - - - - - framePositionUIDs of the frame - - - - - A framePostion defines a location where a frame in mounted. - - - - - - - - - - - framePositionUID of the frame, where the landing gear - is attached to. - - - - - - - - - - - - - Position of the landing gear on a wing - - - - Definition of the position of the landing gear - (intersection point of main strut and pintle sturt) on a wing, - using relative componentSegment coordinates - - - - - - - - - - Relative height of spar or rib at which landing gear is attached. - - - - - - Relative spanwise position (eta) of spar at which landing gear is attached. - - - - - Relative chordwise position (xsi) of the rib at which landing gear is attached. - - - - - - - - - - - - - Definition of the main landing gear support beam - position - - - Definition of the main landing gear support beam - position - - - - - - - - - - Relative chordwise coordinate (xsi) of the - inner end of the support beam. The eta - position of the inner end is defined by the eta position of the - wing root (=wing-fuselage attachment). - - - - - Relative spanwise coordinate (eta) of the - outer end of the support beam. The xsi - coordinate of the outer end is defined by the spar position - (first spar), where the support beam is attached to. - - - - - - - - - - - - - - Configuration - - - - Contains references to control control devices and (or) the global aircraft configuration node. - - - - - - - - - - - - - Reference to the aircraft configuration node (aircraft/model/configurations/configuration) - - - - - - - State description of the control elements - - - - - - - - - - - - - - Standard profile - - - - - - - - - - - - - - - - - - - - - - - Rectangle - - - - The width of the profile is always 1, since scaling is performed after referencing it (e.g., in the fuselage). - The resulting profile is defined by the following equation: - - - - with c = cornerRadius and r = heightToWidthRatio. - Example: Rectangle with cornerRadius=0.125 and heightToWidthRatio=0.5 - - - - - - - - - - - - - - - - - - Corner radius - - - - - - - - - - - - - - - - - - Height-to-width ratio - - - - - - - - - - - - - - - - Superellipse - - - - A profile based on superellipses is composed of an upper and a lower semi-ellipse, which may differ from each other in their parameterization. The total width and height of the profile is always 1, since scaling is performed after referencing (e.g., in the fuselage). - This lowerHeightFraction describes the portion of the lower semi-ellipse on the total height. - The resulting profile is defined by the following set of equations: - - - - - - - with - - - - The following examples indicate the various possibilities of parametric profiles: - Example 1: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (0.5; 2; 5; 3; 0.25) - - - - Example 2: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (2; 2; 2; 2; 0.5) = a circle - - - - Example 3: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (1; 1; 1; 1; 0.5) = a square / diamond - - - - Note: For exponents that are infinitely large, the superellipse converges to a rectangle. However, the value Inf is not a valid entry at this point. Use the square element instead. - - - - - - - - - - - Exponent m for upper semi-ellipse - - - - - Exponent n for upper semi-ellipse - - - - - Exponent m for lower semi-ellipse - - - - - Exponent n for lower semi-ellipse - - - - - - Fraction of height of the lower semi-ellipse relative to the total height - - - - - - - - - - - - - - - - - - - - Performance Cases - - - - Definition of missions and point performance events to evaluate the performance of a vehicle. - The definition of performance cases is independent from a specific vehicle. - - - - - - - - - - - - - - - - - - - - - - - - UID of the runway - - - - - - - Offset from runway threshold in cartesian coordinates in the runway coordinate system - - - - - - - - - - - - - - - - UID of the runway - - - - - - - Offset from runway threshold in cartesian coordinates in the runway coordinate system - - - - - - - - - - - - - - - Requirements - - - - Requirement settings for the point performance definition - - - - - - - - - - - Sustained load factor to be achieved - - - - - - - Instantaneous load factor to be achieved - - - - - - - Specific excess power to be achieved [m/s] - - - - - - - Roll rate to be achieved [deg/s] - - - - - - - Roll acceleration to be achieved upon control onset [deg/s^2] - - - - - - - Roll acceleration to be achieved upon control stop [deg/s^2] - - - - - - - - - - - - - - Controllability requirements - - - Contains a list of controllability requirements - - - - - - - - - - - - - - - - - - - - Trim requirements - - - Contains a list of trim requirements - - - - - - - - - - - - - - - - - - - - - Controllability requirement - - - - - - - - - - Name - - - - - Description - - - - - UID of point performance definition - - - - - UID of weight and balance description - - - - - - - - - - - - - - - - - Trim requirement - - - - - - - - Name - - - - - Description - - - - - UID of a predefined flight point - - - - - UID of weight and balance description - - - - - - - - - - - - - - - Trim - - - - Provides a list of trim cases - - - - - - - - - - - - - - - - - - - - - - Trim case - - - - - - - - - - - - - - Name - - - - - Description - - - - - UID of trim requirement - - - - - - - Description of the linear model - - - - - - - - - - - - - - Turn - - - - - - - - - - - - - ... - - - - - ... - - - - - - - - - - - - - - Level flight - - - - - - - - - - - - - - Specific excess power - - - - - - - - - - - - - - Climb - - - - - - - - - - - - - - - - - - - - Descent - - - - - - - - - - - - - - - - - - - - Environmental conditions - - - - Specification of environmental conditions - - - - - - - - - - - - Delta temperature - - - - - - - - - - - - - - Flight Cases - - - - - - - - - - - - - - - - - - - - - - - - Flight point - - - - - - - - - - - - - - - - - - - - Mach number - - - - - - - Calibrated air speed - - - - - - - True air speed - - - - - - - - - - - - - - - - - Configurations which apply for this performance requirement - - - - - - - - - - - - - - - - Default configuration uID - - - - - - - - - - - - - - - Specific configuration uIDs - - - - - - - - - - - - - - - - - - - - - - - - Connection between segments, pointPerformances and a configurationUID - - - - - - - - - - - - - - - - Configuration uID - - - - - - - - List of pointPerformanceUIDs - - - - - - - - - - - - - - Segments - - - - - - - - - - - - - - - - - - - - - - - - Specification of a segment uID and index of the parameter lapses - - - - - - - - - - - - - - - - - Vector with semicolon separated indices of the parameters within a segment. If not given then the complete segment is applied. - - - - - - - - - - - - - - Released stores - - - - - - - - - - - - - - - - - - - - - - - - Released store - - - - - - - - - - - - - - - - UID of the released store. - - - - - - - Quantity of the released store. - - - - - - - - - - - - - - Runway start position - - - - - Description of the vehicle on the runway relative to the runway threshold. - - - - - - - - - - - - - - X-position in cartesian coordinates in the runway coordinate system - - - - - - - Y-position in cartesian coordinates in the runway coordinate system - - - - - - - Z-position in cartesian coordinates in the runway coordinate system - - - - - - - - - Lengthwise distance along the runway centerline from the runway threshold - - - - - - - Lateral offset from the runway centerline. Positive values on the starboard side. - - - - - - - - - - - - - - - Ducts - - - - - - - - - - - - - - - - - - - - Duct assembly - - - - - - - - - - - Name - - - - - - - Description - - - - - - - UID of part to which the duct is - mounted (if any) - - - - - - - - - - - - - - - - - - Duct - - - - - - - - - - - Name - - - - - - - Description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Duct structure - - - - - - - - - - - - - - - - - - - - - List of fuselage fuel tanks integrated in compartments. - - - - - - - - - - - - - The integral fuel tank geometry is defined by a link to a fuselage geometry compartment. -The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - - - Definition of one fuel tank integrated in a fuselage compartment. - - - The definition of fuselage tanks is still preliminary. - Currently, there is no link to any structural elements - - - - - - - - - - - Name of the fuselage fuel tank. - - - - - - Description of the fuselage fuel tank. - - - - - - Link to the tank geometry defined by a compartment. - - - - - - - - - - - - - - - - - - - Generic fuel tank - - - - - - - - - - - - - - - - - - - - - - Cryogenic tank - - - - - - - - - - Name - - - - - - Description - - - - - - - - Volume - - - - - Burst pressure - - - - - - - - - - - - - - Hulls - - - - - - - - - - - - - - - - - - - Hulls - - - - - - - - - - Name - - - - - - Description - - - - - - - - - - - - - Inner radius of the cylinder - - - - - Inner length of the cylinder - - - - - - - - - - - - - - - - - - - Dome Type - - - - - - - - - - - - - - - - - - - - - - - - Ellipsoid dome - - - - - - - - - - Half axis fraction - - - - - - - - - - - - - Torispherical dome - - - - - - - - - - R1: dish radius - - - - - R2: knuckle radius - - - - - - - - - - - - - Isotensoid dome - - - - - - - - - - Radius of the fitting/smaller polar opening - - - - - - - - - - - - - Structure - - - - - - - - - - - - - - - - - - - - - - - - Skin Layers - - - - - - - - - - - - - - - - - + + + + + + + + + + + + CPACS root element + + + + + Version + + V3.3 + + Date + + 2020-06-03 + + + + 1. Overview + + The Common Parametric Aircraft Configuration Scheme (CPACS) is an XML-based data format for describing aircraft configurations and their corresponding data. + This XML-Schema document (XSD) serves two purposes: (1) it defines the CPACS + data structure used in the XML file (e.g., aircraft.xml) and + (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., Tixi or + XML tools in Eclipse) parses the XSD and XML files and validates whether the data set defined by the user (or tool) conforms to the given structure defined by the schema. + + + + This documentation explains the elements defined in CPACS and its corresponding data types. + Data types can either be simple types (string, double, boolean, etc.) or + complex types (definition of attributes and sub-elements to build a hierarchical + structure). In addition, the sequence of the elements and their occurrence is documented. + To link the XML file to the XSD file, the header of the XML file should specify the path of the schema file. + An example could look like this: + <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + + CPACS is an open source project published by the German Aerospace Center (DLR e.V.). For further information please visit www.cpacs.de. + + + + + 2. Data hierarchy + + CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. + For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. + + + + + + + 3. Coordinate Systems + + Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. + The CPACS coordinate system is the coordinate system identified by TIGL, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. + Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. + The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. + The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. + + + + Axis + + + Direction + + + Description + + + + x + tailwards + from nose to tail + + + y + spanwise + from symmetry plane to the right wingtip + + + z + upwards + from landing gear to tip of vertical tailplane + + + The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. + + + + The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + + + + The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. + + + + The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. + + + + Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + + + + 4. Units + + There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: + + + [m] + Position, Distance + + + [m^2] + Area + + + [m^3] + Volume + + + [kg] + Mass + + + [s] + Time + + + [K] + Temperature + + + or in derived units, e.g.: + + + [N] + Force + + + [Nm] + Moment + + + [W] + Power + + + [J] + Energy + + + The only non SI unit used throughout CPACS is the angle in degrees [°]. + For the sake of an intuitive use the angles are given in degrees rather than in radian [rad]. + + + [°] + Angle + + + + + + 5. Splitting up a CPACS dataset into several files + + To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: + <?xml version="1.0" encoding="utf-8"?> +<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + <vehicles> + <profiles> + <wingAirfoils> + <externaldata> + <path>file:://airfoils</path> + <filename>NACA0010.xml</filename> + <filename>NACA2412.xml</filename> + </externaldata> + <airfoil uID="NACA0012"> + <name>NACA 0012 Airfoil</name> + <pointList>...</pointList> + </airfoil> + </wingAirfoils> + </profiles> + </vehicles> +<cpacs> + Such an external file would look like: + <?xml version="1.0" encoding="utf-8"?> +<airfoil uID="NACA0010"> + <name>NACA 0010 Airfoil</name> + <pointList>...</pointList> +</airfoil> + The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), then it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). + For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given: + + Absolute local path: "file:///tmp" or "file:///c:/windows/tmp" + Relative local direcotry: "file://relativeDirectory" or "file://../anotherRelativeDirectory" + Remote net ressource: "http://www.someurl.de" + + A CPACS dataset with external files, being loaded by a special library like the TIVA XML Interface TIXI, shall collect all its external datafiles and build up a single tree from them. A validation against this schema is only possible for such a single tree file; the <externaldata>nodes are not recognized by it. To preserve the information, necessary to split the file up into external files again later, externaldata information is maintained within three attributes of the former external top node: + + externalFileName - Name of the file where the external data shall be saved + externalDataDirectory - Directory of the external data file. Its content is analogous to the <externaldata>'s <path>node described above. + externalDataNodePath - XPATH of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPATH in the outer external file. If, e.g., in the example above the <pointList>node would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. + + The single tree for the example above would look like: + <?xml version="1.0" encoding="utf-8"?> +<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + <vehicles> + <profiles> + <wingAirfoils> + <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils"> + <name>NACA 0010 Airfoil</name> + <pointList>...</pointList> + </airfoil> + ... + <airfoil uID="NACA0012"> + <name>NACA 0012 Airfoil</name> + <pointList>...</pointList> + </airfoil> + </wingAirfoils> + </profiles> + </vehicles> +<cpacs> + + + + 6. UIDs and references + + The CPACS-dataset often uses references between nodes. Typically, these + references define connections between elements which are located somewhere else in the hierarchical dataset (e.g. a wing is connected to a + fuselage; a specific engine is connected to a pylon; etc.). These connections are defined by + unique identifiers (uID) which are specified as attributes. Thus, there are elements which can be referenced via a uID attribute, e.g. a fuselage: + <fuselage uID="ATTAS_fuselage">... + + as well as elements which refer to the former, e.g. a wing pointing to its geometrical parent: + <wing uID="e382bf5j"> + <name>ATTAS main wing</name> + <parentUID isLink="True">ATTAS_fuselage</parentUID> + ... + Such referencing elements must carry the isLink="True" attribute. + + Since uIDs are only used to link nodes within the XML file, no naming convention is required. UIDs, however, must be unique! + Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), + uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element + to convey human-readable meanings. + + + + 7. Symmetry + + Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). Hence, some parts offer the option to set a symmetry attribute for them, like: + <wing symmetry="x-z-plane">... + This attribute explains that the whole part with all its subnodes is symmetric to the given plane. Possible planes are: + x-y-plane + x-z-plane + y-z-plane + none + inherit + + By default, the symmetry of a component is inherited from its parent. If e.g. a wing is symmetrically defined, a pylon will also have a symmetry by default. + This symmetry inheritance can be broken, by explicitly deleting the symmetry with symmetry="none". + + + + + UIDs, references and symmetry + + All nodes, e.g. parentUID, in CPACS that refer to a component that holds symmetry attribute, e.g. wing, have to carry the symmetry attribute as well. + The symmetry attribute may take three values: symm, def, full: + + + def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. + + symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) + + full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + + + <wing uID="ATTAS_main_wing" symmetry="x-z-plane"> + ... + <segments> + <segment uID="ATTAS_main_wing_innersegment"> + ... + In the example above, to refer to the "other" side of the wing on must use the definition as such: + <loadcase> + ... + <segments> + <segment> + <segmentUID isLink="True" symmetry="symm">ATTAS_main_wing_inner_segment</segmentUID> + <strip>... + + + + 8. Vectors and arrays + + For large data sets (e.g. increments of aerodynamic coefficients due to control surface deflections) it is advantageous + to map them via vectors and arrays instead of using a sequence of nodes for each data value. Therefore vectors and arrays are defined as semicolon-separated lists in CPACS. Via the documentation (derived from the XSD) of the corresponding nodes it has to be checked whether it is a vector or an array. + + Vector + The vector is meant as a one-dimensional-array. In such a node, the values are given in a semicolon separated list: + <angleOfAttack>0.;1.5;3.;4.5;6;7.5;9.</angleOfAttack> + + Array + + As for vectors, multi-dimensional arrays provide values in a semicolon separated list. An array is always preceded by a sequence of vectors, containing the dimensions and index values. Which vectors of an array are dimensioning is specified in the respective documentation of the array. + + <altitude>1000.;2000.;3000.</altitude> <!-- vector element --> + <incrementMaps> + <incrementMap uID="incMap_b3ac2"> + <controlSurfaceUID>InnerWingFlap</controlSurfaceUID> + <controlParameters>-1;-0.5;0;1</controlParameters> <!-- vector element --> + <!-- array of dimension length(altitude) x length(controlParameters): --> + <dcl>11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34.</dcl> + + + + Values for cl increments: + + + + Control parameter = -1 + Control parameter = -0.5 + Control parameter = 0 + Control parameter = 1 + + + Altitude = 1000m + 11. + 12. + 13. + 14. + + + Altitude = 2000m + 21. + 22. + 23. + 24. + + + Altitude = 3000m + 31. + 32. + 33. + 34. + + + + + + + + + + 9. Control Parameters + + Control parameters are abstract parameters, linking a generic floating point value to a certain status of a control device + (e.g. control surface, landing gear, suction system, brake parachute, ...). For control surfaces, such a data pair (control parameter + and control surface deflection status) is called a <step> and the ordered list of all steps for a control surface forms its deflection + <path>. + The control parameter values for each step are arbitrary floating point values. However, it is strongly recommended to use + values between -1. and +1., or between 0. And +1. (depending on the type of control surface). The smallest and the largest value implicitly + define the maximum deflection limits. It is mandatory, that the value “0.” is within the specified range, as this value is treated as + undeflected and used to specify a “clean” aircraft configuration (e.g. used in the clean aero performance map). It is recommended, but not + mandatory to specify a <step> with a <controlParameter> of 0. Consequently, no <controlParameter> must be used twice within + a single <path> definition. Deflection values between two specified steps are handled by linear interpolation. + The following example shows the usage of control parameters within a control surface deflection path definition: + <controlSurfaces> + <trailingEdgeDevices> + <trailingEdgeDevice uID="InnerWingFlap"> + ... + <path> + ... + <steps> + <step> + <controlParameter>-1</controlParameter> + <hingeLineRotation>-20.</hingeLineRotation> + </step> + <step> + <controlParameter>-0.5</controlParameter> + <hingeLineRotation>-10.</hingeLineRotation> + </step> + <step> + <controlParameter>0</controlParameter> + <hingeLineRotation>0.</hingeLineRotation> + </step> + <step> + <controlParameter>1</controlParameter> + <hingeLineRotation>5.</hingeLineRotation> + </step> + </steps> + ... + + + + + 10. Atmosphere + + At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). + Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) + It covers temperature, pressure, density, speed of sound, dynamic viscosity and kinematic viscosity with respect to altitude. + In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. + For details, see ISA manual, section 2.3, page E-viii f. + ISA covers a range from -5000 m to 80000 m. + Temperature offsets are introduced on top of the definitions in the ISA manual (which does not cover such variations). The offset model + is based upon the idea that the pressure at a fixed geopotential altitude is independent from temperature offset (pressure altitude). + The temperature offset changes only the density (following rho = p / Gas Constant / T) (and viscosity, of course) + + + + CPACS 3.3 + + Release in June 2021 + + Revision of the mission definition including parameter lapses within segments (compatibility break) + Revision of the point performance definition (compatibility break) + Revision of performance requirements (compatibility break) + Revision of landing gears (compatibility break) + Revision of control surface tracks definition (compatibility break) + Load analysis: Revision of flightLoadCasesType (compatibility break) + Load analysis: Revision of aeroCasesType (compatibility break) + Load analysis: loadEnvelopesType relocated and envelope simplified to a single uID-Sequence (compatibility break) + Load analysis: Replaced dynamicAircraftModel elements by loadApplicationPointSets (compatibility break) + Flight dynamics: Group flightPerformance, flyingQualities and trim under flightDynamics parent node (compatibility break) + Introduced a configuration node to describe aircraft and payload configurations + Fuselage profiles: Introduced rectangle and super ellipse as standard profiles + Fuselage profiles: Added vector to specify curve parameters for profiles with kinks + Internal structure: Added standard profiles to profile based structural elements + Internal structure: Added ribPosts element to wingRibCrossSectionType + Internal structure: Upper and lowerCap now optional in sparCellType + Internal structure: Stringers and frames can reference sections + MassBreakdown: Set mass inertia Jxy, Jxz and Jyz optional + MassBreakdown: Added mMiscellaneous element + MassBreakdown: Added fuselage walls + Added flight envelope to aircraft global element + Added new base types: doubleVectorBaseType, posIntVectorBaseType, doubleArrayBaseType + Added 'none' and 'inherit' to list of symmetry flags + Set mapType attribute of vector and array elements to optional (requires TiXI>=3.1) + AeroMaps: Defined angleOfSideslip as input and added distinction between minimum and maximum angleOfAttack in aeroLimitMaps (compatibility break) + AeroMaps: Added missing singular incrementMap element to incrementMaps in aeroLimitsMap (compatibility break) + AeroMaps: Adopted the camelCase style for damping derivatives (compatibility break) + Introduced common nomenclature for speeds and altitudes (compatibility break) + Control distributors are set to optional + Added instructions for superposition of control surface deflections + Further elaboration of development standards + General improvements of the documentation + + + + + CPACS 3.2 + + Release in February 2020 + + Replaced tool-specific elements with xsd:any element and strict schema request for validation + UIDs adapted to type xsd:ID and xsd:IDREF + UIDs optional for transformationType and pointTypes + Replaced xsd:sequence elements with xsd:all elements where possible + CpacsVersion element set to optional + GuideCurves are now optional for nacelleCowlType + Documentation adaptions + + + + + CPACS 3.1 + + Release in August 2019 + + Redefinition of aeroPerformanceMaps + Added nodes for detailed engine pylons and nacelles + Added nodes to model generic walls + Extension of material definition + Added fuselage compartment definition + Added fuselage fuel tank definition + Explicit wing stringer definition integrated into wing stringer definition + RelativeDeflections renamed to control parameters + Control distributors modified to only have a single command input vector + "cpacsVersion" restricted to current schema version + Code cleanup + Cpacs_schema.xml removed + Documentation adaptions + + + + + CPACS 3.0 + + Release in Jul 2018 + + New component segment definition; this is affecting all structural components of wings + Renamed angleOfYaw into angleOfSideslip + Fixes in documentation + Made all uID attributes required + Minor fixes in choices and typos + Added nodes for the geometry of generic system components + Added performance requirements for aircraft models + Redefined the whole mission definition including point performances + Made link to missionUID in trajectory optional + Added new parameters to enginePerformanceMap + Relocated mFixedLeadingEdge and mFixedTrailingEdge within the massBReakdown structure + Changed aeroPerformanceMap to use altitude and standard atmosphere instead of reynolds number + Added an optional local direction for guide curves and an illustration image + Announced toolspecifics definitions as deprecated; will be removed from CPACS in next release and should be managed in separate namespace by tool maintainers + Added an option for aerodynamic performance maps of elastic aircraft + Enabled the definition of multiple aeroPerformanceMaps + Enabled the use of spar points for rib placement and rib points for spar placement + Added explicit stringer definitions for wing cells + All issues for this release can be found online + https://github.com/DLR-LY/CPACS/issues + + + + + CPACS 2.3.1 + + Release in Jul 2016 + + CPACS 2.3.1 is a beta release, all parameters may be subject to change. + Added a branch for the definition of design studies. + Added thermal properties for materials. + Revised the definition of flights/flightplans. + Added an airline definition. + Added structure for skid gear components. + Changed the units for material density to SI units. + Revised the top level fleets node and put it into the new airline node. + All issues for this release can be found online + https://github.com/DLR-LY/CPACS/issues + + + + + CPACS 2.3 + + Release in Nov 2015 + CPACS 2.3 is the fourth public release of CPACS. Major changes include: + + Included vector notation for weight and balance. + Included flight system and flight dynamic information. + Included top level aircraft requirements. + Included a prototype for detailed nacelle geometries. + Included structural mounts. + Extended aero data set for loads. + Extended the mass breakdown. + Updated the symmetry definition, please take a look at the documentation point 5 and 6. + All issues for this release can be found online + https://github.com/DLR-LY/CPACS/issues + + + + + CPACS 2.2.1 + + Release in Feb 2015 + + CPACS 2.2.1 is a beta release, all parameters may be subject to change. + Included preliminary definition of guidecurves. + Included additional means to describe the wing structure. + Included preliminary fuselage fuel tanks. + Included preliminary load envelope. + Included preliminary flight performance and flight qualities. (flight dynamics will follow) + Updated toolspecifics + Updated uncertainty definition + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.2 + + Release in May 2014 + + CPACS 2.2 is the third public release of CPACS. Major changes include + Additions and changes to the loadCaseType. + Included additional genericGeometricEntities for bellyfairings etc. + The mass breakdown is extended for a more detailed fuselage strucuture. + Steadiness information on the geometry is excluded from CPACS 2.2. CPACS 2.3 will include optional guidelines for smoother surfaces. + Uncertainties can now be specified (CPACS 2.2alpha doubleBaseType, CPACS 2.2 also in vector notations) + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.1 + + Release in May 2013 + + CPACS 2.1 is the second public release of CPACS. Most of the implementation was already included in CPACS 2.01 + included fuselage structure and cabin definition + all data is defined according to the CPACS coordinate system. That is the initial coordinate system in which geometries are defined. Therefore, it can but must not meet your body axis. + the mass breakdown is extended for a more detailed wing strucuture + profiles can now be included based on a two-dimensional class shape transformation. The old parametrization will still be available. TIGL will learn CST asap. + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.01 + + Release in Nov 2012 + + CPACS 2.01 is an internal release for the VAMP project. It is the testbed for CPACS 2.1 + included fuselage structure + additions to the load case definition + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.0 + + Release in Mar 2012 + + CPACS 2.0 is the first public release + large impacts on the documentation + all issues can be found online + http://code.google.com/p/cpacs/issues/list + compatible with TIGL 2.0 + excluded fuselage structure, reintegration in CPACS 2.1 + + + + + CPACS 1.6 + + Release in Jul 2011 + + Thanks for the input on the documentation to Felix Dorbath, Till Pfeiffer, Alexander Koch, Falk Heinecke and Tom Otten + preliminary added enginePylons + deleted seatAssemblyPositionType + updated toolspecific blocks from handbook aero and cpacs mass updater + added weight and balance definition + added loads reference axis and dynamic aircraft model + added wing documentation + added weights documentation + added fleet documentation + added paramam toolspecific documentation + added wing tank definition + changed some names in the massBreakdown + deleted old loadCaseDefinitions + no more plural element for loadAnalyses + shifted groundforces to groundloadcases, this will need an update + added noseLandingGear + mainLandingGear can now have plural SideStruts + + + + + CPACS 1.5 + + Release in Feb 2011 + + uID for transformation + extended stringUIDBaseType with optional attribute isLink + all elements xxxUID are now of Type stringUIDBaseType + added new material definition from FA to distinguish between diffent material types + changed fuselage structure definition due to input from BK + changed rib definition in cells in component segments + cleaned up material definition in component segments + added cpacsVersion information to the header and updates types + added area and length to the loadCase reference on wing strips + added wingFuselageAttachment + + + + + CPACS 1.4 + + Release in Nov 2010 + + Geometry definition for engine and nacelle added + Trailing Edge Devices, Leading Edge Devices and Spoilers added + Rotorcraft added, similar to aircraft + Splitted up multiple Point Types + sparCell added uID + new inline Documentation introduced in CPACS type + + + + + CPACS 1.3 + + Release in Aug 2010 + + Fuel definition added + Introduced component segments for the wing structure + Mission definition was updated + VSAero toolspecific data updated + + + + + CPACS 1.2 + + Release in May 2010 + + Fuselage Structure Elements are updated following the input from BK + + stringers>arbitrary additional parameters: yBezugAtStartX, zBezugAtStartX, yBezugAtEndX, zBezugAtEndX + paxCrossBeams additional parameters: startX, endX + cargoCrossBeams additional parameters: startX, endX + paxCrossBeamStruts additional parameters: startX, endX + cargoCrossBeamStruts additional parameters: startX, endX + structure>pressureBulkhead: positionX instead of positionZ + reinforcementNumberVertical: number of vertical reinforcements + reinforcementNumberHorizontal: number of horizontal reinforcements + maxFlectionDepth: max camber of pressure bulkhead + reinforcementNumber: number of reinforcements rear pressure bulkhead + sheetProperties: definition of sheet properties + innerRadius: inner radius of the pressure bulkhead + + Dummy Wingbox element is included. This definition needs further enhancements + + cpacs>vehicles>aircraft>model>fuselage>fuselage>structure + Wingbox: + xStart: start of the wingbox area + xEnd: end of the wingbox area + zStart: upper limit of the wingbox area + + Damping Derivaties are added in the form of dcfxdp, dcfxdq, dcfxdr, dcfydp, etc. The data will be stored in the model/global/aeroperformaneMap under a new dampingDerivatives element. Unit is deg/sec. + StructureProfiles are defined in the profiles element. They are referenced in structuralElements for several entities such as stringer, frame etc. Currently they are referenced via 'structuralProfileUID' for name consistency it should be either only 'structure' or only 'structural' + Control Commmands. The chain between pilot inputs and controlsurface deflections is now closed. + + Parameters located at cpacs\vehicles\aircraft\model\systems + cockpitControl: links from pilotInput to commandCase + commandCase: links from commandCase to controlDistributor or controlFunction + controlDistributor links to the controlSurface + controlLaws includes controlModes automatic and manual + controlModes contain controlFunctions + + TraFuMo toolspecific data added + + + + + CPACS 1.1 + + Release in Feb 2010 + + Fleets model added. The fleets modeling from CATS is introduced to CPACS 1.1 + Reference changed. The reference type in wingSegmentStripCoefficientsType was changed from referenceType to pointType + + + + + + + + + + + + + + + + + + + + + + + + + CPACS header + + + Header type, containing CPACS dataset description + + + + + + + + + + + Name of CPACS dataset + + + + + Description of CPACS dataset + + + + + + Creator of initial CPACS dataset + + + + + + Timestamp of initial CPACS dataset creation + + + + + + Version of initial CPACS dataset + + + + + + CPACS version that the dataset is valid to. The element is optional, since data sets + can be valid for several CPACS versions. However, we strongly recommend to assign data sets to a + specific CPACS version as far as possible, especially since some tools and libraries (e.g. TiGL) + require this specification. + + + + + + + + + + + + + + + updatesType + + + Updates type, containing update data for the CPACS + dataset + + + + + + + + + + + + + + + + + + + + + complexBaseType + + + Base type for complex nodes (including external data + attributes) + + + + + + + + + + + + + + + stringBaseType + + + Base type for string nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + stringUIDBaseType + + + This is the base type that links to other components. It should always contain a UID. + This node has an additional attribute isLink that will be used if a stringBaseType refers to a uID. TIXI can then + perform automatic validation for the existence of the referenced uID. + Furthermore this node contains an additional attribute symmetry. The symmetry attribute may take three values: symm, def, full + def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. + symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) + full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + + + + + + + + + + + + + + + + + + + + + + + + + + stringVectorBaseType + + + + Base type for string vector nodes + The vector base type can include optional uncertainty + information. The description of uncertainties is placed in + addtional attributes. First, it is described by an attribute that + describes the type of uncertainty function called functionName. + The functionName attribute includes the tag name of the + distribution function which is listened in the table shown below. + Each uncertainty function is further describes by a set of + parameters that are described in the table below. + If the uncertainty values change for the elements of + the vector than the attribute may be written as a list of values + separated by semicolons + DEPRECATED: As of CPACS + version 3.3, the mapType + attribute is set to optional to ensure the compatibility of older data sets. + However, since the type is uniquely defined via the XSD, the attribute is superfluous + and will therefore be completely omitted in the next major release (Note: requires + TiXI >= 3.3). Please contact the CPACS team + if for any reason you see a long-term need for the mapType + attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vector with semicolon separated values of type double + + + + Any entries of type double separated by semicolons are permitted, e.g.: + +<doubleVectorTest>123.456;+123.456;-1.234e56;-.45E-6;NaN</doubleVectorTest> + + +<doubleVectorTest>123.456</doubleVectorTest> + + +<doubleVectorTest>123.456,+1234.456</doubleVectorTest> + + +<doubleVectorTest>123.456;mainWingUID</doubleVectorTest> + + +<doubleVectorTest>123.456;1234.4E 56;-1.234e5.6</doubleVectorTest> + + + + + + + + + + + + + + + + + + + doubleVectorConstraintBaseType + + + + Base type for double vectors including a relational operator attribute indicating valid constraint region. + The doubleVectorConstraintBaseType extends the doubleVectorBaseType and thus inherits all its attributes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vector with semicolon separated positive integer values + + + + Any positive integer values separated by semicolons are permitted, e.g.: + +<intVectorTest>0;1;2;3;4;5</intVectorTest> + + +<intVectorTest>1</intVectorTest> + + +<intVectorTest>0,1,2,3,4,5</intVectorTest> + + +<intVectorTest>0.;1.;2.</intVectorTest> + + +<intVectorTest>-1;0;1</intVectorTest> + + + + + + + + + + + + + + + + + + + stringArrayBaseType + + + Base type for string array nodes (including maptype + array attribute) + DEPRECATED: As of CPACCS version 3.3, the mapType attribute is set to optional to ensure the compatibility of older data records. However, since the type is uniquely defined via the XSD, the attribute is superfluous and will therefore be completely omitted in future versions. + + + + + + + + + + + + + + + + + Array with semicolon separated values of type double + + + + In CPACS arrays are used to exchange values + in full-factorial parameter spaces, for example to describe the aerodynamic coefficients depending + on Mach number and altitude. + + Thus, the dimensions of the array are spanned by the input vectors. See the following + example where two input vectors are defined. For clarification the entries of the array result from + the multiplication of the index values of the corresponding input vectors: + +<inputVector1>1;2;3</inputVector1> +<inputVector2>4;5;6;7</inputVector2> + + +<array>4;5;6;7;8;10;12;14;12;15;18;21</array> + + Any entries of type double separated by semicolons are valid, e.g.: + +<doubleArrayTest>123.456;+123.456;-1.234e56;-.45E-6;NaN;0</doubleArrayTest> + + +<doubleArrayTest>123.456</doubleArrayTest> + + +<doubleArrayTest>123.456,+1234.456</doubleArrayTest> + + +<doubleArrayTest>123.456;mainWingUID</doubleArrayTest> + + +<doubleArrayTest>1234.4E 56;-1.234e5.6</doubleArrayTest> + + + Please note that the syntax of arrays in the current CPACS + version correspond exactly to the syntax of vectors. There is no special character indicating + the dimensions. Thus, the input vectors have to be determined from the documentation of the + corresponding elements and splitting of the one-dimensional vector has to be done manually. + + + + + + + + + + + + + + + + + + + doubleBaseType + + + + Base type for double nodes (including external data + attributes) + The double base type can include optional uncertainty + information. The description of uncertainties is placed in + addtional attributes. First, it is described by an attribute + that describes the type of uncertainty function called + functionName. The functionName attribute includes the tag name + of the distribution function which is listened in the table + shown below. Each uncertainty function is further describes by a + set of parameters that are described in the table below. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + doubleConstraintBaseType + + + + Base type for double nodes including a relational operator attribute indicating valid constraint region + The doubleConstraintBaseType extends the doubleBaseType and thus inherits all its attributes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + timeConstraintBaseType + + + + Base type for time nodes including a relational operator attribute indicating valid constraint region + The timeConstraintBaseType extends the timeBaseType and thus inherits all its attributes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + integerBaseType + + + Base type for integer nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + booleanBaseType + + + Base type for boolean nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + dateTimeBaseType + + + Base type for dateTime nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + timeBaseType + + + Base type for time nodes (including external data attributes) + This time type is based on the xsd:time definition. + "To specify a time zone, you can either enter a time in UTC time by adding a "Z" behind the time - like this: 09:30:10Z + or you can specify an offset from the UTC time by adding a positive or negative time behind the time - like this: + 09:30:10-06:00 + or + 09:30:10+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) + + + + + + + + + + + + + + + + + + + dateBaseType + + + Base type for date nodes (including external data attributes). + This date type is based on the xsd:date definition. + "To specify a time zone, you can either enter a date in UTC time by adding a "Z" behind the date - like this: 2002-09-24Z + or you can specify an offset from the UTC time by adding a positive or negative time behind the date - like this: + 2002-09-24-06:00 + or + 2002-09-24+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) + + + + + + + + + + + + + + + + + + + + + + Positionings of the wing. + + + Positionings type, containing all the positionings of + the wing sections. + + + + + + + + + + + + + + + + + + + Positioning of the wing section + + + + The positionings describe an additional translation of + sections. Basically, the positioning is a vector having the + length 'length' and an orientation that is described by the + parameters 'sweepAngle' and 'dihedralAngle'. If the 'sweepAngle' + and the 'dihedralAngle' are set to zero (or left blank) the + positioning vector equals the positive y-axis of the coordinate + system (in case of a positive 'length'). + If the parameter 'fromSectionUID' is set, the + positioning describes the translation between the 'from' towards + the 'to' section. If the parameter 'fromSectionUID' is left + blank the orgin of the positioning vector is the origin of the + parent coordinate syste. + The orgin of the section coordinate system is the + position which is described by the positioning vector PLUS the + translation which is described in the section. + Please note: If the orgin of the positioning vector is + defined by using another section, i.e. fromSection is defined, + the orgin of this vector equals the end of the positioning + vector of the previous section. This means that the section + translation of the from-section has no influence on the + positioning of the to-section. Therefore the total translation, + which is described by positionings, is the sum of the current + positioning and all positionings that are defined 'before'. + + An example for this is given at positioning 3 and 4 at + the picture below. Please note, that any other combination of + positionings would be possible. + Application of the sweepangle does not lead to a + rotation of the section. Application of the dihedral does not + lead to a rotation of the section. + + + + + + + + + + + + + + Name of the positioning. + + + + + Description of the positioning. + + + + + + Distance between inner and outer section + (length of the positioning vector). + + + + + Sweepangle between inner and outer section. + This angle equals a positive rotation of the positioing vector + around the z-axis of the wing coordinate system. + + + + + + Dihedralangle between inner and outer section. + This angle equals a positive rotation of the positioing vector + around the x-axis of the wing coordinate system + + + + + + Reference to starting section of the + positioning vector. If missing, the positioning is made from the + orgin of the wing coordinate system. + + + + + Reference to ending section (section to be + positioned) of the positioning vector. + + + + + + + + + + + + + + Transformation + + + Transformation type, containing a set of + transformations. The order of the transformations is scaling + -> rotation -> translation, and they are executed in this + order. Any of them can be omitted; it will be replaced by its + defaults. + Transformations are always executed relative to the + child not the parent. I.e. a scaling does not have an influence + on the parent item. For example in the outer geometry of a wing + the element scaling does not influence the section. Scaling does + also not effect rotation and translation. + + + + + + + + + + Scaling data default: 1,1,1. Those parameters + describe the scaling of the x-, y-, and z-axis. + + + + + + Rotation data default: 0,0,0. The rotation + angles are the three Euler angles to describe the orientation of + the coordinate system. The order is allways xyz in CPACS. + Therefore the first rotation is around the x-axis, the second + rotation is around the rotated y-axis (y') and the third + rotation is around the two times rotated z-axis (z''). + + + + + + Translation data default: 0,0,0. Translations + can either be made absolute in the global coordinate system + (absGlobal), absolute in the local Coordinate system (absLocal) + or relative (relative), normalized with the maximum dimensions + of the parent. + + + + + + + + + + + + + + 2D transformation + + + + + + + + + + + + + Scaling of the structural profile + + + + + + rotation around z-axis of profile definition + + + + + + translation of profile definition + + + + + + + + + + + + + + + Point: x,y,z + + + Point type, containing an xyz data triplet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + Point: x + + + Point type, containing a x data. + + + + + + + + + + X-Component + + + + + + + + + + + + + + Point: y + + + Point type, containing a y data. + + + + + + + + + + Y-Component + + + + + + + + + + + + + + Point: z + + + Point type, containing a z data. + + + + + + + + + + Z-Component + + + + + + + + + + + + + + Point: x,y + + + Point type, containing an xy data doublet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + + + + + + + + + + Point: x, z + + + Point type, containing an xz data doublet. + + + + + + + + + + X-Component + + + + + Z-Component + + + + + + + + + + + + + + Point: y, z + + + Point type, containing an yz data doublet. + + + + + + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + Point: x,y,z + + + Point type, containing an obligatory xyz data triplet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + Point with global/local reference + + + PointAbsRel type, containing an xyz data triplet. Each + of the components is optional. The refType attribute defines, + whether coordinates are absolute in the global ccordinate system + [absGlobal], absolute in the parent element's local coordinate + system [absLocal]. If the object does not have a + parent, only [absGlobal] is permitted. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + + + + + + + + + Point with constraints + + + Point constraint type, containing an xyz data triplet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + List of 3D points, kept in three relative coordinate + vecors (rX, rY, rZ) + + + + This set of vectors contains an ordered list of points + for rX, rY, and rZ coordinates in the form of stringBased + Vectors. The x, y and z vector elements with the same index + specify a 3D point relative to a geometric segment. + + + + + + + + + + + + + + + + + + + + Vector of rX coordinates. Relative + circumferential coordinate on wing / fuselage profile + + + + + + Vector of rY coordinates. Relative span + coordinate along a segment + + + + + Vector of rZ coordinates. Relative coordinate + normal to the linear strake (normalised with chordlength / + diameter c*) + + + + + + + + + + + + + List of points + + + PointList type, containing an ordered list of points + + + + + + + + + + + Data point + + + + + + + + + + + + + List of points in x,y + + + PointList type, containing an ordered list of points + + + + + + + + + + + Data points in x-y-space. + + + + + + + + + + + + + List of 3D points, kept in three coordinate vecors (x, + y, z) + + + + This set of vectors contains an ordered list of points + for x, y and z coordinates in the form of stringBased Vectors. + The x, y and z vector elements with the same index specify a 3D + point. + + + + + + + + + + + Vector of x coordinates + + + + + Vector of y coordinates + + + + + Vector of z coordinates + + + + + + + + + + + + + Maps points (actually the index in the point list) to a curve parameter. + + + + Which parameters are allowed depends on the context. + For exampple in a wing profile, values between -1 and 1 are valid. + + + + + + + + + + + List of indices of points to be mapped. Each index must be in the range [1, npoints]. + + + + + List of parameters on the curve, that is mapped to the points defined by their index. + + + + + + + + + + + + + A curve that interpolates a list of points. + + + + The curve interpolates the list of points, typically with a b-spline. + In theory, the interpolation is somewhat ambiguous as it is not defined at which + curve parameter a point will be interpolated. + + To solve is ambiguity, an optional parameter map can be defined + that maps point indices with curve parameters. + + Kinks can also be modeled by populating the "kinks" array with the + indices of points that should be on a kink. As an example, look at the following image: + + + + + In this example, the kinks array will be "3;7". + Optionally, the parameters of the kinks can be set in the parameter map. + The whole profile looks as follows: + + +<pointList> + <x>...</x> + <y>...</y> + <z>...</z> + <kinks>3;7</kinks> + <parameterMap> + <pointIndex>3;5;7</pointIndex> + <paramOnCurve>0.2;0.5;0.8</paramOnCurve> + </parameterMap> +</pointList> + + + + + + + + + + + + Indices of points at which the curve has a kink. Each index is in the range [1, npoints]. + + + + + + Map between point index and curve parameter. + + + + + + + + + + + + + List of 2D points, kept in two coordinate vecors (x, y) + + + + This set of vectors contains an ordered list of points + for x and y coordinates in the form of stringBased Vectors. + The x and y vector elements with the same index specify a 2D + point. The coordinates of the x vector of [0, 1]. + + + + + + + + + + + Vector of x coordinates + + + + + Vector of y coordinates + + + + + + + + + + + + + Point in eta and xsi coordinates + + + Point described by eta-xsi coordinates. + Can be either segment or component segment coordinates. + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta-xsi values are considered to be in segment + eta-xsi coordinates; if it points to a componentSegment, + then componentSegment eta-xsi coordinates are used. + + + + + + + + + + + + + Relative height at eta, xsi position + + + Point described by eta-xsi and a relative height coordinate. + Can be either segment or component segment coordinates. + If relHeight is not given, the point has no offset from the eta-xsi plane + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative height position. + relHeight is relative to the local airfoil thickness. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta-xsi values are considered to be in segment + eta-xsi coordinates; if it points to a componentSegment, + then componentSegment eta-xsi coordinates are used. + + + + + + + + + + + + + Positive double values larger than 0 + + + + + + + + + + + + + + + + + List of uIDs + + + + + + + + + + + Reference to a uID + + + + + + + + + + + + + + + + UIDGroupDefinitionType + + + + + + + + + + + + + + + + + + + + + + + + + + + UIDGroupDefinitionsType + + + + + + + + + + + + + + + + + + + + + + + Actuator attachment + + + + + + + + + + + + + Relative spanwise position of the actuator. + Eta refers to the dimensions of the control surface. + + + + + + + + + + + + + + + + + Definition of the position and material properties of + the control surface actuator attachment. + + + + Definition of the position and material properties of + the control surface actuator attachment. + Please refer to the picture below for the definition + of the parameters: + + + + + + + + + + + + + + Definition of the relative chordwise position + of the parent actuator attachment. Xsi refers to the parents + dimensions. + + + + + Definition of the relative height position of + the parent actuator attachment. relHeight refers to the parents + dimensions. + + + + + Definition of the material properties of the + actuator attachment at the parent. + + + + + + + + + + + + + actuatorFuselageWingAttachmentType + + + + + + + + + + + + + + + + + + + + + + + actuatorFuselageWingType + + + + + + + + + + + + + Reference to the actuator. + + + + + Definition of the actuator to fuselage + attachment. + + + + + Definition of the actuator to wing attachment. + + + + + + + + + + + + + + + Definition of the position and material properties of + the parent actuator attachment. + + + + Definition of the position and material properties of + the parent actuator attachment. + Please refer to the picture below for the definition + of the parameters: + + + + + + + + + + + + + + Definition of the relative chordwise position + of the parent actuator attachment. Xsi refers to the parents + dimensions. + + + + + Definition of the relative height position of + the parent actuator attachment. relHeight refers to the parents + dimensions. + + + + + Definition of the material properties of the + actuator attachment at the parent. + + + + + + + + + + + + + actuatorsFuselageWingType + + + + + + + + + + + + + Definition of one actuator (e.g. trim actuator + of an HTP) of the attachment. + + + + + + + + + + + + + aeroPerformanceMapRCType + + + AeroPerformanceMapRC type, containing a perfomance map + with aerodynamic data. Array order is: angleOfAttack min->max + then angleOfSideslip then altitude then machNumber + + + + + + + + + + Atmospheric model and temperature offset + + + + + Mach number + + + + + Altitude + + + + + Sideslip angle + + + + + Angle of attack + + + + + Name and version of the tool used to compute + the aerodynamic performance + + + + + Modeling level of the methods used to compute + the aerodynamic performance. The higher the analysisLevel, the + higher the quality of the results. Possible use of + analysisLevel: 0- 9 = Statistical models, 10-19 = Analytic + models, 20-29 = Lifting line method, 30-39 = Panel method, 40-49 + = Panel-BL-coupled method, 50-59 = Full potential method, 60-69 + = Full potential-BL coupled method, 70-79 = CFD euler method, + 80-89 = CFD euler-bl coupled method, 99-99 = CFD RANS method, + >=100 = Experimental data. + + + + + + + + + + + + + + + + + + + + aeroPerformanceMapsRCType + + + aeroPerformanceMapsRC type, containing multiple + aeroPerformanceMapRC nodes for different cases + + + + + + + + + + + + + + + + + + + aeroPerformanceType + + + aeroPerformance type, containing perfomance maps with + aerodynamic data of an airfoil. + + + + + + + + + + Aerodynamic performance map of the full + configuration + + + + + Aerodynamic performance maps of isolated + fuselages + + + + + Aerodynamic performance maps of isolated wings + + + + + + Aerodynamic performance maps of control + surfaces + + + + + Aerodynamic performance maps of isolated + airfoils + + + + + + + + + + + + + aeroelasticDivergenceType + + + AeroelasticDivergence type, containing the results from + aeroelastic analysis + + + + + + + + + + + + + + + + + + + aeroelasticStaticMaxDisplacementType + + + AeroelasticStaticMaxDisplacement type, containing the + Maximum static displacement from aeroelastic analysis + + + + + + + + + + Maximum translation + + + + + Maximum rotation + + + + + + + + + + + + + Aeroelasticity + + + Aeroelastics type, containing the results from + aeroelastic analysis + + + + + + + + + + + + + + + + + + + + Results from several analysis + modules connected to CPACS + + + AircraftAnalyses type, containing detailed analysis + data of the aircraft + Within this element results from analysis modules are + stored that rely to the overall definition of the aircraft. These + include e.g. aerodynamic data or loadCases + For further documentation please refer to the + respective elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Global data + + + AircraftGlobal type, containing global data of the + aircraft + + + + + + + + + + + designRange equals the full payload max + range, i.e. point B in payload range + diagramm + + + + + + + + + + + + + + + + + + + Aircraft model + + + + The aircraftModelType contains the geometric aircraft + model and associated data. + Elements specifying the geometry of the aircraft are fuselages, + wings, + engines (referenced via uID), + enginePylons, landingGear, + systems (to some extend) and genericGeometryComponents. + + Other elements are dedicated to additional data associated to this aircraft model. Brief and concise analysis results are stored + in the global node. The analysis node contains + extensive results from multidisciplinary analysis modules. + In the current CPACS version requirements only refer to the aircraft performance and are therefore specified in the + performanceRequirements node. + + + + + + + + + + + + Name of the aircraft model + + + + + + Description of the aircraft model + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aircraft + + + + The aircraftType contains a list of aircraft models. + + + Note: Since there is no distinction between plural and singular in English, aircraft + refers to plural form, while a single aircraft itself is referened as model. + + + + + + + + + + + + + + + + + + + + + airfoilAeroPerformanceType + + + airfoilAeroPerformance type, containing perfomance maps + with aerodynamic data of an airfoil. + + + + + + + + + + Reference to the uID of the analysed airfoil + + + + + + References used for the calculation of the + force and moment coefficients of the airfoil (in the airfoil + axis system!) + + + + + Calculated aerodynamic performance maps of the + airfoil + + + + + + + + + + + + + airfoilsAeroPerformanceType + + + airfoilsAeroPerformance type, containing + airfoilsAeroPerformance + + + + + + + + + + + + + + + + + + + airframeMaintenanceCostType + + + + + + + + + + + + + + + + + + + + + + + airlineType + + + Describes a specific airline and their fleet + + + + + + + + + + Name of the airline + + + + + Description of the airline + + + + + + + + + + + + + + + + Airlines + + + Contains a list of different airlines + + + + + + + + + + + + + + + + + + + airportCompatabilityGlobalType + + + + + + + + + + + + + + + + + + + + + + + + + + airportType + + + Airport type, containing data of an airport + + + + + + + + + + Name of airport + + + + + Description of airport + + + + + IATA 3-letter-code + + + + + ICAO 4-letter-code + + + + + Position in degrees north + + + + + Position in degrees east + + + + + Airport elevation + + + + + + + + + + + + + + + Airports + + + Airports type, containing data of the airports + + + + + + + + + + + + + + + + + + + + alignmentCrossBeamType + + + + + + + + + + + + + Offset in direction of extrusion, first side + (absolute value) + + + + + Offset in direction of extrusion, second side + (absolute value) + + + + + Rotation around local x axis (extrusion axis) + + + + + + Translation along local y axis (perpendicular + to extrusion axis) + + + + + Translation along local z axis (perpendicular + to x ynd y axes) + + + + + + + + + + + + + + alignmentFloorPanelType + + + + + + + + + + + + + Offset from seat rail 1 reference Position in + local y direction (in plane of panel, absolute value) + + + + + + Offset from seat rail 2 refernce position in + local y direction (in plane of panel, absolute value) + + + + + + Offset from seat rail 1 refernce position in + local z direction (in plane of panel, absolute value)) + + + + + + + + + + + + + + + alignmentStringFrameType + + + + + + + + + + + + + Rotation around local x axis (extrusion axis) + + + + + + Translation along local y axis (perpendicular + to extrusion axis) + + + + + Translation along local z axis (perpendicular + to x ynd y axes) + + + + + + + + + + + + + + alignmentStructMemberType + + + + + + + + + + + + + Offset in direction of extrusion (absolute + value) + + + + + Rotation around local x axis (extrusion axis) + + + + + + Translation along local y axis (perpendicular + to extrusion axis) + + + + + Translation along local z axis (perpendicular + to x ynd y axes) + + + + + + + + + + + + + + atmosphericModelType + + + Defines the the athmospheric model which should be used. + Currently there is only a single option which is ISA for ICAO Standard + atmosphere (ISA) from 1993. For more details on atmospheric + models, please refer to documentation of the <CPACS> root + element. + + + + + + + + + + Atmospheric model (e.g. ISA for ICAO Standard + atmosphere (ISA) from 1993). + + + + + + + + + + + + Offset from temperature of the atmospheric model [K]. + For more details on atmospheric models, please refer to documentation + of the <CPACS> root element. + + + + + + + + + + + + + Attachment pin of the wing-fuselage-attachment. + + + + Attachment pin of the wing-fuselage-attachment. + + + + + + + + + + + + + Definition which translation degrees of + freedom are blocked. Default x=0 (free); y=1 (blocked); z=1 + (blocked). + + + + + + + + + + + + + + + + Definition of attachment pins for the wing-fuselage + attachment. + + + Definition of attachment pins for the wing-fuselage + attachment. + + + + + + + + + + + + + + + + + + + Axle + + + Geometric description and material properties of the + landing gear axle + + + + + + + + + + Length of the axle. For a single wheel, the length is equal to the distance between the center of the piston and the center of the wheel. For two wheels, the length is equal to the distance between the centers of the wheels with the axis being centered w.r.t. to the Piston. + + + + + Axle shaft properties + + + + + Number of wheels attached to this axle + + + + + Defines the side of the first wheel (inboard or outboard; inboard corresponds to the negative y-direction or in flight direction left) for odd number of wheels on this axis. Each additional wheel is the added on the opposite site of the previous wheel. + + + + + + + + + + + + Properties of the wheel(s) attached to this axle. If more than one wheel is attached, all wheels on a single axis have the same properties. + + + + + + + + + + + + + + Definition of the landing gear wheel. + + + The center plane of the wheel is located on the end point of the axle. + + + + + + + + + + Wheel radius + + + + + With of the wheel + + + + + Brake: false = + not braked; true = braked. + + + + + + + + + + + + + + beamCrossSectionType + + + beamCrossSectionType, containing the beam geometrical + properties + + + + + + + + + + + + + + + + + + + + + + + + beamStiffnessType + + + globalBeamStiffnessType, containing the beam + stiffnesses such as EA, EI + + + + + + + + + + + + + + + + + + + + + + + + + + blockedDOFType + + + + + + + + + + + + + + + + + + + + + + + Bogie + + + Geometric description and material properties of the + landing gear axle bogie (including the axle configuration) + + + + + + + + + + Length of the bogie + + + + + Tilt angle of the bogie in airborne conditions + + + + + + + + + + + + + + + + Bogie axle assembly + + + Description of an axle installed on the bogie and its + relative position to it + + + + + + + + + + + Relative position of the axle to the bogie (if more than one axle is defined; 0 = forward end of bogie; 1 = rear end of bogie) + + + + + + + + + + + + + + + + + + + Bogie axle assemblies + + + + A list of axles that are attached to the bogie + and their relative position to it + + + + + + + + + + + + + + + + + + + + cabGeometryType + + + cabGeometry provides the geometry of the cabin in terms + of constant height contour lines. The lines all share a common + x-vector. The vectors yZ[N] provide the lateral contour at + Z-coordinate provided in the vector z. The number of contour + lines can differ and is given by the length of the vector z + + + + + + + + + + + + + x-coordinates for all contour lines, relative + to cabin origin. + + + + + z-coordinate of contour lines. Contour lines + are constant z, so each entry in this vector belongs to a single + contour line. + + + + + + + + + + + + + + + cabinAisleType + + + aisles has as many entries as there are aisles in the + cabin. In a normal single aisle there are two aisles: the cabin + aisle and the aisle leading to the cockpit. + + + + + + + + + + + + Provides the longitudinal coordinates. The + number of coordinates can be chosen as appropriate, the minimum + number is two. The coordinates are relative to the cabin origin. + + + + + + Provides the center points of the aisle. The + y-vector has to have same length as the x-vector. The aisle + stretches equally left and right of the provided y-coordinate. + + + + + + the width of the aisle at floor level at each + y-coordinate. + + + + + + + + + + + + + + cabinAislesType + + + + + + + + + + + + + + + + + + + + + + cabinDoorType + + + doors describe all doors of the cabin. They are linked + to a structural door description. The cabin door is usually equal + in size to the door, but does not need to be. The structural door + might describe a wider cut-out, while the cabin door is primarily + intended for evacuation modeling and cabin layout. In order to + obtain a 3-dimensional door representation, the local cabin + geometry shall be used. + + + + + + + + + + + + + Number of passengers this door adds to the + overall exit capacity limit of the aircraft. + + + + + This is the forward x-coordinate of the door + relative to the cabin origin. + + + + + the door sill height relative to cabin origin. + + + + + + The width of the door in x-direction. + + + + + + the effective height of the door. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cabinDoorsType + + + + + + + + + + + + + + + + + + + + + + cabinFloorElementType + + + floorElement describes objects like monuments or other + installations inside the cabin. + + + + + + + + + + + + + + + + + + + + + + + forward center coordinate of object relative + to cabin origin. + + + + + center y-coordinate relative to cabin origin. + + + + + + length of the object + + + + + length of the object + + + + + length of the object + + + + + + + + + + + + + + + cabinFloorElementsType + + + + + + + + + + + + + + + + + + + + + + cabinSeatElementType + + + seats describe all seats inside the aircraft. They are + – strictly speaking – also objects mounted on the floor, hence + floor objects. But the specific characteristics of seats justify + a differentiation between seats and other objects on the floor. + Seats are seat group, for example a triple seat. Therefore they + have multiple seats. + + + + + + + + + + + + Number of seats + + + + + + + + + + + + + + + + x-coordinate relative to cabin origin. + + + + + + y-coordinate relative to cabin origin. + + + + + + delta-y-coordinate of the individual seat + center points from the y-coordinate of the seat object. This is + important to locate passengers. It is assumed that seats have no + angle. + + + + + length of the seat group. + + + + + width of the seat group. + + + + + height of the seat group. + + + + + + + + + + + + + + + + + cabinSeatElementsType + + + + + + + + + + + + + + + + + + + + + + cabinSpaceType + + + spaces describe areas in the cabin that need to be + clear for use as emergency area. Depending on the type of area, + it can have a height limit. The spaces are required for + downstream cabin design, for example to describe an empty cabin. + + + + + + + + + + + + + x-coordinates. These describe an area, so they + are not monotonous ascending. + + + + + y-coordinates at given x-coordinates. Warning: + x-y do not represent a function as single x-positions can have + multiple y-coordinates. Hence, no interpolation is possible. + + + + + + the height above the floor that is required to + be empty of any objects. + + + + + + + + + + + + + + cabinSpacesType + + + + + + + + + + + + + + + + + + + + + + Cap + + + + SparCap type, containing the cross section area of the + spar cap and the material properties. + Pleas find below a picture where all spar cross + section parameters as well as the orientation refereneces for + the material definition can be found: + + + + + + + + + + + + + + Area of the cap + + + + + + + + + + + + + + cargoCrossBeamStrutsAssemblyType + + + CargoCrossBeamStrutsAssembly type, containing cargo + crossBeam strut assemblys + + + + + + + + + + + + + + + + + + + cargoCrossBeamsAssemblyType + + + CargoCrossBeamsAssembly type, containing cargo + crossBeam assemblys + + + + + + + + + + + + + + + + + + + cargoDoorsAssemblyType + + + CargoDoorsAssembly type, containing cargo door + assemblys + + + + + + + + + + + + + + + + + + + Chordwise positioning of wing cells. + + + CellPositioningChordwise defines the chordwise direction of a wing cell either in two xsi + (xsi1 at innerBorder and xsi2 at outerBorder) coordinates, via referencing a spar-uID or via a + contour coordinate in chordwise direction. + + + + + + + + + + + Relative chordwise position of the inner + end. + + + + + Relative chordwise position of the outer + end. + + + + + + Reference to a spar as chordwise border. + + + + + + Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. + + + + + + + + + + + + + Spanwise positioning of wing cells. + + + CellPositioningSpanwise defines the chordwise direction of a wing cell either in two eta + (eta1 at leadingEdge and eta2 at trailingEdge) coordinates, via referencing a rib-uID or via a contour + coordinate in chordwise direction. + + + + + + + + + + + Relative spanwise position of the forward + end. + + + + + Relative spanwise position of the rear end. + + + + + + + + RibNumber is the reference to the rib number + of the rib set which is referenced by 'ribDefinitionUID'. + + + + + + Reference to a ribDefinition set. The single + rib of this ribDefinition set is defined by using 'ribNumber'. + + + + + + + Spanwise contour coordinate as spanwise border. 0 equals root, 1 equals tip. + + + + + + + + + + + + + centerFuselageAssemblyType + + + CenterFuselageAssembly type, containing wing box + assemblys + + + + + + + + + Choise between diffent center fuselage + modelling options + + + + Simplified center fuselage definition (rigid + body) + + + + UID of first frame in rigid center fuselage + area + + + + + UID of last frame in rigid center fuselage + area + + + + + UID of start stringer to define center + fuselage area + + + + + UID of end stringer to define center fuselage + area + + + + + + Detailled low wing center fuselage definition + (draft definition) + + + + + + Detailled high wing center fuselage definition + (draft definition) + + + + + + + + + + + + + + + centerFuselageAreasAssemblyType + + + centerFuselageAreasAssembly type, containing center + fuselage area assembly + + + + + + + + + + + + + + + + + + + centerFuselageHighWingConfiguration + + + + + + + + + + + + + + + + + + + + + + centerFuselageKeelbeamType + + + CenterFuselage / Keelbeam definition between mainframe1 + und mainframe3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageLateralPanelsType + + + CenterFuselage / lateral Panel definition between + mainframe2 und mainframe3 + + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageLongFloorBeamConnectionType + + + CenterFuselage / Long. floor beam connection + + + + + + + + + + + + + + + + + + + + + centerFuselageLowWingConfiguration + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageMainFramesType + + + CenterFuselage / main frame definition, containing + mainframe and pressure Bulkhead definitions + + + + + + + + + + + + + + + + + + + + + + + + centerFuselagePressureFloorType + + + CenterFuselage / pressure floor definition between + mainframe2 und mainframe3 + + + + + + + + + + + + + + + + + + + + + + + + centerFuselagePressureFloorType + + + CenterFuselage / side box definition between mainframe2 + und mainframe3 + + + + + + + + + + + + + + + + + + + + + certificationCasesType + + + + + + + + + + + + + + + + + + + + + + chargesCostType + + + + + + + + + + + + + + + + + + + + + + + + + + cockpitControlType + + + single cockpitControl is defined by a pilotInput and a + commandOutput. The commandOutput is linked to the commandCase + + + + + + + + + + + + + + + + + + + + + + + + + cockpitControlsType + + + Cockpit controls type, containing the cockpit controls + + Some controls are mandatory, others can be added via + cockpitControl elements + + + + + + + + + + + + + + + + + + + + + + commandCaseCommandType + + + single commandCaseCommand can either hold a + controlFunction or a controlDistributor + + + + + + + + + + + + + + + + + + + + + + + commandCaseType + + + single commandCase Containing several + commandCaseCommands + + + + + + + + + + + + + + + + + + + + + + commandCasesType + + + plural Element for commandCase, some fixed dp, dq, dr + and dx, dy, dz + + + + + + + + + + + + + + + + + + + + + + + + + componentCostType + + + + + + + + + + + + + + + + + + + + + + Load envelope + + + List of load cases defining a load envelope + + + + + + + + + + + Name + + + + + Description + + + + + UID of the corresponding point set + + + + + + List of uIDs defining the loads envelope + + + + + + + + + + + + + componentSegmentPathType + + + + + + + + + + + + + Definition of hingePoint of the + componentSegment. The hingePoint is used as reference point for + the deflection definition. + + + + + Definition of the orientation of the hinge + line with three Euler-rotation angles. The hinge line is + oriented along the global y-axis if all rotations are 0. + + + + + + Definition of all steps of the deflection + path. + + + + + + + + + + + + + componentSegmentStepType + + + + + + + + + + + + + The control parameter is used to reference the + state of a control device, e.g. in the load + case description. Can have any value and is NOT limited to the + range of -1 to 1. + + + + + Translation along the x-, y- and z-Coordinate + of the rotated hinge coordinate system. + + + + + Rotation around the hinge line. + + + + + + + + + + + + + + componentSegmentStepsType + + + + + + + + + + + + + Definition of one step of the deflection path. + + + + + + + + + + + + + + ComponentSegment of the wing. + + + + Within componentSegments the wing structure, the + control surfaces, the wing fuel tanks and the + wingFuselageAttachment is defined by using relative coordinates. + + A componentSegment is defined in the same way as + segments: from one cross section (sections->elements) to + another. Compared to segments one componentSegment can can start + and end at elements that are not consecutive. Therefore that one + componentSegment can be the combination of several segments. + Each wing has at least one componentSegment (from root to tip). + The maximal number of componentSegments equals the number of + segments (each segment is defined as one componentSegment). + This also implies that each segment can only be part of one componentSegment. + + In principal a componentSegment can combine any number + of segments. But if in one section two elements are defined, the + componentSegment has to start/end there as no well-defined + relative coordinats can be defined if steps in the wing occure. + + An example for wing componentSegments can be found in + the picture below: + + + + Within componentSegments a relative spanwise + coordinate (eta) and a relative chordwise coordinate (xsi) is + defined. Those coordinates are used for the definition of e.g. + wing structures and control surfaces. there are two types of eta xsi coordinates. + Segment (eta, xsi) coordinates define the relative local coordinate system for a segment ranging from (0,0) to (1,1). + + + + + + The eta xsi coordinates for a component segment are based on the segment eta xsi planes. + As a reference length for the component segment eta coordinate the + mid chord lines of all the segments are used. + The beginning of this line at from-element equals eta = 0, while the end of this line + at the to-element equals eta = 1. All wing positions that lie on the same + element (segment border) have the same eta coordinate. The points inbetween + two elements are defined by the iso xsi lines of the segment eta xsi space. + An example for the definition of the relative axes can + be found in the picture below: + + + + + In order to calculate the global coordinates of a component segment eta xsi point + one first has to calculate the eta point on the xsi iso line of (xsi=0.5), + and then walk along the iso eta lineof the segment. + + An example for determining the a component + eta xsi point can be found in the picture below: + + + + + + + + + + + + + + + + + + + + + + + + Name of the wing componentSegment. + + + + + + + Description of the componentSegment. + + + + + + + Reference to the element from which the + componentSegment shall start. + + + + + + + Reference to the element from which the + componentSegment shall end. + + + + + + + + + Description of deflection path of + componentSegments (e.g. used for + trimmable HTPs). + + + + + + + + + + + + + + + + + + + ComponentSegments of the wing. + + + ComponentSegments type, containing all the + componentSegments of the wing. + + + + + + + + + + + + + + + + + + + compositeLayerType + + + CompositeLayer type, conatining data of a composite + layer + + + + This type defines single composite layers by + giving a ply thickness, ply reference angle and a materialUID. + + + + + + + + Name of layer + + + + + Description of layer + + + + + Thickness of layer + + + + + Angle of layer in degree + + + + + Material UID of the layer + + + + + + + + + + + + + compositeType + + + Composite type, conatining data of a composite + + + + + Within this type individual stackings of + composites can be introduced by defining an offset and a set of + composite layers. The order of the composite layers defines the + stacking order. + + + + + + + Name of composite + + + + + Description of composite + + + + + offset of the laminate. The reference plane of + the laminate is the arithmetic mean of the laminate thickness. + + + + + + + + + + + + + + + + compositesType + + + + + + + + + + + + + + + + + + + + + + connectivitiesType + + + + + + + + + + + + + + + + + + + + + + connectivityType + + + + + + + + + + + + + + + + + + + + + + + + + + Constraints + + + + Constraint settings for the point performance definition + + + + + + + + + + + Calibrated airspeed [m/s] + + + + + + + Mach number [-] + + + + + + + Climb angle [deg] + + + + + + + Rate of climb [m/s] + + + + + + + Rate of turn [deg/s] + + + + + + Thrust setting for derated engine as fraction of max. thrust (e.g.: for powered descents, deceleration not at IDLE, manoevres) + + + + + + + Rate of velocity [m/s^2] + + + + + + + Duration [s] + + + + + + + Angle of attack [deg] + + + + + + + Constant altitude [m] + + + + + + + + + + + + + + Constraint + + + + + Specification of performance constraints. + + Constraints allow vectors of double values to define parameter lapses within a mission segment. The example below illustrates this by means of an exemplary climb profile of a conventional airliner, in which multiple physical and regulatory speed constraints are simultaneously specified over several altitudes (e.g., to account for the crossover altitude): + <endCondition> + <positionGeo> + <altitude relationalOperator="ge" uID="altClimb">10058.4</altitude> <!-- FL330 --> + </positionGeo> +</endCondition> +<constraint> + <referenceEndConditionUID>altClimb</referenceEndConditionUID> + <endConditionRatio>0.0;0.303</endConditionRatio> <!-- FL0, FL100 --> + <continuitySetting>discrete</continuitySetting> + <CAS relationalOperator="le">128.61;154.33</CAS> <!-- 250 [kt], 300 [kt]--> + <machNumber relationalOperator="le">0.78;0.78</machNumber> + <prioritySetting>velocity</prioritySetting> +</constraint> + + + From FL0 until FL100, the vehicle should fly at a velocity less than or equal to CAS = 250 kt or M = 0.78. In this first segment at low altitudes, the constraint on CAS is triggered. + + + From FL100 until FL330, the vehicle should fly at a velocity less than or equal to CAS = 300 kt or M = 0.78. In this second segment, the vehicle starts by increasing velocity until 300 kt, the constraint on maximum machNumber triggers from the crossover altitude onwards + + + + + + + + + + + + + Reference to the uID of the segment end condition variable + + + + + + + Vector indicating the ratios of the constraintSettings profile with respect to the provided referenceEndCondition, ranging from 0 to 1. If this vector is defined, the provided constraintSettings are expected to be vectors with the same length providing ratio-value pairs. Example: for referenceEndCondition <range><z> (i.e.: flown distance in z direction of the segment), a vector of <CAS> and <machNumber> is provided to define a climb profile. + + + + + + Defines how to interpret the parameter lapses within the segment: discrete steps (C0 continuity) or linear interpolation (C1 continuity) + + + + + + + + + + + + + + + Calibrated airspeed within the + segment + + + + + + + Mach number within the segment + + + + + + + Climb angle within the segment + + + + + + + Climb angle within the segment + + + + + + + Specific excess power within the segment + (e.g.: for defining minimum SEP to + remain after step climbs have been + performed). + + + + + + + Altitude difference of each step climb + + + + + + + + Flight heading at the end of the + segment in compassAngle with + reference to true North [deg] + + + + + + + Total change of heading angle during + segment (a full turn is 360 degrees) + [deg] + + + + + + + + Rate of turn within the segment + + + + + + + Thrust setting for derated engine as + fraction of max. Thrust (e.g.: for + powered descents, deceleration not at + IDLE, manoevres). + + + + + + + Rate of velocity within the segment + + + + + + + Load factor experienced during segment + + + + + + + Constant altitude for the segment. + + + + + + + priority setting indicating which + constraint is preferred within the + segment + + + + + + + + + + + + + + + + + + + + + + Airfoil definition of an control surface at the + inner/outer border. + + + + Optional definition of the exact airfoil shape at the + inner/outer border of the control surface. + The airfoil shape is defined via referencing to the + airfoilUID. As the leading and trailing edge point is fix due to + the outer shape definition of the control surface the airfoil + can only be rotated around the x-axis (axis going from leading + to trailing edge of the inner/outer border of the control + surface). Scaling in x-direction is also defined by the outer + shape, wherefore only scaling in y and z direction is allowed. + + + + + + + + + + + + Reference to the airfoil uID. + + + + + + Rotation around an axis, going from the + leading edge point to the trailing edge point of the inner/outer + border of the control surface. Defaults to 90°, which is + equivalent to perpendicular on the control surface middle plane. + + + + + + Scaling of the airfoil in spanwise direction + (not used for 2D airfoils). + + + + + Scaling in thickness direction of the airfoil. + + + + + + + + + + + + + + controlDistributorType + + + + single controlDistributor bundling several + controlElements + Within some analyses, it might occur that overlapping control element settings are specified. In this case, + it is assumed that a cumulative setting is built by summing up the individual settings. As the behavior of these settings + is not necessarily linear, a certain order of summation has to be followed: + + (1) The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. + (2) With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. + (3) All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. + (4) With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. + (5) During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. + + + + + + + + + + + + + + Vector of command inputs. The minimum and maximum value is given by the lowest and highest entry of the vector, respectively. + + + + + + + + + + + + + + + controlDistributorsType + + + plural Element for controlDistributor + + + + + + + + + + + + + + + + + + + controlElementType + + + Single controlElement linking the inputs of a controlDistributor via a gain + table to a contol device by using its uID. Controls can be ControlSurfaces and in the + future thrust. + + + + + + + + + + UID of the control device, e.g. a control surface. It is not allowed to reference another control distributor. + + + + + Vector of control device states resulting from the input commands. It must be of the same length as the inputCommands element. + The minimum and maximum values are defined according to the minimum and maximum values of the input commands. + + + + + + + + + + + + + controlElementsType + + + plural Element for controlElement + + + + + + + + + + + + + + + + + + + controlFunctionType + + + single controlFunction containing the controller's + parameters + + + + + + + + + + + + + + + + + + + + + + + + + + controlFunctionsType + + + plural Element for controlFuntion + + + + + + + + + + + + + + + + + + + controlLawModeType + + + Control Laws type, containing the aircraft's control + law mode + + + + + + + + + + + + + + + + + + + controlLawModesType + + + Control Laws type, containing the aircraft's control + law modes + + + + + + + + + + + + + + + + + + + controlLawsType + + + Control Laws type, containing the aircraft's control + laws + + + + + + + + + + + + + + + + + + + + Definition of an actuator of the control surface, that + is not placed within a track. + + + Definition of an actuator of the control surface, that + is not placed within a track. + + + + + + + + + + Reference to the actuator (actuator definition + currently not available in CPCAS, status 1.6). + + + + + + + + + + + + + + + + Definition of actuators of the control surface, that + are not placed within a track. + + + Definition of actuators of the control surface, that + are not placed within a track. + + + + + + + + + + + + + + + + + + + Airfoil definition of an control surface between inner + and outer border. + + + + Optional definition of the exact airfoil shape between + the inner and outer border of the control surface. + The airfoil shape is defined via referencing to the + airfoilUID. As the leading and trailing edge point is fix due to + the outer shape definition of the control surface the airfoil + can be rotated around the x-axis (axis going from leading to + trailing edge of the control surface) and around the z-axis + (normal axis on the control surface middle plane). Scaling in + x-direction is also defined by the outer shape, wherefore only + scaling in y and z direction is allowed. + + + + + + + + + + + Relative spanwise coordinate (eta) of the + control surface, where the leading edge of the airfoil is + placed. + + + + + Reference to the airfoil uID. + + + + + + Rotation around an axis, going from the + leading edge point to the trailing edge point of the control + surface. Defaults to 90°, which is equivalent to perpendicular + on the control surface middle plane. + + + + + Rotation of the airfoil around the control + surface middle plane normal direciotn. Reference point is the + most forward point of the airfoil. Defaults to 90°, which is + equivalent to the airfoilplacement in flight direction (along + wings-x axis). + + + + + Scaling of the airfoil in spanwise direction + (not used for 2D airfoils). + + + + + Scaling in thickness direction of the airfoil. + + + + + + + + + + + + + + Inner/outer border of the control surface. + + + + Definition of the inner/outer border of the control + surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + In addition, optionally, the airfoil shape of the + control surface can be defined closer. For the leading edge + devices 'hollow'. If an exact control surface airfoil definition + should be used, outerShape->airfoils can be used. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + Relative spanwise inner/outer position of the + leading edge of the control surface. + + + + + Relative spanwise inner/outer position of the + trailing edge of the control surface. Defaults to 'etaLE'. + + + + + + Relative chordwise inner/outer position of + the trailing edge of the control surface. Reference is eta/xsi + from the parent. + + + + + + + + + + + + + + + + + + + + + + + Inner/outer border of the control surface. + + + + Definition of the inner/outer border of the control + surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + In addition, optionally, the airfoil shape of the + control surface can be defined closer. For the + spoiler'relHeightLE' is used. If an exact control surface + airfoil definition should be used, outerShape->airfoils can + be used. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + Relative spanwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + Relative spanwise inner/outer position of the + trailing edge of the control surface. Reference is eta/xsi from + the parent. Defaults to 'etaLE'. + + + + + Relative chordwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + Relative chordwise inner/outer position of the + trailing edge of the control surface. Reference is eta/xsi from + the parent. + + + + + + Defines the relative high of lowest point of + the spoiler leading edge, relative to the airfoil height of the + parent at this position. See picture below. + + + + + + + + + + + + + + + + Inner/outer border of the control surface. + + + + Definition of the inner/outer border of the control + surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + In addition, optionally, the airfoil shape of the + control surface can be defined closer. For the trailing edge + device this is done at 'leadingEdgeShape', for the spoiler + 'relHeightLE' is used and for the leading edge devices 'hollow'. + If an exact control surface airfoil definition should be used, + outerShape->airfoils can be used. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + Relative spanwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + Relative spanwise inner/outer position of the + trailing edge of the control surface. Reference is eta/xsi from + the parent. Defaults to 'etaLE'. + + + + + Relative chordwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + + + + + + + + + + + + Optional definition of the exact airfoil shape of the + control surface. + + + + + + + + + + + + + + + + + + + + + + This type contains a vector of deflection values for a + single control surface + + + + + 0. General overview + + In this type, a vector of deflections of a single + control surface is specified. + + + + 1. + <controlSurfaceUID> + (mandatory) + + + A reference to a control surface from the aircraft + model + + + + 2. + <controlParameters> + (mandatory) + + + A vector of controlParameters of the selected + control surface (with respect to the defined deflection path). + + + + + + + + + + + + + + Reference to a control surface + + + + + + Control parameters of the control surface + + + + + + + + + + + + + + This type contains a list of control surfaces and their + deflection vectors + + + + + 0. General overview + + In this type, a list of control surfaces is defined. + + + + + 1. + <controlSurface> + (mandatory) + + + One of these nodes per deflected control surface is + required here. + + + + + + + + + + + + + + + + + + + + + + controlSurfaceHingeMomentMapType + + + controlSurfaceHingeMomentMap type, containing a moment + map with aerodynamic data for a control surface. Array order is: + controlParameters min->max then angleOfAttack then angleOfSideslip + then reynoldsNumber then machNumber. AngleOfAttack, angleOfSideslip, + reynoldsNumber and machNumber are taken from the basic + performance map one level above. + + + + + + + + + + Reference to the control surface + + + + + + Control parameters of the control surface + + + + + + + + + + + + + + + + + + + + controlSurfaceHingeMomentMapsType + + + controlSurfaceHingeMomentMapsType type, containing the + aerodynamic moment maps for one or more control surfaces. + + + + + + + + + + + + + + + + + + + + controlSurfaceHingePointType + + + + The deflection path of a control surface is described + with respect to two hinge points - one at the inner border of + the control surface and one at the outer border of the control + surface. Those two points are defined using the xsi and relative + height coordinates of the parent. Therefore those points can also + lay outbound of the control surface. Those two points defined + the hinge line, which is a straight line between the two points. + + An example can be found below: + + + + + + + + + + + + + + Relative chordwise coordinate (xsi) of the + hinge line point. Reference is the parent chord. + + + + + + Relative height of the hinge line point. + Reference is the parent airfoil height. + + + + + Optional absolute translation of the hinge point. + This can be used to move the hinge points outside of the wing shape. + + + + + + + + + + + + + Outer shape definition of the control surface. + + + + + Definition of the outer shape of the leading edge + control surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + + + + + + + + + Outer shape definition of the spoiler control surface. + + + + + Definition of the outer shape of the control surface. + + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + + + + + + + + + Outer shape definition of the control surface. + + + + + Definition of the outer shape of the trailing Edge + control surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + + + + + + + + + Definition of the deflection path of the control + surface. + + + + The deflection path of a control surface is described + with respect to two hinge points - one at the inner border of + the control surface and one at the outer border of the control + surface. Those two points are defined using the xsi and relative + height coordinates of the parent. Therefore those points can also + lay outbound of the control surface. Those two points defined + the hinge line, which is a straight line between the two points. + + The deflection path of the control surface is defined + within the hinge line coordinat system. This is defined as + follows: The x-hinge coordinate equals the wing x-axis. The + y-hinge coordinate equals the hinge line axis (see above; + positive from inner to outer hinge point). The z-hinge line is + perpendicular on the x-hinge and y-hinge coordinate according to + the right hand rule. The rotation of the control surface is + defined as rotation around the positive y-hinge line. + + The deflection of the is defined in any number of + steps. The deflection of the control surface is done as follows: + First the x-deflection at the inner and outer border; afterwards + the z-deflection of the inner and outer border; last the + y-deflection of the inner border. The y-deflection is only + defined at the inner border, as it is identical to the outer + border. If no values for the outer border deflection are given, + they default to the values of the inner border. + An example can be found below: + + + + + + + + + + + + + + + + + + + + + + + + + controlSurfacePerformanceMapType + + + ControlSurfacePerformanceMap type, containing a delta + performance map with aerodynamic data for a control surface. Array + order is: relativeDeflection min->max then angleOfAttack then + angleOfSideslip then altitude then machNumber. AngleOfAttack, + angleOfSideslip, altitude and machNumber are taken from the + basic performance map one level above. + + + + + + + + + + Reference to the control surface + + + + + + Relative deflection of the control surface + + + + + + + + + + + + + + + + + + + + controlSurfacePerformanceMaps + + + controlSurfacePerformanceMaps type, containing the + aerodynamic delta performance maps for one or more control + surfaces. + + + + + + + + + + + + + + + + + + + Border type for the inner and outer border of a wing + cut out + + + + Maybe applied to specifiy inner and outer border of + the cutout either via eta or rib references + + + + + + + + + + + + + + + Link to a rib definition + + + + + + Rib number in the corresponding + ribDefinitionUID + + + + + + + Spanwise location of the border at the + leading edge of the cut out + + + + + Spanwise location of the border at the + trailing edge of the cut out + + + + + + + + + + + + + + Cut out of the parents upper/lower skin due to a + control surface. + + + + Optional. Definition of the skin cut out due to a + control surface. The cut out of the skin can either be defined + by referencing to a spar uID or by defining the relative chord + values (xsi) of the cut at the inner and outer border of the + control surface. The xsi value is based on the parents chord. + For leading edge devices additional parameters can be defined. + + An example for wing cut outs can be found in the + picture below: + + + + + + + + + + + + + + + Xsi value of the inner border, where the cut + out begins. + + + + + Xsi value of the outer border, where the cut + out begins. + + + + + + Reference to a spar, defining the skin cut + out. + + + + + + + + + + + + + controlSurfaceStepType + + + + The deflection path of the control surface is defined + within the hinge line coordinat system. This is defined as + follows: The x-hinge coordinate equals the wing x-axis. The + y-hinge coordinate equals the hinge line axis (see above; + positive from inner to outer hinge point). The z-hinge line is + perpendicular on the x-hinge and y-hinge coordinate according to + the right hand rule. The rotation of the control surface is + defined as rotation around the positive y-hinge line. + + The deflection of the is defined in any number of + steps. The deflection of the control surface is done as follows: + First the x-deflection at the inner and outer border; afterwards + the z-deflection of the inner and outer border; last the + y-deflection of the inner border. The y-deflection is only + defined at the inner border, as it is identical to the outer + border. If no values for the outer border deflection are given, + they default to the values of the inner border. + An example can be found below: + + + + + + + + + + + + + + The control parameter links a generic floating point value to + a certain status of a control device (e.g. control surface, landing gear, suction + system, brake parachute, ...). See the documentation of the global CPACS-Element for + further information. + + + + + + Translation of the inner hinge line point + within the hinge line coordinate system. Defaults to zero. Not + allowed for spoilers! + + + + + Translation of the outer hinge line point + within the hinge line coordinate system. Defaults to the values + of the inner hinge line point. Not allowed for spoilers! + + + + + + Positve rotation around the hinge line, + heading from the inner to the outer border. Defaults to zero. + + + + + + + + + + + + + + Definition of the steps of the control surface + deflection path. + + + + List of steps. + + + + + + + + + + + + + + + + + + + + Control surface tracks (mechnaical link between control + surface and parent). + + + + A track generally describes the structural connection between a control surface and a wing (or parent element). For example, a track can be a flap track, a revolute joint connecting an aileron or spoiler, or the kinematics of slats on a wing. + The spanwise position of the track is defined by + etaPosition, which refers to the control surface dimensions. + + The structural properties of the track (e.g. + materials) are defined in trackStructure. + If an actuator is included into the the track, a + reference is given in actuator. + The principal kinematic of the track is defined by + setting the trackType and trackSubType. Please refer to the + tables below for setting the trackType and trackSubType + parameter. Note, those tables are not final - they are extended + continuously. + + + + Trailing edge track types + + + trackType + picture + description + trackSubType + picture + description + + + 1 + + + + + + Revolute joint; no actuators; the revolute joint is on TED hinge line. + 1 + + + + + + Revolute attached at the wings rear spar and the TEDs front spar respectively the load + carrying ribs of the TED. + + + 2 + + + + + + Revolute joint; dropped hinge; linear or rotary actuator (subtype-dependent) included. + The drive strut (if any) is defined as strut1. + 1 + + + + + + Box beam design as wing attachment; rotary drive attached at wing rear spar. + + + + + + 2 + + + + + + Wing attachment at wing rear spar; rotary drive attached at wing rear spar + + + + + + 3 + + Track mounted inside the fuselage at wing root. + + + 3 + + + + + + Upside-down, forward link in conjunction with a straight track on a fixed structure + as aft. support; including rotary drive. + 1 + + + + + + Wing attachment using a box beam design where track is mounted; rotary actuator mounted + at the wing rear spar. + + + + + + 2 + + Track mounted inside the fuselage at wing root. + + + 4 + + + + + + Straight and sloped track on a fixed structure as forward support and an upright link as + aft. support; linear or rotary actuator (subtype-dependent) included. + 1 + + + + + + Wing attachment using a box beam design where the track is mounted; rotary actuator at + the wing rear spar. + + + + + + 2 + + + + + + Wing attachment using a box beam design where track is mounted; rotary actuator mounted + on the track. + + + + + + 3 + + Track mounted inside the fuselage at wing root. + + + + + + + + + + + + + + Relative chordwise position of the track. Eta + refers to the control surface. + + + + + Type of the track. Please refer to the remarks + of the controlSrufaceTrackTypeType for details. + + + + + + + + + + + + + + + + Type of the track. Please refer to the remarks + of the controlSrufaceTrackTypeType for details. + + + + + + + + + + + + + + + + + + + + + + + + + + Control surface tracks (mechnaical link between control + surface and parent). + + + + + + + + + + + + + + + + + + + + + + Cut out of the parents structure due to a control + surface. + + + + Optional. Definition of the parents structure cut out + due to a control surface. The cut out is split into three parts: + cut out of the upper and lower skin and the definition of an + profile conecting the cut out of the upper and lower skin. + + An example for wing cut outs can be found in the + picture below: + + + + In the default configuration the cut out is as wide as + the control surface. If additional spacing is necessary inner + and outer border may be set. + + + + + + + + + + + + + + + + + + + + + + + + + controlSurfacesType + + + Definition of the outer shape, structure and deflection + of all control surfaces (flaps, slats, soiler, ailerons...) of + the wing. + + + + + + + + + + + + + + + + + + + + + costAirConditioningSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costAutomaticFlightSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costAuxilaryPowerUnitsType + + + + + + + + + + + + + + + + + + + + + + + + + costBleedAirSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costCommunicationSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costComponentsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costDeIcingSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costElectricalSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costEnginePylonsType + + + + + + + + + + + + + + + + + + + + + + + + + costEquippedEnginesType + + + + + + + + + + + + + + + + + + + + + + + + + costFireProtectionSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costFixedEmergencyOxygenSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + + costFlightControlSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costFuelSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costFurnishingElementsType + + + + + + + + + + + + + + + + + + + + + + + + + + + costFurnishingsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costFuselagesType + + + + + + + + + + + + + + + + + + + + + + + + + costHydraulicSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costInstrumentSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costLandingGearType + + + + + + + + + + + + + + + + + + + + + + + + + costLightingSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costNacellesType + + + + + + + + + + + + + + + + + + + + + + + + + costNavigationSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costPowerUnitsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costWaterInstallationSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costWingsType + + + + + + + + + + + + + + + + + + + + + + + + + + + crashLoadCasesType + + + + + + + + + + + + + + + + + + + + + + crashLoadcaseType + + + CrashLoadcase type, containing a crash loadcase + + + + + + + + + + + + + Optional start of crash section: Default: + first frame of model + + + + + Optional end of crash section: Default: last + frame of model + + + + + Initial velocities + + + + + Initial rotations around axes, roll, pitch, + yaw + + + + + Initial rotational velocities aroud axes + + + + + + Definition of reference point to consider + rotation + + + + + AccelerationFields, usually gravity in z + + + + + + Definition of impact Surface for crash + simulation + + + + + + + + + + + + + + + + + + + + + + + crewCostType + + + + + + + + + + + + + + + + + + + + + + + + crossBeamAssemblyPositionType + + + CrossBeamAssemblyPosition type, containing the position + of a crossBeam assembly + + + + + + + + + + UID of profile based structural element to be + used as crossbeam + + + + + UID of the frame to which the crossbeam is + attached + + + + + Referenze z position of the crossbeam + + + + + + + + + + + + + + + + crossBeamStrutAssemblyPositionType + + + CrossBeamStrutAssemblyPosition type, containing a + crossBeam strut assembly position + + + + + + + + + + UID of profile based structural element to be + used as crossbeam strut + + + + + UID of the frame to which the crossbeam strut + is attached + + + + + UID of the crossbeam to which the crossbeam + strut is attached + + + + + Referenze y position of the strut at the + crossbeam intersection + + + + + angle of the strut in global yz plane + + + + + + + + + + + + + + + + cruiseRollerType + + + + + + + + + + + + + Definition of the position of the mid point of + the roll of the cruise roller. + + + + + Definition of the attachment of the cruise + roller to the parent of the flap. This is the track on which the + roll rolls during retracted flap position + + + + + Definition of the attachment of the cruise + roller to the flap. + + + + + Degree of freedom that is blocked by the + cruise roller if the flap is in retracted position. Positive = + cruise roller blockes bending in the direction of the upper skin + of the parent. Negative = cruise roller blockes bending in the + direction of the lower skin of the parent. + + + + + + + + + + + + + + cruiseRollersType + + + + + + + + + + + + + Definition of one cruise rollers/mid-span + stops. + + + + + + + + + + + + + cst2DType + + + + + + + + + + + A 2D impelmentation for Class shape + transformations. For more details look at AIAA Journal of Aircraft + Vol.45 No.1 2008 + + + + + The psi vector for definition of the class and + shape function, i.e. the points at which the CST functions will + be evaluated + + + + + N1 for the class function for the upper side + of the profile + + + + + N2 for the class function for the upper side + of the profile + + + + + B Coefficients for the Bernstein polynominal + on the upper side + + + + + N1 for the class function for the lower side + of the profile + + + + + N2 for the class function for the lower side + of the profile + + + + + B Coefficients for the Bernstein polynominal + on the lower side + + + + + Optionally, the trailingEdgeThickness of the + profile + + + + + + + + + + + + + + + + + + + + + + + curvePointType + + + Point on a curve in normalized curve coordinates. + The referenceUID must reference a one-dimensional curve such as spars. + + + + + + + + + + Relative position on the referenced line/curve. + + + + + This reference uID determines the reference curve. + If it points to a spar, then the eta value is considered to be a spar coordinate + between start (eta=0) and end (eta=1) of the spar. + + + + + + + + + + + + + cutLoadIntegrationPointsType + + + cutLoadIntegrationPoints are defined in a vector + notation, due to the high amounts of data. Usually they well be + defined inbetween the ribs. Each point must have an id. + Optionally it is possible to rotate the orientation within a + cutloadIntegrationPoint to obtain meaningful results. The + orientation is optional and relative to the CPACS coordinate + system + + + + + + + + + + + + + + + + + + + + + + + + + Additional definition of the leading edge cut out. + + + + + Optional. Definition of additional parameters, + describing the shape of the parents leading edge of the cut out + due to leading edge devices. + The parameters are described in the picture below: + + + + + + + + + + + + + + + Relative height of the most forward position of + the parents leading edge, relative to the airfoil height without + cut out. + + + + + Relative chordwise position of the most + forward position of the parents leading edge, relative to the + parents chord without cut out. + + + + + + + + + + + + + cutOutControlPointsType + + + + + + + + + + + + + + + + + + + + + + + Definition of cut out profiles. + + + + Optional, the exact shape between the upper and lower + skin cut out can be given by using cutOutProfiles. In general + cut out profiles are open profiles and not closed profiles as + e.g. wing airfoils. The placement, scaling and (partly) rotation + of the cut out profiles is fixed as the beginning and ending + point of the profile is fixed as can be seen in the two pictures + below. + + + + + + + + + + + + + + + + + Reference to the profile uID. Profiles should + be linked in profiles/structuralProfiles + + + + + Relative spanwise position of the cut out + profile. The eta coordinate refers to the control surface and + desribes the cut out profile at the leading edge of the control + surface. + + + + + Rotation of the airfoil around the control + surface middle plane normal direciotn. Reference point is the + most forward point of the airfoil. Defaults to 90°, which is + equivalent to the airfoilplacement in flight direction (along + wings-x axis). + + + + + + + + + + + + + Definition of cut out profiles. + + + + + + + + + + + + + + + + + + + + + + + + cutOutType + + + CutOut type, containing cut-outs + + + + + + + + + + Name of the cut out element + + + + + + Description of the cut out element + + + + + + Width of the cut element (absolute value) + + + + + + Height of the cut element (absolute value) + + + + + + Fillet radius of the cut element (absolute + value) + + + + + UID of a structural element that reinforces + the cut out + + + + + + + + + + + + + + Damping derivatives for positive and negative rotation + rates + + + + + 0. General overview + + This type contains the damping derivatives. They are + split up into those derivatives for positive rotation rates, + and those for negative rotation rates. + + + + 1. <positiveRates> (optional) + + Damping derivatives, calculated by positive rotation + rates. + + + + 2. <negativeRates> (optional) + + Damping derivatives, calculated by negative rotation + rates. + + + + + + + + + + + + + + + + + + + + + + + + deckType + + + Deck type, containing the data of a deck + + + + + + + + + + Name of the deck + + + + + Description of the deck + + + + + + The starting point of the deck/cabin. In a + conventional aircraft like the A320, it would be the rear wall + of the cockpit. The coordinate is relative to the parent object + defined by “parentUID”, which should be the fuselage. + + + + + + The starting point of the deck/cabin. In a + conventional aircraft like the A320, it would be the rear wall + of the cockpit. The coordinate is relative to the parent object + defined by “parentUID”, which should be the fuselage. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + decksType + + + Decks type, containing the decks of the fuselage + + + + + + + + + + + + + + + + + + + + deltaTemperatureType + + + + + + + + + + + + + + + + + + + + + + + + + + + + Design masses + + + The design mases are requerments wich can com form the + TLARs + + + + + + + + + + Take off mass + + + + + Zero Fuel mass + + + + + Maximum landing mass + + + + + Maximum ramp mass (the maximum weight + authorised for the ground handling) + + + + + + + + + + + + + Design parameter definition + + + Contains a the values of a parameter and its uid as reference. + + + + + + + + + + + + + + + + + + + + + + Design parameters list + + + Contains a list of all design parameters. + + + + + + + + + + + + + + + + + + + + Design space definition + + + Contains the definition of the design space. + + + + + + + + + + + + + + + + + + + + + + + Design study definitions + + + Contains the data of design studies definitions. + + + + + + + + + + + + + + + + + + + + directOperatingCostType + + + + + + + + + + + + + + + + + + + + + + + + + + + + divergenceCaseType + + + DivergenceCase type, containing a case for aeroelastic + divergence analysis + + + + + + + + + + Mach number of divergence case + + + + + + Divergence stagnation pressure + + + + + + + + + + + + + + divergenceCasesType + + + DivergenceCases type, containing the cases for + aeroelastic divergence analysis + + + + + + + + + + + + + + + + + + + doorAssemblyPositionType + + + DoorAssemblyPosition type, containing the position of a door + assembly + + + + + + + + + + + + optional definition of door type (restricted to pax, + service, emergency, cargo) + + + + + + + + + + + + + + + UID of the door element + description + + + + + UID of the forward door frame + + + + + UID of the backward door frame + + + + + UID of the stringer at the upper door + edge + + + + + UID of the stringer at the lower door + edge + + + + + Lower height of the door with respect to the floor. + (Information necessary for boarding and evacuation analysis not + necessarily linked to structures) + + + + + Minimum widh of the door element. (Information + necessary for boarding and evacuation analysis not necessarily + linked to structures) + + + + + Minimum height of the door element. (Information + necessary for boarding and evacuation analysis not necessarily + linked to structures) + + + + + Door on right side of the fuselage = 1; on the left = + -1. (Information necessary for boarding and evacuation analysis not + necessarily linked to structures) + + + + + + + + + + + + + + doorCutOutType + + + CutOut type, containing cut-outs + + + + + + + + + + Name of door cutout element + + + + + Description of door cutout + element + + + + + Fillet radius of door cutout + element + + + + + Reference UID to the description of a DSS (door + surround structure) + + + + + + + + + + + + + + doorSurroundStructurePositionType + + + DoorSurroundStructurePosition type, containing the position of a + door surround structure + + + + + + + + + + + + number of bays effected by DSS in front of + door + + + + + number of bays effected by DSS in behind of + door + + + + + number of bays effected by DSS + + + + + number of bays effected by DSS + + + + + + + + + + + + + + doorSurroundStructuresAssemblyType + + + doorSurroundStructuresAssembly type, containing + dorrSurroundStructure definitions + + + + + + + + + + + + + + + + + + + doorsType + + + Doors type, containing doors + + + + + + + + + + + + + + + + + + + driveSystemType + + + DriveSystem Type, defining a drive system (combination + of transmissions/gearboxes and shafts and their links to engines + and rotors) of a rotorcraft model. + + + + + + + + + + + + + + + + + + + + + driveSystemsType + + + DriveSystems Type, containing all the drive systems + (combination of transmissions/gearboxes and shafts and their + links to engines and rotors) of a rotorcraft model. + + + + + + + + + + + + + + + + + + + dynamicAircraftModelAnalysisType + + + + + + + + + + + + + + + + + + + + + + dynamicAircraftModelCoordinatesType + + + + + + + + + + + + + + + + + + + + + + + + + Emissivity map, containing the diffuse emissivity of a material at different spectral lengths. + + + The emissivity of a material can vary with the spectral wave length. + The vectors diffuseEmissivity and waveLength must have the same size to be valid. + The data should be linearly interpolated. + + + + + + + + + + + Wave length in [m] + + + + + Diffuse emissivity of the material + + + + + + + + + + + + + engineAnalysisType + + + + + + + + + + + + + Thrust at takeoff + + + + + Fan pressure ratio at takeoff + + + + + + Bypass ratio at takeoff + + + + + overall pressure ratio at takeoff + + + + + + Maximum rotations per second, shaft 1 + + + + + + Maximum rotations per second, shaft 2 + + + + + + Design tip relative mach number (FAN) + + + + + + DryMass of engine + + + + + + + + + + + + + + Definition of global geometry parameters of the engine + fan. + + + + + + + + + + + + + Inner radius of the fan. + + + + + Outer radius of the fan. + + + + + + + + + + + + + Definition of the global engine geometry. + + + + All engine geometry definitions refer to the engine + coordinate system. The engine coordinate system has its orgine + in the middle of the fan plan. The positive x-axis is heading to + the rear, the positive z-axis to the top and the y-axis + according to the right hand rule. + + + + + + + + + + + length of engine + + + + + diameter of engine + + + + + dProp + + + + + Chordlength of a fan blade + + + + + + + + + + + + + + + + + engineGlobalType + + + EngineGlobal type, containing global engine data + + + + + + + + + + + Concept of engine + + + + + + + + + + + + + + + Year of first certification + + + + + + Rotation direction of the engine if looking at + it from the front, i.e. from propeller/fan to exhaust + + + + + + + + + + + + + + Hub to tip ratio + + + + + Number of rotor blades of fan + + + + + + Number of outlet guiding vanes + + + + + + Rotor stator spacing (relative to chordlength) + + + + + + + + + + + + + + Definition of one engine mount. + + + + + + + + + + + + + Name of the engine mount. + + + + + Description of the engine mount. + + + + + + position of the engine mount refering to the + engine coordinate system. + + + + + + UID of the engine mount. + + + + + + + + + + + + List of all engine mounts. + + + + + + + + + + + + + + + + + + + + + + Definition of the engine nacelle type. + + + + The engine nacelle is currently located together with + the engine. It gives a simple description of the outer shell of + the engine. All values are defined according to the base area, + center point of the fan(i.e. negative values can occur in the + definition) In most cases there will be a bypass engine. For + non-bypass or mixed engines ignore the bypass nozzle. For further + information on the geometric setup, please refer to the picture + below. + + + + + + + + + + + + + + + + + + + + + + + + + + + + enginePerformanceMapType + + + EnginePerformanceMap type, containing a perfomance map + with engine data + + + + + + + + + + + + + + Flight Level + + + + + Mach number + + + + + Absolute thrust [N] + + + + + Fuel mass flow + + + + + Speed at core engine nozzle + + + + + + Total temperature at core engine nozzle + + + + + + Mass flow through core engine nozzle + + + + + + Speed at bypass nozzle + + + + + Total temperature at bypass nozzle + + + + + + Mass flow through bypass nozzle + + + + + + Percent of n1Max, shaft 1 + + + + + Percent of n2Max, shaft 2 + + + + + Fan pressure ratio + + + + + Fan efficiency + + + + + Turbine entry total temperature + + + + + + Emission index Carbon Monoxide + + + + + + Emission index Nitrogen Oxide + + + + + + Emission index Sulfur Oxide + + + + + + Emission index Soot + + + + + Emission index unburned hydrocarbon + + + + + + air density at core outlet 8 + + + + + + air density at bypass outlet 18 + + + + + + area at core outlet + + + + + area at bypass outlet + + + + + + + + + + + + + + enginePerformanceMapsType + + + + + + + + + + + + + + + + + + + + + + enginePositionType + + + EnginePosition type, containing data for a single + engine + + + + + + + + + + Name of the engine + + + + + Description of the engine + + + + + Reference to the used engine + + + + + + Component, to which the engine is mounted + + + + + + + + + + + + + + + + + + + + + + + + + + + Engine references + + + EnginePositions type, containing a reference to the + used engines and their positions at the configuration + + + + + + + + + + + + + + + + + + + Definition of one engine pylon. + + + + + + + + + + + + + Name of the engine pylon. + + + + + Description of the engine pylon. + + + + + + UID of the parent (normaly wing or fuselage). + + + + + + + + + + + + UID of the engine pylon. + + + + + + + + + + + + + + + + + + + + + + + Engine pylons + + + + + + + + + + + + + + + + + + + + + + Definition of the engine spinner geometry. + + + + + + + + + + + + + Most forward x-position of the spinner. + + + + + + X-position of the spinner base. + + + + + + Radius of the spinner at the base position. + + + + + + + + + + + + + + engineType + + + Engine type, containing engine data. + + + + + + + + + + Name of engine + + + + + Description of engine + + + + + Scaling of engine take-off thrust + + + + + + + + + + + + + + + + + + + Engines + + + Engines type, containing complete engine configurations + + + + + + + + + + + + + + + + + + + + etaIsoLineType + + + Iso line described by point of the same eta coordinate. + Can be either segment or component segment coordinates. + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta value is considered to be in segment + eta coordinate; if it points to a componentSegment, + then componentSegment eta coordinate is used. + + + + + + + + + + + + + fleetType + + + Each fleet can be divided into sub fleet groups + + + + + + + + + + Name of fleet + + + + + Description of the fleet + + + + + Description of sub-fleets. + + + + + + + + + + + + + + flightAnalysisType + + + + + + + + + + + + + + + + + + + + + + + Flight dynamics + + + + + + + + + + + + + + + + + + + + + + + + Linear model parameters + + + + + + + + + + + + + + + + + + + + + + + + + + Trim result + + + + + + + + + + + Mach number + + + + + + + True airspeed + + + + + + + Angle of attack + + + + + + + Altitude + + + + + + + + + + + + + + Load case + + + This node defines the load case + + + + + + + + + + + Name of the load case + + + + + + + Description of the load case + + + + + + + + + + + + + + + + + Load case specification + + + Input values defining a load case + + + + + + + + + + + Environment + + + + + + + Altitude above sea level + + + + + + + Mach number + + + + + + + UID of the aerodynamic loads (aeroCase) + + + + + + + + Controller description. Note: Since there is no controller description in CPACS yet, the expected content of this string element has to be defined individually for each project. + + + + + + + + + + + UID referencing the mass state of aircraft for this load case + + + + + + + + + + + + + + Flight load cases + + + + + + + + + + + + + + + + + + + + + + Flight loads + + + Loads resulting from the load case analysis + + + + + + + + + + + + + + + + + + + + + Load conditions + + + Inertia load conditions acting on the aircraft + + + + + + + + + + + Description + + + + + + + Safety factor applied on the loads + + + + + + + + Rotational rates around centre of gravity + + + + + + + Enumeration flag stating the typ of the load + case (i.e. limit or ultimate loads) + + + + + + + + + + + + + Angle of sideslip [deg] + + + + + + + Angle of attack [deg] + + + + + + + + + + + + + + + + Flight point definition for load case analysis + + + Description of the aircraft's flight state for + this load case. + + + + + + + + + + + + Environmental conditions + + + + + + + Altitude above sea level + + + + + + + Mach number + + + + + + + + + + + + + + Accelerations + + + Translational or rotational accelerations acting + on the aircraft + + + + + + + + + + + Rotational accelerations acting around aircraft centre of gravity [deg/s^2] + + + + + + + + + + + + + Load factors + + + + + + + + + + + + + + Load factor in x-direction + + + + + + + Load factor in y-direction + + + + + + + Load factor in z-direction + + + + + + + + + + + + + + Load case superposition + + + List of uIDs referencing load cases that are superimposed to the current load case + + + + + + + + + + + + UID reference to another load case to be superimposed + + + + + + + + + + + + + + Gust definition + + + The coordinate system of the gust corresponds to the CPACS coordinate system. + + + + + + + + + + Parameters describing the shape of the gust + + + + + + + + + + + + + + + + + Angle between gust and vehicle [deg] (e.g., 0deg: from right to left; 90 deg: downwards; 180deg: from left to right; 270/-90deg: upwards) + + + + + + + Gust length: length of ramp or gradient distance of 1-cos gust + + + + + + + Gust velocity + + + + + + + + + + + + + + Flight path + + + Definition of a flight path by points of longitude, latitude and a descriptive waypoint code. + + + + + + + + + + Vector of waypoint codes. If waypoint codes are not available put empty items into the waypoint string + + + + + Vector of waypoint latitude values in [deg] + + + + + Vector of waypoint longitude values in [deg] + + + + + Indicates the type of the way point. + + + + + + + + + + + + + + + + + + + + Performance case + + + + + + + + + + + + + + Name + + + + + + + Description + + + + + + + UID of flight performance requirement + + + + + + + + + + + + + + + + + + + + + + + Performance cases + + + List of performance cases + + + + + + + + + + + + + + + + + + + + Results of the landing analysis + + + + + + + + + + + + + Determined landing distance. + + + + + + Determined ground phase distance. + + + + + + + + + + + + + + Results of the take-off analysis + + + + + + + + + + + + + Main element containing the results for + take-off calculations optimized for min-imum liftoff speed + VLOFmin. + + + + + Main element containing the results for + take-off calculations optimized for min-imum safety speed V2min. + + + + + + + + + + + + + + flightPointType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flight systems + + + + + + + + + + + + + + + + + + + + + + flightType + + + Flight type, containing data of a scheduled flight + + + + + + + + + + MissionUID for the flights mission definition + + + + + ModelUID of the aircraft appointed to perform the flight + + + + + Departure day of the flight + + + + + Time of departure - the time is defined as SOBT (Scheduled Off-Block Time) / STD (Scheduled Time of Departure) + + + + + Arrival day of the flight + + + + + Time of arrival - the time is defined as SIBT (Scheduled In-Block Time) / STA (Scheduled Time of Arrival) + + + + + Reference to the operating airline of a flight + + + + + + + + + + + + + + + Flights + + + Flighs type, containing all flight definitions + + + + + + + + + + + + + + + + + + + + floorPanelAssemblyPositionType + + + FloorPanelAssemblyPosition type, containing a floor + panel assembly position + + + + + + + + + + x coordinate of the begin of the floor panel + (absolute value) + + + + + x coordinate of the end of the floor panel + (absolute value) + + + + + UID of the first long. floor beam to be + connected to the floor panel + + + + + UID of the second long. floor beam to be + connected to the floor panel + + + + + UID of structural sheet element used for the + floor panel + + + + + + + + + + + + + + + floorPanelsType + + + FloorPanels type, containing floor panel definitions + + + + + + + + + + + + + + + + + + + + Flying qualities + + + Provides a list of flying qualities cases + + + + + + + + + + + + + + + + + + + + + Flying qualities case + + + + + + + + + + + + + Name + + + + + Description + + + + + Aircraft Class; Class 1 small light aircraft; + Class 2 medium weight aircraft, low to medium maneuverability; + Class 3 large, heavy aircraft, low to medium maneuverability; + Class 4 high maneuverability aircraft + + + + + Flight Phase Category; Category A Non-terminal + flight phases requiring maneuvering, precision tracking, or + precise flight-path control (e.g. air-to-air combat, terrain + following). Category B Non-terminal Flight Phases with gradual + maneuvers and without precision tracking, although accurate + flight-path control may be required (e.g. climb, cruise). + Category C Terminal Flight Phases are normally accomplished + using gradual maneuvers and usually require accurate flight-path + control (takeoff, approach and landing). + + + + + main element containing longitudinal transfer + functions + + + + + main element containing lateral directional + transfer functions + + + + + main element containing characteristic + parameters of the handling qualities criteria + + + + + + main element containing handling qualities + ratings + + + + + + + + + + + + + + fqCharParametersType + + + + + + + + + + + + + static margin [-] + + + + + main element containing characteristic + parameter of phugoid damping + + + + + main element containing characteristic + parameters of short period mode criteria + + + + + main element containing characteristic + parameters of roll oscillation criterion + + + + + coupling of roll and spiral mode: normal = no + coupling of roll and spiral mode coupled = coupling of roll and + spiral mode + + + + + main element containing characteristic + parameters of lateral eigenvalues + + + + + main element containing characteristic + parameters of effective roll time constant criterion + + + + + + main element containing characteristic + parameters of roll performance criterion + + + + + + + + + + + + + fqEiglatType + + + + + + + + + + + + + natural frequency of dutch roll mode [rad/s] + + + + + + damping of dutch roll mode [-] + + + + + + roll time constant [s] + + + + + time to double of spiral mode [s] + + + + + + ratio of bank to sideslip angle [-] + + + + + + natural frequency of coupled rollspiral motion + [rad/s] + + + + + damping ratio of coupled roll-spiral motion + + + + + + product of roll-spiral damping and natural + frequency [rad/s] + + + + + handling qualities level of roll time constant + + + + + + handling qualities level of roll spiral mode + + + + + + + + + + + + + + fqLateralType + + + + + + + + + + + + + numerator of transfer function roll control + surface deflection to bank angle + + + + + numerator of transfer function roll control + surface deflection to yaw rate + + + + + numerator of transfer function roll control + surface deflection to sideslip angle + + + + + numerator of transfer function roll control + surface deflection to bank angle of reduced 4th order system + + + + + + numerator of transfer function roll control + surface deflection to sideslip angle of reduced 4th order system + + + + + + numerator of transfer function yaw control + surface deflection to yaw rate + + + + + numerator of transfer function yaw control + surface deflection to sideslip angle + + + + + numerator of transfer function roll stick + input to roll rate + + + + + numerator of transfer function roll stick + input to yaw rate + + + + + numerator of transfer function roll stick + input to bank angle + + + + + numerator of transfer function roll stick + input to sideslip angle + + + + + numerator of transfer function pedal input to + roll rate + + + + + numerator of transfer function pedal input to + yaw rate + + + + + numerator of transfer function pedal input to + bank angle + + + + + numerator of transfer function pedal input to + sideslip angle + + + + + denominator of lateral motion + + + + + + denominator of lateral motion of reduced 4th + order system + + + + + + + + + + + + + fqLongitudinalType + + + + + + + + + + + + + numerator of transfer function pitch stick + input to pitch rate + + + + + numerator of transfer function pitch control + surface deflection to pitch angle + + + + + numerator of transfer function pitch stick + input to pitch angle + + + + + numerator of transfer function pitch stick + input to angle of attack + + + + + numerator of transfer function pitch stick + input to vertical load factor + + + + + denominator of longitudinal motion + + + + + + + + + + + + + + fqPhugoidType + + + + + + + + + + + + + damping ratio of phugoid mode [-] + + + + + + time to double amplitude of unstable phugoid + mode [s] + + + + + + + + + + + + + fqRatingsType + + + + + + + + + + + + + handling qualities level of phugoid damping + + + + + + handling qualities level of C* criterion + + + + + + main element containing handling qualities + levels of short period mode + + + + + main element containing handling qualities + levels of roll oscillation criterion + + + + + main element containing handling qualities + levels of lateral eigenvalues + + + + + handling qualities level of effective roll + time constant + + + + + handling qualities level of roll performance + + + + + + + + + + + + + + fqRollPerfType + + + + + + + + + + + + + time to reach critical bank angle [s] + + + + + + critical bank angle that has to be reached + [deg] + + + + + + + + + + + + + fqRoloscType + + + + + + + + + + + + + ratio of oscillatory component of the roll + rate to the average roll rate [-] + + + + + phase angle of dutch roll oscillation in + sideslip [deg] + + + + + phase angle between roll rate and sideslip in + dutch roll mode [deg] + + + + + ratio of first minimum roll rate to first + maximum [-] + + + + + handling qualities level of ratio of + oscillatory component of roll rate to average roll rate + + + + + + + + + + + + + + fqShortPeriodType + + + + + + + + + + + + + steady state normal acceleration change with + angle of attack [g/rad] + + + + + short period natural frequency of reduced + order system [rad/s] + + + + + short period damping ratio of reduced order + system [-] + + + + + equivalent pitch time delay of reduced order + system [s] + + + + + handling qualities level of CAP criterion + + + + + + + + + + + + + + fqTreffType + + + + + + + + + + + + + effective roll time constant [s] + + + + + + time where tangent of bank angle step response + is placed [s] + + + + + + + + + + + + + frameType + + + frame type, containing frame definition (V1.5+) + + + + + + + + + + + + + + + + + + + + + framesAssemblyType + + + FramesAssembly type, containing frames assembly + + + + + + + + + + + + + + + + + + + + freePathType + + + + + + + + + + + + + + + + + + + + + + + mass + + + + + + + + + + + + + + + + + + + + + + Fuels + + + fuelType containing data for fuels + Can be used as a catalog for different (liquid) fuel + types + + + + + + + + + + + + + at 15deg C + + + + + + + + + + + + + + + + + + + + Fuels + + + fuelType containing data for fuels + + + + + + + + + + + + + + + + + + + fuselageAeroPerformanceType + + + fuselageAeroPerformance type, containing perfomance + maps with aerodynamic data of a fuselage. + + + + + + + + + + Reference to the uID of the analysed fuselage + + + + + + References used for the calculation of the + force and moment coefficients of the fuselage (in the fuselage + axis system!) + + + + + Calculated aerodynamic performance maps of the + fuselage + + + + + + + + + + + + + fuselageCutOutType + + + fuselageCutOut type, containing a fuselage cutout + definition + + + + + + + + + + Name of the cutout + + + + + Description of the cutout + + + + + X position of the cutout center point + + + + + + Y offset of the cutout reference point + + + + + + Z offset of the cutout reference point + + + + + + Angle in degrees of the vector pointing from + the cutout reference point to the cutout center point, measured + relative to the direction of the fuselage z axis. + + + + + + Coordinates of the unit vector defining the + direction of extrusion + + + + + Coordinates of the unit vector defining the + y-axis of the local cutout coordinate system. Must be normal to + the orientationVector. + + + + + This value is used to define the width of the + cutout + + + + + This value is used to define the height of the + cutout + + + + + This value is used to define the width of the + cutout + + + + + This value is used to define the height of the + cutout + + + + + Fillet radius of the cut element (absolute + value) + + + + + Cutout type. Determines the type of the cutout + and how it is treated by the tools. Possible values: + ("window"|"door"|"ramp") + + + + + + + + + + + + + + + + + + + + + + + + + + fuselageCutOutsType + + + fuselageCutOuts type, containing fuselage cutouts + + + + + + + + + + + + + + + + + + + + fuselageElementType + + + FuselageElement type, containing fuselage element data + + + + + + + + + + + Name of fuselage element + + + + + Description of fuselage element + + + + + + Reference to a fuselage profile + + + + + + + + + + + + + + + + fuselageElementsType + + + FuselageElements type, containing the elements of a + fuselage section + + + + + + + + + + + + + + + + + + + List of fuel tanks + + + + + + + + + + + + + The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. +The fuel tank volume type should also be used for the wing fuel tank + + + + + + + + + + + + + + fuselageProfilesType + + + FuselageProfiles type, containing fuselage profile + geometries. See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + + + fuselageSectionType + + + FuselageSection type, containing fusleage section and + element data + + + + + + + + + + Name of fuselage section + + + + + Description of fuselage section + + + + + + + + + + + + + + + + + fuselageSectionsType + + + FuselageSections type, containing fuselage sections + + + + + + + + + + + + + + + + + + + + fuselageSegmentType + + + FuselageSegment type, containing data of a fuselage + segment + + + + + + + + + + Name of fuselage segment + + + + + Description of fuselage segment + + + + + + Reference to element from which the segment + shall start + + + + + Reference to element at which the segment + shall end + + + + + Optional and additional guidecurves to shape + the outer geometry. + + + + + + + + + + + + + + fuselageSegmentsType + + + FuselageSegments type, containing fuselage segment + definitions (from sections and elements) + + + + + + + + + + + + + + + + + + + fuselageStructureType + + + FuselageStructure type, containing data of the fuselage's + structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fuselageType + + + + Fuselage type, containing all data related to a + fuselage + + + + + + + + + + + + + + + Name of fuselage + + + + + + + Description of fuselage + + + + + + + UID of part to which the fuselage is + mounted (if any) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fuselagesAeroPerformanceType + + + fuselagesAeroPerformance type, containing + fuselagesAeroPerformance + + + + + + + + + + + + + + + + + + + Fuselages + + + Fuselages type, containing the fuselages of the + configuration + + + + + + + + + + + + + + + + + + + This type contains a vector of deflection values for a + single gear + + + + + 0. General overview + + In this type, a vector of deflections of a single + gear is specified. + + + + 1. + <gearUID> + (mandatory) + + + A reference to a gear from the aircraft model + + + + + 2. + <controlParameters> + (mandatory) + + + A vector of control parameters of the selected + gear + + + + + + + + + + + + + Reference to a gear + + + + + Control parameters of the gear + + + + + + + + + + + + + + This type contains a list of gears and their deflection + vectors + + + + + 0. General overview + + In this type, a list of gears is defined. + + + + + 1. + <gear> + (mandatory) + + + One of these nodes per deflected gear is required + here. + + + + + + + + + + + + + + + + + + + + + + stringerFramePositionType + + + stringerFramePosition type, containing individual + stringer / frame postion definition (CPACS V2.1+) + + + + + + + + + + + + + + + + + + + + + Continuity definition for profile extrusion: + 0= C0 (allows sharp edges, default), 2= C2 (defines curvature + continuity) + + + + + + + + + + + + + Definition of interpolation between different + profiles: 0= no interpolation 1= interpolation of strcutural + profile + + + + + + + + + + + + + + + + + + + + + + generalStructuralMemberType + + + + + + + + + + + + + + + + + + + + + + + + generalStructuralMembersAssemblyType + + + generalStructuralMembersAssembly type, containing + structural member assemblys + + + + + + + + + + + + + + + + + + + genericCostType + + + + + + + + + + + + + + + + + + + + + + + + genericGeometricComponentType + + + + In some cases additional geometric components need to + be linked to a CPACS, but these components are not yet handled by + CPACS explicitly. For example, a belly fairing and/or external + tanks. + A generic geometric component may be applied to include + such a geometry from an external file (preferably STEP) in the + context of the overall aircraft. + + + + + + + + + + + + + + Name of genericGeometricComponent + + + + + + Description of genericGeometricComponent + + + + + + UID of part to which the component is mounted + (if any) + + + + + + + + + + + + + + + + + + + + + + + + + + + Generic geometric components + + + + + + + + + + + + + + + + + + + + + + mass + + + genericMassType, describing mass, inertia and CoG data. + + + + + + + + + + + name + + + + + description + + + + + parentUID + + + + + mass value + + + + + mass loaction values (x,y,z) + + + + + + mass orientation values + + + + + + + + + + + + + + + genericSystemsType + + + Node for geometrical layout of system components + based on simple geometric shapes + + + + + + + + + + + + + + + + + + + Generic system type containing describing the basic dimensions of a system component using simple geometric shapes + + + + The generic base types must be one of the following cone|sphere|cube|cylinder. The origin of the shapes is at the center of volume for cube, sphere and cylinder. Since the cone is constructued from a cylindric shape, its origin is at the same location as the origin of the basic cylinder, although not any longer the center of volume due to scaling of one side. While cube and sphere are symmetrical in all three axis, cylinder and cone are standing upright in the direction of cpacs z-axis. The tip of the cone is located in direction of the positive z-axis. The figure below illustrates the default position and orientation of the different shapes. Note that the cube, cylinder and sphere were moved along the x-axis for demonstration by 2, 4 and 6 meters respectively. + For spheres the default diameter is 1m. Cubes have a length of 1m in all three dimensions. Cylinders have a length of 1m and a diameter of 1m for the circular cross section. The cone is a cylinder with the top face scaled down to zero. + + + + + + + + + + + + + + + Name of the system component. + + + + + Description of the system component. + + + + + Enum for selecting the basic shape of the + component + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + geographicPointConstraintType + + + Geographic point constraint, containing a longitude, latitude, altitude data triplet. + + + + + + + + + + Longitude coordinate 0-360 + + + + + Latitude coordinate 0-360 + + + + + Altitude in meters + + + + + + + + + + + + + geographicPointType + + + Geographic point type, containing a longitude, latitude, altitude data triplet. + + + + + + + + + + Longitude coordinate 0-360 + + + + + Latitude coordinate 0-360 + + + + + Altitude in meters + + + + + + + + + + + + + + airfoilAeroPerformanceType + + + airfoilAeroPerformance type, containing perfomance maps + with aerodynamic data of an airfoil. + + + + + + + + + + References used for the calculation of the + force and moment coefficients + + + + + Calculated aerodynamic performance maps of the + full configuration + + + + + + + + + + + + + globalBeamPropertiesType + + + globalBeamPropertiesType, containing the global beam + properties such as EA, EI, mass + + + + + + + + + + + + + + + + + + + + + + + + + + + Ground load Cases + + + + + + + + + + + + + + + + + + + + + + guideCurveProfileGeometryType + + + + A guide curve profile is defined by a profile name, an + optional description and a 3-dimensional relative pointlist with + all three coordinates mandatory. For typical profiles, one of + the coordinate vectors contains only "0" entries. All point + coordinates are transferred to the global coordinate system. + First and last point may, but need not to, be identical. + + The points have to be ordered in a mathematical + positive sense. + A profile can be symmetric. In that case the profile + is interpreted as being not closed and will be closed by + mirroring it on the symmetry plane. + Curves have to go continuously over the whole wing or + fuselage + Connection of guide curves from segment to segment + + + + + + + + Please note, currently it is not possible to apply any + means of class based transformation in the description. However, + this may be an addition for the future. + + + + + + + + + + + Name of profile + + + + + Description of profile + + + + + + + + + + + + + + + + + + + + + + + + + + guideCurveProfilesType + + + Guide Curve Profiles type. This type is used to + describe guide curves that enable designers to create a geometry + that deviates from a standard loft. + + + + + + + + + + + + + + + + + + + + Guide Curve Type + + + + A guide curve may be used to alter the shape of the + outer geometry and "guide" the loft. + The guide curve profiles are defined in the guideCurveProfileGeometryType. + Their use on wing and fuselage components is illustrated in the image below. + + + + + + + + + + + + + + + Name of guide curve + + + + + Description of guide curve + + + + + Reference to a guide curve profile + + + + + + For the first segment fromGuideCurveUID is not + a valid entry! For the first guideCurve + fromRelativeCircumference must be applied! fromGuideCurveUID is + exclusive. + + + + + + Reference to the previous guide curve from + which this guide curve shall start. + + + + + + Continuity definition for geometry + generation. Possible options: C0, C1 from previous, C2 from + previous, C1 to previous, C2 to previous + + + + + + + + + + + + + + + + + + + Reference to the relative circumference + position from which the guide curve shall start. Valid values + are in the interval -1.0...1.0. + + + + + + Tangent at first point + + + + + + + + The relative circumference + position at which the guide curve shall end. Valid values + are in the interval -1.0...1.0. + + + + + + Tangent at last point + + + + + + Local direction along which the relative x-coordinates of + the guide curve points are defined. For the wing the default is + the wing's local x-axis, for the fuselage its the fuselage's local z-axis. + + + + + + + + + + + + + + + Guide Curves Type + + + Guide Curve type. This type is used to describe guide + curves that enable designers to create a geometry that deviates + from a standard loft. + + + + + + + + + + + + + + + + + + + hingeMomentsMapType + + + hingeMomentsMap type, containing a hinge moments map + with aerodynamic data. Array order is: angleOfAttack min->max + then angleOfSideslip then reynoldsNumber then machNumber. + All coefficients in the aeroperformanceMap relate to + the CPACS coordinate system. See documentation of the + CPACS-Element for further information. + + + + + + + + + + Name of the AeroPerformanceMap. + + + + + + Description of the AeroPerformanceMap. + + + + + + Mach number + + + + + Reynolds Number + + + + + Sideslip angle + + + + + Angle of attack + + + + + + + + + + + + + + htpFwdInterfaceDefType + + + Definition of the interface of forward HTP attachment + + + + + + + + + + Definition of the forward HTP attachment + interface + + + + relative width of reinforcement at fwd HTP + attachment, between 0.0 and 1.0 + + + + + relative width of plate at fwd HTP attachment + (only applicable for Type1 model), between 0.0 and 1.0, smaller + than htpPlateWidth + + + + + UID of panel element at HTP forward attachment + in x-direction (shell elements) + + + + + UID of panel element at HTP forward attachment + in z-direction (shell elements) + + + + + UID of reinforcements for panel element at HTP + forward attachment in z-direction (beam elements) + + + + + + UID of the element to fix HTP to fuselage + (beam elements) + + + + + + + + + + + + + + htpInterfaceDefType + + + Definition of the interface of HTP + + + + + + + + + Definition of the HTP interface + + + + + UID of the fuselage frame at the forward HTP + attchment + + + + + + UID of the fuselage frame at the backward HTP + attchment + + + + + + maximum HTP deflection (nose up in + degrees) + + + + + + maximum HTP deflection (nose down in + degrees) + + + + + + angle of the reinforcements at backward HTP + attchment + (in degrees) + + + + + + Defines area (absolute) in x-direction around + htpFrame2UID where the HTP attachmentpoint has correct position + ==> check and potentially warning message + + + + + Defines area (absolute) in y-direction around + the + outer edge of htpFrame2UID where the HTP attachmentpoint has correct + y-position ==> check and potentially warning + message + + + + + + Defines allowed z-position for rear HTP + attachment + relativ to total frame height ==> check and potentially warning + message ==> check and potentially warning + message + + + + + + Definition of HTP structural + elements + + + + + + Definition of HTP forward attachment to + structure + + + + + + + + + + + + + + + htpStructElemDefType + + + definition of structural elements in HTP attachment + + + + + + + + + + Definition of tailplane attachment area + (Standard Configuration) + + + + UID of structural element for HTP front + crossbeams + + + + + UID of structural element for HTP rear + crossbeams + + + + + UID of structural element for HTP diagonal + beams + + + + + UID of structural element for HTP side beams + + + + + + UID of structural element for upper HTP cutout + reinforcement beams, also used for lower cutout reinforcement, + when not explicitely defined + + + + + UID of structural element for lower HTP cutout + reinforcement beams (optional) + + + + + + + + + + + + + + indirectOperatingCostType + + + + + + + + + + + + + + + + + + + + + + interConnectionStrutAttachmentType + + + + + + + + + + + + + Definition of the position of the attachment + joint in relative coordinates. + + + + + Material settings of the attachment. + + + + + + + + + + + + + + interconnectionStrutType + + + + + + + + + + + + + uID of control surface where this flap is + attached to by the interconnection strut. + + + + + Material settings of the strut (if strut is + moddeled as a simple strut). + + + + + Definition of the attachment on this control + surface. + + + + + Definition of the attachment on the other + control surface + + + + + Free path in positive (tensil) and negative + (compression) direction before interconnection strut blocks. + + + + + + + + + + + + + + + interconnectionStrutsType + + + + + + + + + + + + + Definition of one interconnection strut. + + + + + + + + + + + + + + intercostalPositionType + + + intercostalPosition type, containing the position of intercostals + in DSS + + + + + + + + + + + + UID of the frame at which intercostal + starts + + + + + UID of the forward door frame + + + + + UID of the door + + + + + non-dimensional value ranging between 0 and 1 + + + + + + UID of profileBasedStructuralElement used for + intercostal + + + + + + + + + + + + + + IntercostalsAssemblyType + + + IntercostalsAssembly type, containing intercostal + definitions + + + + + + + + + + + + + + + + + + + structuralElementsConnectionsType + + + StructuralElementsConnections type, containing + connections between structural elements + + + + + + + + + + Flag for automatic generation of interface + definitions (draft version) + + + + + + + + + + + + + + + landingGearInterfaceDefinitionsType + + + CenterFuselage landing gear interface definitions + + + + + + + + + + + + + + + + + + + + + + + + + + keelbeamType + + + HighWingCenterFuselage / Keelbeam definition between + mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lateralPanelsType + + + HighWingCenterFuselage / lateral Panel definition + between mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + + + + + longFloorBeamConnectionType + + + HighWingCenterFuselage / Long. floor beam connection + + + + + + + + + + + + + + + + + + + + + centerFuselageMainFramesType + + + High wing main frame definition, containing mainframe + UIDs + + + + + + + + + + + + + + + + + + + + + + + pressureFloorType + + + High Wing Center Fuselage / pressure floor definition + between mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + + sideboxType + + + HighWingCenterFuselage / side box definition between + mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + Landing gear position safety margins + + + LandingGearPositionSafetyMargins type, containing the + safety margins of the gear due to its position + + + + + + + + + + Safety margin for landing gear x position + regarding tail clearance at takeoff pitch angle + + + + + + Safety margin for landing gear x position to + avoid tail dropping down during touchDown and ground maneuvering + + + + + + Safety margin for landing gear y position to + avoid wing tip dropping down during ground maneuvering + + + + + + Safety margin for landing gear y position + regarding wingtip or engine nacelle clearance at a certein roll + angle + + + + + + + + + + + + + Landing gears + + + Contains a list of landing gears. + + + + + + + + + + + + + + + + + + + Landing gears + + + LandingGear type, containing the definition of nose, + main and skid gears. + + + + + + + + + + + + + + + + + + + + + Trailing edge device of the wing. + + + A leadingEdgeDevice (LED) is defined via its outerShape + relative to the componentSegment. The WingCutOut defines the area + of the skin that is removed by the LED. Structure is similar to + the wing structure. The mechanical links between the LED and the + parrent are defined in tracks. The deflection path is described + in path. Additional actuators, that are not included into a + track, can be defined in actuators. + Leading and trailing edge are defined by the outer + shape of the wing segments, i.e. the trailing edge of a + trailingEdgeDevice is the trailing edge of the wing. This is also + valid for kinks that are present in the wing but not explicitly + modeled in the control surface. + The edges of the control surface within the wing are a + straight line in absolute coordinates! Hence, there needs to be a + straight connection between the eta-wise outer and inner points + of the edge that is within the wing in absolute coordinates. + + + + + + + + + + + Name of the leading edge device. + + + + + + Description of the leading edge device. + + + + + + UID of the parent of the LED. The parent is + the componentSegment, where it is attached to. + + + + + + + + + + + + + + + + + + + + + Definition of the wings leading edge devices. + + + + Definition of the wings leading edge devices. + + + + + + + + + + + + + + + + + + + + Optional definition of the airfoil inner shape of + leading edge devices (LED). + + + + All parameters are optional. For the definition of the + parameters, please refer to the picture below. Parameters from + the outer border default to the parameters of the inner border. + + + + + + + + + + + + + + + Relative height of the most forward point of + the LED's rear part, based on the airfoil height of the parent + at this position. Optional. + + + + + Relative chordwise position of the most + forward point of the LED's rear part, based on the chord of the + parent at this position. Optional. + + + + + + + + + + + + + Optional definition of the leading edge shape of + trailing edge devices (TED). + + + + All parameters are optional. For the definition of the + parameters, please refer to the picture below. Parameters from + the outer border default to the parameters of the inner border. + + + + + + + + + + + + + + + Relative height of the leading edge of the TED, + based on the airfoil height of the parent at this position. + Optional. + + + + + Relative chordwise upper skin position, of the + border, where the airfoil of the TED is equivalent of the + airfoil from the parent. Measured from the rear to the front (0 + = TED trailing edge; 1 = TED leading edge). Values form the + outer border default to the value of the inner border. Optional. + + + + + + Relative chordwise lower skin position, of the + border, where the airfoil of the TED is equivalent of the + airfoil from the parent. Measured from the rear to the front (0 + = TED trailing edge; 1 = TED leading edge). Values form the + outer border default to the value of the inner border. Optional. + + + + + + + + + + + + + + linerType + + + Liner type, containing liner data + + + + + + + + + + Type of liner + + + + + + + + + + + + + % of fan diameter + + + + + % of fan diameter + + + + + + + + + + + + + linkToFile + + + Please provide a link to the additional file that shall + be loaded by the TIGL library. Furthermore it is necessary to + provide the format attribute so that the file type can be + identified. Several CAD formats provide multiple endings, and + hence, this measure seems necessary. + + + + + + + + + + + + + + + + + + + + + + + + + Load analysis + + + + + + + + + + + + + + + + + + + + + + + loadBreakdownType + + + + + + + + + + + + + + + + + + + + + + + + + + Load cases + + + + + + + + + + + + + + + + + + + + + + + + + loadReferenceAxisPointType + + + + + + + + + + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative height position. + relHeight is relative to the local airfoil thickness. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta-xsi values are considered to be in segment + eta-xsi coordinates; if it points to a componentSegment, + then componentSegment eta-xsi coordinates are used. + + + + + + + + + + + + + + loadReferenceAxisPointsType + + + + + + + + + + + + + + + + + + + + + + Load envelopes + + + The loads envelope is the results of the loadsAnalysis + and lists those loadcases that are limiting for the design + + + + + + + + + + + + + + + + + + + + + logFloorBeamPositionType + + + longFloorBeamPosition type, containing individual + position definition + + + + + + + + + + UID of structural element + + + + + UID of crossbeam to which the long. beam is + attached + + + + + y position of long. beam + + + + + + Continuity definition for profile extrusion: + 0= C0 (allows sharp edges, default), 2= C2 (defines curvature + continuity) + + + + + + + + + + + + + Definition of interpolation between different + profiles: 0= no interpolation 1= interpolation of strcutural + profile + + + + + + + + + + + + + + + + + + + + + + longFloorBeamType + + + longFloorBeam type, containing a long. floor beam + definition + + + + + + + + + + + + + + + + + + + + longFloorBeamsAssemblyType + + + longFloorBeamsAssembly type, containing long. floor + beam assemblys + + + + + + + + + + + + + + + + + + + mAirConditioningType + + + + + + + + + + + + + Air conditioning mass description + + + + + + + + + + + + + + mAutomaticFlightSystemType + + + + + + + + + + + + + Automatic flight system mass description + + + + + + + + + + + + + + mAuxillaryPowerUnitType + + + + + + + + + + + + + Auxillary power unit masse description + + + + + + + + + + + + + + mBellyFairingsType + + + + + + + + + + + + + + + + + + + + + + + mBleedAirSystemType + + + + + + + + + + + + + Bleed air system mass description + + + + + + + + + + + + + + mBulkCargoType + + + + + + + + + + + + + + + + + + + + + + mBulkCargosType + + + + + + + + + + + + + + + + + + + + + + + mBulkheadsType + + + + + + + + + + + + + + + + + + + + + + + mCabinFloorsType + + + + + + + + + + + + + + + + + + + + + + + mCabinLightingsType + + + + + + + + + + + + + + + + + + + + + + + mCargoFloorsType + + + + + + + + + + + + + + + + + + + + + + + mCargoLiningsType + + + + + + + + + + + + + + + + + + + + + + + mCargoLoadingsType + + + + + + + + + + + + + + + + + + + + + + + Cargo masses + + + + + + + + + + + + + Cargo masses description + + + + + Cargo mass description + + + + + + + + + + + + + + + + mCarriagesType + + + + + + + + + + + + + + + + + + + + + + + mCarryOnType + + + + + + + + + + + + + + + + + + + + + + mCarryOnsType + + + + + + + + + + + + + + + + + + + + + + + mCateringsType + + + + + + + + + + + + + + + + + + + + + + + mCellsType + + + + + + + + + + + + + + + + + + + + + + + mCockpitLightingsType + + + + + + + + + + + + + + + + + + + + + + + mCommunicationType + + + + + + + + + + + + + Communication mass description + + + + + + + + + + + + + + mComponentSegmentType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mComponentSegmentsType + + + + + + + + + + + + + + + + + + + + + + + mControlSurfaceSupportType + + + + + + + + + + + + + + + + + + + + + + + + + mControlSurfaceSupportsType + + + + + + + + + + + + + + + + + + + + + + + mCrewMembersType + + + + + + + + + + + + + + + + + + + + + + + mCrewSeatsType + + + + + + + + + + + + + + + + + + + + + + + mDeIcingType + + + + + + + + + + + + + De-icing mass description + + + + + + + + + + + + + mDocumentsToolsType + + + + + + + + + + + + + + + + + + + + + + + mDoorsType + + + + + + + + + + + + + + + + + + + + + + + mElectricalDistributionType + + + + + + + + + + + + + Electrical distribution mass description + + + + + + + + + + + + + + mElectricalGenerationType + + + + + + + + + + + + + Electrical generation mass description + + + + + + + + + + + + + + mEmergencyEquipmentsType + + + + + + + + + + + + + + + + + + + + + + + mEmergencyOxygenSystemsType + + + + + + + + + + + + + + + + + + + + + + + mEmptyULDType + + + + + + + + + + + + + + + + + + + + + + mEmptyULDsType + + + + + + + + + + + + + + + + + + + + + + + mEngineControlType + + + + + + + + + + + + + Engine control mass description + + + + + + + + + + + + + + mEquippedEnginesType + + + + + + + + + + + + + + Equipped engines mass description + + + + + + + + + + + + + + + mExtLightingsType + + + + + + + + + + + + + + + + + + + + + + + mFireProtectionType + + + + + + + + + + + + + Fire protection mass description + + + + + + + + + + + + + + mFixedGalleysType + + + + + + + + + + + + + + + + + + + + + + + mFixedLeadingEdgeType + + + + + + + + + + + + + + + + + + + + + + mFixedLeadingEdgesType + + + + + + + + + + + + + + + + + + + + + + + + mFixedTrailingEdgeType + + + + + + + + + + + + + + + + + + + + + + + + mFixedTrailingEdgesType + + + + + + + + + + + + + + + + + + + + + + + mFlightControlsType + + + + + + + + + + + + + Flight controls mass description + + + + + + + + + + + + + + mFloorCoveringsType + + + + + + + + + + + + + + + + + + + + + + + mFramesType + + + + + + + + + + + + + + + + + + + + + + + + + mFreshWaterSystemsType + + + + + + + + + + + + + + + + + + + + + + + mFuelSystemType + + + + + + + + + + + + + Fuel system mass description + + + + + + + + + + + + + + Fuel mass + + + + + + + + + + + + + Fuel mass description + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Furnishing mass description + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mFuselageStructureType + + + + + + + + + + + + + Fuselage structure mass description + + + + + + + + + + + + + + + + + + + + + + + + + + mWallsType + + + + + + + + + + + + + + + + + + + + + + + mFuselagesStructureType + + + + + + + + + + + + + Fuselages structure mass description + + + + + + + + + + + + + + + mHydraulicDistributionType + + + + + + + + + + + + + Hydraulic distribution mass description + + + + + + + + + + + + + + mHydraulicGenerationType + + + + + + + + + + + + + Hydraulic generation mass description + + + + + + + + + + + + + + mIFESystemsType + + + + + + + + + + + + + + + + + + + + + + + mInstrumentPanelType + + + + + + + + + + + + + Instrument panel mass description + + + + + + + + + + + + + + mInsulationsType + + + + + + + + + + + + + + + + + + + + + + + mIntegratedModularAvionicsType + + + + + + + + + + + + + Integrated modular avionics mass description + + + + + + + + + + + + + + mInterGasSystemType + + + + + + + + + + + + + Inter gas system mass description + + + + + + + + + + + + + + mLandingGearSupportsType + + + + + + + + + + + + + + + + + + + + + + + mLandingGearsType + + + + + + + + + + + + + + Landing Gears mass description + + + + + + + + + + + + + + + + mLavatoriesType + + + + + + + + + + + + + + + + + + + + + + + mLiningsType + + + + + + + + + + + + + + + + + + + + + + + mMainGearsType + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Manufacturer empty mass description + + + + + + + + + + + + + + + + + + mMillitarySystemsType + + + + + + + + + + + + + Millitary systems mass description + + + + + + + + + + + + + + mMiscellaneousType + + + Miscellaneous masses must only specify componenent masses for which NO DEDICATED ELEMENT EXISTS in the mass breakdown list! + + + + + + + + + + + + + + + + + + + mMoveableLeadingEdgeType + + + + + + + + + + + + + + + + + + + + + + + + mMoveableLeadingEdgesType + + + + + + + + + + + + + + + + + + + + + + + mMoveableTrailingEdgeType + + + + + + + + + + + + + + + + + + + + + + + + mMoveablesType + + + + + + + + + + + + + + + + + + + + + + + + mNavigationType + + + + + + + + + + + + + Navigation mass description + + + + + + + + + + + + + + mNoseGearsType + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Operator items mass description + + + + + + + + + + + + + + + + + + + + + mOverheadBinsType + + + + + + + + + + + + + + + + + + + + + + + mPartStowDoorsType + + + + + + + + + + + + + + + + + + + + + + + mPassengerType + + + + + + + + + + + + + + + + + + + + + + mPassengersType + + + + + + + + + + + + + + + + + + + + + + + Passengers masses + + + + + + + + + + + + + Passanger masses Description + + + + + + Passanger mass Description + + + + + + + + + + + + + + Payload mass + + + + + + + + + + + + + Payload mass description + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Power units mass description + + + + + + + + + + + + + + + + + + + + mPylonAttachmentsType + + + + + + + + + + + + + + + + + + + + + + + mPylonsType + + + + + + + + + + + + + + Pylons mass description + + + + + + + + + + + + + + + mRibType + + + + + + + + + + + + + + + + + + + + + + mRibsType + + + + + + + + + + + + + + + + + + + + + + + mSeatsType + + + + + + + + + + + + + + + + + + + + + + + mShellType + + + + + + + + + + + + + + + + + + + + + + + + + mShellsType + + + + + + + + + + + + + + + + + + + + + + + + mSkinPanelsType + + + + + + + + + + + + + + + + + + + + + + + mSkinsType + + + + + + + + + + + + + + + + + + + + + + + mSparsType + + + + + + + + + + + + + + + + + + + + + + + mSpecialStructuresType + + + + + + + + + + + + + + + + + + + + + + + mSpoilersType + + + + + + + + + + + + + + + + + + + + + + + mStringersType + + + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Structure mass description + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Systems mass description + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mTrailingEdgeDeviceType + + + + + + + + + + + + + + + + + + + + + + + + mTrailingEdgeDevicesType + + + + + + + + + + + + + + + + + + + + + + + mULDContentType + + + + + + + + + + + + + + + + + + + + + + mULDContentsType + + + + + + + + + + + + + + + + + + + + + + + mVacuumWasteSystemsType + + + + + + + + + + + + + + + + + + + + + + + mWasteWaterSystemsType + + + + + + + + + + + + + + + + + + + + + + + mWindowsType + + + + + + + + + + + + + + + + + + + + + + + mWingBoxType + + + + + + + + + + + + + + + + + + + + + + + + + mWingStructureType + + + + + + + + + + + + + Wing structure mass description + + + + + + + + + + + + + + + mWingsStructureType + + + + + + + + + + + + + Wings structure mass description + + + + + + + + + + + + + + + Main actuator + + + + Definition of the landing gear main actuator. + + + + + + + + + + + Reference to the main actuator uID of the + landing gear + + + + + + + + + + + + + + Main landing gear + + + List of main gears + + + + + + + + + + + + + + + + + + + mainStrutInterfaceDefinitionsType + + + HighWingCenterFuselage main strut interface definitions + + + + + + + + + + + + + + + + + + + + + + mainStrutFuselageAttachmentType + + + HighWingCenterFuselage / main strut attachment to + fuselage frame and stringer + + + + + + + + + + + + + reference to the structural element that comprises this connection. + + + + + + + + + + + + + + maintenanceCostType + + + + + + + + + + + + + + + + + + + + + + + + Mass breakdown + + + + + 1. General + + + The + massBreakeDown + is subdivided in + designMasses + , + fuel + , + payload + and + mOME + (operating empty mass). + + + designMass + + The design masses contain the overall values for + mTOM and so forth. These should be listed as specified by the + TLAR or found from initial sizing. + + fuel + and + payload + + The fuel and payload nodes should contain maximum + values, i.e. full fuel tanks, all passengers on board and full + cargo holding. These values may exceed the maximum allowable + take-off mass as the actual loading of the aircraft should be + specified in the weight and balance section of the aircraft. + + + mOEM + + + The operation empty mass structure is based on the Airbus Mass + Standard brake down [AIRBUS MASS STANDARD 2008]. The + operator’s mass empty (OME) is defined by the sum of the + following component masses: + + operator’s items + manufacturer’s mass empty (MME) + + + + + + + 2. massDescription + + + Each sub component has the following + massDescription + which include a: + + Name + Description + parentUID + Mass value + Mass location + Mass orientation + Mass Inertia. + + + + The + massdescription + can be found at the + designMasses + direct under each item. At the + fuel + , + payload + and + mOME + under massDescription in each item and sub item. + + Concerning symmetry please note that any item + referenced by its UID, e.g. wingUID, accounts for the complete + component, e.g. right and left side. Hence for these items + their complete mass needs to be specified. If the mass of + geometricallly symmetrical components is different, please use + the symmetry modifyers for UIDs: _symm and _mirror. See also + the overall CPACS definition section on symmetry + + + + + + + + + + + + + + + + + + + + + + + + + Fuel Mass Fraction + + + Describing the mass fraction considered for a mission segment sequence + + + + + + + + + + Reference to the segment from which the fuel fraction should be considered + + + + + Reference to the segment to which the fuel fraction should be considered + + + + + Float value of the mass fraction defined as + fraction = m_end / m_start + + + + + + + + + + + + + massInertiaType + + + massInertiaType + + + + + + + + + + + + + + + + + + + + + + + + massInertiaVectorType + + + + + + + + + + + + + + + + + + + + + + + + + + + materialDefinitionForProfileBasedPointType + + + MaterialDefinitionForProfileBased type, containing a + material definition (Reference to material and thickness) for + profile based objects, addition point reinforcements + + + + + + + + + + uID of the profile point to which the + additional stiffness shall be applied. + + + + + uID of a material definition. + + + + + + cross sectional area of additional long. + stiffener at strctural element point + + + + + optional auxiliary parameter for special use + (no physical meaning) + + + + + optional auxiliary parameter for special use + (no physical meaning) + + + + + + + + + + + + + Definition of the properties of the structural + profile sheet + + + MaterialDefinitionForProfileBased type, containing a + material definition (Reference to material and thickness) for + profile based objects. + + + + + + + + + + + UID of the sheet to which the material + properties shall be applied + + + + + + Predefined ID of the sheet of a standard profile + + + + + + + + + + + + + + + + + + Length of the sheet of a standard profile [m] + + + + + + + + + uID of a composite definition. + + + + + + Orthoropy direction of the composite. + + + + + + Scaling factor of the composite thickness. + + + + + + + + uID of a material definition. + + + + + + Absolute thickness of the material [m] + + + + + + + + + + + + + + + + Material Definition + + + MaterialDefinition type, containing a material + definition (Reference to material and thickness) + + + + + + + + + choice between composite / isotropic material + definition + + + + + uID of a composite definition. + + + + + + Orthotropy direction of the composite. + + + + + + Scaling factor of the composite thickness. + Absolute thicknesses are defined in each composite material + seperatly + + + + + + + uID of a material definition. + + + + + + Absolute thickness of the material. + + + + + + + + + + + + + + + Material + + + + Definition of the material properties for one of the following + material types: + + isotropic materials + anisotropic 2D and 3D materials + orthotropic 2D and 3D materials + + The nonemclature is adopted from [1] to define the material properties in an orthotogonal 1-2-3 + coordinate system. This may be illustrated by the stresses of a three-dimensional cube: + + + + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + + + + + + + + + + + + Name of the material + + + + + Description of the material + + + + + Material density [kg/m^3] + + + + + + + + + + + + + + + + + Reference temperature for thermal expansion + coefficient [K] + + + + + + + + + + + + + + + + + Isotropic material properties + + + + Defines the material properties for an isotropic material. Note that the shear modulus G + is defined in terms of the elastic modulus E and the Poisson's ratio nu as: + + + + Specifying a value for all three properties E, G and nu therefore results in an overdetermined material definition and must be avoided. + + + + + + + + + + + + Young's modulus [N/m^2] + + + + + + + Shear modulus [N/m^2] + + + + + + + Poisson's ratio + + + + + + + Thermal expansion coefficient [1/K] + + + + + + + Thermal conductivity of the material in + [W/(m*K)] + + + + + + + Allowable stress for tension [N/m^2] + + + + + + + Allowable stress for compression [N/m^2] + + + + + + + Allowable stress for shear [N/m^2] + + + + + + + Allowable strain for tension + + + + + + + Allowable strain for compression + + + + + + + Allowable strain for shear + + + + + + + Yield strength, tension [N/m^2] + + + + + + + Yield strength, compression [N/m^2] + + + + + + + Plastification curves for isotropic + materials incl. element elimination + + + + + + + Optional knockdown factor for fatiuqe + (defaults to 1) + + + + + + + Fatigue behaviour of the material + + + + + + + Damage tolerance behaviour of the + material + + + + + + + + + + + + + + + Anisotropic material properties for 2D materials + + + + + Defines the material properties for a linear anisotropic material in the plane stress state (i.e., shell). The stress-strain relationship is defined as: + + + + The terminology of this complex type refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. + + + + + + + + + + + + Coefficient 11 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 12 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 13 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 22 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 23 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 33 of reduced stiffness matrix [N/m^2] + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal expansion coefficient in material direction + 12 [1/K] + + + + + Thermal conductivity of the material in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 2 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 3 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 [N/m^2] + + + + + + Allowable stress for compression in material direction 1 [N/m^2] + + + + + + Allowable stress for tension in material direction 2 [N/m^2] + + + + + + Allowable stress for compression in material direction 2 [N/m^2] + + + + + + Allowable stress for shear [N/m^2] + + + + + + Allowable strain for tension in material direction 1 + + + + + Allowable strain for compression in material direction 1 + + + + + + Allowable strain for tension in material direction 2 + + + + + Allowable strain for compression in material direction 2 + + + + + + Allowable strain for shear + + + + + + + + + + + + + + Orthotropic material properties for 2D materials + + + + + Defines the material properties for an orthotropic material in the plane stress state (i.e., shell). The strain-stress relationship is defined as: + + + + Inverting the strain-stress relation and introducing thermal expansion yields: + + + + with: + + + + The terminology refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + + + + + + + + + + + + Young's modulus in material direction 1 [N/m^2] + + + + + Young's modulus in material direction 2 [N/m^2] + + + + + Shear modulus in material in 2-3 plane [N/m^2] + + + + + Shear modulus in material in 3-1 plane [N/m^2] + + + + + Shear modulus in material in 1-2 plane [N/m^2] + + + + + Poisson's ratio + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal conductivity of the material in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 2 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 + [N/m^2] + + + + + Allowable stress for compression in material + direction 1 [N/m^2] + + + + + Allowable stress for tension in material direction 2 + [N/m^2] + + + + + Allowable stress for compression in material + direction 2 [N/m^2] + + + + + Allowable stress for shear [N/m^2] + + + + + + Allowable strain for tension in material direction 1 + + + + + + Allowable strain for compression in material + direction 1 + + + + + Allowable strain for tension in material direction 2 + + + + + + Allowable strain for compression in material + direction 2 + + + + + Allowable strain for shear + + + + + + + + + + + + + + Anisotropic material properties for 3D materials + + + + + Defines the material properties for a linear anisotropic material in three spatial directions (i.e., solid). The stress-strain relationship is defined as: + + + + The terminology of this complex type refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. + + + + + + + + + + + + Coefficient 11 of stiffness matrix [N/m^2] + + + + + Coefficient 12 of stiffness matrix [N/m^2] + + + + + Coefficient 13 of stiffness matrix [N/m^2] + + + + + Coefficient 14 of stiffness matrix [N/m^2] + + + + + Coefficient 15 of stiffness matrix [N/m^2] + + + + + Coefficient 16 of stiffness matrix [N/m^2] + + + + + Coefficient 22 of stiffness matrix [N/m^2] + + + + + Coefficient 23 of stiffness matrix [N/m^2] + + + + + Coefficient 24 of stiffness matrix [N/m^2] + + + + + Coefficient 25 of stiffness matrix [N/m^2] + + + + + Coefficient 26 of stiffness matrix [N/m^2] + + + + + Coefficient 33 of stiffness matrix [N/m^2] + + + + + Coefficient 34 of stiffness matrix [N/m^2] + + + + + Coefficient 35 of stiffness matrix [N/m^2] + + + + + Coefficient 36 of stiffness matrix [N/m^2]2] + + + + + Coefficient 44 of stiffness matrix [N/m^2]] + + + + + Coefficient 45 of stiffness matrix [N/m^2] + + + + + Coefficient 46 of stiffness matrix [N/m^2] + + + + + Coefficient 55 of stiffness matrix [N/m^2] + + + + + Coefficient 56 of stiffness matrix [N/m^2] + + + + + Coefficient 66 of stiffness matrix [N/m^2] + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal expansion coefficient in material direction + 3 [1/K] + + + + + Thermal expansion coefficient affecting strain in material direction + 23 [1/K] + + + + + Thermal expansion coefficient affecting strain in material direction + 31 [1/K] + + + + + Thermal expansion coefficient affecting strain in material direction + 12 [1/K] + + + + + Thermal conductivity of the material in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 2 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 3 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 + [N/m^2] + + + + + Allowable stress for compression in material + direction 1 [N/m^2] + + + + + Allowable stress for tension in material direction 2 + [N/m^2] + + + + + Allowable stress for compression in material + direction 2 [N/m^2] + + + + + Allowable stress for tension in material direction 3 + [N/m^2] + + + + + Allowable stress for compression in material + direction 3 [N/m^2] + + + + + Allowable stress for shear in 2-3 plane [N/m^2] + + + + + Allowable stress for shear in 3-1 plane [N/m^2] + + + + + + Allowable stress for shear in 1-2 plane [N/m^2] + + + + + Allowable strain for tension in material direction 1 + + + + + + Allowable strain for compression in material + direction 1 + + + + + Allowable strain for tension in material direction 2 + + + + + + Allowable strain for compression in material + direction 2 + + + + + Allowable strain for tension in material direction 3 + + + + + + Allowable strain for compression in material + direction 3 + + + + + Allowable strain for shear in 2-3 plane + + + + + + Allowable strain for shear in 3-1 plane + + + + + + Allowable strain for shear in 1-2 plane + + + + + + + + + + + + + + + Orthotropic material properties for 3D materials + + + + + Defines the material properties for an elastic orthotropic material in three spatial directions (i.e., solid). The strain-stress relationship is defined as: + + + + Note that nuij is related to nuji by: + + + + The terminology refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + + + + + + + + + + + + Young's modulus in material direction 1 [N/m^2] + + + + + Young's modulus in material direction 2 [N/m^2] + + + + + Young's modulus in material direction 3 [N/m^2] + + + + + Shear modulus in the 2-3 plane [N/m^2] + + + + + Shear modulus in the 3-1 plane [N/m^2] + + + + + + Shear modulus in the 1-2 plane [N/m^2] + + + + + Poisson's ratio in in 2-3 plane + + + + + Poisson's ratio in in 3-1 plane + + + + + Poisson's ratio in in 1-2 plane + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal expansion coefficient in material direction + 3 [1/K] + + + + + Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] + + + + + Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 + [N/m^2] + + + + + Allowable stress for compression in material + direction 1 [N/m^2] + + + + + Allowable stress for tension in material direction 2 + [N/m^2] + + + + + Allowable stress for compression in material + direction 2 [N/m^2] + + + + + Allowable stress for tension in material direction 3 + [N/m^2] + + + + + Allowable stress for compression in material + direction 3 [N/m^2] + + + + + Allowable stress for shear in 2-3 plane [N/m^2] + + + + + + Allowable stress for shear in 3-1 plane [N/m^2] + + + + + Allowable stress for shear in 1-2 plane [N/m^2] + + + + + + Allowable strain for tension in material direction 1 + + + + + + Allowable strain for compression in material + direction 1 + + + + + Allowable strain for tension in material direction 2 + + + + + + Allowable strain for compression in material + direction 2 + + + + + Allowable strain for tension in material direction 3 + + + + + + Allowable strain for compression in material + direction 3 + + + + + Allowable strain for shear in 1-3 plane + + + + + + Allowable strain for shear in 1-3 plane + + + + + + Allowable strain for shear in 1-2 plane + + + + + + + + + + + + + + Materials + + + Materials type, containing material and composite data. + A material describes the properties of a certain material. + Several materials can be combined within one composite. + + + + + + + + + + + + + + + + + + + + + Mission definitions + + + + Specifies missions for performance evaluation of aircraft. + As the topmost element of the hierarchical mission definition, individual missions are grouped together + in the missions node. Here, segmentBlocks + are referenced. These again link to a list of segments. + + + + + + + + + + + + + + + + + + + + + + Setting default and specific performance maps to be used for a model + + + + + + + + + + Default performance map which is used if no other performance map + is assigned through the specificPerformanceMap node + + + + + List of specific performance maps used on dedicated mission segments + + + + + + + + + + + + + + End condition + + + + + Specifies the end conditions for a segment or segment block (e.g.: an altitude or velocity). If a phase has no endCondition, it will base its endCondition on the segmentBlock settings (e.g.: it is the cruise segment, retrieving its total length based on the length of the segmentBlock minus all other segment lengths avaible within the segmentBlock). + + + + + + + + + + + + + + Calibrated airspeed [m/s] + + + + + + + + + + + + + + Mach number + + + + + + + + + + + + + + + + Global coordinate in xyz coordinates + + + + + + + + + + + + + + Global coordinate in geographic + coordinates (longitude, latitude, + altitude) + + + + + + + + + + + + + + Runway + + + + + + + + + + + + + + + + MassFraction ending the segment + + + + + + + + + + + + + + Fuel mass fraction ending the + segment, as remaining fuel mass with + respect to initial segment fuel mass + + + + + + + + + + + + + + Remaining absolute fuel ending the + segment + + + + + + + + + + + + + + Consumed fuel mass ending the + segment + + + + + + + + + + + + + + + + Flight heading at the end of the + segment in compassAngle with + reference to true North [deg] + + + + + + + + + + + + + + Total change of heading angle during + segment (a full turn is 360 degrees) + [deg] + + + + + + + + + + + + + + + Flown distance in the segment (x, y, z) + + + + + + + + + + + + + + + Duration of the segment [hh:mm:ss] + + + + + + + + + + + + + + UTC time at end of mission + + + + + + + + + + + + + + + Specific excess power at the end of the + segment + + + + + + + + + + + + + + Rate of climb ending the segment + + + + + + + + + + + + + + Achieved flightPathAngle ending the segment + + + + + + + + + + + + + + + + + + + + + Mission block constraints + + + Definition of constraints for the mission segment block + + + + + + + + + + + + + + + + + + + + Segment block + + + A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). + + + + + + + + + + Name + + + + + Description + + + + + + Segment direction. Either 'outbound' or 'inbound'. Only needed for radiusOfAction kind of missions. + + + + + + + + + + + + + + + + Specifies to which type of mass the segment fuel mass + should be added (blockFuel = designFuel + additionalFuel; Total fuel requirement + = blockFuel + reserveFuel; designFuel = the fuel of the segmentBlock is part of the design mission) + + + + + + + + + + + + + + + + Number of repetitions of this segment block, e.g. to perform repeated holding patterns + + + + + + + + + + + + + + + Segment blocks + + + A list of segment blocks. A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). + + + + + + + + + + + + + + + + + + + Segment + + + Definition of a mission segment which can be used to define missions. + + + + + + + + + + Name + + + + + Description + + + + + Type of the mission segment (takeOff, clime, cruse, ...) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Indication whether the distance flown during the segment is to be taken into account in the segmentBlock's distance calculation. + + + + + + Environmental conditions. If the environmentalCondition is not provided at segment level, the conditions of the + previous segment are inherited (this inhertance can continue until the startCondition, where the initial + environmentalConditions are provided). + + + + + + + Fuel mass + + + + + + + + + + + + + + + + + + + + Mission segment constraints + + + Contains a set of constraints for the segment + + + + + + + + + + + + + + + + + + + Mission segments + + + A collection of mission segments which can be reused to define missions. + + + + + + + + + + + + + + + + + + + Start conditions + + + Conditions which define the start of a mission + + + + + + + + + + + Calibrated airspeed at the start of the mission [m/s] + + + + + Mach number at the start of the mission + + + + + + + Global coordinate at the start of the mission in xyz coordinates + + + + + Global coordinate at the start of the mission in geographic coordinates (longitude, latitude, altitude) + + + + + + UID of the runway at which the + mission starts + + + + + + + + Flight heading at the start of the mission, in compassAngle with reference to true North + + + + + + UTC time at start of mission + + + + + + + + + + + + + + Mission + + + Contains a list of segmentBlock uID's forming the mission along with additional mission information. + + + + + + + + + + Name + + + + + Description + + + + + + + List of segmentBlock uID's forming the mission. Segments must first be grouped in segmentBlocks to be assigned to a mission. + + + + + + + + + + + + + + + Missions + + + A list of missions. + + + + + + + + + + + + + + + + + + + Monetary values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nacelleProfilesType + + + Nacelle profiles type, containing nacelle profile geometries. + See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + nacelleSectionType + + + + + + + + + + + + + + + + + + + + + + + + + + nacelleSectionsType + + + + + + + + + + + + + + + + + + + + + + Noise + + + + + + + + + + + + + FAR approach noise level + + + + + FAR sideline noise level + + + + + FAR take-off noise level + + + + + + + + + + + + + Nose landing gears + + + List of nose gears + + + + + + + + + + + + + + + + + + + Operating empty mass + + + + + + + + + + + + + Operating empty mass description + + + + + + + + + + + + + + + + operationalCaseType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + operationalCasesType + + + + + + + + + + + + + + + + + + + + + + outerCutOutProfileType + + + + + + + + + + + + + + + + + + + + + + + Parameter definition for design studies. + + + Contains a name for the design parameter to give semantic meaning to parameters used in design studies. + + + + + + + + + + + Name of parameter + + + + + + + + + + + + + + Container for parameter definitions + + + Contains a of the design parameter definitions. + + + + + + + + + + + + + + + + + + + + paxCrossBeamStrutsAssemblyType + + + PaxCrossBeamStrutsAssembly type, containing pax + crossBeam strut assemblys + + + + + + + + + + + + + + + + + + + paxCrossBeamsAssemblyType + + + PaxCrossBeamsAssembly type, containing pax crossBeam + assemblys + + + + + + + + + + + + + + + + + + + paxDoorsAssemblyType + + + PaxDoorsAssembly type, containing pax door assemblys + + + + + + + + + + + + + + + + + + + + payloadGlobalType + + + + + + + + + + + + + + + + + + + + + + + Flight performance requirements + + + Contains a list of flight performance requirements + + + + + + + + + + + + + + + + + + + + Flight performance requirement + + + + + + + + + + + + + Name of the performance case + + + + + Description of the performance case + + + + + Requirement classification based on the MoSCoW method (must, should, could or wont) + + + + + + + + + + + + + + + Reference to the considered weightAndBalance case + + + + + The UID of the mission to be flown + + + + + List of point performance uIDs constraining the mission + + + + + + + + + + + + + + + + Selection of performance maps + + + + + + + + + + Engine performance map selection + + + + + Aerodynamic performance map selection + + + + + + + + + + + + + Performance requirements + + + + + + + + + + + + + + + + + + + + + + + + + + performanceTargetsGlobalType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Piston + + + + Geometric description and material properties of the + landing gear piston. The figure below shows the condition of the + uncompressed piston, where the length of the exposed part is the + sum of the maxSpringDeflection + and the compressedExternalLength: + + + + + + + + + + + + + + + Length of the piston + + + + + + Maximum spring deflection of the piston (difference between minimum and maximum deflection) + + + + + Length of the piston that remains outside of the main strut in fully compressed state + + + + + + + + + + + + + + plasticityCurvePointType + + + + + + + + + + + + + Tangent modulus [N/m^2] + + + + + True stress [N/m^2] + + + + + + + + + + + + + Points on plasticity curve of material + (min. 1 point) + + + + + + + + + + + + pointPerformanceType + + + Specific performance settings for the point performance calculation (e.g.: a cruise Mach number) + + + + + + + + + + Name + + + + + Description + + + + + + + Defines at which part of the mission + the point performance should be + considered - after indicated segment + of the mission as defined in + performanceCase + + + + + + + Defines at which part of the mission + the point performance should be + considered - at the defined + massFraction within the mission as + defined in performanceCase + (mCurrent/mTO) + + + + + + + Defines at which part of the mission + the point performance should be + considered - at the defined + fuelFraction within the mission as + defined in performanceCase + (mFuelCurrent/mFuelTO) + + + + + + + + Indicates the type of point performance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Point performance definitions + + + List of point performance definitions + + + + + + + + + + + + + + + + + + + pressureBulkheadAssemblyPositionType + + + PressureBulkheadAssemblyPosition type, containing a + pressure bulkhead assembly position + + + + + + + + + + Frame to which bulkhead is attached to + + + + + + UID of bulkhead element desription + + + + + + + + + + + + + + + pressureBulkheadAssemblyType + + + PressureBulkheadAssembly type, containing pressure + bulkhead assemblys + + + + + + + + + + + + + + + + + + + pressureBulkheadType + + + PressureBulkhead type, containing data of a pressure + bulkhead + + + + + + + + + + Name of the pressure bulkhead structural + element + + + + + Description of the pressure bulkhead + structural element + + + + + UID of structural sheet element used for the + bulkhead + + + + + Choice between flat and curved bulkhead types + + + + + additional data for flat (forward) pressure + bulkhead + + + + Number of vertical reinforcements on flat + bulhhead + + + + + UID of structural elements used as vertical + reinforcements + + + + + Number of horizontal reinforcements on flat + bulhhead + + + + + UID of structural elements used as + horizontal reinforcements + + + + + + additional data for curved (rear) pressure + bulkhead + + + + Radius of bulkhead calotte in the plane of + the adjacent frame + + + + + maximum flection of the pressure bulkhaed + calotte + + + + + Number of radial reinforcements (equally + distributed) on curved bulhhead + + + + + UID of structural elements used as radial + reinforcements on curved bulkheads + + + + + + + + + + + + + + + + pressureBulkheadsType + + + PressureBulkheads type, conteining pressure bulkheads + + + + + + + + + + + + + + + + + + + + Structural elements based on profiles + + + + + Short description + + The ProfileBasedStructuralElement type containins the + data of a structural element, that are based on 2-dimensional profiles. + There are three approaches to model profile based structural elements: + + by specifying global beam properties + by referencing a structuralProfile2D element + by choosing one of the prescribed standard profiles + + + + + + 1. Global beam properties + + In the section globalBeamProperties the properties + of the structural profile in an equivalent beam representation + are defined. + + + + 2. Structural 2D profile + + The structuralProfileUID element refers to the uID of the structuralProfile2D element. + As described in the corresponding documentation, this profile is defined by several points in the x-y-space. + Two points always form a sheet. + The properties of each sheet are defined in the sheetProperties element. + The orthotropy direction of composite materials equals the sheets' x-axis. + The orthotropy direction angle equals a positive rotation around the sheets' z-axis as indicated in the picture below (part 3), which shows an example of a wing stringer.: + + + + + + + 3. Standard structural 2D profile + + Instead of referencing a structuralProfile2D element, it is also possible to select a predefined standard profile. + These profiles are listed in the figure below. + Under sheetProperties, only the standardProfileSheetID (equals S1, S2, ...) must now be specified along with a corresponding length. + + + + + + + + + + + + + + + + Name of the profile based structural element + + + + + + Description of the profile based structural + element + + + + + Choice between global beam properties and sheet properties + + + + + + Choice between general profile element + description (referencing a structuralProfile) and predefined + standard profiles + + + + Definition based on structuralProfile + definition + + + + Reference to the structural profile profile + uID + + + + + + Reference point in structural profile + definition for structural element definition + + + + + + + Standard Profile Type, see picture below for + further information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + structuralElementType + + + profileBasedStructuralElements type, containing a list + of profile based structural elements + + + + + + + + + + + + + + + + + + + profileGeometryType + + + + A profile is defined by a profile name, an optional + description and a 3-dimensional pointlist with all three + coordinates mandatory. For typical profiles, one of the + coordinate vectors contains only "0" entries. All point + coordinates are transferred to the global coordinate system. The + points have to be ordered in a mathematical positive sense. + Normalized coordinates are not required. First and last point + may, but need not to, be identical. Hence, it is possible to + include "open" profiles. However, the trailing edge position of + the upper and lower point need to be identical. No crooked + trailing edges are possible. + Example 1: For a conventional wing, the airfoil + coordinates are defined in x and z with all the y-coordinates + set to "0". The points have to be ordered from the trailing edge + along the lower side to the leading edge and then along the + upper side back to the trailing edge. + Example 2: For a fuselage, the coordinates are + typically given in y and z with x set to "0". Starting point of + the profile sould be the lowest point (typically in the symmetry + plane), then upwards on the positive y-side up to the highest + point (again, typically in the symmetry plane). Depending on, + whether the fuselage shall be specified with symmetry condition + or not, the profile either ends there, or continues on the + negative y-side back down to the lowest point. + Alternatively, it is possible to specify the + coordinates of a profile via the CST (class function /shape + function transformation technique) notation. Please see the + cst2DType for further information. + A profile can be symmetric. In that case the profile + is interpreted as being not closed and will be closed by + mirroring it on the symmetry plane. + + + + + + + + + + + Name of profile + + + + + Description of profile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + profileGeometry2DType + + + + A profile is defined by a profile name, an optional + description and a 2-dimensional pointlist with both + coordinates mandatory. All point coordinates are transferred + to the global coordinate system depending on the context they + are used in. The points have to be ordered in a mathematical + positive sense. The x-coordinates of the profile has to be + normalized between 0 and 1. First and last point + may, but need not to, be identical. Hence, it is possible to + include "open" profiles. However, the trailing edge position of + the upper and lower point need to be identical. No crooked + trailing edges are possible. + Example 1: For a conventional nacelle profile, the airfoil + coordinates are defined in x and y. The points have to be ordered + from the trailing edge along the lower side to the leading + edge and then along the upper side back to the trailing edge. + When used for a nacelle the profile axis align + with the global axes as follows: + +x_profile -> +x_global; + +y-profile -> -z_global + Example 2: For a fuselage, the coordinates are + also given in x and z with x as the normalized fuselage height. + Starting point of the profile sould be the lowest point + (typically in the symmetry plane), then upwards on the positive x-side up to the highest + point (again, typically in the symmetry plane). Depending on, + whether the fuselage shall be specified with symmetry condition + or not, the profile either ends there, or continues on the + negative x-side back down to the lowest point. + Alternatively, it is possible to specify the + coordinates of a profile via the CST (class function /shape + function transformation technique) notation. Please see the + cst2DType for further information. + A profile can be symmetric. In that case the profile + is interpreted as being not closed and will be closed by + mirroring it on the symmetry plane. + + + + + + + + + + + Name of profile + + + + + Description of profile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Profiles + + + Profiles type, containing profile geometries + + + + + + + + + + + + + + + + + + + + + + + + + + Attachment of the pylon to the parent. + + + + + + + + + + + + + Material properties of the attachment. + + + + + + Link to the structural profile of the + attachment. + + + + + + UID of the attachment. + + + + + + + + + + + + Attachments of the pylon to the parent. + + + + + + + + + + + + + + + + + + + + + + + Structural properties of the pylon box (ribs, upper, + lower and side panels). + + + + + + + + + + + + + + + + + + + UID of the pylon box. + + + + + + + + + + + + Definition of one pylon pin. + + + + + + + + + + + + + First element (parentAttachmentUID, engineUID + or uID of a pylon structure. + + + + + Second element (parentAttachmentUID, engineUID + or uID of a pylon structure. + + + + + Position of the pylon pin related to the pylon + coordinate system. + + + + + + Blocked DOFs. Referes to the rotated + coordinate system that is defined in 'orientation'. + + + + + + + + UID of the pin. + + + + + + + + + + + + Definition of pylon pins. + + + + + + + + + + + + + + + + + + + + + + Definition of a rib set. + + + + RibDefinitionType, containing the definition for ribs. + Ribs are defined in sets of one or more ribs. The positions of + the rib, as well as the orientation of the ribs are defined in + 'ribPositioing'. The cross section properties, as e.g. + materials, are defined in 'ribCrossSection'. + + + + + + + + + + + Name of the rib set. + + + + + Description of the rib set. + + + + + + + + + + + + + + + + + Structural properties of all tibs of the engine pylon + box. + + + + + + + + + + + + + + + + + + + + + + pylonRibsPositioningType + + + + Within the ribsPositioning type the position and the + orientation of the ribs of the rib set are defined. + The forward and the rear beginning of the rib set is + defined using relDepthStart and relDepthEnd. The orientation of + the ribs is defined in ribRotaton. The number of ribs of the + current rib set is either defined by ribNumber or by spacing. + + + + + + + + + + + + relDepthStart defines the forward location of + the beginning of the rib set. 0 equals the forward end of the + pylon box, while 1 equals the rear end of the pylon box. + + + + + + relDepthEnd defines the rear end. 0 equals the + forward end of the pylon box, while 1 equals the rear end of the + pylon box. + + + + + Ribs can be rotated in the side view. The + defaults to 90°, which equals an orientation along the pylons + z-axis. The angle is meassured around the positive y-direction + of the pylon. + + + + + + The spacing of the ribs defines the distance + between two ribs, measured along the pylons x-axis. First rib + is placed at relDepthStart. + + + + + RibNumber defines the number of ribs in this + ribSet. First rib is at relDepthStart along the pylons x-axis, + last rib is at relDepthEnd. The spacing is constant. + + + + + + + + RibCrossingBehaviour can either be "cross" or + "end". If it is end then ribs will end it they intersect + another rib. It it is cross ribs are placed uncut. + + + + + + + + + + + + + + + + + + + + + Structural properties of a pylon shackle. + + + + + + + + + + + + + Material properties of the shackle. + + + + + + Link to the structural profile of the shackle. + + + + + + + UID of the shackle. + + + + + + + + + + + + Structural properties of pylon shackles (for pylon to + parent attachment), if existing. + + + + + + + + + + + + + + + + + + + + + + + Structural properties of the pylon shells. + + + + + + + + + + + + + + UID of the structural profile. + + + + + + Material settings. + + + + + + UID of the structure. + + + + + + + + + + + + Definition of the load carrying structure of the engine + pylon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Structural properties of struts (drag struts, upper + links and tangent links), if existing. + + + + + + + + + + + + + + + + + + + + + + + + radiativeForcingType + + + + + + + + + + + + + + + + + + + + + + + + + + + + recurringCostType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reference values + + + Reference type, containing the reference values of the + aircraft model + + + + + + + + + + Reference area (typically planform area) + + + + + + Reference length (typically Mean Aerodynamic + Chord MAC). In CPACS, only one reference length exists (and is + used, e.g. for all three moment coefficients. Coordinates given + relative to MAC shall always use this length as MAC. + + + + + + Moment reference point (in global coordinate + system). The x-coordinate is typically chosen same as of the + leading edge of the wing in the spanwise section having a + chordlength identical to MAC. Coordinates given as %MAC shall + always use this x-coordinate and length (e.g. 0%MAC = x, 100%MAC + = x + length). The y coordinate is typically 0. The z coordinate + is often chosen either as 0., or as z of fueselage nose or as z + of middle of center fuselage part. + + + + + + + + + + + + + requirementType + + + + + + + + + + + + + + + + + + + + + + + RibIdentificationType, defining one rib. + + + + + + + + + + + + + UID of the rib definition set. + + + + + + Number of the rib of the rib definition set. + + + + + + + + + + + + + + Definition of the rib rotation + + + The rotation around z describes the rotation around the + wings midplane normal axis. The defaults to 90°. The reference + for the 'zero-angle' of the z-rotation is defined in + ribRotationReference. + + + + + + + + + + RotationReference defines the reference for + the z-rotation it is either sparUID, „LeadingEdge“, + „TrailingEdge“, "globalX", "globalY" or "globalZ". + If it is not defined the rotation reference is + the eta-axis (=leading edge, that is projected on the wings + y-z-plane). A z-rotation angle of 90 degrees means, that the rib + is perpendicular on the ribRotationReference (e.g. spar, leading + edge...). The rib itself is always straight, and the rotation + is defined with respect of the intersection point of the rib + with the ribRotationReference. + + + + + The rotation around z describes the rotation + around the wings midplane normal axis. The defaults to 90°. The + reference for the 'zero-angle' of the z-rotation is defined in + ribRotationReference. + + + + + + + + + + + + + rivetJointAreaAssemblyPositionType + + + RivetJointAreaAssemblyPosition type, containing a rivet + joint area assembly position + + + + + + + + + + + + + + + + + + + + + rivetJointAreasAssemblyType + + + RivetJointAreasAssembly type, containing rivet joint + area assemblys + + + + + + + + + + + + + + + + + + + rivetType + + + Rivet type, containing a rivet + + + + + + + + + + Name of the rivet type + + + + + Description of the rivet type + + + + + + Tensile Strength of the rivet type + + + + + + Shear Strength of the rivet type + + + + + + + + + + + + + + + rivetsType + + + Rivets type, containing rivets + + + + + + + + + + + + + + + + + + + rotorAirfoilsType + + + RotorAirfoils type, containing rotor airfoil + geometries. See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + + rotorBladeAttachmentType + + + RotorBladeAttachment type, defining the elements used + to attach one or more rotor blades to the rotor head. + + + + + + + + + + Name of the blade attachment. + + + + + + Description of the blade attachment. + + + + + + + The azimuthAngles element is used to specify + a list of discrete azimuth angles (in deg) at which instances + of attached blades are to be created. The number of blades will + equal to the number of elements of the vector. E.g. + <azimuthAngles>0;90;180;270</azimuthAngles> for a + four blade rotor with equal equiangularly distributed blades. + The transformation of the respective rotor blade corresponds to + a rotation by azimuthAngle around the z axis of the rotor + coordinate system in mathematically positive sense of rotation. + + + + + + If only the number of blades is specified, + the attached blades will be distributed equiangularly and the + first blade will be attached at azimuth angle 0. (Formula: + azimuthAngle[i] = i*360deg/numberOfBlades, + i=0..numberOfBlades-1) + + + + + + Definition of all hinges used to attach the + rotor blade. + + + + + UID of the rotorBlade which should be attached + to the rotor hub. + + + + + + + + + + + + + + rotorBladeAttachmentsType + + + RotorBladeAttachments type, containing all hinges and + blade UIDs attached to the current rotor hub. + + + + + + + + + + + + + + + + + + + rotorBladesType + + + + RotorBlades type, containing all the rotor blade + gometry definitions of an rotorcraft model. + Rotor blade geometries are defined using the same data + structure as wings (wingType). But in order to be compatible + with the other rotor blade related types (e.g. rotorType, + rotorHubType, rotorHubHingeType) there are some additional + conventions/requirements regarding the definition and + orientation of rotorBlade geometries: + + Rotor blades should be positioned relative to the + global z-axis the way they will be positioned to the rotor + shaft (when blade azimuth=0deg). + The global x-axis should be used as radial axis + (usually the quarter chord line of the rotor blade coincides to + a great extent with the x-axis of the rotor blade coordinate + system). + All sections should be positioned in the positive + x halfspace. + Segments should connect sections with ascending x + coordinates. + Airfoils defined in the rotorAirfoils node should + be used instead airfoils from the wingAirfoils node. + + + + + + + + + + + + + + + + Rotor blade geometries are defined using the + same data structure as wings (wingType). But in order to be + compatible with the other rotor blade related types (e.g. + rotorType, rotorHubType, rotorHubHingeType) there are some + additional conventions/requirements regarding the definition and + orientation of rotorBlade geometries: see remarks. + + + + + + + + + + + + + + rotorHubHinge type, containing a rotor hub hinge + (flap/leadLag/pitch). + + + + RotorHubHinge type, containing a rotor hub hinge + (flap/leadLag/pitch) of a rotorcraft model. + + + + + + + + + + + Name of the hinge. + + + + + Description of the hinge. + + + + + + Hinge type. Possible values: "flap", "pitch" + "leadLag". This is used to define the rotation axis of the hinge + (flap = y-axis in blade cs, pitch = x-axis in blade cs, lead-lag + = z-axis in blade cs). + + + + + + + + + + + + The angle (in deg) at which the hinge is in + neutral position. This element is normally used to define + precone or prelag angles of the attached blade. Defaults to 0. + + + + + + Static stiffness of the hinge in (N/m) for + linear hinges and (N.m/deg) for angular hinges. Default value: + +inf (statically rigid hinge) + + + + + Dynamic stiffness of the hinge in (N/m) for + linear hinges and (N.m/deg) for angular hinges. Default value: + +inf (statically rigid hinge) + + + + + Damping of the hinge in (N/(m/s)) for linear + hinges and (N.m/(deg/s)) for angular hinges. Default value: +inf + + + + + + + + + + + + + + + rotorHubHingesType + + + RotorHubHinges type, defining hinges used to attach a + rotor blade to the rotor head. + + + + + + + + + + Definition of a flap, lead-lag or pitch hinge. + + + + + + + + + + + + + + rotorHubType + + + RotorHub type, containing definitions for the rotor hub + and attached hinges and blades. + + + + + + + + + + Name of the rotor hub. + + + + + Description of the rotor hub. + + + + + + Rotor head type. Possible values: "semiRigid", + "rigid", "articulated", "hingeless" + + + + + + + + + + + + + Rotor blade attachments are used to define how + many rotor blades are attached at which azimuth positions of the + rotor hub and the used hinges. + + + + + + + + + + + + + + Rotor type, containing a rotor (main rotor, tail rotor, + fenestron, propeller,...) of an rotorcraft model. + + + + Rotor type, containing a rotor (e.g. main rotor, tail + rotor, fenestron, propeller,...) definition of a rotorcraft + model. + The position and attitude of the rotor is defined + using the transformation element. The following image shows the + CPACS conventions for the orientation of rotors and rotor axis + systems: + + + + + The origin coincides with the center of rotation. + + The z-axis corresponds to the axis of rotation + and thus coincides with the rotor shaft centerline. It Points + in the main thrust direction of the rotor (usually upwards for + a main rotor, forwards for a propeller). + The x-axis points from nose to tail (usually + rearwards for main and tail rotors, upwards for a propeller). + + The y-axis completes the right-handed orthogonal + coordinate system. + + Rotor hub attributes, hinges and references to + attached rotor blades are defined in the rotorHub element. + + + Note that rotor blade geometries are only referenced and not + defined in the child nodes of the rotor element. Refer to the + documentation of rotorBladesType ( + Empty#T/rotorBladesType + ) and wingType ( + Empty#T/wingType + ) for information on the definition of rotor blade geometries. + + The following figure shows the transformations to be + applied to rotorBlade geometries to visualize them in the rotor + frames for a given state (each rotor: rotorAzimuth given, each + hinge: hingeDeflection given): + + + + + + + + + + + + + + Name of the rotor. + + + + + Description of the rotor. + + + + + UID of the part to which the rotor is mounted + (if any). The parent of the rotor can e.g. be the fuselage. In + each rotorcraft model, there is exactly one part without a + parent part (The root of the connection hierarchy). + + + + + + Rotor type. Possible values: "mainRotor" + (default), "tailRotor", "fenestron" or "propeller".. + + + + + + + + + + + + + + Nominal value of the angular rotation speed in + rotations per minute (rpm). + + + + + Transformation (scaling, rotation, + translation). This element is used to define the position and + attitude of the rotor relative to the global or the parent + component's axis system. Note that an anisotropical scaling + transformation should not be applied to the rotor. + + + + + + The rotorHub element contains the definition + of the rotor hub type and number and azimuth angles of the + attached blades and their hinges. The rotor hub position and + attitude coincides with the rotor axis system's origin and z + axis. + + + + + + + + + + + + + + + + + + + + + + + + + rotorcraftAnalysesType, results from several analysis + modules connected to CPACS + + + RotorcraftAnalyses type, containing detailed analysis + data of the rotorcraft + Within this element results from analysis modules are + stored that rely to the overall definition of the rotorcraft. + These include e.g. aerodynamic data or loadCases + For further documentation please refer to the + respective elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + rotorcraftGlobalType + + + RotorcraftGlobalType type, containing global data of + the rotorcraft + + + + + + + + + + Number of passenger seats + + + + + Cargo transport capacity [kg] + + + + + + Cruise Mach Number + + + + + Configuration of the rotorcraft: + standard(single main rotor, single tail rotor) / tandem / + coaxial/intermeshing / sideBySide/tiltRotor/tiltWing + + + + + + + + + + + + + + massBreakdownType + + + + + 1. General + + + The + massBreakeDown + is subdivided in + designMasses + , + fuel + , + payload + and + mOME + (operating empty mass). + + + designMass + + The design mass is a description from TLARs and can + be understand as design criteria. + + fuel + and + payload + + The fuel and payload mass are the maximum masses + which can be achieved. Full fuel tanks, all passengers on + board and full cargo holding. + + mOEM + + + The operation empty mass structure is based on the Airbus Mass + Standard brake down [AIRBUS MASS STANDARD 2008]. The + operator’s mass empty (OME) is defined by the sum of the + following component masses: + + operator’s items + manufacturer’s mass empty (MME) + + + + + + + 2. massDescription + + + Each sub component has the following + massDescription + which include a: + + Name + Description + parentUID + Mass value + Mass location + Mass orientation + Mass Inertia. + + + + That + massdescription + can be found at the + designMasses + direct under each item. At the + fuel + , + payload + and + mOME + under massDescription in each item and sub item. + + + + For the clean up the + mOME + there is consisting a script witch is programmed in Matlab but + also as standalone vision available. Setting for that tool can + be done under + toolspesifics/cmu + . + + + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Manufacturer empty mass description + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Group mass of hierarchy level 1 + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Group mass of hierarchy level 2 + + + + + + + + + + + + + + + Operating empty mass + + + + + + + + + + + + + Operating empty mass description + + + + + + + + + + + + + + + + rotorcraftModelType + + + RotorCraftModel type, containing a complete rotorcraft + model (Geometry and all specific data). The rotorcraftModelType + is basically a copy of the aircraftModelType with the following + additional elements: rotors, rotorBlades, driveSystems. + Furthermore the folowing elements have been adapted for + rotorcraft: global and analyses (aeroPerformance and + massBreakdown). + + + + + + + + + + Name of rotorcraft model + + + + + Description of rotorcraft model + + + + + + + + + + + + + + + + + + + + + + + + + + Rotorcraft + + + Rotorcraft type, containing all the rotorcraft models. + + Most of the extensions used in the rotorcraft type have + been defined as part of the work in the DLR project RIDE + (Rotorcraft Integrated Design and Evaluation, 2009-2012). + Therefore some of the definitions and conventions are tightly + coupled to the RIDE toolchain and tools. Further generalization + and assimilation of these parts to the definitions for fixed-wing + aircraft is planned for the near future. + + + + + + + + + + + + + + + + + + + rotorsType + + + Rotors type, containing all the rotors (mainRotors, + tailRotors, fenestrons, propellers, ...) of an rotorcraft model. + + + + + + + + + + + + + + + + + + + + runwayILSType + + + RunwayILS type, containing ILS data of a runway + + + + + + + + + + + Position of the localizer antenna + + + + + + + Position of the glide slope antenna + + + + + + Angle of the glide path + + + + + + + + + + + + + + runwayType + + + Runway type, containing data of a runway + + + + + + + + + + Name of runway + + + + + Description of runway + + + + + Position in degrees north + + + + + Position in degrees east + + + + + Threshold elevation + + + + + Runway heading + + + + + Takeoff run available + + + + + Landing distance available + + + + + Conditions of the runway + + + + + + + + + + + + + + + runwaysType + + + Runways type, containing data of the airport's runways + + + + + + + + + + + + + + + + + + + + seatModuleType + + + SeatModule type, containing data of a seat module + + + + + + + + + + + Name of the seat module + + + + + Description of the seat module + + + + + + Number of seats in the seat module, e.g 1, 2 + or 3 + + + + + Total width of the seat module + + + + + + seat module mass (optional, use of data to be + clarified) + + + + + seat module mass CoG (optional, use of data to + be clarified) + + + + + + + + + + + + + + seatModulesType + + + SeatModules type, containing seat modules + + + + + + + + + + + + + + + + + + + shaftLinkedComponentsType + + + ShaftLinkedComponents type, containing UIDs of engines, + transmissions and rotors linked by a shaft. + + + + + + + + + + + UID of a linked engine. + + + + + UID of a linked transmission shaft input. + + + + + + UID of a linked transmission shaft output. + + + + + + UID of a linked rotor. + + + + + + + + + + + + + + shaftType + + + Shaft type defining a shaft used as a link between + drive system components. + + + + + + + + + + + + + + + + + + + + + + shaftsType + + + Shafts type, containing all the shafts of a drive + system. + + + + + + + + + + + + + + + + + + + sheet3DType + + + + + + + + + + + + + + + + + + + + + + + + + + sheetBasedStructuralElementType + + + sheetBasedStructuralElementType type, sheet definition + for use in fuselage/structure + + + + + + + + + + Material definition of the skin segment + (Material, thickness, (lay-up)) + + + + + + + + + + + + + + sheetBasedStrcuturalElementsType + + + sheetBasedStrcuturalElementsType, containing sheet + based structural element definitions + + + + + + + + + + + + + + + + + + + sheetList3DType + + + + + + + + + + + + + + + + + + + + + + List of sheets, connecting 2-dimensional profile + points. + + + SheetList type, containing a list of sheets. Each sheet + combines two points to one sheet. + + + + + + + + + + + + + + + + + + + sheetPointsType + + + + + + + + + + + + + + + + + + + + + + sheetType + + + Sheet type, containing connection data of a sheet + + + + + + + + + + + Name of sheet within the profile definition + + + + + + Description of sheet within the profile + definition + + + + + Point from which the sheet definition starts + start + + + + + Continuity definition for profile geometry + generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines + tangential continuity), 2= C2 (defines curvature continuity) + 2=all + + + + + + + + + + + + + + Definition of an orientation vector at P1 + + + + + + Point at which the sheet definition ends + + + + + + Continuity definition for profile geometry + generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines + tangential continuity), 2= C2 (defines curvature continuity) + 2=all + + + + + + + + + + + + + + Definition of an orientation vector at P2 + + + + + + + + + + + + + + + singleGenericMassType + + + + + + + + + + + + + + + + + + + + + + Skid landing gears + + + List of skid gears + + + + + + + + + + + + + + + + + + + fuselagePanelType + + + FuselagePanel type, panel of the fuselage between + stringers/ frames (new in V1.5) + + + + + + + + + + UID of sheetBasedStructuralElement used for + the panel + + + + + UID of frame at start of the skin segment + + + + + + UID of frame at end of the skin segment + + + + + + UID of stringer at start of the skin segment + + + + + + UID of stringer at end of the skin segment + + + + + + + + + + + + + + + fuselageSkinSegmentType + + + FuselageSkinSegment type, containing material on skin + over circumference + + + + + + + + + + + + + + + + + + + skinType + + + Containing data defining the skin + + + + + + + + + + Default UID of sheetBasedStructuralElement + used for the fuselage skin not covered by individual panels + + + + + + + + + + + + + + + Spar cell of the spar. + + + + Within spar cells a special area of the spar is + defined where different cross section and material properties + shall be defined. + The area of the spar is defined by using the + parameters 'fromEta' and 'toEta'. The definition of the caps, + webs and rotation is equivalent to the cross section definition + of the complete spar. + + + + + + + + + + + Beginning (= inner border) of the spar cell. + + + + + + Ending (= outer border) of the spar cell. + + + + + + Upper Cap + + + + + + Lower Cap + + + + + + Web 1 + + + + + + Web 2 + + + + + + The angle between the wing middle plane and + web 1 [deg]. Default is 90 degrees. Positive rotation is around the + spar axis heading along with the positive eta-axis. + + + + + + + + + + + + + + + SparCells of current spar. + + + sparCells are an optional Element. They are defined via + the etaCoordinates and define a region of special cross section + and material properties. + + + + + + + + + + + + + + + + + + + Definition of the spar cross section. + + + + Spar type, containing the cross section definition of + a spar. The spar middle point is defined by the intersection of + the wing middle plane and web1. This equals the coordinate + defined within the sparPosition. + Please find below a picture where all spar cross + section parameters as well as the orientation refereneces for + the material definition can be found: + + + + + + + + + + + + + + + + + + + The angle between the wing middle plane and + web1. Default is 90 degrees. Positive rotation is around the + intersection axis of the spar and the wing middle plane. The + positive heading of this axis is inline with the positive + heading of the componentSegment eta-axis. + + + + + + + + + + + + + Spar position on the wing + + + + sparPositionType, a sparPostion defines a location + within the componentSegment where a spar in mounted. Eta and xsi + are relative to the componentSegment. + Please find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + As an alternative to the relative eta coordinate it is + possible to specify an elementUID so that the spar position is + relative to the outer geometry, e.g. kink, of the wing. + + + + + + + + + + + + Defines a spar position on an existing rib using a relative xsi coordinate + to determine the chord wise position on that rib + + + + + Defines a spar position using relative eta/xsi coordinates + + + + + + + + + + + + + + sparPositionUIDs of the spar. + + + + sparPositionType, a sparPostion defines a location + within the componentSegment where a spar in mounted. Those + positions are combined to spars by using a list of spar position + uIDs. The order of the sparPositionUIDs must be the same as the + order of the points on the real spar (from root to tip or from + tip to root). + Pleas note: orientation of a spar must be allways + outbound or allways inbound. A zigzag spar orientation where + e.g. the spar starts at the root, goes to the tip and goes back + to another point at the root is not allowed. + Pleas find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + + + + + + + + + + + List of spar position uIDs. + + + + + + + + + + + + + + Spar definition points on the wing. + + + + sparPositionType, a sparPostion defines a location + within the componentSegment where a spar in mounted. Eta and xsi + are relative to the componentSegment. + Please find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + + + + + + + + + + + + + + + + + + + + SparSegments (=spars) of the wing. + + + SparSegmentType, each spar is defined by multiple + sparPositions that are referenced via their uID. The spar cross + section is defined in 'sparCrossSection'. + + + + + + + + + + Name of the spar segment (=spar). + + + + + + Description of the spar segment (spar). + + + + + + + + + + + + + + + + + Spar segments of the wing. + + + sparSegmentsType, containing multiple sparSegment + (=spars) of the wing. + + + + + + + + + + + + + + + + + + + Specific heat map, containing the specific heat capacity of a material at different temperatures. + + + The specific heat of a material can vary with the temperature. The vectors specificHeat and temperature + must have the same size to be valid. The data should be linearly interpolated. + + + + + + + + + + + Temperature in [K] + + + + + Specific heat capacity of the material in [J/(kg*K)] + + + + + + + + + + + + + Specific performance map + + + + Applying a specific performance map to selected mission segments. In addition to the obligatory defaultPerformanceMapUID at least a segmentUID or pointPerformanceUID must be given. + + + + + + + + + + + UID of performance map to be used for mission segments + + + + + + + List of all mission segment UIDs to which the performance map is to be applied + + + + + List of point performance UIDs to which the performance map is to be applied + + + + + + List of point performance UIDs to which the performance map is to be applied + + + + + + + + + + + + + + specificPerformanceMapsType + + + Collection of all assignments of specific performance maps to selected mission segments + + + + + + + + + + + + + + + + + + + Spoilers of the wing. + + + A spoiler is defined via its outerShape relative to the + componentSegment. The WingCutOut defines the area of the upper + skin that is removed by the spoiler. Structure is similar to the + wing structure. The mechanical links between the spoiler and the + parrent are defined in tracks. The deflection path is described + in path. Additional actuators, that are not included into a + track, can be defined in actuators. + + + + + + + + + + Name of the spoiler. + + + + + Description of the spoiler. + + + + + + UID of the parent of the spoiler. The parent + is the componentSegment, where the spoiler is attached. + + + + + + + + + + + + + + + + + + + + + Definition of the wings spoilers. + + + Definition of the wings spoilers. + + + + + + + + + + + + + + + + + + + State parameter definition + + + Contains the values of a parameter and its uid as reference. + + + + + + + + + + + + + + + + + + + + + + + + State parameters list + + + Contains a list of all state parameters. + + + + + + + + + + + + + + + + + + + + stiffnessType + + + + + + + + + + + + + + + + + + + + + + + + + + + stringerFramePositionType + + + + Description of individual stringer / frame postions + + + + + + + + + + + + + + UID of profile based structural element + + + + + + + x position in absolute value + + + + + + UID reference to a fuselageSectionElement + + + + + + + y coordinate of reference system + + + + + + z coordinate of reference system + + + + + + angle definition to calculate intersection + with loft + + + + + + Continuity definition for profile extrusion: + 0= C0 (allows sharp edges, default), 2= C2 (defines curvature + continuity) + + + + + + + + + + + + + Definition of interpolation between different + profiles: 0= no interpolation 1= interpolation of strcutural + profile + + + + + + + + + + + + + + + + + + + + + + arbitraryStringerType + + + ArbitraryStringer type, containing stringer definition + (CPACS V1.5+) + + + + + + + + + + + + + + + + + + + + stringersAssemblyType + + + StringersAssembly type, containing an assembly of + stringers (new V1.5) + + + + + + + + + + + + + + + + + + + Structural elements + + + structuralElements Type, containing the different structural + elements + + + + + + + + + + + + + + + + + + + + + + + + + + + structuralMountType + + + + + + + + + + + + + + If this value is set to true then only the end points of the intersection shall be included as nodes in the model. + + + + + + The UID for the first connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. + + + + + + Optional counter to specify numbered items, e.g. ribs in a ribSet. + + + + + + The UID for the second connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. + + + + + + Optional counter to specify numbered items, e.g. ribs in a ribSet. + + + + + + + + + + + + + + + structuralProfile3DType + + + + + + + + + + + + + + + + + + + + + + + + + + 2-dimensional cross sections of structural profiles. + + + + + StructureProfile type, containing data of a structure + profile cross sections. The cross section profile is defined by + several points (->pointList) in the x-y-space. Two points are + combined to one sheet (->sheetList) by using the pointUIDs. + + This profile is defined by several points in the + x-y-space. Allways two points are combined to one sheet. The + properties of each sheet are defined in the 'sheetProperties' + section by referencing on the sheetUID and the material + properties. The orthotropy direction of composite materials equals + the x-sheet axis. The orthotropy direction angle equals a positive + rotation around the z-sheet axis as indicated in the picture below + (part 3.), where a wing stringer is defined as an example: + + + + + + + + + + + + + + + Name of the structure profile. + + + + + + Description of the structure profile. + + + + + + List of structural profile points, only x and + y. + + + + + + + + + + + + + + + Definition cross sections of structural profiles. + + + + Structuralprofiles type, containing cross section + information of structural profiles. + + + + + + + + + + + + + + + + + + + + Geometric description and material properties of a strut + + + + + + + + + + Length of the strut + + + + + + + + + + + + + + Design study parameters and results + + + + Contains optimization data such as definitions of design parameters and design studies. + + + + + + + + + + + + + + + + + + + + + + + + + subFleetType + + + Each fleet can be divided into sub fleet groups + + + + + + + + + + Name of fleet + + + + + Description of the fleet + + + + + A ; separated list of all tailsign strings + + + + + + + + + + + + + + subFleetsType + + + Contains a list of different sub fleets + + + + + + + + + + + + + + + + + + + subLoadType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Systems + + + + Systems type, containing the aircraft's control system + data + Please see the attached picture for further + documentation + + + + + + + + + + + + + + Node for geometrical layout of system components + based on simple geometric shapes + + + + + + Cockpit controls, e.g. stickRoll, pedals + + + + + + Different commandCases that are commanded, + e.g. roll, accelerate + + + + + Control Distributors, deliver inputs to the + control actuators. E.g. different angles of different ailerons. + + + + + + Control laws, for regulated actuation + + + + + + + + + + + + + + tailplaneAttachmentAreaType + + + tailplaneAttachmentArea type, containing dat on + fuselage + structure to attach tailplaine + + + + + + + + + + Definition of tailplane attachment area + (Standard + Configuration) + + + + + type of tailplane attachment: Currently + restricted to + 'Type1' and 'Type2' (see documentation) + + + + + + + + + + + + + + Definitions of VTP interface + + + + + + Definitions of VTP interface + + + + + + + + + + + + + + + takeoffPerformanceParametersType + + + + + + + + + + + + + Take-off distance at liftoff speed VLOF. + + + + + + Take-off distance at safety speed V2. + + + + + + Optimal speed Velev at point of initiating + take-off rotation by elevator deflection for a minimum take-off + distance. + + + + + Optimal rotation speed VR for a mini-mum + take-off distance + + + + + Liftoff speed VLOF. + + + + + Safety speed V2. + + + + + Take-off decision speed V1 + + + + + Minimum control speed ground VMCG. + + + + + + Flight path angle being achieved at V2 with + one engine failure in 400 ft height above ground. This is the + result of a post trim calculation using the deter-mined V2. If + the trim calculation fails the entry is set to -90. + + + + + + + + + + + + + + Structural properties of the tangent links, if + existing. The tangent links do connect the engine pylon with the + engine to carry the thrust forces. + + + + + + + + + + + + + + + + + + + + + + simpleConnectionType + + + SimpleConnection type, containing a simple connection + + + + + + + + + + + Can be each structural member (skinSegment, + stringer, frame, paxCrossBeam, cargoCrossBeam, + paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, + floorPanel, seatModule) + + + + + Can be each structural member (skinSegment, + stringer, frame, paxCrossBeam, cargoCrossBeam, + paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, + floorPanel, seatModule) + + + + + + + + + + + + + + + simpleConnectionsType + + + SimpleConnections type, containing simple connections + + + + + + + + + + + + + + + + + + + + topologyEntriesType + + + + + + + + + + + + + + + + + + + + + + topologyEntryType + + + A topology entry is used to combine the dynamic aicraft + models of several components, e.g. wing and fuselage. By default + these will be stiff. If desired stiffness and rotation with + respect to the CPACS coordinate system may be specified. + + + + + + + + + + + + + + + + + + + + + + + totalOperatingCostType + + + + + + + + + + + + + + + + + + + + + + + + trackActuatorType + + + + + + + + + + + + + Reference to the uID of the actuator of the + track. + + + + + Definition of the material properties of the + actuator to track attachment. + + + + + + + + + + + + + + wingSparsType + + + Spars type, a spar is defined by sparSegments that + stretch between multiple sparPositions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Definition of the struts of a control surface track. + + + + Definition of the struts of a control surface track. + + + + + + + + + + + + + + + + + + + + Definition of a strut of a control surface track. + + + + Definition of a strut of a control surface track. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specification of joint coordinates. + + + + Specification of joint coordinates. + + + + + + + + + + + + + + + + + + + + Set of joint coordinates + + + + Definition of a set of joint coordinates. + + + + + + + + + + + Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + + + + + + + + Joint coordinates + + + + Definition of a joint coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Trailing edge device of the wing. + + + A trailingEdgeDevice (TED) is defined via its + outerShape relative to the componentSegment. The WingCutOut + defines the area of the skin that is removed by the TED. + Structure is similar to the wing structure. The mechanical links + between the TED and the parrent are defined in tracks. The + deflection path is described in path. Additional actuators, that + are not included into a track, can be defined in actuators. + + Leading and trailing edge are defined by the outer + shape of the wing segments, i.e. the trailing edge of a + trailingEdgeDevice is the trailing edge of the wing. This is also + valid for kinks that are present in the wing but not explicitly + modeled in the control surface. + The edges of the control surface within the wing are a + straight line in absolute coordinates! Hence, there needs to be a + straight connection between the eta-wise outer and inner points + of the edge that is within the wing in absolute coordinates. + + + + + + + + + + + Name of the trailing edge device. + + + + + + Description of the trailing edge device. + + + + + + UID of the parent of the TED. The parent can + either be the uID of the componentSegment of the wing, or the + uID of another TED. In the second case this TED is placed within + the other TED (double slotted flap). In this way n-slotted TEDs + can be created. + + + + + + + + + + + Definition of cruise rollers/mid-span stops. + Those features are small rolls at the leading edge of a flap + that keep the flap within the bending wing at cruise + configuration. + + + + + Definition of interconnection struts. Those + struts connect two neighbouring flaps and are load carrying in + case of an actuator of flap track failour. + + + + + Definiton of z-couplings. Those elements + couple two neighbouring flaps in z-direction. + + + + + + + + + + + + + + + Definition of the wings trailing edge devices. + + + + Definition of the wings trailing edge devices. + + + + + + + + + + + + + + + + + + + + Trajectories + + + + + + + + + + + + + + + + + + + + + + trajectoryGlobalType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + trajectoryType + + + + + + + + + + + + + + + + + + + + + + + + + + + transmissionGearRatioType + + + TransmissionGearRatio type, defining the ratio of + output rotation velocity to input rotation velocity. + + + + + + + + + + + + + + + + + + + + transmissionShaftInputType + + + TransmissionShaftInput type, defining a shaft input for + a transmission. + + + + + + + + + + + + + + + + + + + + transmissionShaftInputsType + + + TransmissionShaftInputs type, defining the shaft inputs + of a transmission. + + + + + + + + + + + + + + + + + + + transmissionShaftOutputType + + + TransmissionShaftOutput type, defining a shaft output + for a transmission. + + + + + + + + + + + + + + + + + + + + + transmissionShaftOutputsType + + + TransmissionShaftOutputs type, defining the shaft + outputs of a transmission. + + + + + + + + + + + + + + + + + + + transmissionType + + + Transmission type, defining a transmission/gearbox. + + + + + + + + + + + + + + + + + + + + + + + + + transmissionsType + + + Transmissions type, containing all the + transmissions/gearboxes of a rotorcraft model. + + + + + + + + + + + + + + + + + + + + + + + + + + + updateType + + + Update type, containing a datablock for each update of + the CPACS dataset + + + + + + + + + + Description of Modification of CPACS data + + + + + + Creator of CPACS modification + + + + + + Timestamp of CPACS modification + + + + + + New version number of CPACS dataset after + modification + + + + + CPACS version that the dataset is valid to + + + + + + + + + + + + + + Structural properties of the upper links, if existing. + The upper links do connect the upper forward part of the pylon + box with the forward wing attachment. + + + + + + + + + + + + + + + + + + + + + + variableSegmentType + + + + Containing the definition of variable segments for a segment block + + + + + + + + + + + defines uID of the segment having variable conditions + + + + + defines which condition(s) are variable within the segment (must be one of the defined + endConditions for the segmentBlock) + + + + + + + + + + + + + + + + + + + + List of segments that are allowed to be varied within a mission optimization. + + + + Provides a list of segments having variable conditions within the segmentBlock. + Example: a segmentBlock containing takeOff, climb, cruise, decent, landing segments has a cruise segment for which the range is variable. + The range of this segment is then to be calculated using the range defined for the segmentBlock while concerning the known ranges of all + other segments within the segmentBlock. + This concept needs to be practically tested. Does it suffice to mention (a list of) segments that are free to change to fit the overall block constraints? What happens if a segment is variable, though it has some constraints? When to define a segment as variable (climb until endPosition z, then endPosition x should be left free. Is the segment then variable? Probably not.). Somehow the 'free' segment should be in between fully defined segments (i.e.: a cruise+descent in between endPosition z == ICA and endPosition z == 0 for landing to define max range. How to define this exactly?) + + + + + + + + + + + + + + + + + + + Vehicles + + + + The vehiclesType contains all vehicle-specific + data. + This includes the vehicle itself (i.e. aircraft + and rotorcraft). Furhtermore, components + (e.g. engines, structuralElements, etc.) + as well as physical properties of materials and + fuels can be predefined for easy and consistent reuse via + uID-references. + + + + + + + + + + + + + + + + + + + + + + + + + + + + vtpFrameDefType + + + Definition of the individual VTP attachments + + + + + + + + + + Definition of tailplane attachment area + (Standard Configuration) + + + + UID of the fuselage frame at this VTP + attchment + + + + + Flag for option for VTP attachment between + defined FrameUID and the next one + + + + + UID of panel element at VTP attachment (shell + elements) + + + + + UID of structural element at VTP attachment + (base, beams) + + + + + UID of structural element at VTP attachment + (horizontal, beams) + + + + + UID of structural element at VTP attachment + (radial, beams) + + + + + + + + + + + + + + vtpInterfaceDefType + + + Definition of the interface of the VTP + + + + + + + + + Definition of the VTP interface + + + + + Definition of the VTP attachment frames and + their + reinforcement + + + + + + Defines area for valid x-position of VTP (just + used + if attachmentpoint is directly based on frame) ==> check and + potentially warning message + + + + + + Definition of the max. distance between + fuselage and + the defined VTP pins ==> check and potentially warning + message + + + + + + Definition of reinforcement area at VTP frame + positions (relative coordinate, smaller than + 1.0) + + + + + + Definition of vertical reinforcements at VTP + frame + positions (relative coordinate, smaller than + 1.0) + + + + + + value to change from horizontal to radial + reinforcements for VTP frame plates + + + + + + UID of elements to connect VTP pins with + fuselage + (beam elements) + + + + + + + + + + + + + + + webType + + + + SparWeb type, containing the cross section area of the + spar web and the material properties. + Pleas find below a picture where all spar cross + section parameters as well as the orientation refereneces for + the material definition can be found: + + + + + + + + + + + + + + Material definition of the spar web. + + + + + + relPos ranges from 0 to 1 It defines the + position of the web relative to the caps (see picture below).. + + + + + + + + + + + + + + weightAndBalanceCaseType + + + WeightAndBalanceCase type, containing weight and + balance data for one case + + + + + + + + + + + + + + + + + + + + + + + + weightAndBalanceFuelInTankType + + + + + + + + + + + + + + + + + + Ranges from 0 for empty tank to 1 + + + + + + + + + + + + + + weightAndBalanceFuelInTanksType + + + + + + + + + + + + + + + + + + + + + + weightAndBalanceFuelType + + + + + + + + + + + + + + + + + + + + + + + + + weightAndBalancePayloadType + + + + + + + + + + + + + + + + + + + + + + + + + + Weight and balance + + + WeightAndBalance type, containing weight and balance + datasets + + + + + + + + + + + + + + + + + + + + weightAndBalancemCargosType + + + For a higher ganularity it is possible to add more + information on the actual Cargo that are included in the + operational case. Please note that the information needs to be + identical with the massBreakdown. Hence, only links via uIDs can + be specified. + + + + + + + + + + + + + + + + + + + + + + weightAndBalancemPaxxType + + + For a higher ganularity it is possible to add more + information on the actual Pax that are included in the + operational case. Please note that the information needs to be + identical with the massBreakdown. Hence, only links via uIDs can + be specified. + + + + + + + + + + + + + + + + + + + + + + windowAssemblyPositionType + + + WindowAssembly type, containing an the position of a + windows assembly + + + + + + + + + + UID of the window element to be used + + + + + + x position of window elemment on global x axis + + + + + + z position of window elemment refernce point + + + + + + angle around global x axis to define window + position with respect to positionX and postionZ + + + + + + + + + + + + + + + windowsAssemblyType + + + WindowsAssembly type, containing an assembly of windows + + + + + + + + + + + + + + + + + + + + windowsType + + + Windows type, containing windows + + + + + + + + + + + + + + + + + + + + wingAeroPerformanceType + + + wingAeroPerformance type, containing perfomance maps + with aerodynamic data of a wing. + + + + + + + + + + Reference to the uID of the analysed wing + + + + + + References used for the calculation of the + force and moment coefficients of the wing (in the wing axis + system!) + + + + + Calculated aerodynamic performance maps of the + wing + + + + + + + + + + + + + wingAirfoilsType + + + WingAirfoils type, containing wing airfoil geometries. + See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + Cell of the wing + + + + A cell defines a special region of the wing. Within + this region skin and stringer properties can be defined that + differer from the properties of the rest of the wing. In general + a cell is defined by defining four borders – the cell leading + and trailing edge and the inner border and the outer border. + Those borders can either be defined by using eta/xsi coordinates + or by referencing to spars and ribs. Mixed definitions (e.g. + forward border is defined due to a spar, side borders due to eta + coordinates) is allowed. In general a cell is quadrilateral. But + if e.g. the spar, which is used for the definition of the + trailing edge, has a kink, the cell can have more than four + corners. + The cell leading and trailing edge (= forward and rear + border) can either be defined by referencing to a spar + (->sparUID) or by the defining the xsi (=relative chord) + coordinates of the border (xsi1 = inner end; xsi2 = outer end). + + The cell inner and outer border can either be defined + by referencing to a rib (->ribDefinitionUID and ribNumber) or + by the defining the eta (=relative spanwise) coordinates of the + border (eta1 = forward end; eta2 = rear end). + Some examples for wing cells can be found in the + picture below: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cells of the wing. + + + WingCells type, containing all the cells of the wing. + + + + + + + + + + + + + + + + + + + + Structure of the wing + + + wingComponentSegmentStructure type, containing the + whole structue (skins, ribs, spars...) of the wing. + + + + + + + + + + + + + + + + + + + + + + + Element of the section. + + + + Within elements the airfoils of the wing are defined. + Each section can have one or more elements. Within each element + one airfoil have to be defined. If e.g. the wing should have a + step at this section, two elements can be defined for the two + airfoils. + Mathematically spoken a element is a coordinate system + that is translated, rotated and scaled relative to the section + coordinate system. This transformation parameters are defined + withing the transformation section. The wirfoil, which is linked + by using the parameter airfoilUID is directly 'copied' in the + element coordinate system. If e.g. the airfoil is defined from 0 + to 1 in x-direction and the total scaling of the elements x-axis + equals 3.5 the wing chord is 3.5 m long. + An example for wing element can be found in the + picture below: + + + + + + + + + + + + + + Name of the wing element. + + + + + Description of the wing element. + + + + + + Reference to a wing airfoil. + + + + + + + + + + + + + + + + Elements of the wing. + + + WingElements type, containing the elements of a wing + section. + + + + + + + + + + + + + + + + + + + Border of the fuel tank (either rib or spar). + + + + + + + + + + + + + + Spar uID of the bordering spar. + + + + + + + UID of the rib set of the bordering rib. + + + + + + RibNumber of the rib set of the bordering + rib. + + + + + + + + + + + + + + Definition of the geometry of the wing fuel tank by + defining a continouse list of borders. + + + + + + + + + + + + + + + + + + + + + + Definition of one wing fuel tank. + + + + + + + + + + + + + Name of the wing fuel tank. + + + + + + Description of the wing fuel tank. + + + + + + + + + + + + + + + + + Definition of different volumes of the fuel tank. + + + + + + + + + + + + + + Theoretical volume if material thicknesses + (ribs, spars, skins, stringers) and systems (fuel pumps, + pipes...) are neglected. + + + + + + + Usable fuel volume aircraft operations. + + + + + + Total real fuel tank volume. + + + + + + + + Factor between the usalbe fuel volume and + the real fuel volume. + + + + + Factor between the real fuel volume and the + theoretical optimum fuel volume. + + + + + + + + + + + + + + + List of wing fuel tanks. + + + + + + + + + + + + + + + + + + + + + + Definition of the wing-fuselage attachment + + + + Definition of the wing-fuselage attachment. The area + of the fuselage attachment (resp. center wing box, CWB) is + defined by defining one resp. two ribs from the rib definition. + If one rib is defined (rib1) the CWB goes from the closer end of + the componentSegment (e.g. wing symetry plane) to the defined + rib. If two ribs are defined (rib1 and rib2), the CWB is between + both ribs. + Additionally attachment pins can be defined. At those + positions the wing is attached to the fuselage. This can be e.g. + used for defining the wing-attachment of high wing + configurations, HTPs or VTPs. + + + + + + + + + + + Definition of first (=inner) rib of the + fuselage attachment. + + + + + Definition of the second (=outer) rib of the + fuselage attachment. Optional. Only to be used if attachment is + defined over two ribs. + + + + + Definition of position, orientation, materials + and blocked DOFs of attachment pins. + + + + + Definition of actuators (e.g. trim actuator of + an HTP) of the attachment. + + + + + + + + + + + + + Definition of the wing-fuselage attachment. + + + Definition of the wing-fuselage attachment + + + + + + + + + + + + + + + + + + + wingInterfaceDefinitionsType + + + CenterFuselage high wing interface definitions + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageMainFramesType + + + High wing main frame definition, containing mainframe + UIDs + + + + + + + + + + + + + + + + + + + + + wingInterfaceSupportStrutType + + + wingInterfaceSupportStrut type, containing support + strut definition + + + + + + + + + + Name of support strut. + + + + + Type description: lateral or longitudinal + support strut. + + + + + + + + + + + + + + + + + + wingInterfaceSupportStrutsAssemblyType + + + wingInterfaceSupportStrutsAssembly type, containing + support struts assembly + + + + + + + + + + + + + + + + + + + + Definition of the cell of the intermediateStructure + + + + + IntermediateStructure: + It defines the filling materials between the upper and + lower shell (e.g. honeycombe structures in a smeared + representation). IntermediateStructure is optional.The position + of the intermediateStructure is defined in so called cells (= + special areas on the wing). Default is no intermediateStructure. + + Material Definition of intermediateStructure: + + The material of the intermediateStructure is reference + by 'material'. The material orientation is defined by 'rotX' and + 'rotZ'. 'rotZ' is defined equivalent to the stringer angle resp. + the skin orthotropyDirection. 'rotX' equals a positive rotation + around the wings x-axis, while a rotation of zero is equivalent + to the wing middle plane. + A picture to clarify the reference direction of rotZ + (equivalent to orthothropy direction of the wing) can be found + in the picture below: + + + + Position definition by using cells: + A cell defines a special region of the wing. Within + this region the cell properties are defined. In general a cell + is defined by defining four borders – the cell leading and + trailing edge and the inner border and the outer border. Those + borders can either be defined by using eta/xsi coordinates or by + referencing to spars and ribs. Mixed definitions (e.g. forward + border is defined due to a spar, side borders due to eta + coordinates) is allowed. In general a cell is quadrilateral. But + if e.g. the spar, which is used for the definition of the + trailing edge, has a kink, the cell can have more than four + corners. + The cell leading and trailing edge (= forward and rear + border) can either be defined by referencing to a spar + (->sparUID) or by the defining the xsi (=relative chord) + coordinates of the border (xsi1 = inner end; xsi2 = outer end). + + The cell inner and outer border can either be defined + by referencing to a rib (->ribDefinitionUID and ribNumber) or + by the defining the eta (=relative spanwise) coordinates of the + border (eta1 = forward end; eta2 = rear end). + Some examples for wing cells can be found in the + picture below: + + + + + + + + + + + + + + + + + + Reference to the material of the intermediate + structure. + + + + + 'rotX' equals a positive rotation around the + wings x-axis, while a rotation of zero is equivalent to the wing + middle plane direction. + + + + + 'rotZ' is defined equivalent to the stringer + angle resp. the skin orthotropyDirection. + + + + + + + + + + + + + + IntermediateStructure cells + + + Definition of the intermediateStructure of the + componentSegment of the wing. + + + + + + + + + + + + + + + + + + + Definition of a ribCell + + + RibCells are optional elements. They are defined via a + fromRib and a toRib. The enumeration is within the ribSet. + RibNumber 1 starts at etaStart. + + + + + + + + + + Defines the beginning of the ribCell. The + enumeration is within the ribSet. + + + + + Defines the ending of the ribCell. The + enumeration is within the ribSet. + + + + + WING: The Rotation along the x describes a + rotation around a line, that is defined by the intersection of + the rib with the wing middle plane (orientated from leading to + trailing edge). This angle defaults to 90° which means, that the + rib is perpendicular on the wings middle plane. PYLON: The + Rotation along the z describes a rotation around the pylons + z-axis (= rotation in top view). This angle defaults to 90° + which means, that the rib is perpendicular to the pylons x-axis. + + + + + + The orthotropyDirection is defined as rotation + around the ribs z-axis. The rib coordinate system is defined as + follows: x-axis is from leading to trailingeEdge of the + componentSegment in the direction of the rib elongation. z-axis + is normal to the rib in the direction of positive eta. y is + defined by right hand rule. Rotation is around the z-axis. Zero + degrees are at the x-axis positive direction. + + + + + + + + + + + + + + + + + Cross section properties of a wing rib + + + wingRibCrossSectionType, containing the definition of + ribsCrossSection + + + + + + + + + + The orthotropyDirection is defined as rotation + around the ribs z-axis. The rib coordinate system is defined as + follows: x-axis is from leading to trailingeEdge of the + componentSegment in the direction of the rib elongation. z-axis + is normal to the rib in the direction of positive eta. y is + defined by right hand rule. Rotation is around the z-axis. Zero + degrees are at the x-axis positive direction. + + + + + + WING: The Rotation along the x describes a + rotation around a line, that is defined by the intersection of + the rib with the wing middle plane (orientated from leading to + trailing edge). This angle defaults to 90° which means, that the + rib is perpendicular on the wings middle plane. The rotation + angle is defined at the intersection point of the rib with the + ribReference line. The rib itself is allways straight and not + twisted. PYLON: The Rotation along the z describes a rotation + around the pylons z-axis (= rotation in top view). This angle + defaults to 90° which means, that the rib is perpendicular to + the pylons x-axis. + + + + + + + + Post element definition applied to all vertical intersections with spars + + + + + + + + + + + + + Explicit positioning of a wing rib + + + + Use this type for an explicit positioning of a rib. As opposed to + ribsPositioning, this defines a single rib connecting a specified start + and end point. + + + + + + + + + + + + + Defines the start of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the start of the rib defined by a point on a reference curve + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the beginning of the rib using a specific sparPosition. + + + + + + + + + Defines the end of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the end of the rib given by a point on a reference curve + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the end of the rib using a specific sparPosition. + + + + + + + + Defines the forward beginning of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + RibEnd defines the backward ending of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + + + + + + + + wingRibPointType + + + + The wingRibPointType is used to define reference points on ribs. + It can be used for rib set definitions (wingRibsPositioningType) as + well as explicit rib definitions (wingRibExplicitPositioningType). + + + + + + + + + + + + The UID of the rib definition. Can be a reference to nodes + of either wingRibsPositioningType or wingRibExplicitPositioningType. + + + + + + + For references of type wingRibsPositioningType this node indicates the rib number of the rib set. + If not given it defaults to 1. + + + + + + + Normalized xsi coordinate of the rib point which is measured along the rib + from the start point [0] towards the end point [1]. + + + + + + + + + + + + + + Definition of a set of ribs + + + + RibDefinitionType, containing the definition for ribs. + Ribs are defined in sets of one or more ribs. The positions of + the rib, as well as the orientation of the ribs are defined in + 'ribPositioing'. The cross section properties, as e.g. + materials, are defined in 'ribCrossSection'. + + + + + + + + + + + Name of the rib set + + + + + Description of the rib set + + + + + + + + + + + + + + + + + + + + Wing ribs + + + RibDefinitions type, containing the definition of all + ribs of the wing. + + + + + + + + + + + + + + + + + + + Positioning of a set of wing ribs + + + + The ribsPositioning type allows the definition of a set + of ribs which is distributed over a specified spanwise area. + The positions of the ribs are defined by placing the + ribs on a reference line on the wing (ribReference). The inner + and the outer beginning of the rib set is defined using etaStart + and etaEnd. The position of the forward and rear end of the ribs + is defined by ribStart and ribEnd. The orientation of the ribs + is defined in ribRotation. The number of ribs of the current rib + set is either defined by ribNumber or by spacing. + Three examples how ribs can be placed on the wing are + illustrated in the picture below. For more detailed information, + please refer to the description of each parameter. + + + + + + + + + + + + + + + + Defines the start of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the start of the rib by a point on a reference curve, + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the beginning of the rib using a specific sparPosition + + + + + + + + + Defines the end of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the end of the rib defined by a point on a reference curve + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the end of the rib using a specific sparPosition + + + + + + + + Defines the forward beginning of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + Defines the backward ending of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + + The spacing of the ribs defines the distance between two ribs, + measured on the + ribReferenceLine. First rib is placed at etaStart. + + + + + + + Defines the number of ribs in this ribSet. First rib is at + etaStart on the + referenceLine, last rib is at etaEnd. The spacing is constant on the + ribReferenceLine. + + + + + + + + The ribReference is the reference line for the computation of the rib set spacing. + It can either be a sparUID or "trailingEdge" or "leadingEdge" + + + + + + + + RibCrossingBehaviour can either be 'cross' or 'end'. If it is set to'end' the ribs + of this rib set will end at the intersection with another rib. + If it is set to + 'cross' the ribs of this rib set will continue at the intersection + with another rib. + + + + + + + + + + + + + + + + + + + + + + Section of the wing. + + + + WingSection type, containing a wing section. The + sections contains elements, where the airfoils are defined. For + the definition of a wing at least two sections (root and tip) + have to be defined, but any number greater than 2 is also + possible. + Mathematically spoken a section is a coordinate system + that is translated, rotated and scaled relative to the wing + coordinate system. This transformation parameters are defined + withing the transformation section. + In addition to the translation, which is defined in + the transformation part, the section can be translated by using + the positionings vectors (wing->positiongs). Translation of + the positionings vectors is added to the translation of the + section. + An example for wing sections can be found in the + picture below: + + + + + + + + + + + + + + Name of wing the wing section. + + + + + + Description of the wing section. + + + + + + + + + + + + + + + + + Sections of the wing. + + + WingSections type, containing all the sections of the + wing. + + + + + + + + + + + + + + + + + + + Segment of the wing. + + + + A segment defines which two wing elements (=cross + sections) are linked to one wing segment. + An example for wing segments can be found in the + picture below: + + + + + + + + + + + + + + Name of wing the wing segment. + + + + + + Description of the wing segment. + + + + + + Reference to the element from which the + segment shall start. + + + + + Reference to the element at which the segment + shall end. + + + + + Optional and additional guidecurves to shape + the outer geometry. + + + + + + + + + + + + + + Segments of the wing. + + + WingSegments type, containing all the segments of the + wing. + + + + + + + + + + + + + + + + + + + Shells of the wing + + + Within the wingShellType the upper and lower skin of a + and the skin stringers are defined. At 'skin' and 'stringer' the + skin and stringer properties of the complete componentSegment are + defined. If different skin or stringer properties should be + defined in a special region of the wing this can be done within + 'cells'. + If the stringer should not be defined explicite, they + can be defined implizite by defining an equivalent material layer + and using a composite as material. + + + + + + + + + + + + + + + + + + + + + + Material properties of the wing skin. + + + + The wingSkinType describes the material properties of + the wing. + For composites materials: the positive z-direction is + from the outer side to the inner side. + For composites materials: the reference axis for the + orthotropyDirection is defined by the two leading edge points of + the 'from'- and the 'to'-element of the componentSegment + definition. The angle between the reference axis and the + orthotropyDirection equals the rotation around the z-reference + axis. For details, please refer to the picture below: + + + + + + + + + + + + + + + Material properties of the wing skin. + + + + + + + + + + + + + + Wing spars + + + + Spars type, a spar is defined by sparSegments that + stretch between multiple sparPositions. The spar definition is + very flexible in CPACS. Spars can start and end at any position + of the wing, spars can have kinks at any position of the wing + and spars can cross each other or merge. + At first the spar points (->sparPositions) have to + be defined. Spar points are defined using the relative + coordinates eta and xsi. Spar points do lay on wing middle + plane. + Two or more spar points are connected to on spar + segment (->sparSegments). Each spar segment can be seen as + one spar. The spar geometry between two spar points is defined + as a direct/straight connection in global coordinate system + and not in eta xsi coordinates of the component segment. + One spar point can be used by more than one spar, if + e.g. two spars are merging. The detailed cross section of the + spar is also defined with sparSegments. + Pleas find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + + + + + + + + + + + + + + + + + + + + + Definition of the wing stringers. + + + + Within the wingStringerType wing stringers are + defined. The stringer are defined by referencing on the + stringerStructureUID, where the shape and material settings of + one single stringer is defined. In addition the orientaion and + the stringer pitch have to be defined: + One stringer intersects the point at the given xsi and + eta position. + + + + Alternatively, an exlicit stringer definition can be + applied if the stringers shall be tapered. + + + + + + + + + + + + + This is the simple and default stringer + definition + + + + The pitch describes the distance between to + adjacent stringers in the plane rectangular to the stringer + elongation direction. + + + + + + Stringer angle: the reference axis for the + stringer angle is defined by the two leading edge points of + the 'from'- and the 'to'-element of the componentSegment + definition. The angle between the reference axis and the + stringers equals the rotation around the z-reference axis. For + details, please refer to the picture below. + + + + + + If the reference of the stringer angle shall + be different from the default implementation then this + parameter may be set. Allowed values include: leadingEdge, + trailingEdge and globalY. Furthremore, it is possible to + provide the UID of a spar. + + + + + + This is the explicit stringer definition. + Please note that for a consistent definition two out of the + possible three elements innerBorder (xsiLE, xsiTE), outerBorder + (xsiLE, xsiTE) and stringer angle (and angle reference) must be + defined. Any combination of two of the three is valid + + + + + The number of stringers; default is 0 + + + + + + Stringer angle: the reference axis for the + stringer angle is defined by the two leading edge points of + the 'from'- and the 'to'-element of the componentSegment + definition. The angle between the reference axis and the + stringers equals the rotation around the z-reference axis. For + details, please refer to the picture below. + + + + + + If the reference of the stringer angle shall + be different from the default implementation then this + parameter may be set. Allowed values include: leadingEdge, + trailingEdge and globalY. Furthremore, it is possible to + provide the UID of a spar. + + + + + Inner border xsi coordinate at the leading + edge of the stringer definition + + + + + Outer border xsi coordinate at the leading + edge of the stringer definition + + + + + Inner border xsi coordinate at the trailing + edge of the stringer definition + + + + + Outer border xsi coordinate at the trailing + edge of the stringer definition + + + + + + + + + + + + + + + wingStructuralMountsType + + + + + + + + + + + + + + + + + + + + + + Wing type, containing all a lifting surface (wing, HTP, + VTP, canard...) of an aircraft model. + + + + Wing type, containing all a lifting surface (wing, + HTP, VTP, canard...) of an aircraft model. + Position of the wing: The position of the wing is + defined using the transformation parameters. Using those + parameters, the wing coordinate system is translated, rotated + and scaled. + Definition of the wings outer shape: The outer shape + of the wing is defined by airfoils that are placed within the 3D + space. Two airfoils are combined to one wing segment within the + segments. For the definition of the positions of the airfoils, + differnt sections are defined. Within each section one or more + elements are defined. The airfoil shape is defined within the + elements. If the wings outer shape should e.g. have a step it is + possible to define two different airfoils in one section by + using two elements. In most cases each section will only include + one element. Positionings are vectors that are used for an + additional translation of the sections by using 'user friendly + paramaters' as e.g. sweep and dihedral. Please note, the first + positioning may be non-zero. Often it will be zero just to + locate the wing at the position stated by the translation, but + this is not necessary. Finally the wing segments are defined by + combining two consecutive elements. A more detailed description + is given within the different parameters. + Definition of control surfaces, wing structures, wing + fuel tank and wing fuselage attachment: those parts are defined + within componentSegments. Please refer to the documentation + there. + + + + + + + + + + + + + + Name of the wing. + + + + + Description of the wing. + + + + + UID of part to which the wing is mounted (if + any). The parent of the wing can e.g. be the fuselage. In each + aircraft model, there is exactly one part without a parent part + (The root of the connection hierarchy). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The two elements that where the structural connection + is placed. + + + + + + + + + + + + + Element uID of the element of the CURRENT + componentSegment where the structural connection is placed. + + + + + + Element uID of the element of the second + componentSegment where the structural connection is placed. + + + + + + + + + + + + + + Two spars that are structurally connected. + + + + + + + + + + + + + Spar uID of the CURRENT componentSegment. + + + + + + Spar uID of the second componentSegment. + + + + + + + + + + + + + + wingWingAttachmentType + + + Definition of the structural connection between two + wings resp. two componentSegments. Note: All structural + connections between two wings/componetSegments have to be defined + using wingWingAttachments. The wingWingAttachment has only be + defined in one of the two componentSegments, that are connected. + + + + + + + + + + + UID of the componentSegment, that is connected + with the current one. + + + + + + + Defines if the upper shell of the current + componentSegment is structurally connected to the upper or lower + shell of the second componentSegment. Can have the values + 'upperShell' or 'lowerShell'. + + + + + Defines if the lower shell of the current + componentSegment is structurally connected to the upper or lower + shell of the second componentSegment. Can have the values + 'upperShell' or 'lowerShell'. + + + + + + + + + + + + + wingWingAttachmentsSparsType + + + + + + + + + + + + + + + + + + + + + + List of wingWingAttachments. + + + + + + + + + + + + + + + + + + + + + + wingsAeroPerformanceType + + + wingsAeroPerformance type, containing + wingsAeroPerformance + + + + + + + + + + + + + + + + + + + Wings + + + Wings type, containing all the lifting surfaces (wings, + HTPs, VTPs, canards...) of an aircraft model. + + + + + + + + + + + + + + + + + + + xsiIsoLineType + + + Iso line described by point of same xsi coordinate. + Can be either segment or component segment coordinates. + + + + + + + + + + Relative spanwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta value is considered to be in segment + eta coordinate; if it points to a componentSegment, + then componentSegment eta coordinate is used. + + + + + + + + + + + + + zCouplingType + + + + + + + + + + + + + Reference to the control surface that is + connected to this controll surface by the z-coupling.. + + + + + + Material of the movable part of the + z-coupling. + + + + + Definition of the attachment of the z-coupling + to this control surface. + + + + + Definition of the attachment of the z-coupling + to the other control surface. + + + + + + + + + + + + + + zCouplingsType + + + + + + + + + + + + + Definiton of one z-coupling. + + + + + + + + + + + + + + damTolBehaviourType + + + + + + + + + + + + + Damage tolerance law, Walker approach + + + + + Damage tolerance law, Forman approach + + + + + + + + + + + + + fatigueStressBasedBrownMillerType + + + + + + + + + + + + + Parameter sigma_f [N/m^2] + + + + + Parameter b [-] + + + + + Parameter epsilon_f [-] + + + + + Parameter c [-] + + + + + + + + + + + + + damTolWalkerType + + + + + + + + + + + + + Fracture toughness KIc [Pa m^0.5] + + + + + Parameter C0 [m/cycle] + + + + + Parameter m [-] + + + + + Parameter gamma [-] + + + + + + + + + + + + + damTolFormanType + + + + + + + + + + + + + Parameter Kc [Pa m^0.5] + + + + + Parameter C2 [m/cycle] + + + + + Parameter m2 [-] + + + + + + + + + + + + + + + + + The compartment defines an enclosed volume within the fuselage. It is defined by a set of border geometries. This could be pressureBulkheads, walls or floors and they are referred by their uIDs. The volume is closed with the fuselage skin. The geometry tool has to check, if the compartment definition gives a closed geometry. + + + + + + + + + + + The compartment defines an enclosed volume in the + fuselage. It is defined by a set of border geometries. + This could be pressureBulkheads, walls or floors and + they are referenced by their uIDs. The volume is closed + with the fuselage skin. The geometry tool has to check, + if the compartment definition gives a closed geometry. + + + + + + + + + Compartment geometry uIDs list. + + + + + + + Name of the compartment. + + + + + + + Description of the compartment. + + + + + + + Ideal design volume of the compartment. + + + + + + + + + + + + + + + + + + + + + + + UIDs of 2d structural fuselage elements + (e.g., pressure bulkheads, walls or + floors). The compartment will be + enclosed with the fuselage skin + + + + + + + + + + + + + + fatigueBehaviourType + + + + + + + + + + + + + Fatigue law, stress based Brown Miller approach [N/m^2] + + + + + + + + + + + + + plasticityCurvesType + + + + + + + Plastification curve incl. element elimination (isotropic + materials). The data may be used to describe the plastic behavior of isotropic + materials in non-linear analysis, such as crash simulations. The input is defined + according to the needs of Material 103 (single stress strain option) in the + PAM-CRASH explicit Finite Element code, but can also be used for equivalent material + laws in alternative simulation environment (see PAM-CRASH Solver Reference Manual., + Material 103). + + + + + + + + + + + + + + + + This type describes the plasticity curve of isotropic + materials + + + + ... + + Plastification curve incl. element elimination + (isotropic materials) + + Plastification curve incl. element elimination (isotropic + materials) The data may be used to describe the plastic behavior of + isotropic materials in non-linear analysis, such as crash + simulations. The input is defined according to the needs of Material + 103 (single stress strain option) in the PAM-CRASH explicit Finite + Element code, but can also be used for equivalent material laws in + alternative simulation environment (see PAM-CRASH Solver Reference + Manual., Material 103) + Source: PAM-CRASH V2010 - Notes Manual + + + + + + + + + + + + Name of the post failure definition + + + + + + + Description of the post failure + definition + + + + + + + Strain rate for following plastcity + curve [1/s] + + + + + + + + + + plasticEliminationStrain [-]; Plastic + strain for element elimination during + the non-linear analysis + + + + + + + + + + + + + + + + Definition of wall positions to place + walls inside fuselage. + + + + + + + List of wall segments. + + + + + + + + + + + + Definition of wall positions to place walls inside fuselage. + + + + + + + Wall position definition specifying a point in the fuselage to be connected to a wall segment. + + + + + + + + + + + + + + Wall segment definition. + + + + + + + + + + Definition of a wall position to place walls inside fuselage. + + + + + + + UID of a bulkhead determining the + x-coordinate of the position with the given + y- and z-coordinates. + + + + + + + UID of a wall segment determining the + x-coordinate of the position with the given + y- and z-coordinates. + + + + + + + UID of fuselage section determining the + x-coordinate of the position with the given + y- and z-coordinates. + + + + + + Absolute x-coordinate of wall position in fuselage coordinate system. + + + + + + Absolute y-coordinate of wall position in fuselage coordinate system. + + + + + Absolute z-coordinate of wall position in fuselage coordinate system. + + + + + + + + + + + + Defines extrusion direction. Rotation angle + around fuselage x-axis of extrusion direction. A + value of 0deg means fuselage z-axis as extrusion + direction. Default: 0.0deg. + + + + + + + + + + + + + + By default, the wall is only extruded in positive direction. If doubleSidedExtrusion is true, the wall is additionaly extruded in negative direction as well. Default: false. + + + + + Rotates the first edge of the wall segment so that it is adjacent with the structural element defined in the first wall position (bulkhead, fuselage section or another plane wall). Default: false. + + + + + Rotates the last edge of the wall segment so that it is adjacent with the structural element defined in the last wall position (bulkhead, fuselage section or another plane wall). Default: false. + + + + + + A list of uIDs referencing other + structural/geometric elements that shall serve + as a boundary of the wall element. Possible + references are floor, wall or + genericGeometryComponent. A major requirement is + that the referenced element has an intersection + with the wall for at least the distance between + two wall positions. So that a full geometric + face of the wall is bounded by it. Neighbouring + wall faces that are not completely bounded by + the reference element are not affected. + + + + + + + Reference to the structural property definition + of this wall segment. + + + + + + + List of wall position uIDs that are used for + this wall segment. At least two positions must + be defined (for start and end position of wall). + If more than two positions are referenced here, + the wall is constructed out of several planar + faces that connect two consecutive positions + (Note: Order of position uIDs defines + connectivity). + + + + + + + + + + + A list of uIDs referencing other structural/geometric + elements that shall serve as a boundary of the wall + element. Possible references are floor, wall or + genericGeometryComponent. A major requirement is that + the referenced element has an intersection with the wall + for at least the distance between two wall positions. So + that a full geometric face of the wall is bounded by it. + Neighbouring wall faces that are not completely bounded + by the reference element are not affected. + + + + + + + + + UID referencing another + structural/geometric element that shall + serve as a boundary of the wall element. + Possible references are floor, wall or + genericGeometryComponent. + + + + + + + + + + + + + + + Structural wall reinforcement definition specifying physical properties of a fuselage wall segment. + + + + + + + + + + + + + + Reference to a sheet element definition specifying the physical properties of the wall's shell. + + + + + Reinforcements running along the position polygon of the wall positions. + + + + + Reinforcements running in lateral/radial direction in the wall segment plane. + + + + + Reinforcement at inner side of wall. This is either, depending on the extrusion direction flag, the edge of the wall that connects the positions ("positiveDirection") or the edge of the wall where the wall intersects with the fuselage skin in the opposite direction of the extrusion direction. + + + + + + Reinforcement at outer side of wall. The outer side of the wall is defined as the edge of the wall at the intersection of the wall with the fuselage skin running along the main direction of the wall. + + + + + + + Lateral caps are the reinforcements of + the wall at the edges lateral to the + main direction of the wall. These caps + can be either defined at start, end, + start and end or at all wall positions + according to the placement flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reference to wall position uID. + + + + + + + + + + + + nacelleCowlType + + + + Describes the cowl geometry for nacelles + using sections positioned around the + rotational center of the engine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nacelleCenterCowlType + + + + Describes the curve for defining rotational center of the engine. + + + + + + + + + + + + + + + + + + + + + + Aerodynamic performance + + + + The aerodynamic coefficients and derivatives are stored in aerodynamic maps. Individual maps can be used to + gather the aerodynamic characteristics for specific boundary conditions. + + + + + + + + + + + + + + + + + + + + + Aerodynamic map + + + + + The aeroMap contains aerodynamic coefficients and derivatives for a specific set of aerodynamic + and configurative boundary conditions. + + The aeroMap allows for the simultaneous specification of multiple + controlDevice settings. + In this case, it is assumed that a cumulative setting is built by summing up the individual settings. The correct + sequence of this summation is described in the controlDistributorType documentation. + + + + + + + + + + + + Name + + + + + Description + + + + + + + + + + + + + + + + + + + + Boundary conditions + + + Specification of boundary conditions. + + + + + + + + + + + + + + Offset from temperature of the + atmospheric model [K]. For more details + on atmospheric models, please refer to + documentation of the <CPACS> root + element. + + + + + + + Configuration settings + + + + + + + + + + + + + + Control elements + + + Specification of control element settings. Control elements can be controlDistributors + or individual control devices, such as control surfaces or landing gears. + + + + + + + + + + + + + + + + + + + + Control element + + + Specification of an control element setting. A control element can be a controlDistributor + or an individual control device, such as a control surface or a landing gear. + + + + + + + + + + + Reference to the uID of a control device, e.g. a control surface or a landing gear + + + + + Control parameter of the control device + + + + + + + Reference to a control distributor uID + + + + + Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + + + + + + + + Aerodynamic coefficients and derivatives + + + + + Description + + The aeroPerformanceMap contains a map + with aerodynamic data of the complete aircraft in the form of + nondimensional coefficients. The force coefficients in + i-direction (ci) + are nondimensionalized by dynamic pressure and reference area, + the moment coefficients (cmi) by dynamic pressure, reference + area and reference length. + + All coefficients in the aeroPerformanceMap relate to + the aerodynamic coordinate system which is deducted from the CPACS coordinate system by + the transformations of angle of attack and angle of yaw. See the documentation of the + CPACS element for further details. + + The dependend parameters of the aeroPerformanceMap are altitude, + machNumber, angleOfSideslip and + angleOfAttack. These elements are vectors of equal length, where values + with identical indices belong together. The solution vectors ci and + cmi have the same length as the input vectors. Shown below is an example where + with 10 values per vector: + + <altitude mapType="vector">12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02</altitude> +<machNumber mapType="vector">0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2</machNumber> +<angleOfSideslip mapType="vector">0;0;0;0;0;2;2;2;2;2</angleOfSideslip> +<angleOfAttack mapType="vector">-2;0;2;4;6;-2;0;2;4;6</angleOfAttack> +<cd mapType="vector">0.056;0.094;0.132;0.17;0.208;0.072;0.11;0.148;0.186;0.224</cd> +<cs mapType="vector">0.;0.;0.;0.;0.;0.01;0.015;0.02;0.025;0.03</cs> +<cl mapType="vector">-0.1;0.04;0.18;0.32;0.46;-0.08;0.03;0.14;0.25;0.36</cl> + + The aerodynamic coefficients for altitude=1200m, machNumber=0.2, + angleOfSideslip=0° and angleOfAttack=6° can be found at the 5th index: + cd=0.208, cs=0 and cl=0.46. + + + + + + + + + + + + + + + Altitude [m] + + + + + + + Mach number + + + + + + + Sideslip angle [deg] + + + + + + + Angle of attack [deg] + + + + + + + Drag coefficient in aerodynamic + coordinates + + + + + + + Coefficient of the side force vector in + aerodynamic coordinates (perpendicular + to lift and drag) + + + + + + + Lift coefficient in aerodynamic + coordinates + + + + + + + + + + + + + + + + + + + Increment maps for aerodynamic coefficients + + + + + + + + + + + + + + + + + + + Increment map from aerodynamic coefficients + + + The increment map is composed of two-dimensional arrays. The first dimension is given by the + length of the input vectors of the baseline aeroPerformanceMap and the second dimension by the vector of relative + deflections (or command inputs) of control surfaces (or control distributors). An example is described in the <CPACS> + root element. + + + + + + + + + + + + Reference to the uID of a control device, e.g. a control surface or a landing gear + + + + + Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + Reference to a control distributor uID + + + + + Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + Increment of drag coefficient in aerodynamic coordinates + + + + + Increment of coefficient of the side force vector in aerodynamic coordinates (perpendicular to lift and drag) + + + + + Increment of lift coefficient in aerodynamic coordinates + + + + + Increment of cmd + + + + + Increment of cms + + + + + Increment of cml + + + + + + + + + + + + + + Aerodynamic limitations + + + + This map explicitly specifies limitations of a vehicle in terms of angles of attack and sideslip angles. + All vectors, i.e. altitude, machNumber, + angleOfSideslip and angleOfAttack, must have the + same length. To avoid redundancy with the aeroPerformanceMap, this type does not contain + any aerodynamic coefficients. + Since angleOfSideslip and angleOfAttack + are closely interdependent for a given machNumber and altitude + combination, a positive and negative maximum angleOfAttack is defined for a given combination of + machNumber, altitude and + angleOfSideslip. The limits of angleOfSideslip + can be determined by evaluating the nominal decrease of angleOfAttack values or by + agreeint with the data supplier that the minimum and maximum value of the angleOfSideslip + vector corresponds with physical limits. + In order to avoid data redundancy, the operational limits should not reflect the extrema of aerodynamic + coefficients as these can be extracted from the performanceMap via interpolation. + Note: In future CPACS versions, a revision of the aeroLimitsMap + will be targeted, since operational limits are not a purely aerodynamic issue. + + + + + + + + + + + + Altitude [m] + + + + + + + Mach number + + + + + + + Angle of sideslip + + + + + + + + + + + + + + + + Increment maps for limitation values due to movable device deflections + + + Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control + surfaces or landing gears). + + + + + + + + + + + + + + + + + + + Increment maps for limitation values due to movable device deflections + + + Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control + surfaces or landing gears). + + + + + + + + + + + + Reference to the uID of a control device, e.g. a control surface or a landing gear + + + + + Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + Reference to a control distributor uID + + + + + Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + Reference to an increment map of the aeroPerformanceMap + + + + + + Increments of the vehicle operation limits + + + + + + + + + + + + + + Damping derivatives for positive and negative rotation rates + + + + + 0. General overview + + This type contains the damping derivatives. They are + split up into those derivatives for positive rotation rates, + and those for negative rotation rates. + + + + 1. <positiveRates> (optional) + + Damping derivatives, calculated by positive rotation + rates. + + + + 2. <negativeRates> (optional) + + Damping derivatives, calculated by negative rotation + rates. + + + + + + + + + + + + + + + + + + + + + + + Damping derivatives + + + This type contains aerodynamic performance maps with + the damping derivatives. The derivatives are calculated using + rotational rates [rad/s], normalized by: + Rate*ReferenceLength/flow speed. The rotations are performed + around the global axis directions with the aircraft model's + global reference point as origin. The damping derivative + performance maps are vectors of the same length as the input + vectors of the baseline aerodynamic performance maps, consisting of + semicolon separated values. + + + + + + + + + + + Change of cd by normalized roll rate + + + + + Change of cd by normalized pitch rate + + + + + Change of cd by normalized yaw rate + + + + + Change of cs by normalized roll rate + + + + + Change of cs by normalized pitch rate + + + + + Change of cs by normalized yaw rate + + + + + Change of cl by normalized roll rate + + + + + Change of cl by normalized pitch rate + + + + + Change of cl by normalized yaw rate + + + + + Change of cmd by normalized roll rate + + + + + Change of cmd by normalized pitch rate + + + + + Change of cmd by normalized yaw rate + + + + + Change of cms by normalized roll rate + + + + + Change of cms by normalized pitch rate + + + + + Change of cms by normalized yaw rate + + + + + Change of cml by normalized roll rate + + + + + Change of cml by normalized pitch rate + + + + + Change of cml by normalized yaw rate + + + + + + + + + + + + + Vehicle operation limit + + + Vehicle operation limit defined by sets of minimum and maximum angleOfSideslip + and minimum and maximum angleOfAttack for a given altitude and Mach number. + This might be, e.g., a safety margin to the angle of attack at maximum lift or the flight + attitude a fighter aircraft is capable to fly in stalled conditions. The corresponding aerodynamic coefficients must + be extracted from the aeroPerformanceMap. + + + + + + + + + + Minimum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] + + + + + Maximum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] + + + + + + + + + + + + + Operation Limit Increments + + + Changes of the deltas of operation limit angles with respect to the corresponding increment aeroPerformanceMaps. + Values are specified as an array with same indices like the corresponding increment map. + + + + + + + + + + Minimum delta angle of attack [deg] + + + + + Maximum delta angle of attack [deg] + + + + + + + + + + + + + Toolspecific data + + + + This type contains a list of tools each specifying some basic tool information as well as the actual toolspecific part. + + The toolspecific elements must be defined in a separate namespace which can be specified and linked with the corresponding XSD file + in the CPACS header: + <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd" + xsi:schemaLocation="http://www.cpacs.de/myTool pathToToolspecificSchemaFile/toolspecific_myTool.xsd"> + + A simple example could look like this: + <toolspecific> + <tool> + <name>myToolName</name> + <version>1.2.3</version> + <myTool xmlns="http://www.cpacs.de/myTool" schemaVersion="1.0"> + <parentElement> + <childElement1>stringValue</childElement1> + <childElement2>1.0</childElement2> + </parentElement> + </myTool> + </tool> +</toolspecific> + + + + + + + + + + + + + + + + + + + + Tool identification + + + + Tool information as described in the toolspecificType. + + + + + + + + + + + + Name of the tool + + + + + + + Version of the tool + + + + + + + Wildcard for the root element of a toolspecific namespace + + + + + + + + + + + + + + Global analysis information + + + + + + + + + + + + + + + + + + + + + + + Load application points + + + + Multiple sets of scattered load application points can be defined. However, no specific information about the corresponding loads (e.g. whether aerodynamic or structural loads are involved) or mesh topologies are specified here, as such assumptions are tool-specific. + + + + + + + + + + + + + + + + + + + + + Load application point set + + + + + A point set contains discrete spatial points at which loads are applied (e.g., aerodynamic or structural loads). A typical procedure in CPACS is as follows: + + + + Reference a wing, fuselage or control surface by its uID using the componentUID node. + Define a reference axis through the above component with the loadReferenceLine element to specify where a load distribution shall be applied. + Compute the intersections with (e.g.) ribs of the referenced component (wing, fuselage or control surface) and write the results into loadApplicationPoints. This procedure results from common practice where the forces in structural analyses are typically introduced at structural elements such as ribs and spars. With respect to preliminary aircraft design a two-dimensional load distribution is preferred. However, an arbitrary distribution of the load application points is possible (without the intersection of structural elements with a reference axis in the previous step), for example to define discrete load distributions on the wing surface in streamwise and spanwise direction. + Specify the location and orientation of cut loads in the cutLoadIntegrationPoints element and the corresponding connectivity information in the connectivities node. + + + + + + + + + + + + + + + + + UID of a wing, fuselage or control surface + + + + + + + Reference axis (line) for load distribution + + + + + + + List of points at which load vectors are + applied to + + + + + + + List of points at which cut loads are applied to + + + + + + + Specification of connectivity properties between points + + + + + + + + + + + + + + + Vehicle configurations + + + + List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) + + + + + + + + + + + + + + + + + + + + + Vehicle configurations + + + + List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) + + + + + + + + + + + + Name + + + + + + + Description + + + + + + + + + Deck configurations + + + + + + + + + + + + + + + Internal pressure of a deck + + + + + + + + + + + Internal pressure of a fuselage, deck or compartment + + + + + + + + + + + + + + Cabin pressure + + + + Internal pressure of a fuselage, deck or compartment + + + + + + + + + + + + UID of a fuselage, deck or compartment + + + + + + + Internal pressure [Pa] + + + + + + + + + + + + + + Load set + + + A set of forces and moments + + + + + + + + + + + Description + + + + + + + UID of load application point set (analysis/global/loadApplicationPoints) + + + + + + + Force in x-direction [N] + + + + + + + Force in y-direction [N] + + + + + + + Force in z-direction [N] + + + + + + + Moment around x-axis [Nm] + + + + + + + Moment around y-axis [Nm] + + + + + + + Moment around z-axis [Nm] + + + + + + + Nodal displacement in x-direction [m] + + + + + + + Nodal displacement in y-direction [m] + + + + + + + Nodal displacement in z-direction [m] + + + + + + + Nodal rotation around x-axis [deg] + + + + + + + Nodal rotation around y-axis [deg] + + + + + + + Nodal rotation around z-axis [deg] + + + + + + + Load brake-down + + + + + + + + + + + + + + + Load sets + + + + A list of load sets + + + + + + + + + + + + + + + + + + + + + Aerodynamic load cases + + + + Combines a set of aerodynamic load cases + + + + + + + + + + + + + + + + + + + + Aerodynamic load case + + + + Specification of an aerodynamic load case + + + + + + + + + + + + Name + + + + + + + Description + + + + + + + + + + + + + + + + + + Specification + + + + Specification of the vehicle properties and dynamics + + + + + + + + + + + Altitude + + + + + + + Mach number + + + + + + + Angle of sideslip [deg] + + + + + + + + Angle of attack [deg] + + + + + + + Target lift coefficient + + + + + + + + Normalized roll rate [rad/sec]. It is specified around the global x-axis + with the aircraft model's global reference point as origin and + nondimensionalized by: pStar = p * reference length / flow speed. + + + + + + + Normalized pitch rate [rad/sec]. It is specified around the global y-axis + with the aircraft model's global reference point as origin and + nondimensionalized by: qStar = q * reference length / flow speed. + + + + + + + Normalized yaw rate [rad/sec]. It is specified around the global z-axis + with the aircraft model's global reference point as origin and + nondimensionalized by: rStar = r * reference length / flow speed. + + + + + + + + Reference to a weight and balance description + + + + + + + + + + + + Aerodynamic loads + + + + Description of the aerodynamic loads + + + + + + + + + + + + Angle of attack [deg] + + + + + + + Angle of sideslip [deg] + + + + + + + + + + + + + + + + Aerodynamic loads of components + + + + Specification of the aerodynamic loads of components + + + + + + + + + + + + + + + + + + + + Aerodynamic data of components + + + + Aerodynamic data of individual components of the aircraft (e.g. control surface loads and hinge moments) + + + + + + + + + + + + Reference to a component uID + + + + + + + + + + + + + + + Aerodynamic loads of the vehicle + + + + Description of the aerodynamic loads of the vehicle + + + + + + + + + + + + + + + + + + + + + Aerodynamic coefficients + + + + A set of aerodynamic coefficients in the aerodynamic coordinate system + + + + + + + + + + + + Drag coefficient in aerodynamic + coordinates + + + + + + + Coefficient of the side force vector in + aerodynamic coordinates (perpendicular + to lift and drag) + + + + + + + Lift coefficient in aerodynamic + coordinates + + + + + + + Aerodynamic moment around d-axis of the aerodynamic coordinate system + + + + + + + Aerodynamic moment around s-axis of the aerodynamic coordinate system + + + + + + + Aerodynamic moment around l-axis of the aerodynamic coordinate system + + + + + + + + + + + + + + + Drag contributions + + + + The drag contributions relate to different physical mechanisms. The sum of the contributions does not have to be equal to the total drag. + + + + + + + + + + + + Drag contributions due to the displacement of the flow around a component. Zero for irrotational two-dimensional flows. + + + + + + + Drag contributions due to shear forces on surfaces + + + + + + + Drag contributions due to friction + + + + + + + Drag contributions due to energy loss through vortex structures caused by the pressure difference between the upper and lower sides of three-dimensional lifting surfaces. + + + + + + + Drag contributions due to mixing of streamlines between airframe components (e.g., interaction between wing and fuselage or pylon and wing). + + + + + + + Drag contributions due to energy dissipation in shock waves + + + + + + + Drag contributions due to trimmed aircraft configuration + + + + + + + + + + + + + + Aerodynamic coefficients breakdown + + + + + Breakdown of the total aerodynamic coefficients into contributions + from the various vehicle componenents. A detailed breakdown is only specified + for the wing. Other components, such as the fuselage, are more generically + referred to as otherComponents. Since + the sum of the contributions within a breakdown must equal the total + coefficients, the remaining contributions must be listed in + remainingContributions. + + + The remainingContributions cannot be defined alone. Either the + definition of a wing, otherComponents + or both together is valid and can be combined with remainingContributions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of the wings + + + + Contains a list of wings for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a wing + + + + + Describes the contributions of a specific wing to the total aerodynamic coefficients of a vehicle + + + It is obligatory to reference a wing via its uID and to provide its + coefficients. The breakdown of the coefficients comprises the segments + and remainingContributions. The latter must only be specified if segments + is given. + + + + + + + + + + + + + Reference to a wing uID + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of wing segments + + + + Contains a list of wing segments for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a wing segment + + + + + Describes the contributions of a specific wing segment to the total aerodynamic coefficients of a wing + + + It is obligatory to reference a segment via its uID and to provide its + coefficients. The breakdown of the coefficients comprises the strips + and remainingContributions. The latter must only be specified if strips + is given. + + + + + + + + + + + + + Reference to a wing segment uID + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of strips within a wing segment + + + + Contains a list of strips within a wing segment for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a strip within a wing segment + + + + + Describes the contributions of a specific strip within a wing segment to the total aerodynamic coefficients of a wing segment + + + The strip extends spatially between two eta coordinates (i.e., from an inner border to an outer border). + In order to avoid redundancy, the inner border (denoted as from) is always identical to the outer border of the previous strip (denoted by to). + Accordingly, only the to-border can be specified explicitly, while the from-border equals implicitly either to 0 + (for the first strip) or the toSegmentEta value of the previous element. The toSegmentEta of the last strip + must be equal to 1! + + + It is obligatory to provide the coefficients of the strip. The breakdown comprises the chordwiseParts + and remainingContributions. The latter must only be specified if the breakdown into chordwiseParts + is given. This breakdown is optional. If it is specified, but the sum of all chordwiseParts does not match the strip coefficients, one or more remainingContributions may be applied + to ensure consistency (sum of all chordwiseParts + sum of all remainingContributions must be equal to total strip coefficients). + + + + + + + + + + + + + Spanwise coordinate eta in the segment coordinate system to define the end of the strip + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a chrordwise part within a wing segment strip + + + + Contains a list of chordwise parts within a wing segment strip for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a chordwise part within a within a wing segment strip + + + + + Describes the contributions of a specific par within a wing segment to the total aerodynamic coefficients of a wing segment strip + + + A chordwisePart aescribes the contributions of a specific chordwise part within a wing strip + to the total aerodynamic coefficients of this strip. It extends spatially between the two eta + positions of the parent strip (see strip documentation) and four xsi positions in the segment coordinate system. + As with the parent stips, only the trailing border (..ToSegmentXsi) of a chordwisePart is defined, while the leading border always equals the trailing border of the preceding chordwisePart (or 0 for the first part). + To account for oblique trailing borders (e.g., to match the aileron on a tapered wing) two different toSegmentXsi positions can be defined, one at the inner border (innerBorderToSegmentXsi) and one at the outer border (innerBorderToSegmentXsi) of the parent strip. + The innerBorderToSegmentXsi and outerBorderToSegmentXsi of the last chordwisePart must be equal to 1. + + + + + + + + + + + + + Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the inner eta border + + + + + + + Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the outer eta border + + + + + + + + + + + + + + + + Remaining contributions to aerodynamic coefficients + + + + This node lists the remaining contributions which were not specified so that the sum of the coefficients are equal to the total coefficients. + + + + + + + + + + + + + + + + + + + + Remaining contribution to aerodynamic coefficients + + + + This node lists a remaining contribution which was not specified so that the sum of the coefficients are equal to the total coefficients. + + + + + + + + + + + + Name + + + + + + + Description + + + + + + Type (numerical/unspecified): "numerical", for example, describes rounding errors to clearly + separate them from other effects currently labeld as "unspecified". + The latter usually summarizes physical effects such as viscosity and should be further described via "description". + The approach is currently being tested in practice in order to derive a robust definition of categories in the future. + + + + + + + + + + + + + + + + + + + + + + + + Reference values for aerodynamic coefficients + + + + Specification of reference values for aerodynamic coefficients. + + + + + + + + + + + + Reference area + + + + + + + Reference lengt + + + + + + + Reference point + + + + + + + Reference translation + + + + + + + Reference rotation + + + + + + + + + + + + + + Aerodynamic contributions of the components + + + + Contains a list of components for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a component + + + + Describes the contributions of a specific component to the total aerodynamic coefficients + + + + + + + + + + + + Reference to a component + + + + + + + + + + + + + + + Atmospheric model + + + Available options: ISA. See documentation of <CPACS> root element for further details. + + + + + + + + + + + + + + + + + + Flight Envelopes + + + + Specification of flight envelopes + + + + + + + + + + + + + + + + + + + + + Flight Envelope + + + + Specification of a flight envelope + + + + + + + + + + + + Offset from temperature of the atmospheric model [K] + + + + + + + + + + + + + + + Flight envelope speed + + + + Specification of the V-speed + + + + + + + + + + + + + Vector with altitudes + + + + + + + Vector with True Airspeeds + + + + + + + + + + + + + + Speed designators + + + + Provides an enumerated list of V-speeds as defined by regulations. + + + + + + + + + + + Design maneuvering speed + + + + + + + Design speed for maximum gust intensity + + + + + + + Design cruise speed, used to show compliance with gust intensity loading + + + + + + + Design diving speed, the highest speed planned to be achieved in testing + + + + + + + Designed flap speed + + + + + + + Stall speed or minimum steady flight speed for which the aircraft is still controllable + + + + + + + Stall speed or minimum flight speed in landing configuration + + + + + + + Stall speed or minimum steady flight speed for which the aircraft is still controllable in a specific configuration + + + + + + + Minimum control speed + + + + + + + Never exceed speed + + + + + + + Maximum operating limit speed + + + + + + + + + + + + + Landing gear base + + + + Base type for landing gears (i.e. nose gear, main gear and skid gear). + An example of a nose and main gear is shown below: + + + + + + + + + + + + + + Name + + + + + Description + + + + + UID of the parent component. If set, the position of the main strut is defined relative to the parent coordinate system. + + + + + + + + + Total length of landing gear, equals the distance from the middle of the bogie/axles to the axis of rotation of the pintle strut. Distance is measured while landing gear is fully extended and in airborne condition (i.e., if a spring is present, the totalLength includes the springDeflectionLength) + + + + + Static suspension travel means the positive distance between the total length in airborne condition and the reduced length due to compression on the ground. + + + + + Compressed suspension travel means the positive distance between the total length in airborne condition and the maximum reduced length due to maximum compression on the ground (e.g., landing shock). + + + + + + + Transformation with respect to the uppermost point of the main strut. From this point the landing gear is oriented in negative z-direction by default. + + + + + + + + + + + + + + + + + + + + + + + + + Landing gear control parameters + + + + Parameters of a landing gear control such as extraction or steering. + + + + + + + + + + + + Retraction angle of the main landing + gear. Equals a rotation around the + global z-axis in degrees. 0 = retraction + to the front; 90 = retraction to the + left; 180 = retraction to the rear; 270 + = retraction to the right. + + + + + + + + Distance of the center of rotation to the top of the main strut + for retracting and extending the landing gear. I.e., a value of + 0 means that the landing gear will rotate around the upper end + of the main strut during retraction. If this value is greater + than 0, the center of rotation is shifted by this value above + the main strut end point (translation along the main strut axis). + + + + + + + + + + + + + + Landing gear control functions + + + + + A list of functions which can be addressed by the controlDistributor. + + + + + + + + + + Extension path + + + + + Steering path + + + + + Braking state + + + + + + + + + + + Braking function + + + + + Describes the braking state of the landing gear. + + + + + + + + + + Control parameter indicating that the brake is set + + + + + Control parameter indicating that the brake is released + + + + + + + + + + + + Steering path + + + + + Describes the steering path of the landing gears via a list of steps. + + + + + + + + + + Step within the steering path + + + + + + + + + + + + Steering step + + + + + Describes a step with the steering path of the landing gear. + + + + + + + + + + Step type (centered, fullBackboard or fullStarboard) + + + + + + + + + + + + Control parameter + + + + + Steering angle [deg] + + + + + + + + + + + Extension path + + + + + Describes the extension path of the landing gears via a list of steps. + + + + + + + + + + Step within the extension path + + + + + + + + + + + + Extension step + + + + + Describes a step with the extension path of the landing gear. Make sure to provide a least one step with stepType=extracted! + + + + + + + + + + Step type (retracted or extracted) + + + + + + + + + + + + Control parameter + + + + + Extension angle of the main strut [deg] + + + + + + + + + + + Assembly of landing gear components + + + + + Describes an assembly of the various landing gear components + + + + + + + + + + + + Main strut + + + + + + + + + + Drag strut (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) + + + + + + + + + + + Pintle strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) + + + + + Pintle strut (one or two pintle struts are supported) + + + + + + + + Side strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) + + + + + + + + + + + + Strut assembly + + + Geometric description, spatial placement and specification of material parameters + + + + + + + + + + Strut properties + + + + + The starting point of the support strut must connect to the main strut. This element specifies the relative position on the main strut (0 -> top end, 1 -> bottom end). + + + + + + + + + + + + End position in absolute coordinates. Coordinates are relative to parent if it has a parentUID reference (otherwise global). + + + + + End position in eta/xsi/relHeight coordinates + + + + + End position as a relative position on another strut of this landing gear + + + + + + Attachment to an aircraft wing or fuselage component + + + + + Reference to an actuator uID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Strut properties + + + + + Geometric description and material properties + of a strut + + + + + + + + + + + + + (Outer) radius of the strut + + + + + + Material of the strut + + + + + Inner radius of the strut + + + + + + + + Reference to structural element for a more + detailed cross section definition + + + + + + + + + + + + + + + + Definition of the wing attachment + + + + + Definition of the wing attachment, if + attached to the wing. The definition + includes the position of the landing gear as + well as the information to which spars resp. + supportBeam the gear is attached. + + + + + + + + + + + + UID of the second spar, where the landing gear is attached to. Only used, if the landing gear is attached between two spars. + + + + + + UID of a set of ribs (ribDefinition) + + + + + Number of the rib in the rib set (ribDefinition) + + + + + + + + UID of the structural mount + + + + + + + + + + + + + + + Main landing gear support beam + + + + Definition of the main landing gear support beam, if a + support beam is used for the attachment. The defintion includes + cross section properties as well as the position of the support + beam. + + + + + + + + + + + + + + + + + + + + + framePositionUIDs of the frame + + + + + A framePostion defines a location where a frame in mounted. + + + + + + + + + + + framePositionUID of the frame, where the landing gear + is attached to. + + + + + + + + + + + + + Position of the landing gear on a wing + + + + Definition of the position of the landing gear + (intersection point of main strut and pintle sturt) on a wing, + using relative componentSegment coordinates + + + + + + + + + + Relative height of spar or rib at which landing gear is attached. + + + + + + Relative spanwise position (eta) of spar at which landing gear is attached. + + + + + Relative chordwise position (xsi) of the rib at which landing gear is attached. + + + + + + + + + + + + + Definition of the main landing gear support beam + position + + + Definition of the main landing gear support beam + position + + + + + + + + + + Relative chordwise coordinate (xsi) of the + inner end of the support beam. The eta + position of the inner end is defined by the eta position of the + wing root (=wing-fuselage attachment). + + + + + Relative spanwise coordinate (eta) of the + outer end of the support beam. The xsi + coordinate of the outer end is defined by the spar position + (first spar), where the support beam is attached to. + + + + + + + + + + + + + + Configuration + + + + Contains references to control control devices and (or) the global aircraft configuration node. + + + + + + + + + + + + + Reference to the aircraft configuration node (aircraft/model/configurations/configuration) + + + + + + + State description of the control elements + + + + + + + + + + + + + + Standard profile + + + + + + + + + + + + + + + + + + + + + + + Rectangle + + + + The width of the profile is always 1, since scaling is performed after referencing it (e.g., in the fuselage). + The resulting profile is defined by the following equation: + + + + with c = cornerRadius and r = heightToWidthRatio. + Example: Rectangle with cornerRadius=0.125 and heightToWidthRatio=0.5 + + + + + + + + + + + + + + + + + + Corner radius + + + + + + + + + + + + + + + + + + Height-to-width ratio + + + + + + + + + + + + + + + + Superellipse + + + + A profile based on superellipses is composed of an upper and a lower semi-ellipse, which may differ from each other in their parameterization. The total width and height of the profile is always 1, since scaling is performed after referencing (e.g., in the fuselage). + This lowerHeightFraction describes the portion of the lower semi-ellipse on the total height. + The resulting profile is defined by the following set of equations: + + + + + + + with + + + + The following examples indicate the various possibilities of parametric profiles: + Example 1: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (0.5; 2; 5; 3; 0.25) + + + + Example 2: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (2; 2; 2; 2; 0.5) = a circle + + + + Example 3: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (1; 1; 1; 1; 0.5) = a square / diamond + + + + Note: For exponents that are infinitely large, the superellipse converges to a rectangle. However, the value Inf is not a valid entry at this point. Use the square element instead. + + + + + + + + + + + Exponent m for upper semi-ellipse + + + + + Exponent n for upper semi-ellipse + + + + + Exponent m for lower semi-ellipse + + + + + Exponent n for lower semi-ellipse + + + + + + Fraction of height of the lower semi-ellipse relative to the total height + + + + + + + + + + + + + + + + + + + + Performance Cases + + + + Definition of missions and point performance events to evaluate the performance of a vehicle. + The definition of performance cases is independent from a specific vehicle. + + + + + + + + + + + + + + + + + + + + + + + + UID of the runway + + + + + + + Offset from runway threshold in cartesian coordinates in the runway coordinate system + + + + + + + + + + + + + + + + UID of the runway + + + + + + + Offset from runway threshold in cartesian coordinates in the runway coordinate system + + + + + + + + + + + + + + + Requirements + + + + Requirement settings for the point performance definition + + + + + + + + + + + Sustained load factor to be achieved + + + + + + + Instantaneous load factor to be achieved + + + + + + + Specific excess power to be achieved [m/s] + + + + + + + Roll rate to be achieved [deg/s] + + + + + + + Roll acceleration to be achieved upon control onset [deg/s^2] + + + + + + + Roll acceleration to be achieved upon control stop [deg/s^2] + + + + + + + + + + + + + + Controllability requirements + + + Contains a list of controllability requirements + + + + + + + + + + + + + + + + + + + + Trim requirements + + + Contains a list of trim requirements + + + + + + + + + + + + + + + + + + + + + Controllability requirement + + + + + + + + + + Name + + + + + Description + + + + + UID of point performance definition + + + + + UID of weight and balance description + + + + + + + + + + + + + + + + + Trim requirement + + + + + + + + Name + + + + + Description + + + + + UID of a predefined flight point + + + + + UID of weight and balance description + + + + + + + + + + + + + + + Trim + + + + Provides a list of trim cases + + + + + + + + + + + + + + + + + + + + + + Trim case + + + + + + + + + + + + + + Name + + + + + Description + + + + + UID of trim requirement + + + + + + + Description of the linear model + + + + + + + + + + + + + + Turn + + + + + + + + + + + + + ... + + + + + ... + + + + + + + + + + + + + + Level flight + + + + + + + + + + + + + + Specific excess power + + + + + + + + + + + + + + Climb + + + + + + + + + + + + + + + + + + + + Descent + + + + + + + + + + + + + + + + + + + + Environmental conditions + + + + Specification of environmental conditions + + + + + + + + + + + + Delta temperature + + + + + + + + + + + + + + Flight Cases + + + + + + + + + + + + + + + + + + + + + + + + Flight point + + + + + + + + + + + + + + + + + + + + Mach number + + + + + + + Calibrated air speed + + + + + + + True air speed + + + + + + + + + + + + + + + + + Configurations which apply for this performance requirement + + + + + + + + + + + + + + + + Default configuration uID + + + + + + + + + + + + + + + Specific configuration uIDs + + + + + + + + + + + + + + + + + + + + + + + + Connection between segments, pointPerformances and a configurationUID + + + + + + + + + + + + + + + + Configuration uID + + + + + + + + List of pointPerformanceUIDs + + + + + + + + + + + + + + Segments + + + + + + + + + + + + + + + + + + + + + + + + Specification of a segment uID and index of the parameter lapses + + + + + + + + + + + + + + + + + Vector with semicolon separated indices of the parameters within a segment. If not given then the complete segment is applied. + + + + + + + + + + + + + + Released stores + + + + + + + + + + + + + + + + + + + + + + + + Released store + + + + + + + + + + + + + + + + UID of the released store. + + + + + + + Quantity of the released store. + + + + + + + + + + + + + + Runway start position + + + + + Description of the vehicle on the runway relative to the runway threshold. + + + + + + + + + + + + + + X-position in cartesian coordinates in the runway coordinate system + + + + + + + Y-position in cartesian coordinates in the runway coordinate system + + + + + + + Z-position in cartesian coordinates in the runway coordinate system + + + + + + + + + Lengthwise distance along the runway centerline from the runway threshold + + + + + + + Lateral offset from the runway centerline. Positive values on the starboard side. + + + + + + + + + + + + + + + Ducts + + + + + + + + + + + + + + + + + + + + Duct assembly + + + + + + + + + + + Name + + + + + + + Description + + + + + + + UID of part to which the duct is + mounted (if any) + + + + + + + + + + + + + + + + + + Duct + + + + + + + + + + + Name + + + + + + + Description + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Duct structure + + + + + + + + + + + + + + + + + + + + + List of fuselage fuel tanks integrated in compartments. + + + + + + + + + + + + + The integral fuel tank geometry is defined by a link to a fuselage geometry compartment. +The fuel tank volume type should also be used for the wing fuel tank + + + + + + + + + + + + + Definition of one fuel tank integrated in a fuselage compartment. + + + The definition of fuselage tanks is still preliminary. + Currently, there is no link to any structural elements + + + + + + + + + + + Name of the fuselage fuel tank. + + + + + + Description of the fuselage fuel tank. + + + + + + Link to the tank geometry defined by a compartment. + + + + + + + + + + + + + + + + + + + Generic fuel tank + + + + + + + + + + + + + + + + + + + + + + Cryogenic tank + + + + + + + + + + Name + + + + + + Description + + + + + + + + Volume + + + + + Burst pressure + + + + + + + + + + + + + + Hulls + + + + + + + + + + + + + + + + + + + Hulls + + + + + + + + + + Name + + + + + + Description + + + + + + + + + + + + + Inner radius of the cylinder + + + + + Inner length of the cylinder + + + + + + + + + + + + + + + + + + + Dome Type + + + + + + + + + + + + + + + + + + + + + + + + Ellipsoid dome + + + + + + + + + + Half axis fraction + + + + + + + + + + + + + Torispherical dome + + + + + + + + + + R1: dish radius + + + + + R2: knuckle radius + + + + + + + + + + + + + Isotensoid dome + + + + + + + + + + Radius of the fitting/smaller polar opening + + + + + + + + + + + + + Structure + + + + + + + + + + + + + + + + + + + + + + + + Skin Layers + + + + + + + + + + + + + + + + + diff --git a/cpacs_gen_input/test.html b/cpacs_gen_input/test.html index 9c2642d80a..66cec97287 100644 --- a/cpacs_gen_input/test.html +++ b/cpacs_gen_input/test.html @@ -1,92 +1,92 @@ - - - - - CPACS XSD Baumdiagramm - - - - - - - + + + + + CPACS XSD Baumdiagramm + + + + + + + diff --git a/src/common/tiglcommonfunctions.cpp b/src/common/tiglcommonfunctions.cpp index f3da1b8dbc..2b3c521117 100644 --- a/src/common/tiglcommonfunctions.cpp +++ b/src/common/tiglcommonfunctions.cpp @@ -1,1905 +1,1905 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2013-06-01 Martin Siggel -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/** - * @brief This file implements some commonly used functions/algorithms on opencascade - * data structures. - */ - -#define NOMINMAX - -#if defined _WIN32 || defined __WIN32__ -#include -#include -#else -#include -#endif - -#include "tiglcommonfunctions.h" - -#include "CTiglError.h" -#include "CNamedShape.h" -#include "boolean_operations/CBooleanOperTools.h" -#include "boolean_operations/BRepSewingToBRepBuilderShapeAdapter.h" -#include "ListPNamedShape.h" -#include "CNamedShape.h" -#include "PNamedShape.h" -#include "CTiglRelativelyPositionedComponent.h" -#include "CTiglProjectPointOnCurveAtAngle.h" -#include "CTiglBSplineAlgorithms.h" - -#include "Geom_Curve.hxx" -#include "Geom_Surface.hxx" -#include "GeomAdaptor_Curve.hxx" -#include "BRep_Tool.hxx" -#include "BRepTools_WireExplorer.hxx" -#include "TopExp_Explorer.hxx" -#include "TopExp.hxx" -#include "TopoDS.hxx" -#include "TopoDS_Shape.hxx" -#include "TopoDS_Edge.hxx" -#include "TopTools_IndexedMapOfShape.hxx" -#include "TopTools_HSequenceOfShape.hxx" -#include "GeomAdaptor_Curve.hxx" -#include "BRepAdaptor_CompCurve.hxx" -#include "BRepAdaptor_Curve.hxx" -#include "GCPnts_AbscissaPoint.hxx" -#include "BRep_Builder.hxx" -#include "BRepBuilderAPI_MakeWire.hxx" -#include "BRepBuilderAPI_MakeEdge.hxx" -#include "BRepBuilderAPI_MakeVertex.hxx" -#include "GeomAPI_ProjectPointOnCurve.hxx" -#include "BRepTools.hxx" -#include "BRepBuilderAPI_Sewing.hxx" -#include "Bnd_Box.hxx" -#include "BRepBndLib.hxx" -#include "BRepExtrema_ExtCF.hxx" -#include "BRepIntCurveSurface_Inter.hxx" -#include "BRepFill.hxx" -#include "GProp_GProps.hxx" -#include "BRepGProp.hxx" -#include "BRepClass3d_SolidClassifier.hxx" -#include "BRepExtrema_DistShapeShape.hxx" - -#include -#include -#include -#include -#include -#include -#include "BRepExtrema_ExtCC.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -#include -#include -#include -#include -#include - -#include "Debugging.h" - -namespace -{ - struct IsSame - { - IsSame(double tolerance) : _tol(tolerance) {} - bool operator() (double first, double second) - { - return (fabs(first-second)<_tol); - } - - double _tol; - }; - -} // anonymous namespace - -// calculates a wire's circumference -Standard_Real GetLength(const TopoDS_Wire& wire) -{ - BRepAdaptor_CompCurve aCompoundCurve(wire, Standard_True); - return GCPnts_AbscissaPoint::Length( aCompoundCurve ); -} - -Standard_Real GetLength(const TopoDS_Edge &edge) -{ - Standard_Real umin, umax; - Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, umin, umax); - GeomAdaptor_Curve adaptorCurve(curve, umin, umax); - Standard_Real length = GCPnts_AbscissaPoint::Length(adaptorCurve, umin, umax); - return length; -} - -unsigned int GetNumberOfEdges(const TopoDS_Shape& shape) -{ - TopExp_Explorer edgeExpl(shape, TopAbs_EDGE); - unsigned int iEdges = 0; - for (; edgeExpl.More(); edgeExpl.Next()) { - iEdges++; - } - - return iEdges; -} - -unsigned int GetNumberOfFaces(const TopoDS_Shape& shape) -{ - TopExp_Explorer faceExpl(shape, TopAbs_FACE); - unsigned int iFaces = 0; - for (; faceExpl.More(); faceExpl.Next()) { - iFaces++; - } - - return iFaces; -} - -unsigned int GetNumberOfSubshapes(const TopoDS_Shape &shape) -{ - if (shape.ShapeType() == TopAbs_COMPOUND) { - unsigned int n = 0; - for (TopoDS_Iterator anIter(shape); anIter.More(); anIter.Next()) { - n++; - } - return n; - } - else { - return 0; - } -} - -// Gets a point on the wire line in dependence of a parameter alpha with -// 0.0 <= alpha <= 1.0. For alpha = 0.0 this is the line starting point, -// for alpha = 1.0 the last point on the intersection line. -gp_Pnt WireGetPoint(const TopoDS_Wire& wire, double alpha) -{ - gp_Pnt point; - gp_Vec tangent; - WireGetPointTangent(wire, alpha, point, tangent); - return point; -} - -void WireGetPointTangent(const TopoDS_Wire& wire, double alpha, gp_Pnt& point, gp_Vec& tangent) -{ - if (alpha < 0.0 || alpha > 1.0) { - throw tigl::CTiglError("Parameter alpha not in the range 0.0 <= alpha <= 1.0 in WireGetPointTangent", TIGL_ERROR); - } - // ETA 3D point - BRepAdaptor_CompCurve aCompoundCurve(wire, Standard_True); - - Standard_Real len = GCPnts_AbscissaPoint::Length( aCompoundCurve ); - if (len < Precision::Confusion()) { - // wire length is zero, we can query at parameter 0 and accept zero length tangents - aCompoundCurve.D1(0., point, tangent); - } - else { - GCPnts_AbscissaPoint algo(aCompoundCurve, len*alpha, aCompoundCurve.FirstParameter()); - if (algo.IsDone()) { - double par = algo.Parameter(); - aCompoundCurve.D1( par, point, tangent ); - // normalize tangent to length of the curve - tangent = len*tangent/tangent.Magnitude(); - } - else { - throw tigl::CTiglError("WireGetPointTangent: Cannot compute point on curve.", TIGL_MATH_ERROR); - } - } - -} - -gp_Pnt EdgeGetPoint(const TopoDS_Edge& edge, double alpha) -{ - gp_Pnt point; - gp_Vec tangent; - EdgeGetPointTangent(edge, alpha, point, tangent); - return point; -} - -void EdgeGetPointTangent(const TopoDS_Edge& edge, double alpha, gp_Pnt& point, gp_Vec& tangent) -{ - if (alpha < 0.0 || alpha > 1.0) { - throw tigl::CTiglError("Parameter alpha not in the range 0.0 <= alpha <= 1.0 in EdgeGetPointTangent", TIGL_ERROR); - } - // ETA 3D point - Standard_Real umin, umax; - Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, umin, umax); - GeomAdaptor_Curve adaptorCurve(curve, umin, umax); - Standard_Real len = GCPnts_AbscissaPoint::Length( adaptorCurve, umin, umax ); - if (len < Precision::Confusion()) { - throw tigl::CTiglError("EdgeGetPointTangent: Unable to compute tangent on zero length edge", TIGL_MATH_ERROR); - } - GCPnts_AbscissaPoint algo(adaptorCurve, len*alpha, umin); - if (algo.IsDone()) { - double par = algo.Parameter(); - adaptorCurve.D1( par, point, tangent ); - // normalize tangent to length of the curve - tangent = len*tangent/tangent.Magnitude(); - } - else { - throw tigl::CTiglError("EdgeGetPointTangent: Cannot compute point on curve.", TIGL_MATH_ERROR); - } -} - -Standard_Real ProjectPointOnWire(const TopoDS_Wire& wire, gp_Pnt p) -{ - return ProjectPointOnWireAtAngle(wire, p, gp_Dir(1,0,0), M_PI/2.); -} - -Standard_Real ProjectPointOnWireAtAngle(const TopoDS_Wire &wire, gp_Pnt p, gp_Dir rotationAxisAroundP, double angle) -{ - double smallestDist = DBL_MAX; - double alpha = 0.; - int edgeIndex = 0; - - // find edge with closest dist to point p - BRepTools_WireExplorer wireExplorer; - int iwire = 0; - for (wireExplorer.Init(wire); wireExplorer.More(); wireExplorer.Next(), iwire++) { - Standard_Real firstParam, lastParam; - TopoDS_Edge edge = wireExplorer.Current(); - Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, firstParam, lastParam); - - if (fabs(angle - M_PI / 2.) < 1e-6) { - GeomAPI_ProjectPointOnCurve proj(p, curve, firstParam, lastParam); - if (proj.NbPoints() > 0 && proj.LowerDistance() < smallestDist) { - smallestDist = proj.LowerDistance(); - edgeIndex = iwire; - alpha = proj.LowerDistanceParameter(); - } - } - else { - Handle(Geom_TrimmedCurve) trimmedCurve = new Geom_TrimmedCurve(curve, firstParam, lastParam); - tigl::CTiglProjectPointOnCurveAtAngle proj(p, trimmedCurve, angle, rotationAxisAroundP); - if (proj.IsDone() && proj.NbPoints() > 0 && proj.Point(1).Distance(p) < smallestDist) { - smallestDist = proj.Point(1).Distance(p); - edgeIndex = iwire; - alpha = proj.Parameter(1); - } - } - } - - // compute partial length of wire until projection point is reached - wireExplorer.Init(wire); - double partLength = 0.; - for (int iwire = 0; iwire <= edgeIndex; ++iwire) { - Standard_Real firstParam; - Standard_Real lastParam; - TopoDS_Edge edge = wireExplorer.Current(); - Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, firstParam, lastParam); - GeomAdaptor_Curve adaptorCurve(curve, firstParam, lastParam); - if (iwire == edgeIndex) { - lastParam = alpha; - } - - partLength += GCPnts_AbscissaPoint::Length(adaptorCurve, firstParam, lastParam); - wireExplorer.Next(); - } - - // return relative coordinate - double normalizedLength = partLength/GetLength(wire); - if (normalizedLength > 1.0) { - normalizedLength = 1.0; - } - else if (normalizedLength < 0.0) { - normalizedLength = 0.0; - } - return normalizedLength; -} - - -/// Projects the point onto the plane pln -gp_Pnt2d ProjectPointOnPlane(gp_Pln pln, gp_Pnt p) -{ - gp_Ax1 xAx = pln.XAxis(); - gp_Ax1 yAx = pln.YAxis(); - - double px = (p.XYZ() - xAx.Location().XYZ()) * xAx.Direction().XYZ(); - double py = (p.XYZ() - yAx.Location().XYZ()) * yAx.Direction().XYZ(); - - return gp_Pnt2d(px,py); -} - -gp_Pnt ProjectPointOnShape(const TopoDS_Shape &shape, const gp_Pnt &point, const gp_Vec &direction) -{ - // Construct line in direction of projection through given point - gp_Lin line(point, gp_Dir(direction)); - TopoDS_Edge dir = BRepBuilderAPI_MakeEdge(line).Edge(); - - // Construct Extrema class with line and surface and calculate closest points - // (should be one if line goes through surface) - BRepExtrema_DistShapeShape extrema_distShapeShape(dir, shape); - int nPoints = extrema_distShapeShape.NbSolution(); - - // Make sure only one point was found with a distance of "zero" - if (nPoints == 0) { - throw tigl::CTiglError("Projection of point to shape failed.", TIGL_MATH_ERROR); - } - else if (nPoints > 1) { - LOG(WARNING) << "Projection of point of shape has multiple results. Choosing first."; - } - - return extrema_distShapeShape.PointOnShape2(nPoints); -} - -boost::optional GetFaceAndUV(TopoDS_Shape const& shape, - gp_Pnt const& pnt, - double tol) -{ - boost::optional res; - //find a face that contains the point and query the uv coordinates - TopoDS_Vertex v = BRepBuilderAPI_MakeVertex(pnt); - TopTools_IndexedMapOfShape faceMap; - TopExp::MapShapes(shape, TopAbs_FACE, faceMap); - for (int f = 1; f <= faceMap.Extent(); f++) { - TopoDS_Face const& face = TopoDS::Face(faceMap(f)); - - BRepExtrema_ExtPF proj(v, face); - for (auto i=1; i<=proj.NbExt(); ++i) { - if(proj.SquareDistance(i) < tol) { - UVResult current; - current.face = face; - proj.Parameter(i, current.u, current.v); - res = current; - return res; - } - } - } - - return res; -} - -TopoDS_Face TrimFace(TopoDS_Face const& face, - double umin, - double umax, - double vmin, - double vmax) -{ - Handle(Geom_Surface) surf = BRep_Tool::Surface(face); - Handle(Geom_BSplineSurface) trimmed_surf - = tigl::CTiglBSplineAlgorithms::trimSurface(surf, umin, umax, vmin, vmax); - return BRepBuilderAPI_MakeFace(trimmed_surf, Precision::Confusion()).Face(); -} - -TopoDS_Shape ReplaceFaceInShape(TopoDS_Shape const& shape, - TopoDS_Face const& new_face, - TopoDS_Face const& old_face) -{ - TopoDS_Builder builder; - TopoDS_Compound compound; - builder.MakeCompound(compound); - builder.Add(compound, new_face); - - TopTools_IndexedMapOfShape faceMap; - TopExp::MapShapes(shape, TopAbs_FACE, faceMap); - for (int f = 1; f <= faceMap.Extent(); f++) { - TopoDS_Face loftFace = TopoDS::Face(faceMap(f)); - if( loftFace.IsEqual(old_face) ) { - continue; - } - builder.Add(compound, loftFace); - } - return compound; -} - - -gp_Pnt GetCentralFacePoint(const TopoDS_Face& face) -{ - // compute point on face - Standard_Real umin, umax, vmin, vmax; - - gp_Pnt p; - - Handle(Geom_Surface) surface = BRep_Tool::Surface(face); - BRepTools::UVBounds(face, umin, umax, vmin, vmax); - Standard_Real umean = 0.5*(umin+umax); - Standard_Real vmean = 0.5*(vmin+vmax); - - - // compute intersection of u-iso line with face boundaries - Handle(Geom2d_Curve) uiso = new Geom2d_Line( - gp_Pnt2d(umean,0.), - gp_Dir2d(0., 1.) - ); - - TopExp_Explorer exp (face,TopAbs_EDGE); - std::list intersections; - for (; exp.More(); exp.Next()) { - TopoDS_Edge edge = TopoDS::Edge(exp.Current()); - Standard_Real first, last; - - // Get geomteric curve from edge - Handle(Geom2d_Curve) hcurve = BRep_Tool::CurveOnSurface(edge, face, first, last); - hcurve = new Geom2d_TrimmedCurve(hcurve, first, last); - - Geom2dAPI_InterCurveCurve intersector(uiso, hcurve); - for (int ipoint = 0; ipoint < intersector.NbPoints(); ++ipoint) { - gp_Pnt2d p = intersector.Point(ipoint+1); - intersections.push_back(p.Y()); - } - } - - // remove duplicate solutions defined by tolerance - double tolerance = 1e-5; - intersections.sort(); - intersections.unique(IsSame((vmax-vmin)*tolerance)); - - // normally we should have at least two intersections - // also the number of sections should be even - else something is really strange - //assert(intersections.size() % 2 == 0); - if (intersections.size() >= 2) { - std::list::iterator it = intersections.begin(); - double int1 = *it++; - double int2 = *it; - vmean = (int1 + int2)/2.; - } - - surface->D0(umean, vmean, p); - - return p; -} - -ListPNamedShape GroupFaces(const PNamedShape shape, tigl::ShapeGroupMode groupType) -{ - ListPNamedShape shapeList; - if (!shape) { - return shapeList; - } - - if (groupType == tigl::NAMED_COMPOUNDS) { - BRep_Builder b; - TopTools_IndexedMapOfShape faceMap; - std::map map; - TopExp::MapShapes(shape->Shape(), TopAbs_FACE, faceMap); - if (faceMap.Extent() == 0) { - // return the shape as is - shapeList.push_back(shape); - return shapeList; - } - - for (int iface = 1; iface <= faceMap.Extent(); ++iface) { - TopoDS_Face face = TopoDS::Face(faceMap(iface)); - PNamedShape origin = shape->GetFaceTraits(iface-1).Origin(); - - std::map::iterator it = map.find(origin); - if (it == map.end()) { - TopoDS_Compound c; - b.MakeCompound(c); - b.Add(c, face); - map[origin] = c; - } - else { - TopoDS_Shape& c = it->second; - b.Add(c, face); - } - } - - // create Named Shapes - std::map::iterator it; - for (it = map.begin(); it != map.end(); ++it) { - PNamedShape origin = it->first; - TopoDS_Shape toposhape = it->second; - PNamedShape curshape; - if (origin) { - curshape = PNamedShape(new CNamedShape(toposhape, origin->Name())); - curshape->SetShortName(origin->ShortName()); - } - else { - curshape = PNamedShape(new CNamedShape(toposhape, shape->Name())); - curshape->SetShortName(shape->ShortName()); - } - // set the original face traits - CBooleanOperTools::AppendNamesToShape(shape, curshape); - - // make shells - curshape = CBooleanOperTools::Shellify(curshape); - shapeList.push_back(curshape); - } - } - else if (groupType == tigl::WHOLE_SHAPE) { - shapeList.push_back(shape); - } - else if (groupType == tigl::FACES) { - // store each face as an own shape - TopTools_IndexedMapOfShape faceMap; - TopExp::MapShapes(shape->Shape(), TopAbs_FACE, faceMap); - if (faceMap.Extent() == 0) { - // return the shape as is - shapeList.push_back(shape); - return shapeList; - } - - for (int iface = 1; iface <= faceMap.Extent(); ++iface) { - TopoDS_Face face = TopoDS::Face(faceMap(iface)); - const CFaceTraits& traits = shape->GetFaceTraits(iface-1); - - PNamedShape faceShape; - if (traits.Origin()) { - faceShape = PNamedShape(new CNamedShape(face, traits.Origin()->Name())); - faceShape->SetShortName(traits.Origin()->ShortName()); - } - else { - faceShape = PNamedShape(new CNamedShape(face, shape->Name())); - faceShape->SetShortName(shape->ShortName()); - } - faceShape->SetFaceTraits(0, shape->GetFaceTraits(iface-1)); - shapeList.push_back(faceShape); - } - - } - return shapeList; -} - -// projects a point onto the line (lineStart<->lineStop) and returns the projection parameter -Standard_Real ProjectPointOnLine(gp_Pnt p, gp_Pnt lineStart, gp_Pnt lineStop) -{ - return gp_Vec(lineStart, p) * gp_Vec(lineStart, lineStop) / gp_Vec(lineStart, lineStop).SquareMagnitude(); -} - -IntStatus IntersectLinePlane(gp_Pnt p1, gp_Pnt p2, gp_Pln plane, gp_Pnt& result) -{ - gp_Vec normal = plane.Axis().Direction(); - gp_Pnt center = plane.Axis().Location(); - - double denominator = gp_Vec(p2.XYZ() - p1.XYZ())*normal; - if (fabs(denominator) < 1e-8) { - return NoIntersection; - } - - double alpha = gp_Vec(center.XYZ() - p1.XYZ())*normal / denominator ; - result = p1.XYZ() + alpha*(p2.XYZ()-p1.XYZ()); - - if (alpha >= 0. && alpha <= 1.) { - return BetweenPoints; - } - else if (alpha < 0.) { - return OutsideBefore; - } - else { - // alpha > 1. - return OutsideAfter; - } -} - -// Returns the coordinates of the bounding box of the shape -void GetShapeExtension(const TopoDS_Shape& shape, - double& minx, double& maxx, - double& miny, double& maxy, - double& minz, double& maxz) -{ - Bnd_Box boundingBox; - BRepBndLib::Add(shape, boundingBox); - boundingBox.Get(minx, miny, minz, maxx, maxy, maxz); -} - -// Returns a unique Hashcode for a specific geometric component -int GetComponentHashCode(tigl::ITiglGeometricComponent& component) -{ - const TopoDS_Shape& loft = (*component.GetLoft()).Shape(); - if (!loft.IsNull()) { - return loft.HashCode(2294967295); - } - else { - return 0; - } -} - -// Creates an Edge from the given Points by B-Spline interpolation -TopoDS_Edge EdgeSplineFromPoints(const std::vector& points) -{ - unsigned int pointCount = static_cast(points.size()); - - Handle(TColgp_HArray1OfPnt) hpoints = new TColgp_HArray1OfPnt(1, pointCount); - for (unsigned int j = 0; j < pointCount; j++) { - hpoints->SetValue(j + 1, points[j]); - } - - GeomAPI_Interpolate interPol(hpoints, Standard_False, Precision::Confusion()); - interPol.Perform(); - Handle(Geom_BSplineCurve) hcurve = interPol.Curve(); - - return BRepBuilderAPI_MakeEdge(hcurve); -} - -TopoDS_Edge GetEdge(const TopoDS_Shape &shape, int iEdge) -{ - TopTools_IndexedMapOfShape edgeMap; - TopExp::MapShapes(shape, TopAbs_EDGE, edgeMap); - - if (iEdge < 0 || iEdge >= edgeMap.Extent()) { - return TopoDS_Edge(); - } - else { - return TopoDS::Edge(edgeMap(iEdge+1)); - } -} - -TopoDS_Face GetFace(const TopoDS_Shape &shape, int iFace) -{ - TopTools_IndexedMapOfShape faceMap; - TopExp::MapShapes(shape, TopAbs_FACE, faceMap); - - if (iFace < 0 || iFace >= faceMap.Extent()) { - return TopoDS_Face(); - } - else { - return TopoDS::Face(faceMap(iFace + 1)); - } -} - -Handle(Geom_BSplineCurve) GetBSplineCurve(const TopoDS_Edge& e) -{ - double u1, u2; - Handle(Geom_Curve) curve = BRep_Tool::Curve(e, u1, u2); - curve = new Geom_TrimmedCurve(curve, u1, u2); - - // convert to bspline - Handle(Geom_BSplineCurve) bspl = GeomConvert::CurveToBSplineCurve(curve); - return bspl; -} - -namespace { - bool GetIntersectionPoint_impl(const TopoDS_Face& face, const TopoDS_Edge& edge, gp_Pnt& dst, double tolerance) - { - BRepIntCurveSurface_Inter faceCurveInter; - - double umin = 0., umax = 0.; - const Handle(Geom_Curve)& curve = BRep_Tool::Curve(edge, umin, umax); - - faceCurveInter.Init(face, GeomAdaptor_Curve(curve, umin, umax), tolerance); - - - if (faceCurveInter.More()) { - dst = faceCurveInter.Pnt(); - faceCurveInter.Next(); - while (faceCurveInter.More()) { - if (!dst.IsEqual(faceCurveInter.Pnt(), Precision::Confusion())) { - LOG(WARNING) << "Multiple Intersections found in GetIntersectionPoint"; - } - faceCurveInter.Next(); - } - return true; - } - - return false; - } -} - -bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Edge& edge, gp_Pnt& dst, double tolerance) -{ - const bool intersection = GetIntersectionPoint_impl(face, edge, dst, tolerance); - if (!intersection) { - LOG(WARNING) << "No Intersections found in GetIntersectionPoint"; - } - return intersection; -} - - -bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Wire& wire, gp_Pnt& dst, double tolerance) -{ - DEBUG_SCOPE(debug); - debug.addShape(face, "face"); - debug.addShape(wire, "wire"); - BRepTools_WireExplorer wireExp; - for (wireExp.Init(wire); wireExp.More(); wireExp.Next()) { - const TopoDS_Edge& edge = wireExp.Current(); - if (GetIntersectionPoint_impl(face, edge, dst, tolerance)) { - return true; - } - } - - LOG(WARNING) << "No Intersections found in GetIntersectionPoint(face, wire)"; - return false; -} - -TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, intersectionPointList& intersectionPoints, const double tolerance) -{ - BRepExtrema_ExtCC Intersector; - - // explore the edges of both wires - TopExp_Explorer EdgeExplorer1(wire1, TopAbs_EDGE); - TopExp_Explorer EdgeExplorer2(wire2, TopAbs_EDGE); - - while ( EdgeExplorer2.More() ) { - - TopoDS_Edge edge2 = TopoDS::Edge(EdgeExplorer2.Current()); - Intersector.Initialize(edge2); - - while ( EdgeExplorer1.More() ) { - - TopoDS_Edge edge1 = TopoDS::Edge(EdgeExplorer1.Current()); - - //calculate intersection point - Intersector.Perform(edge1); - - if (!Intersector.IsDone()) { - LOG(ERROR) << "Error intersecting two wires in GetIntersectionPoint!"; - throw tigl::CTiglError("Error intersecting two wires in GetIntersectionPoint!"); - } - - // now go through all extremal distances of the current edge pair - for( int i=1; i<=Intersector.NbExt(); i++ ) { - if( Intersector.SquareDistance(i) < tolerance ) { - - IntersectionPoint intersectionPoint; - - intersectionPoint.SquareDistance=Intersector.SquareDistance(i); - intersectionPoint.Center = Intersector.PointOnE1(i); - intersectionPoint.Center.BaryCenter(0.5,Intersector.PointOnE2(i),0.5); - - //make sure the intersectionPoints are unique - bool foundIntersectionPoint = false; - for (unsigned int i=0;i 1) { - LOG(ERROR) << "unable to get single face from shape: shape contains more than one face"; - throw tigl::CTiglError("unable to get single face from shape: shape contains more than one face!"); - } - return GetFace(shape, 0); -} - -TopoDS_Face BuildFace(const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3, const gp_Pnt& p4) -{ - BRepBuilderAPI_MakeEdge me1(p1, p2); - TopoDS_Edge e1 = me1.Edge(); - BRepBuilderAPI_MakeEdge me2(p3, p4); - TopoDS_Edge e2 = me2.Edge(); - - TopoDS_Face face = BRepFill::Face(e1, e2); - return face; -} - -bool IsPathRelative(const std::string& path) -{ -#if defined _WIN32 || defined __WIN32__ - return PathIsRelativeA(path.c_str()) == 1; -#else - if (path.size() > 0 && path[0] == '/') { - return false; - } - else { - return true; - } -#endif -} - -bool IsFileReadable(const std::string& filename) -{ -#ifdef _MSC_VER - return _access(filename.c_str(), 4) == 0; -#else - return access(filename.c_str(), R_OK) == 0; -#endif -} - -std::string FileExtension(const std::string &filename) -{ - if(filename.find_last_of(".") != std::string::npos) { - return filename.substr(filename.find_last_of(".")+1); - } - else { - return ""; - } -} - -gp_Pnt GetFirstPoint(const TopoDS_Shape& wireOrEdge) -{ - if (wireOrEdge.ShapeType() == TopAbs_WIRE) - return GetFirstPoint(TopoDS::Wire(wireOrEdge)); - if (wireOrEdge.ShapeType() == TopAbs_EDGE) - return GetFirstPoint(TopoDS::Edge(wireOrEdge)); - throw tigl::CTiglError("Shape must be wire or edge"); -} - -gp_Pnt GetFirstPoint(const TopoDS_Wire& w) -{ - TopTools_IndexedMapOfShape wireMap; - TopExp::MapShapes(w, TopAbs_EDGE, wireMap); - TopoDS_Edge e = TopoDS::Edge(wireMap(1)); - return GetFirstPoint(e); -} - -gp_Pnt GetFirstPoint(const TopoDS_Edge& e) -{ - double u1, u2; - Handle_Geom_Curve c = BRep_Tool::Curve(e, u1, u2); - - if (e.Orientation() == TopAbs_REVERSED) { - return c->Value(u2); - } - else { - return c->Value(u1); - } -} - -gp_Pnt GetLastPoint(const TopoDS_Shape& wireOrEdge) -{ - if (wireOrEdge.ShapeType() == TopAbs_WIRE) - return GetLastPoint(TopoDS::Wire(wireOrEdge)); - if (wireOrEdge.ShapeType() == TopAbs_EDGE) - return GetLastPoint(TopoDS::Edge(wireOrEdge)); - throw tigl::CTiglError("Shape must be wire or edge"); -} - -gp_Pnt GetLastPoint(const TopoDS_Wire& w) -{ - TopTools_IndexedMapOfShape wireMap; - TopExp::MapShapes(w, TopAbs_EDGE, wireMap); - TopoDS_Edge e = TopoDS::Edge(wireMap(wireMap.Extent())); - return GetLastPoint(e); -} - -gp_Pnt GetLastPoint(const TopoDS_Edge& e) -{ - double u1, u2; - Handle_Geom_Curve c = BRep_Tool::Curve(e, u1, u2); - - if (e.Orientation() == TopAbs_REVERSED) { - return c->Value(u1); - } - else { - return c->Value(u2); - } -} - -TiglContinuity getEdgeContinuity(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2) -{ - // ********************************************************************************** - // Create a wire from both edges - // ********************************************************************************** - BRepBuilderAPI_MakeWire wireMaker; - wireMaker.Add(edge1); - if (!wireMaker.IsDone()) { - throw tigl::CTiglError("checkEdgeContinuity: Unable to create connected wire", TIGL_ERROR); - } - wireMaker.Add(edge2); - if (!wireMaker.IsDone()) { - throw tigl::CTiglError("checkEdgeContinuity: Unable to create connected wire", TIGL_ERROR); - } - TopoDS_Vertex commonVertex; - TopoDS_Wire wire = wireMaker.Wire(); - - // ********************************************************************************** - // Fix connectivity: Create common vertex - // ********************************************************************************** - ShapeFix_Wire wireFixer; - wireFixer.Load(wire); - wireFixer.FixConnected(); - wireFixer.Perform(); - wire = wireFixer.Wire(); - if (wire.IsNull()) { - throw tigl::CTiglError("checkEdgeContinuity: Unable to create common vertex in connected wire", TIGL_ERROR); - } - - // ********************************************************************************** - // Get new edges with common vertex - // ********************************************************************************** - TopTools_IndexedMapOfShape edges; - TopExp::MapShapes(wire, TopAbs_EDGE, edges); - if (edges.Extent() > 2) { - throw tigl::CTiglError("checkEdgeContinuity: Unexpected error in connected wire", TIGL_ERROR); - } - // There are either two edges that are touching, or one closed edge with touching endpoints. In the latter - // case, edge1 and edge2 are the same object - TopoDS_Edge newedge1 = TopoDS::Edge(edges(1)); - TopoDS_Edge newedge2; - if ( !edge1.IsEqual(edge2) ) { - newedge2 = TopoDS::Edge(edges(2)); - } - else { - newedge2 = newedge1; - } - - TopExp::CommonVertex(newedge1, newedge2, commonVertex); - if (commonVertex.IsNull()) { - throw tigl::CTiglError("checkEdgeContinuity: Unable to find common vertex", TIGL_ERROR); - } - - // ********************************************************************************** - // Get derivatives at common vertex - // ********************************************************************************** - BRepAdaptor_Curve firstCurve; - BRepAdaptor_Curve secondCurve; - if (TopExp::FirstVertex(newedge1).IsSame(commonVertex) && TopExp::LastVertex(newedge2).IsSame(commonVertex)) { - secondCurve.Initialize(newedge1); - firstCurve.Initialize(newedge2); - } - else if (TopExp::LastVertex(newedge1).IsSame(commonVertex) && TopExp::FirstVertex(newedge2).IsSame(commonVertex)) { - firstCurve.Initialize(newedge1); - secondCurve.Initialize(newedge2); - } - else { - throw tigl::CTiglError("checkEdgeContinuity: Unexpected error: Unable to find common vertex in connected wire", TIGL_ERROR); - } - - gp_Pnt point; - gp_Vec firstD1; - gp_Vec firstD2; - gp_Vec secondD1; - gp_Vec secondD2; - firstCurve.D2(firstCurve.LastParameter(), point, firstD1, firstD2); - secondCurve.D2(secondCurve.FirstParameter(), point, secondD1, secondD2); - - // ********************************************************************************** - // Get continuity depending on derivatives at the common vertex - // ********************************************************************************** - if ((firstD1.Magnitude() >= gp::Resolution() && secondD1.Magnitude() >= gp::Resolution()) - && gp_Dir(firstD1).IsEqual(gp_Dir(secondD1), Precision::Confusion())) { - if ((firstD2.Magnitude() >= gp::Resolution() && secondD2.Magnitude() >= gp::Resolution()) - && gp_Dir(firstD2).IsEqual(gp_Dir(secondD2), Precision::Confusion())) { - return C2; - } - else { - return C1; - } - } - else { - return C0; - } -} - -Standard_Boolean IsEqual(const TopoDS_Shape& s1, const TopoDS_Shape& s2) -{ - return s1.IsEqual(s2); -} - -TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) -{ - TopoDS_Wire closedWire = CloseWires(wire1, wire2); - BRepBuilderAPI_MakeFace mf(closedWire); - TopoDS_Face face; - if (mf.IsDone()) { - face = mf.Face(); - } - else { - face = BuildRuledFace(wire1, wire2); - } - return face; -} - -TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir) -{ - TopoDS_Wire closedWire = CloseWires(wire1, wire2, dir); - BRepBuilderAPI_MakeFace mf(closedWire); - TopoDS_Face face; - if (mf.IsDone()) { - face = mf.Face(); - } - else { - face = BuildRuledFace(wire1, wire2); - } - return face; -} - -TopoDS_Face BuildFace(const TopoDS_Wire& wire) -{ - BRepBuilderAPI_FindPlane Searcher( wire, Precision::Confusion() ); - if (Searcher.Found()) { - return BRepBuilderAPI_MakeFace(Searcher.Plane(), wire); - } - - // try to find another surface - BRepBuilderAPI_MakeFace MF( wire ); - if (MF.IsDone()) { - return MF.Face(); - } - - // Fallback solution - BRepFill_Filling filler; - TopExp_Explorer exp; - for (exp.Init(wire, TopAbs_EDGE); exp.More(); exp.Next()) { - TopoDS_Edge e = TopoDS::Edge(exp.Current()); - filler.Add(e, GeomAbs_C0); - } - filler.Build(); - if (filler.IsDone()) { - return filler.Face(); - } - - LOG(ERROR) << "Could not build face from wire."; - throw tigl::CTiglError("BuildFace: Unable to generate face from Wire!"); -} - -TopoDS_Face BuildRuledFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) -{ - // fix edge order in wires so that no self-intersecting faces are generated - TopTools_SequenceOfShape wireSequence; - wireSequence.Append(wire1); - wireSequence.Append(wire2); - - BRepFill_CompatibleWires orderWires(wireSequence); - orderWires.Perform(); - if (!orderWires.IsDone()) { - LOG(ERROR) << "unable to determine common wire order!"; - throw tigl::CTiglError("unable to determine common wire order!"); - } - TopTools_SequenceOfShape orderedWireSequence; - - orderedWireSequence = orderWires.Shape(); - if (orderedWireSequence.Length() != 2) { - LOG(ERROR) << "number of wires in sequence does not match. Expected: 2, Got: " << orderedWireSequence.Length(); - throw tigl::CTiglError("number of wires in sequence does not match. Expected: 2"); - } - TopoDS_Wire sortedWire1 = TopoDS::Wire(orderedWireSequence.First()); - TopoDS_Wire sortedWire2 = TopoDS::Wire(orderedWireSequence.Last()); - - // build curve adaptor, second parameter defines that the length of the single edges is used as u coordinate, - // instead normalization of the u coordinates of the single edges of the wire (each edge would have u-coords - // range from 0 to 1 independent of their length otherwise) - BRepAdaptor_CompCurve compCurve1(sortedWire1, Standard_True); - BRepAdaptor_CompCurve compCurve2(sortedWire2, Standard_True); - - // Wrap the adaptor in a class which manages curve access via handle (HCurve). According to doxygen - // this is required by the algorithms - Handle(Adaptor3d_HCurve) curve1 = new BRepAdaptor_HCompCurve(compCurve1); - Handle(Adaptor3d_HCurve) curve2 = new BRepAdaptor_HCompCurve(compCurve2); - - // We have to generate an approximated curve now from the wire using the adaptor - // NOTE: last parameter value unknown - Approx_Curve3d approx1(curve1, Precision::Confusion(), GeomAbs_C2, 2000, 12); - Approx_Curve3d approx2(curve2, Precision::Confusion(), GeomAbs_C2, 2000, 12); - - // Get approximated curve - if (!approx1.IsDone() || !approx1.HasResult() || - !approx2.IsDone() || !approx2.HasResult()) { - - LOG(ERROR) << "unable to approximate wires by curves for building face"; - throw tigl::CTiglError("unable to approximate wires by curves for building face!"); - } - Handle(Geom_Curve) approxCurve1 = approx1.Curve(); - Handle(Geom_Curve) approxCurve2 = approx2.Curve(); - - TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(approxCurve1); - TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(approxCurve2); - TopoDS_Face face = BRepFill::Face(e1, e2); - return face; -} - -TopoDS_Wire BuildWire(const gp_Pnt& p1, const gp_Pnt& p2) -{ - TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(p1, p2); - TopoDS_Wire w = BRepBuilderAPI_MakeWire(e1); - return w; -} - -TopoDS_Wire BuildWireFromEdges(const TopoDS_Shape& edges) -{ - TopTools_ListOfShape wireList; - BuildWiresFromConnectedEdges(edges, wireList); - if (wireList.Extent() != 1) { - LOG(ERROR) << "Error generating single wire!"; - throw tigl::CTiglError("Error generating single wire in MakeWireFromEdges!"); - } - TopoDS_Wire result = TopoDS::Wire(wireList.First()); - return result; -} - -void BuildWiresFromConnectedEdges(const TopoDS_Shape& shape, TopTools_ListOfShape& wireList) -{ - // get list of edges from passed shape - TopTools_ListOfShape edgeList; - GetListOfShape(shape, TopAbs_EDGE, edgeList); - - // iterate until all edges are converted into wires - while (edgeList.Extent() > 0) { - // pop first edge from edgeList - TopoDS_Edge e1 = TopoDS::Edge(edgeList.First()); - edgeList.RemoveFirst(); - // build a list of edges for a single wire - TopTools_ListOfShape wireEdges; - wireEdges.Append(e1); - FindAllConnectedEdges(e1, edgeList, wireEdges); - - // build wire from wireEdges - BRepBuilderAPI_MakeWire wireBuilder; - TopTools_ListIteratorOfListOfShape eIt; - for (eIt.Initialize(wireEdges); eIt.More(); eIt.Next()) { - wireBuilder.Add(TopoDS::Edge(eIt.Value())); - } - if (!wireBuilder.IsDone()) { - LOG(ERROR) << "Error creating wire!"; - throw tigl::CTiglError("Error creating wire in BuildWiresFromConnectedEdges!"); - } - TopoDS_Wire wire = SortWireEdges(wireBuilder.Wire()); - - wireList.Append(wire); - } -} - -TopoDS_Wire CloseWire(const TopoDS_Wire& wire) -{ - // get the list of end vertices - TopTools_ListOfShape endVertices; - GetEndVertices(wire, endVertices); - - // determine number of end vertices - int numEndVertices = endVertices.Extent(); - - // check if wire is already closed - if (numEndVertices == 0) { - return wire; - } - - // check if we have exatcly two end vertices - if (numEndVertices != 2) { - LOG(ERROR) << "invalid number of end vertices found!"; - throw tigl::CTiglError("invalid number of end vertices found in CloseWire!"); - } - - // next generate an edge between the end vertices - TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(TopoDS::Vertex(endVertices.First()), TopoDS::Vertex(endVertices.Last())); - - // build new wire - BRepBuilderAPI_MakeWire makeWire; - makeWire.Add(wire); - makeWire.Add(edge); - if (!makeWire.IsDone()) { - LOG(ERROR) << "unable to build closed wire!"; - throw tigl::CTiglError("unable to build closed wire in CloseWire!"); - } - TopoDS_Wire result = SortWireEdges(makeWire.Wire()); - return result; -} - -// determine direction from wire1 by using end vertices -TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) -{ - // get a map of vertices with connected edges - TopTools_IndexedDataMapOfShapeListOfShape vertexMap; - TopTools_ListOfShape endVertices1, endVertices2; - - TopExp::MapShapesAndAncestors(wire1, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); - // filter out all vertices which have only a single edge connected (end vertices) - for (int i = 1; i <= vertexMap.Extent(); i++) { - const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); - if (edgeList.Extent() == 1) { - endVertices1.Append(vertexMap.FindKey(i)); - } - } - - // check for correct number of end vertices - if (endVertices1.Extent() != 2) { - LOG(ERROR) << "Unable to close wires because invalid number of end-vertices found!"; - throw tigl::CTiglError("Unable to close wires because invalid number of end-vertices found!"); - } - - TopoDS_Vertex& v1 = TopoDS::Vertex(endVertices1.First()); - TopoDS_Vertex& v2 = TopoDS::Vertex(endVertices1.Last()); - gp_Pnt p1 = BRep_Tool::Pnt(v1); - gp_Pnt p2 = BRep_Tool::Pnt(v2); - gp_Vec dir(p1, p2); - - return CloseWires(wire1, wire2, dir); -} - -TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir) -{ - // get a map of vertices with connected edges - TopTools_IndexedDataMapOfShapeListOfShape vertexMap; - TopTools_ListOfShape endVertices1, endVertices2; - - TopExp::MapShapesAndAncestors(wire1, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); - // filter out all vertices which have only a single edge connected (end vertices) - for (int i = 1; i <= vertexMap.Extent(); i++) { - const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); - if (edgeList.Extent() == 1) { - endVertices1.Append(vertexMap.FindKey(i)); - } - } - vertexMap.Clear(); - TopExp::MapShapesAndAncestors(wire2, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); - // filter out all vertices which have only a single edge connected (end vertices) - for (int i = 1; i <= vertexMap.Extent(); i++) { - const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); - if (edgeList.Extent() == 1) { - endVertices2.Append(vertexMap.FindKey(i)); - } - } - - // check if number of end vertices is correct - int numEndVertices1 = endVertices1.Extent(); - int numEndVertices2 = endVertices2.Extent(); - if (numEndVertices1 != 2 || numEndVertices2 != 2) { - LOG(ERROR) << "Unable to close wires because invalid number of end-vertices found!"; - throw tigl::CTiglError("Unable to close wires because invalid number of end-vertices found!"); - } - - // sort end vertices according to direction vector - TopoDS_Vertex vUpper1 = TopoDS::Vertex(endVertices1.First()); - TopoDS_Vertex vLower1 = TopoDS::Vertex(endVertices1.Last()); - gp_Pnt pUpper = BRep_Tool::Pnt(vUpper1); - gp_Pnt pLower = BRep_Tool::Pnt(vLower1); - gp_Vec vDiff(pLower, pUpper); - if (vDiff.Normalized().Dot(dir.Normalized()) < 0) { - vUpper1 = TopoDS::Vertex(endVertices1.Last()); - vLower1 = TopoDS::Vertex(endVertices1.First()); - } - TopoDS_Vertex vUpper2 = TopoDS::Vertex(endVertices2.First()); - TopoDS_Vertex vLower2 = TopoDS::Vertex(endVertices2.Last()); - pUpper = BRep_Tool::Pnt(vUpper2); - pLower = BRep_Tool::Pnt(vLower2); - vDiff = gp_Vec(pLower, pUpper); - if (vDiff.Normalized().Dot(dir.Normalized()) < 0) { - vUpper2 = TopoDS::Vertex(endVertices2.Last()); - vLower2 = TopoDS::Vertex(endVertices2.First()); - } - - // next build the edges and combine the wires to a single wire - TopoDS_Edge edge1 = BRepBuilderAPI_MakeEdge(vUpper1, vUpper2); - TopoDS_Edge edge2 = BRepBuilderAPI_MakeEdge(vLower1, vLower2); - - // put all edges into a large list - TopTools_ListOfShape edgeList; - edgeList.Append(edge1); - edgeList.Append(edge2); - TopoDS_Iterator edgeIt; - for (edgeIt.Initialize(wire1); edgeIt.More(); edgeIt.Next()) { - edgeList.Append(edgeIt.Value()); - } - for (edgeIt.Initialize(wire2); edgeIt.More(); edgeIt.Next()) { - edgeList.Append(edgeIt.Value()); - } - - BRepBuilderAPI_MakeWire makeWire; - makeWire.Add(edgeList); - if (!makeWire.IsDone()) { - LOG(ERROR) << "error during creation of closed wire!"; - throw tigl::CTiglError("error during creation of closed wire in CloseWires!"); - } - - TopoDS_Wire result = SortWireEdges(makeWire.Wire()); - - return result; -} - -TopoDS_Wire SortWireEdges(const TopoDS_Wire& wire) -{ - ShapeFix_Wire fixWire; - fixWire.Load(wire); - fixWire.FixReorder(); - TopoDS_Wire result = fixWire.Wire(); - return result; -} - -bool GetMinMaxPoint(const TopoDS_Shape& shape, const gp_Vec& dir, gp_Pnt& minPnt, gp_Pnt& maxPnt) -{ - TopExp_Explorer explorer(shape, TopAbs_VERTEX); - - // return false in case shape has no vertices - if (!explorer.More()) { - return false; - } - - // initialize values - const TopoDS_Vertex& v = TopoDS::Vertex(explorer.Current()); - gp_Pnt p = BRep_Tool::Pnt(v); - minPnt = p; - maxPnt = p; - explorer.Next(); - - for (; explorer.More(); explorer.Next()) { - const TopoDS_Vertex& v = TopoDS::Vertex(explorer.Current()); - p = BRep_Tool::Pnt(v); - gp_Vec offset(minPnt, p); - if (offset.Dot(dir) < 0) { - minPnt = p; - } - offset = gp_Vec(p, maxPnt); - if (offset.Dot(dir) < 0) { - maxPnt = p; - } - } - - return true; -} - -void GetListOfShape(const TopoDS_Shape& shape, TopAbs_ShapeEnum type, TopTools_ListOfShape& result) -{ - TopTools_IndexedMapOfShape typeMap; - TopExp::MapShapes(shape, type, typeMap); - for (int i = 1; i <= typeMap.Extent(); i++) { - result.Append(typeMap.FindKey(i)); - } -} - -std::vector GetSubShapes(const TopoDS_Shape& shape, TopAbs_ShapeEnum type) { - std::vector result; - - TopTools_IndexedMapOfShape typeMap; - TopExp::MapShapes(shape, type, typeMap); - for (int i = 1; i <= typeMap.Extent(); i++) { - result.push_back(typeMap.FindKey(i)); - } - - return result; -} - -TopoDS_Shape CutShapes(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2) -{ - BRepAlgoAPI_Section cutter(shape1, shape2, Standard_False); - cutter.ComputePCurveOn1(Standard_True); - cutter.Approximation(Standard_True); - cutter.Build(); - if (!cutter.IsDone()) { - LOG(ERROR) << "Error cutting shapes in method CutShapes!"; - throw tigl::CTiglError("Error cutting shapes in method CutShapes!"); - } - return cutter.Shape(); -} - -TopoDS_Shape SplitShape(const TopoDS_Shape& src, const TopoDS_Shape& tool) -{ -#if OCC_VERSION_HEX >= VERSION_HEX_CODE(6,9,0) - double fuzzyValue = Precision::Confusion(); - const int c_tries = 3; -#endif - - for (int i = 0;; i++) { - GEOMAlgo_Splitter splitter; - splitter.AddArgument(src); - splitter.AddTool(tool); -#if OCC_VERSION_HEX >= VERSION_HEX_CODE(6,9,0) - splitter.SetFuzzyValue(fuzzyValue); -#endif - try { - splitter.Perform(); - } - catch (const Standard_Failure& f) { - std::stringstream ss; - ss << "ERROR: splitting of shapes failed: " << f.GetMessageString(); - LOG(ERROR) << ss.str(); - throw tigl::CTiglError(ss.str()); - } - -#if OCC_VERSION_HEX >= VERSION_HEX_CODE(7,2,0) - if (splitter.HasErrors()) { - if (i < c_tries - 1) { - fuzzyValue *= 10; - LOG(WARNING) << "SplitShape failed, retrying with fuzzyValue: " << fuzzyValue; - continue; - } - - std::ostringstream oss; - splitter.GetReport()->Dump(oss); - LOG(ERROR) << "unable to split passed shapes: " << oss.str(); - throw tigl::CTiglError("unable to split passed shapes: " + oss.str()); - } -#elif OCC_VERSION_HEX >= VERSION_HEX_CODE(6,9,0) - if (splitter.ErrorStatus() != 0) { - if (i < c_tries - 1) { - fuzzyValue *= 10; - LOG(WARNING) << "SplitShape failed, retrying with fuzzyValue: " << fuzzyValue; - continue; - } - - LOG(ERROR) << "unable to split passed shapes!"; - throw tigl::CTiglError("unable to split passed shapes!"); - } -#else - if (splitter.ErrorStatus() != 0) { - LOG(ERROR) << "unable to split passed shapes!"; - throw tigl::CTiglError("unable to split passed shapes!"); - } -#endif - return splitter.Shape(); - } -} - -void FindAllConnectedEdges(const TopoDS_Edge& edge, TopTools_ListOfShape& edgeList, TopTools_ListOfShape& targetList) -{ - TopTools_ListIteratorOfListOfShape edgeIt; - TopoDS_Vertex tempVertex; - TopoDS_Edge connectedEdge; - - // finished gets true as soon as no more connected edge is found in the edgeList - bool finished = false; - // loop until all connected e - while (!finished) { - connectedEdge.Nullify(); - // iterate over all edges in edgeList, and break when a connected edge was found - for (edgeIt.Initialize(edgeList); edgeIt.More(); edgeIt.Next()) { - TopoDS_Edge testEdge = TopoDS::Edge(edgeIt.Value()); - - // check if edges are connected - if (CheckCommonVertex(edge, testEdge)) { - connectedEdge = testEdge; - break; - } - } - // check if a connected edge was found - if (!connectedEdge.IsNull()) { - // remove connected edge from edgeList - edgeList.Remove(edgeIt); - // append connected edge to connectedEdge list - targetList.Append(connectedEdge); - // append all edges which are connected to the new edge to the list - FindAllConnectedEdges(connectedEdge, edgeList, targetList); - } - else { - finished = true; - } - } -} - -bool CheckCommonVertex(const TopoDS_Edge& e1, const TopoDS_Edge& e2) -{ - TopoDS_Vertex v1First, v1Last, v2First, v2Last; - TopExp::Vertices(e1, v1First, v1Last); - TopExp::Vertices(e2, v2First, v2Last); - - gp_Pnt p1First = BRep_Tool::Pnt(v1First); - gp_Pnt p1Last = BRep_Tool::Pnt(v1Last); - gp_Pnt p2First = BRep_Tool::Pnt(v2First); - gp_Pnt p2Last = BRep_Tool::Pnt(v2Last); - - return (p1First.Distance(p2First) < Precision::Confusion() || - p1First.Distance(p2Last) < Precision::Confusion() || - p1Last.Distance(p2First) < Precision::Confusion() || - p1Last.Distance(p2Last) < Precision::Confusion()); -} - -void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices) -{ - // get a map of vertices with connected edges - TopTools_IndexedDataMapOfShapeListOfShape vertexMap; - TopExp::MapShapesAndAncestors(shape, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); - - // filter out all vertices which have only a single edge connected (end vertices) - for (int i = 1; i <= vertexMap.Extent(); i++) { - const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); - if (edgeList.Extent() == 1) { - endVertices.Append(vertexMap.FindKey(i)); - } - } -} - -TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& edge) -{ - TopTools_ListOfShape edgeList; - GetEndVertices(edge, edgeList); - return TopoDS::Vertex(edgeList.First()); -} - -TopoDS_Vertex GetLastVertex(const TopoDS_Edge& edge) -{ - TopTools_ListOfShape edgeList; - GetEndVertices(edge, edgeList); - return TopoDS::Vertex(edgeList.Last()); -} - -TopoDS_Face GetNearestFace(const TopoDS_Shape& shape, const gp_Pnt& pnt) -{ - TopExp_Explorer explorer; - TopoDS_Vertex v = BRepBuilderAPI_MakeVertex(pnt); - TopoDS_Face resultFace; - float resultDistance = std::numeric_limits::max(); - for (explorer.Init(shape, TopAbs_FACE); explorer.More(); explorer.Next()) { - TopoDS_Face checkFace = TopoDS::Face(explorer.Current()); - BRepExtrema_DistShapeShape extrema(checkFace, v); - if (!extrema.IsDone() || extrema.NbSolution() < 1) { - LOG(ERROR) << "unable to determine nearest point between face and vertex!"; - throw tigl::CTiglError("unable to determine nearest point between face and vertex!"); - } - if (extrema.Value() < resultDistance) { - resultFace = checkFace; - resultDistance = static_cast(extrema.Value()); - } - } - return resultFace; -} - -gp_Pnt GetCenterOfMass(const TopoDS_Shape &shape) -{ - // get linear properties of the shape - GProp_GProps LProps; - BRepGProp::LinearProperties(shape, LProps); - - // compute center of the shape - gp_Pnt centerPoint = LProps.CentreOfMass(); - - if (LProps.Mass() < 1e-13) { - // Fallback using center of boundary box, fixes #551 - double minx, maxx, miny, maxy, minz, maxz; - GetShapeExtension(shape, minx, maxx, - miny, maxy, - minz, maxz); - - return gp_Pnt((maxx+minx)*0.5, - (maxy+miny)*0.5, - (maxz+minz)*0.5); - } - - return centerPoint; -} - -double GetArea(const TopoDS_Shape &shape) -{ - // get surface properties of the shape - GProp_GProps SProps; - BRepGProp::SurfaceProperties(shape, SProps); - - // compute the area of the shape or the area that is framed by the shape - double area = SProps.Mass(); - - return area; -} - -TopoDS_Shape RemoveDuplicateEdges(const TopoDS_Shape& shape) -{ - TopTools_ListOfShape initialEdgeList, newEdgeList; - TopTools_ListIteratorOfListOfShape initialEdgeIt, newEdgeIt; - - TopoDS_Vertex v1First, v1Last, v2First, v2Last; - gp_Pnt p1First, p1Mid, p1Last, p2First, p2Mid, p2Last; - - // get list of all edges of passed shape - GetListOfShape(shape, TopAbs_EDGE, initialEdgeList); - - // iterate over all edges - for (initialEdgeIt.Initialize(initialEdgeList); initialEdgeIt.More(); initialEdgeIt.Next()) { - TopoDS_Edge& edge = TopoDS::Edge(initialEdgeIt.Value()); - TopExp::Vertices(edge, v1First, v1Last); - p1First = BRep_Tool::Pnt(v1First); - p1Last = BRep_Tool::Pnt(v1Last); - - // if identical edge is not found already in newEdgeList then add it to this list - bool duplicate = false; - for (newEdgeIt.Initialize(newEdgeList); newEdgeIt.More(); newEdgeIt.Next()) { - TopoDS_Edge& checkEdge = TopoDS::Edge(newEdgeIt.Value()); - TopExp::Vertices(checkEdge, v2First, v2Last); - p2First = BRep_Tool::Pnt(v2First); - p2Last = BRep_Tool::Pnt(v2Last); - - if ((p1First.Distance(p2First) < Precision::Confusion() && - p1Last.Distance(p2Last) < Precision::Confusion()) || - (p1First.Distance(p2Last) < Precision::Confusion() && - p1Last.Distance(p2First) < Precision::Confusion())) { - - // now check for identical mid point - Handle(Geom_Curve) curve; - Standard_Real uStart, uEnd; - // get midpoint of edge - curve = BRep_Tool::Curve(edge, uStart, uEnd); - curve->D0((uStart + uEnd) / 2.0, p1Mid); - // get midpoint of checkEdge - curve = BRep_Tool::Curve(checkEdge, uStart, uEnd); - curve->D0((uStart + uEnd) / 2.0, p2Mid); - - if (p1Mid.Distance(p2Mid) < 1E-5) { - duplicate = true; - break; - } - } - } - // only add edge to newEdgeList if no identical edge already exists in there - if (!duplicate) { - newEdgeList.Append(edge); - } - } - - // finally rebuild a compound of all edges from the newEdgeList - TopoDS_Compound result; - BRep_Builder builder; - builder.MakeCompound(result); - - for (newEdgeIt.Initialize(newEdgeList); newEdgeIt.More(); newEdgeIt.Next()) { - builder.Add(result, TopoDS::Edge(newEdgeIt.Value())); - } - - return result; -} - - -bool IsPointInsideShape(const TopoDS_Shape &solid, gp_Pnt point, Bnd_Box const* bounding_box) -{ - double tol = 1e-3; - // check if solid - if (solid.ShapeType() != TopAbs_SOLID) { - throw tigl::CTiglError("The shape is not a solid"); - } - - TopoDS_Solid s = TopoDS::Solid(solid); - - // first, check if the point is in the bounding box - if (bounding_box) { - // create a copy of the const bounding box to be able to enlarge by tolerance - Bnd_Box bb; - bb.Add(*bounding_box); - bb.Enlarge(tol); - if ( bb.IsOut(point) ) { - return false; - } - } - - // if the point is inside the bounding box, classify the point using BRepClass3d_SolidClassifier - BRepClass3d_SolidClassifier algo(s); - - // test whether a point at infinity lies inside. If yes, then the shape is reversed - algo.PerformInfinitePoint(tol); - - bool shapeIsReversed = (algo.State() == TopAbs_IN); - - algo.Perform(point, tol); - - return ((algo.State() == TopAbs_IN) != shapeIsReversed ) || (algo.State() == TopAbs_ON); -} - -// Checks, whether a point lies inside a given face -bool IsPointInsideFace(const TopoDS_Face& face, gp_Pnt point) -{ - //project point onto surface of face - TopoDS_Vertex v = BRepBuilderAPI_MakeVertex(point); - BRepExtrema_ExtPF proj(v, face); - if (proj.IsDone() && proj.NbExt() > 0 && proj.SquareDistance(1)> Precision::SquareConfusion()) { - return false; - } - - //point is in surface of face. Check if it is inside - BRepClass_FaceClassifier faceClassifier; - faceClassifier.Perform(face, point, Precision::Confusion()); - const TopAbs_State state = faceClassifier.State(); - - if (state == TopAbs_ON || state == TopAbs_IN) { - return true; - } - return false; -} - -// Checks whether a point lies above or below a plane (determined by direction of normal) -bool IsPointAbovePlane(const gp_Pln& pln, gp_Pnt point) -{ - return gp_Vec(pln.Location(), point).Dot(gp_Vec(pln.Axis().Direction())) > 0; -} - -std::vector LinspaceWithBreaks(double umin, double umax, size_t n_values, const std::vector& breaks) -{ - double du = (umax - umin) / static_cast(n_values - 1); - - std::vector result(n_values); - for (int i = 0; i < n_values; ++i) { - result[i] = i * du + umin; - } - - // now insert the break - - double eps = 0.3; - // remove points, that are closer to each break point than du*eps - for (std::vector::const_iterator it = breaks.begin(); it != breaks.end(); ++it) { - double breakpoint = *it; - std::vector::iterator pos = std::find_if(result.begin(), result.end(), IsInsideTolerance(breakpoint, du*eps)); - if (pos != result.end()) { - // point found, replace it - *pos = breakpoint; - } - else { - // find closest element - pos = std::find_if(result.begin(), result.end(), IsInsideTolerance(breakpoint, (0.5 + 1e-8)*du)); - - if (*pos > breakpoint) { - result.insert(pos, breakpoint); - } - else { - result.insert(pos+1, breakpoint); - } - } - } - - return result; -} - -template -T Clamp(T val, T min, T max) -{ - if (min > max) { - throw tigl::CTiglError("Minimum may not be larger than maximum in clamp!"); - } - - return std::max(min, std::min(val, max)); -} - -double Clamp(double val, double min, double max) -{ - return Clamp<>(val, min, max); -} - -int Clamp(int val, int min, int max) -{ - return Clamp<>(val, min, max); -} - -size_t Clamp(size_t val, size_t min, size_t max) -{ - return Clamp<>(val, min, max); -} - -TopoDS_Shape TransformedShape(const tigl::CTiglTransformation& transformationToGlobal, TiglCoordinateSystem cs, const TopoDS_Shape& shape) -{ - switch (cs) { - case WING_COORDINATE_SYSTEM: - case FUSELAGE_COORDINATE_SYSTEM: - return shape; - case GLOBAL_COORDINATE_SYSTEM: - return transformationToGlobal.Transform(shape); - default: - throw tigl::CTiglError("Invalid coordinate system"); - } -} - -TopoDS_Shape TransformedShape(const tigl::CTiglRelativelyPositionedComponent& component, TiglCoordinateSystem cs, const TopoDS_Shape& shape) -{ - return TransformedShape(component.GetTransformationMatrix(), cs, shape); -} - -TopoDS_Shape GetFacesByName(const PNamedShape shape, const std::string &name) -{ - std::vector faces; - for (int i = 0; i < static_cast(shape->GetFaceCount()); i++) { - if (shape->GetFaceTraits(i).Name() == name) { - faces.push_back(GetFace(shape->Shape(), i)); - } - } - - if (faces.empty()) - throw tigl::CTiglError("Could not find faces named " + name); - if (faces.size() == 1) - return faces[0]; - - TopoDS_Compound c; - TopoDS_Builder b; - b.MakeCompound(c); - for (std::size_t i = 0; i < faces.size(); i++) - b.Add(c, faces[i]); - return c; -} - -/// Converters between std::vectors and opencascade vectors -Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts) -{ - Handle(TColgp_HArray1OfPnt) result = new TColgp_HArray1OfPnt(1, static_cast(pnts.size())); - int idx = 1; - for (std::vector::const_iterator it = pnts.begin(); it != pnts.end(); ++it, ++idx) { - result->SetValue(idx, *it); - } - return result; -} - -Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts) -{ - Handle(TColgp_HArray1OfPnt) result = new TColgp_HArray1OfPnt(1, static_cast(pnts.size())); - int idx = 1; - for (std::vector::const_iterator it = pnts.begin(); it != pnts.end(); ++it, ++idx) { - result->SetValue(idx, it->Get_gp_Pnt()); - } - return result; -} - -Handle(TColStd_HArray1OfReal) OccFArray(const std::vector& vector) -{ - Handle(TColStd_HArray1OfReal) array = new TColStd_HArray1OfReal(1, static_cast(vector.size())); - int ipos = 1; - for (const auto& value : vector) { - array->SetValue(ipos, value); - ipos++; - } - - return array; -} - -Handle(TColStd_HArray1OfInteger) OccIArray(const std::vector& vector) -{ - Handle(TColStd_HArray1OfInteger) array = new TColStd_HArray1OfInteger(1, static_cast(vector.size())); - int ipos = 1; - for (const auto& value : vector) { - array->SetValue(ipos++, value); - } - - return array; -} - -bool IsFaceBetweenPoints(const TopoDS_Face& face, gp_Pnt p1, gp_Pnt p2) -{ - BRepExtrema_ExtPF projector1(BRepBuilderAPI_MakeVertex(p1).Vertex(), - face, - Extrema_ExtFlag_MIN); - - gp_Pnt p1Proj; - if (projector1.IsDone() && projector1.NbExt() > 0) { - p1Proj = projector1.Point(1); - } - - // compute the projection of p1 - BRepExtrema_ExtPF projector2(BRepBuilderAPI_MakeVertex(p2).Vertex(), - face, - Extrema_ExtFlag_MIN); - - gp_Pnt p2Proj; - if (projector2.IsDone() && projector2.NbExt() > 0) { - p2Proj = projector2.Point(1); - } - - return gp_Vec(p1Proj, p1).Dot(gp_Vec(p2Proj, p2)) < 0.; -} - -double Mix(double x, double y, double a) -{ - return x*(1.-a) + y*a; -} - -double NormalizeAngleDeg(double angleDeg) -{ - angleDeg = fmod(angleDeg, 360.); - if (angleDeg < 0.) - angleDeg += 360.; - - return angleDeg; -} +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2013-06-01 Martin Siggel +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/** + * @brief This file implements some commonly used functions/algorithms on opencascade + * data structures. + */ + +#define NOMINMAX + +#if defined _WIN32 || defined __WIN32__ +#include +#include +#else +#include +#endif + +#include "tiglcommonfunctions.h" + +#include "CTiglError.h" +#include "CNamedShape.h" +#include "boolean_operations/CBooleanOperTools.h" +#include "boolean_operations/BRepSewingToBRepBuilderShapeAdapter.h" +#include "ListPNamedShape.h" +#include "CNamedShape.h" +#include "PNamedShape.h" +#include "CTiglRelativelyPositionedComponent.h" +#include "CTiglProjectPointOnCurveAtAngle.h" +#include "CTiglBSplineAlgorithms.h" + +#include "Geom_Curve.hxx" +#include "Geom_Surface.hxx" +#include "GeomAdaptor_Curve.hxx" +#include "BRep_Tool.hxx" +#include "BRepTools_WireExplorer.hxx" +#include "TopExp_Explorer.hxx" +#include "TopExp.hxx" +#include "TopoDS.hxx" +#include "TopoDS_Shape.hxx" +#include "TopoDS_Edge.hxx" +#include "TopTools_IndexedMapOfShape.hxx" +#include "TopTools_HSequenceOfShape.hxx" +#include "GeomAdaptor_Curve.hxx" +#include "BRepAdaptor_CompCurve.hxx" +#include "BRepAdaptor_Curve.hxx" +#include "GCPnts_AbscissaPoint.hxx" +#include "BRep_Builder.hxx" +#include "BRepBuilderAPI_MakeWire.hxx" +#include "BRepBuilderAPI_MakeEdge.hxx" +#include "BRepBuilderAPI_MakeVertex.hxx" +#include "GeomAPI_ProjectPointOnCurve.hxx" +#include "BRepTools.hxx" +#include "BRepBuilderAPI_Sewing.hxx" +#include "Bnd_Box.hxx" +#include "BRepBndLib.hxx" +#include "BRepExtrema_ExtCF.hxx" +#include "BRepIntCurveSurface_Inter.hxx" +#include "BRepFill.hxx" +#include "GProp_GProps.hxx" +#include "BRepGProp.hxx" +#include "BRepClass3d_SolidClassifier.hxx" +#include "BRepExtrema_DistShapeShape.hxx" + +#include +#include +#include +#include +#include +#include +#include "BRepExtrema_ExtCC.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +#include +#include +#include +#include +#include + +#include "Debugging.h" + +namespace +{ + struct IsSame + { + IsSame(double tolerance) : _tol(tolerance) {} + bool operator() (double first, double second) + { + return (fabs(first-second)<_tol); + } + + double _tol; + }; + +} // anonymous namespace + +// calculates a wire's circumference +Standard_Real GetLength(const TopoDS_Wire& wire) +{ + BRepAdaptor_CompCurve aCompoundCurve(wire, Standard_True); + return GCPnts_AbscissaPoint::Length( aCompoundCurve ); +} + +Standard_Real GetLength(const TopoDS_Edge &edge) +{ + Standard_Real umin, umax; + Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, umin, umax); + GeomAdaptor_Curve adaptorCurve(curve, umin, umax); + Standard_Real length = GCPnts_AbscissaPoint::Length(adaptorCurve, umin, umax); + return length; +} + +unsigned int GetNumberOfEdges(const TopoDS_Shape& shape) +{ + TopExp_Explorer edgeExpl(shape, TopAbs_EDGE); + unsigned int iEdges = 0; + for (; edgeExpl.More(); edgeExpl.Next()) { + iEdges++; + } + + return iEdges; +} + +unsigned int GetNumberOfFaces(const TopoDS_Shape& shape) +{ + TopExp_Explorer faceExpl(shape, TopAbs_FACE); + unsigned int iFaces = 0; + for (; faceExpl.More(); faceExpl.Next()) { + iFaces++; + } + + return iFaces; +} + +unsigned int GetNumberOfSubshapes(const TopoDS_Shape &shape) +{ + if (shape.ShapeType() == TopAbs_COMPOUND) { + unsigned int n = 0; + for (TopoDS_Iterator anIter(shape); anIter.More(); anIter.Next()) { + n++; + } + return n; + } + else { + return 0; + } +} + +// Gets a point on the wire line in dependence of a parameter alpha with +// 0.0 <= alpha <= 1.0. For alpha = 0.0 this is the line starting point, +// for alpha = 1.0 the last point on the intersection line. +gp_Pnt WireGetPoint(const TopoDS_Wire& wire, double alpha) +{ + gp_Pnt point; + gp_Vec tangent; + WireGetPointTangent(wire, alpha, point, tangent); + return point; +} + +void WireGetPointTangent(const TopoDS_Wire& wire, double alpha, gp_Pnt& point, gp_Vec& tangent) +{ + if (alpha < 0.0 || alpha > 1.0) { + throw tigl::CTiglError("Parameter alpha not in the range 0.0 <= alpha <= 1.0 in WireGetPointTangent", TIGL_ERROR); + } + // ETA 3D point + BRepAdaptor_CompCurve aCompoundCurve(wire, Standard_True); + + Standard_Real len = GCPnts_AbscissaPoint::Length( aCompoundCurve ); + if (len < Precision::Confusion()) { + // wire length is zero, we can query at parameter 0 and accept zero length tangents + aCompoundCurve.D1(0., point, tangent); + } + else { + GCPnts_AbscissaPoint algo(aCompoundCurve, len*alpha, aCompoundCurve.FirstParameter()); + if (algo.IsDone()) { + double par = algo.Parameter(); + aCompoundCurve.D1( par, point, tangent ); + // normalize tangent to length of the curve + tangent = len*tangent/tangent.Magnitude(); + } + else { + throw tigl::CTiglError("WireGetPointTangent: Cannot compute point on curve.", TIGL_MATH_ERROR); + } + } + +} + +gp_Pnt EdgeGetPoint(const TopoDS_Edge& edge, double alpha) +{ + gp_Pnt point; + gp_Vec tangent; + EdgeGetPointTangent(edge, alpha, point, tangent); + return point; +} + +void EdgeGetPointTangent(const TopoDS_Edge& edge, double alpha, gp_Pnt& point, gp_Vec& tangent) +{ + if (alpha < 0.0 || alpha > 1.0) { + throw tigl::CTiglError("Parameter alpha not in the range 0.0 <= alpha <= 1.0 in EdgeGetPointTangent", TIGL_ERROR); + } + // ETA 3D point + Standard_Real umin, umax; + Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, umin, umax); + GeomAdaptor_Curve adaptorCurve(curve, umin, umax); + Standard_Real len = GCPnts_AbscissaPoint::Length( adaptorCurve, umin, umax ); + if (len < Precision::Confusion()) { + throw tigl::CTiglError("EdgeGetPointTangent: Unable to compute tangent on zero length edge", TIGL_MATH_ERROR); + } + GCPnts_AbscissaPoint algo(adaptorCurve, len*alpha, umin); + if (algo.IsDone()) { + double par = algo.Parameter(); + adaptorCurve.D1( par, point, tangent ); + // normalize tangent to length of the curve + tangent = len*tangent/tangent.Magnitude(); + } + else { + throw tigl::CTiglError("EdgeGetPointTangent: Cannot compute point on curve.", TIGL_MATH_ERROR); + } +} + +Standard_Real ProjectPointOnWire(const TopoDS_Wire& wire, gp_Pnt p) +{ + return ProjectPointOnWireAtAngle(wire, p, gp_Dir(1,0,0), M_PI/2.); +} + +Standard_Real ProjectPointOnWireAtAngle(const TopoDS_Wire &wire, gp_Pnt p, gp_Dir rotationAxisAroundP, double angle) +{ + double smallestDist = DBL_MAX; + double alpha = 0.; + int edgeIndex = 0; + + // find edge with closest dist to point p + BRepTools_WireExplorer wireExplorer; + int iwire = 0; + for (wireExplorer.Init(wire); wireExplorer.More(); wireExplorer.Next(), iwire++) { + Standard_Real firstParam, lastParam; + TopoDS_Edge edge = wireExplorer.Current(); + Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, firstParam, lastParam); + + if (fabs(angle - M_PI / 2.) < 1e-6) { + GeomAPI_ProjectPointOnCurve proj(p, curve, firstParam, lastParam); + if (proj.NbPoints() > 0 && proj.LowerDistance() < smallestDist) { + smallestDist = proj.LowerDistance(); + edgeIndex = iwire; + alpha = proj.LowerDistanceParameter(); + } + } + else { + Handle(Geom_TrimmedCurve) trimmedCurve = new Geom_TrimmedCurve(curve, firstParam, lastParam); + tigl::CTiglProjectPointOnCurveAtAngle proj(p, trimmedCurve, angle, rotationAxisAroundP); + if (proj.IsDone() && proj.NbPoints() > 0 && proj.Point(1).Distance(p) < smallestDist) { + smallestDist = proj.Point(1).Distance(p); + edgeIndex = iwire; + alpha = proj.Parameter(1); + } + } + } + + // compute partial length of wire until projection point is reached + wireExplorer.Init(wire); + double partLength = 0.; + for (int iwire = 0; iwire <= edgeIndex; ++iwire) { + Standard_Real firstParam; + Standard_Real lastParam; + TopoDS_Edge edge = wireExplorer.Current(); + Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, firstParam, lastParam); + GeomAdaptor_Curve adaptorCurve(curve, firstParam, lastParam); + if (iwire == edgeIndex) { + lastParam = alpha; + } + + partLength += GCPnts_AbscissaPoint::Length(adaptorCurve, firstParam, lastParam); + wireExplorer.Next(); + } + + // return relative coordinate + double normalizedLength = partLength/GetLength(wire); + if (normalizedLength > 1.0) { + normalizedLength = 1.0; + } + else if (normalizedLength < 0.0) { + normalizedLength = 0.0; + } + return normalizedLength; +} + + +/// Projects the point onto the plane pln +gp_Pnt2d ProjectPointOnPlane(gp_Pln pln, gp_Pnt p) +{ + gp_Ax1 xAx = pln.XAxis(); + gp_Ax1 yAx = pln.YAxis(); + + double px = (p.XYZ() - xAx.Location().XYZ()) * xAx.Direction().XYZ(); + double py = (p.XYZ() - yAx.Location().XYZ()) * yAx.Direction().XYZ(); + + return gp_Pnt2d(px,py); +} + +gp_Pnt ProjectPointOnShape(const TopoDS_Shape &shape, const gp_Pnt &point, const gp_Vec &direction) +{ + // Construct line in direction of projection through given point + gp_Lin line(point, gp_Dir(direction)); + TopoDS_Edge dir = BRepBuilderAPI_MakeEdge(line).Edge(); + + // Construct Extrema class with line and surface and calculate closest points + // (should be one if line goes through surface) + BRepExtrema_DistShapeShape extrema_distShapeShape(dir, shape); + int nPoints = extrema_distShapeShape.NbSolution(); + + // Make sure only one point was found with a distance of "zero" + if (nPoints == 0) { + throw tigl::CTiglError("Projection of point to shape failed.", TIGL_MATH_ERROR); + } + else if (nPoints > 1) { + LOG(WARNING) << "Projection of point of shape has multiple results. Choosing first."; + } + + return extrema_distShapeShape.PointOnShape2(nPoints); +} + +boost::optional GetFaceAndUV(TopoDS_Shape const& shape, + gp_Pnt const& pnt, + double tol) +{ + boost::optional res; + //find a face that contains the point and query the uv coordinates + TopoDS_Vertex v = BRepBuilderAPI_MakeVertex(pnt); + TopTools_IndexedMapOfShape faceMap; + TopExp::MapShapes(shape, TopAbs_FACE, faceMap); + for (int f = 1; f <= faceMap.Extent(); f++) { + TopoDS_Face const& face = TopoDS::Face(faceMap(f)); + + BRepExtrema_ExtPF proj(v, face); + for (auto i=1; i<=proj.NbExt(); ++i) { + if(proj.SquareDistance(i) < tol) { + UVResult current; + current.face = face; + proj.Parameter(i, current.u, current.v); + res = current; + return res; + } + } + } + + return res; +} + +TopoDS_Face TrimFace(TopoDS_Face const& face, + double umin, + double umax, + double vmin, + double vmax) +{ + Handle(Geom_Surface) surf = BRep_Tool::Surface(face); + Handle(Geom_BSplineSurface) trimmed_surf + = tigl::CTiglBSplineAlgorithms::trimSurface(surf, umin, umax, vmin, vmax); + return BRepBuilderAPI_MakeFace(trimmed_surf, Precision::Confusion()).Face(); +} + +TopoDS_Shape ReplaceFaceInShape(TopoDS_Shape const& shape, + TopoDS_Face const& new_face, + TopoDS_Face const& old_face) +{ + TopoDS_Builder builder; + TopoDS_Compound compound; + builder.MakeCompound(compound); + builder.Add(compound, new_face); + + TopTools_IndexedMapOfShape faceMap; + TopExp::MapShapes(shape, TopAbs_FACE, faceMap); + for (int f = 1; f <= faceMap.Extent(); f++) { + TopoDS_Face loftFace = TopoDS::Face(faceMap(f)); + if( loftFace.IsEqual(old_face) ) { + continue; + } + builder.Add(compound, loftFace); + } + return compound; +} + + +gp_Pnt GetCentralFacePoint(const TopoDS_Face& face) +{ + // compute point on face + Standard_Real umin, umax, vmin, vmax; + + gp_Pnt p; + + Handle(Geom_Surface) surface = BRep_Tool::Surface(face); + BRepTools::UVBounds(face, umin, umax, vmin, vmax); + Standard_Real umean = 0.5*(umin+umax); + Standard_Real vmean = 0.5*(vmin+vmax); + + + // compute intersection of u-iso line with face boundaries + Handle(Geom2d_Curve) uiso = new Geom2d_Line( + gp_Pnt2d(umean,0.), + gp_Dir2d(0., 1.) + ); + + TopExp_Explorer exp (face,TopAbs_EDGE); + std::list intersections; + for (; exp.More(); exp.Next()) { + TopoDS_Edge edge = TopoDS::Edge(exp.Current()); + Standard_Real first, last; + + // Get geomteric curve from edge + Handle(Geom2d_Curve) hcurve = BRep_Tool::CurveOnSurface(edge, face, first, last); + hcurve = new Geom2d_TrimmedCurve(hcurve, first, last); + + Geom2dAPI_InterCurveCurve intersector(uiso, hcurve); + for (int ipoint = 0; ipoint < intersector.NbPoints(); ++ipoint) { + gp_Pnt2d p = intersector.Point(ipoint+1); + intersections.push_back(p.Y()); + } + } + + // remove duplicate solutions defined by tolerance + double tolerance = 1e-5; + intersections.sort(); + intersections.unique(IsSame((vmax-vmin)*tolerance)); + + // normally we should have at least two intersections + // also the number of sections should be even - else something is really strange + //assert(intersections.size() % 2 == 0); + if (intersections.size() >= 2) { + std::list::iterator it = intersections.begin(); + double int1 = *it++; + double int2 = *it; + vmean = (int1 + int2)/2.; + } + + surface->D0(umean, vmean, p); + + return p; +} + +ListPNamedShape GroupFaces(const PNamedShape shape, tigl::ShapeGroupMode groupType) +{ + ListPNamedShape shapeList; + if (!shape) { + return shapeList; + } + + if (groupType == tigl::NAMED_COMPOUNDS) { + BRep_Builder b; + TopTools_IndexedMapOfShape faceMap; + std::map map; + TopExp::MapShapes(shape->Shape(), TopAbs_FACE, faceMap); + if (faceMap.Extent() == 0) { + // return the shape as is + shapeList.push_back(shape); + return shapeList; + } + + for (int iface = 1; iface <= faceMap.Extent(); ++iface) { + TopoDS_Face face = TopoDS::Face(faceMap(iface)); + PNamedShape origin = shape->GetFaceTraits(iface-1).Origin(); + + std::map::iterator it = map.find(origin); + if (it == map.end()) { + TopoDS_Compound c; + b.MakeCompound(c); + b.Add(c, face); + map[origin] = c; + } + else { + TopoDS_Shape& c = it->second; + b.Add(c, face); + } + } + + // create Named Shapes + std::map::iterator it; + for (it = map.begin(); it != map.end(); ++it) { + PNamedShape origin = it->first; + TopoDS_Shape toposhape = it->second; + PNamedShape curshape; + if (origin) { + curshape = PNamedShape(new CNamedShape(toposhape, origin->Name())); + curshape->SetShortName(origin->ShortName()); + } + else { + curshape = PNamedShape(new CNamedShape(toposhape, shape->Name())); + curshape->SetShortName(shape->ShortName()); + } + // set the original face traits + CBooleanOperTools::AppendNamesToShape(shape, curshape); + + // make shells + curshape = CBooleanOperTools::Shellify(curshape); + shapeList.push_back(curshape); + } + } + else if (groupType == tigl::WHOLE_SHAPE) { + shapeList.push_back(shape); + } + else if (groupType == tigl::FACES) { + // store each face as an own shape + TopTools_IndexedMapOfShape faceMap; + TopExp::MapShapes(shape->Shape(), TopAbs_FACE, faceMap); + if (faceMap.Extent() == 0) { + // return the shape as is + shapeList.push_back(shape); + return shapeList; + } + + for (int iface = 1; iface <= faceMap.Extent(); ++iface) { + TopoDS_Face face = TopoDS::Face(faceMap(iface)); + const CFaceTraits& traits = shape->GetFaceTraits(iface-1); + + PNamedShape faceShape; + if (traits.Origin()) { + faceShape = PNamedShape(new CNamedShape(face, traits.Origin()->Name())); + faceShape->SetShortName(traits.Origin()->ShortName()); + } + else { + faceShape = PNamedShape(new CNamedShape(face, shape->Name())); + faceShape->SetShortName(shape->ShortName()); + } + faceShape->SetFaceTraits(0, shape->GetFaceTraits(iface-1)); + shapeList.push_back(faceShape); + } + + } + return shapeList; +} + +// projects a point onto the line (lineStart<->lineStop) and returns the projection parameter +Standard_Real ProjectPointOnLine(gp_Pnt p, gp_Pnt lineStart, gp_Pnt lineStop) +{ + return gp_Vec(lineStart, p) * gp_Vec(lineStart, lineStop) / gp_Vec(lineStart, lineStop).SquareMagnitude(); +} + +IntStatus IntersectLinePlane(gp_Pnt p1, gp_Pnt p2, gp_Pln plane, gp_Pnt& result) +{ + gp_Vec normal = plane.Axis().Direction(); + gp_Pnt center = plane.Axis().Location(); + + double denominator = gp_Vec(p2.XYZ() - p1.XYZ())*normal; + if (fabs(denominator) < 1e-8) { + return NoIntersection; + } + + double alpha = gp_Vec(center.XYZ() - p1.XYZ())*normal / denominator ; + result = p1.XYZ() + alpha*(p2.XYZ()-p1.XYZ()); + + if (alpha >= 0. && alpha <= 1.) { + return BetweenPoints; + } + else if (alpha < 0.) { + return OutsideBefore; + } + else { + // alpha > 1. + return OutsideAfter; + } +} + +// Returns the coordinates of the bounding box of the shape +void GetShapeExtension(const TopoDS_Shape& shape, + double& minx, double& maxx, + double& miny, double& maxy, + double& minz, double& maxz) +{ + Bnd_Box boundingBox; + BRepBndLib::Add(shape, boundingBox); + boundingBox.Get(minx, miny, minz, maxx, maxy, maxz); +} + +// Returns a unique Hashcode for a specific geometric component +int GetComponentHashCode(tigl::ITiglGeometricComponent& component) +{ + const TopoDS_Shape& loft = (*component.GetLoft()).Shape(); + if (!loft.IsNull()) { + return loft.HashCode(2294967295); + } + else { + return 0; + } +} + +// Creates an Edge from the given Points by B-Spline interpolation +TopoDS_Edge EdgeSplineFromPoints(const std::vector& points) +{ + unsigned int pointCount = static_cast(points.size()); + + Handle(TColgp_HArray1OfPnt) hpoints = new TColgp_HArray1OfPnt(1, pointCount); + for (unsigned int j = 0; j < pointCount; j++) { + hpoints->SetValue(j + 1, points[j]); + } + + GeomAPI_Interpolate interPol(hpoints, Standard_False, Precision::Confusion()); + interPol.Perform(); + Handle(Geom_BSplineCurve) hcurve = interPol.Curve(); + + return BRepBuilderAPI_MakeEdge(hcurve); +} + +TopoDS_Edge GetEdge(const TopoDS_Shape &shape, int iEdge) +{ + TopTools_IndexedMapOfShape edgeMap; + TopExp::MapShapes(shape, TopAbs_EDGE, edgeMap); + + if (iEdge < 0 || iEdge >= edgeMap.Extent()) { + return TopoDS_Edge(); + } + else { + return TopoDS::Edge(edgeMap(iEdge+1)); + } +} + +TopoDS_Face GetFace(const TopoDS_Shape &shape, int iFace) +{ + TopTools_IndexedMapOfShape faceMap; + TopExp::MapShapes(shape, TopAbs_FACE, faceMap); + + if (iFace < 0 || iFace >= faceMap.Extent()) { + return TopoDS_Face(); + } + else { + return TopoDS::Face(faceMap(iFace + 1)); + } +} + +Handle(Geom_BSplineCurve) GetBSplineCurve(const TopoDS_Edge& e) +{ + double u1, u2; + Handle(Geom_Curve) curve = BRep_Tool::Curve(e, u1, u2); + curve = new Geom_TrimmedCurve(curve, u1, u2); + + // convert to bspline + Handle(Geom_BSplineCurve) bspl = GeomConvert::CurveToBSplineCurve(curve); + return bspl; +} + +namespace { + bool GetIntersectionPoint_impl(const TopoDS_Face& face, const TopoDS_Edge& edge, gp_Pnt& dst, double tolerance) + { + BRepIntCurveSurface_Inter faceCurveInter; + + double umin = 0., umax = 0.; + const Handle(Geom_Curve)& curve = BRep_Tool::Curve(edge, umin, umax); + + faceCurveInter.Init(face, GeomAdaptor_Curve(curve, umin, umax), tolerance); + + + if (faceCurveInter.More()) { + dst = faceCurveInter.Pnt(); + faceCurveInter.Next(); + while (faceCurveInter.More()) { + if (!dst.IsEqual(faceCurveInter.Pnt(), Precision::Confusion())) { + LOG(WARNING) << "Multiple Intersections found in GetIntersectionPoint"; + } + faceCurveInter.Next(); + } + return true; + } + + return false; + } +} + +bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Edge& edge, gp_Pnt& dst, double tolerance) +{ + const bool intersection = GetIntersectionPoint_impl(face, edge, dst, tolerance); + if (!intersection) { + LOG(WARNING) << "No Intersections found in GetIntersectionPoint"; + } + return intersection; +} + + +bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Wire& wire, gp_Pnt& dst, double tolerance) +{ + DEBUG_SCOPE(debug); + debug.addShape(face, "face"); + debug.addShape(wire, "wire"); + BRepTools_WireExplorer wireExp; + for (wireExp.Init(wire); wireExp.More(); wireExp.Next()) { + const TopoDS_Edge& edge = wireExp.Current(); + if (GetIntersectionPoint_impl(face, edge, dst, tolerance)) { + return true; + } + } + + LOG(WARNING) << "No Intersections found in GetIntersectionPoint(face, wire)"; + return false; +} + +TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, intersectionPointList& intersectionPoints, const double tolerance) +{ + BRepExtrema_ExtCC Intersector; + + // explore the edges of both wires + TopExp_Explorer EdgeExplorer1(wire1, TopAbs_EDGE); + TopExp_Explorer EdgeExplorer2(wire2, TopAbs_EDGE); + + while ( EdgeExplorer2.More() ) { + + TopoDS_Edge edge2 = TopoDS::Edge(EdgeExplorer2.Current()); + Intersector.Initialize(edge2); + + while ( EdgeExplorer1.More() ) { + + TopoDS_Edge edge1 = TopoDS::Edge(EdgeExplorer1.Current()); + + //calculate intersection point + Intersector.Perform(edge1); + + if (!Intersector.IsDone()) { + LOG(ERROR) << "Error intersecting two wires in GetIntersectionPoint!"; + throw tigl::CTiglError("Error intersecting two wires in GetIntersectionPoint!"); + } + + // now go through all extremal distances of the current edge pair + for( int i=1; i<=Intersector.NbExt(); i++ ) { + if( Intersector.SquareDistance(i) < tolerance ) { + + IntersectionPoint intersectionPoint; + + intersectionPoint.SquareDistance=Intersector.SquareDistance(i); + intersectionPoint.Center = Intersector.PointOnE1(i); + intersectionPoint.Center.BaryCenter(0.5,Intersector.PointOnE2(i),0.5); + + //make sure the intersectionPoints are unique + bool foundIntersectionPoint = false; + for (unsigned int i=0;i 1) { + LOG(ERROR) << "unable to get single face from shape: shape contains more than one face"; + throw tigl::CTiglError("unable to get single face from shape: shape contains more than one face!"); + } + return GetFace(shape, 0); +} + +TopoDS_Face BuildFace(const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3, const gp_Pnt& p4) +{ + BRepBuilderAPI_MakeEdge me1(p1, p2); + TopoDS_Edge e1 = me1.Edge(); + BRepBuilderAPI_MakeEdge me2(p3, p4); + TopoDS_Edge e2 = me2.Edge(); + + TopoDS_Face face = BRepFill::Face(e1, e2); + return face; +} + +bool IsPathRelative(const std::string& path) +{ +#if defined _WIN32 || defined __WIN32__ + return PathIsRelativeA(path.c_str()) == 1; +#else + if (path.size() > 0 && path[0] == '/') { + return false; + } + else { + return true; + } +#endif +} + +bool IsFileReadable(const std::string& filename) +{ +#ifdef _MSC_VER + return _access(filename.c_str(), 4) == 0; +#else + return access(filename.c_str(), R_OK) == 0; +#endif +} + +std::string FileExtension(const std::string &filename) +{ + if(filename.find_last_of(".") != std::string::npos) { + return filename.substr(filename.find_last_of(".")+1); + } + else { + return ""; + } +} + +gp_Pnt GetFirstPoint(const TopoDS_Shape& wireOrEdge) +{ + if (wireOrEdge.ShapeType() == TopAbs_WIRE) + return GetFirstPoint(TopoDS::Wire(wireOrEdge)); + if (wireOrEdge.ShapeType() == TopAbs_EDGE) + return GetFirstPoint(TopoDS::Edge(wireOrEdge)); + throw tigl::CTiglError("Shape must be wire or edge"); +} + +gp_Pnt GetFirstPoint(const TopoDS_Wire& w) +{ + TopTools_IndexedMapOfShape wireMap; + TopExp::MapShapes(w, TopAbs_EDGE, wireMap); + TopoDS_Edge e = TopoDS::Edge(wireMap(1)); + return GetFirstPoint(e); +} + +gp_Pnt GetFirstPoint(const TopoDS_Edge& e) +{ + double u1, u2; + Handle_Geom_Curve c = BRep_Tool::Curve(e, u1, u2); + + if (e.Orientation() == TopAbs_REVERSED) { + return c->Value(u2); + } + else { + return c->Value(u1); + } +} + +gp_Pnt GetLastPoint(const TopoDS_Shape& wireOrEdge) +{ + if (wireOrEdge.ShapeType() == TopAbs_WIRE) + return GetLastPoint(TopoDS::Wire(wireOrEdge)); + if (wireOrEdge.ShapeType() == TopAbs_EDGE) + return GetLastPoint(TopoDS::Edge(wireOrEdge)); + throw tigl::CTiglError("Shape must be wire or edge"); +} + +gp_Pnt GetLastPoint(const TopoDS_Wire& w) +{ + TopTools_IndexedMapOfShape wireMap; + TopExp::MapShapes(w, TopAbs_EDGE, wireMap); + TopoDS_Edge e = TopoDS::Edge(wireMap(wireMap.Extent())); + return GetLastPoint(e); +} + +gp_Pnt GetLastPoint(const TopoDS_Edge& e) +{ + double u1, u2; + Handle_Geom_Curve c = BRep_Tool::Curve(e, u1, u2); + + if (e.Orientation() == TopAbs_REVERSED) { + return c->Value(u1); + } + else { + return c->Value(u2); + } +} + +TiglContinuity getEdgeContinuity(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2) +{ + // ********************************************************************************** + // Create a wire from both edges + // ********************************************************************************** + BRepBuilderAPI_MakeWire wireMaker; + wireMaker.Add(edge1); + if (!wireMaker.IsDone()) { + throw tigl::CTiglError("checkEdgeContinuity: Unable to create connected wire", TIGL_ERROR); + } + wireMaker.Add(edge2); + if (!wireMaker.IsDone()) { + throw tigl::CTiglError("checkEdgeContinuity: Unable to create connected wire", TIGL_ERROR); + } + TopoDS_Vertex commonVertex; + TopoDS_Wire wire = wireMaker.Wire(); + + // ********************************************************************************** + // Fix connectivity: Create common vertex + // ********************************************************************************** + ShapeFix_Wire wireFixer; + wireFixer.Load(wire); + wireFixer.FixConnected(); + wireFixer.Perform(); + wire = wireFixer.Wire(); + if (wire.IsNull()) { + throw tigl::CTiglError("checkEdgeContinuity: Unable to create common vertex in connected wire", TIGL_ERROR); + } + + // ********************************************************************************** + // Get new edges with common vertex + // ********************************************************************************** + TopTools_IndexedMapOfShape edges; + TopExp::MapShapes(wire, TopAbs_EDGE, edges); + if (edges.Extent() > 2) { + throw tigl::CTiglError("checkEdgeContinuity: Unexpected error in connected wire", TIGL_ERROR); + } + // There are either two edges that are touching, or one closed edge with touching endpoints. In the latter + // case, edge1 and edge2 are the same object + TopoDS_Edge newedge1 = TopoDS::Edge(edges(1)); + TopoDS_Edge newedge2; + if ( !edge1.IsEqual(edge2) ) { + newedge2 = TopoDS::Edge(edges(2)); + } + else { + newedge2 = newedge1; + } + + TopExp::CommonVertex(newedge1, newedge2, commonVertex); + if (commonVertex.IsNull()) { + throw tigl::CTiglError("checkEdgeContinuity: Unable to find common vertex", TIGL_ERROR); + } + + // ********************************************************************************** + // Get derivatives at common vertex + // ********************************************************************************** + BRepAdaptor_Curve firstCurve; + BRepAdaptor_Curve secondCurve; + if (TopExp::FirstVertex(newedge1).IsSame(commonVertex) && TopExp::LastVertex(newedge2).IsSame(commonVertex)) { + secondCurve.Initialize(newedge1); + firstCurve.Initialize(newedge2); + } + else if (TopExp::LastVertex(newedge1).IsSame(commonVertex) && TopExp::FirstVertex(newedge2).IsSame(commonVertex)) { + firstCurve.Initialize(newedge1); + secondCurve.Initialize(newedge2); + } + else { + throw tigl::CTiglError("checkEdgeContinuity: Unexpected error: Unable to find common vertex in connected wire", TIGL_ERROR); + } + + gp_Pnt point; + gp_Vec firstD1; + gp_Vec firstD2; + gp_Vec secondD1; + gp_Vec secondD2; + firstCurve.D2(firstCurve.LastParameter(), point, firstD1, firstD2); + secondCurve.D2(secondCurve.FirstParameter(), point, secondD1, secondD2); + + // ********************************************************************************** + // Get continuity depending on derivatives at the common vertex + // ********************************************************************************** + if ((firstD1.Magnitude() >= gp::Resolution() && secondD1.Magnitude() >= gp::Resolution()) + && gp_Dir(firstD1).IsEqual(gp_Dir(secondD1), Precision::Confusion())) { + if ((firstD2.Magnitude() >= gp::Resolution() && secondD2.Magnitude() >= gp::Resolution()) + && gp_Dir(firstD2).IsEqual(gp_Dir(secondD2), Precision::Confusion())) { + return C2; + } + else { + return C1; + } + } + else { + return C0; + } +} + +Standard_Boolean IsEqual(const TopoDS_Shape& s1, const TopoDS_Shape& s2) +{ + return s1.IsEqual(s2); +} + +TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) +{ + TopoDS_Wire closedWire = CloseWires(wire1, wire2); + BRepBuilderAPI_MakeFace mf(closedWire); + TopoDS_Face face; + if (mf.IsDone()) { + face = mf.Face(); + } + else { + face = BuildRuledFace(wire1, wire2); + } + return face; +} + +TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir) +{ + TopoDS_Wire closedWire = CloseWires(wire1, wire2, dir); + BRepBuilderAPI_MakeFace mf(closedWire); + TopoDS_Face face; + if (mf.IsDone()) { + face = mf.Face(); + } + else { + face = BuildRuledFace(wire1, wire2); + } + return face; +} + +TopoDS_Face BuildFace(const TopoDS_Wire& wire) +{ + BRepBuilderAPI_FindPlane Searcher( wire, Precision::Confusion() ); + if (Searcher.Found()) { + return BRepBuilderAPI_MakeFace(Searcher.Plane(), wire); + } + + // try to find another surface + BRepBuilderAPI_MakeFace MF( wire ); + if (MF.IsDone()) { + return MF.Face(); + } + + // Fallback solution + BRepFill_Filling filler; + TopExp_Explorer exp; + for (exp.Init(wire, TopAbs_EDGE); exp.More(); exp.Next()) { + TopoDS_Edge e = TopoDS::Edge(exp.Current()); + filler.Add(e, GeomAbs_C0); + } + filler.Build(); + if (filler.IsDone()) { + return filler.Face(); + } + + LOG(ERROR) << "Could not build face from wire."; + throw tigl::CTiglError("BuildFace: Unable to generate face from Wire!"); +} + +TopoDS_Face BuildRuledFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) +{ + // fix edge order in wires so that no self-intersecting faces are generated + TopTools_SequenceOfShape wireSequence; + wireSequence.Append(wire1); + wireSequence.Append(wire2); + + BRepFill_CompatibleWires orderWires(wireSequence); + orderWires.Perform(); + if (!orderWires.IsDone()) { + LOG(ERROR) << "unable to determine common wire order!"; + throw tigl::CTiglError("unable to determine common wire order!"); + } + TopTools_SequenceOfShape orderedWireSequence; + + orderedWireSequence = orderWires.Shape(); + if (orderedWireSequence.Length() != 2) { + LOG(ERROR) << "number of wires in sequence does not match. Expected: 2, Got: " << orderedWireSequence.Length(); + throw tigl::CTiglError("number of wires in sequence does not match. Expected: 2"); + } + TopoDS_Wire sortedWire1 = TopoDS::Wire(orderedWireSequence.First()); + TopoDS_Wire sortedWire2 = TopoDS::Wire(orderedWireSequence.Last()); + + // build curve adaptor, second parameter defines that the length of the single edges is used as u coordinate, + // instead normalization of the u coordinates of the single edges of the wire (each edge would have u-coords + // range from 0 to 1 independent of their length otherwise) + BRepAdaptor_CompCurve compCurve1(sortedWire1, Standard_True); + BRepAdaptor_CompCurve compCurve2(sortedWire2, Standard_True); + + // Wrap the adaptor in a class which manages curve access via handle (HCurve). According to doxygen + // this is required by the algorithms + Handle(Adaptor3d_HCurve) curve1 = new BRepAdaptor_HCompCurve(compCurve1); + Handle(Adaptor3d_HCurve) curve2 = new BRepAdaptor_HCompCurve(compCurve2); + + // We have to generate an approximated curve now from the wire using the adaptor + // NOTE: last parameter value unknown + Approx_Curve3d approx1(curve1, Precision::Confusion(), GeomAbs_C2, 2000, 12); + Approx_Curve3d approx2(curve2, Precision::Confusion(), GeomAbs_C2, 2000, 12); + + // Get approximated curve + if (!approx1.IsDone() || !approx1.HasResult() || + !approx2.IsDone() || !approx2.HasResult()) { + + LOG(ERROR) << "unable to approximate wires by curves for building face"; + throw tigl::CTiglError("unable to approximate wires by curves for building face!"); + } + Handle(Geom_Curve) approxCurve1 = approx1.Curve(); + Handle(Geom_Curve) approxCurve2 = approx2.Curve(); + + TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(approxCurve1); + TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(approxCurve2); + TopoDS_Face face = BRepFill::Face(e1, e2); + return face; +} + +TopoDS_Wire BuildWire(const gp_Pnt& p1, const gp_Pnt& p2) +{ + TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(p1, p2); + TopoDS_Wire w = BRepBuilderAPI_MakeWire(e1); + return w; +} + +TopoDS_Wire BuildWireFromEdges(const TopoDS_Shape& edges) +{ + TopTools_ListOfShape wireList; + BuildWiresFromConnectedEdges(edges, wireList); + if (wireList.Extent() != 1) { + LOG(ERROR) << "Error generating single wire!"; + throw tigl::CTiglError("Error generating single wire in MakeWireFromEdges!"); + } + TopoDS_Wire result = TopoDS::Wire(wireList.First()); + return result; +} + +void BuildWiresFromConnectedEdges(const TopoDS_Shape& shape, TopTools_ListOfShape& wireList) +{ + // get list of edges from passed shape + TopTools_ListOfShape edgeList; + GetListOfShape(shape, TopAbs_EDGE, edgeList); + + // iterate until all edges are converted into wires + while (edgeList.Extent() > 0) { + // pop first edge from edgeList + TopoDS_Edge e1 = TopoDS::Edge(edgeList.First()); + edgeList.RemoveFirst(); + // build a list of edges for a single wire + TopTools_ListOfShape wireEdges; + wireEdges.Append(e1); + FindAllConnectedEdges(e1, edgeList, wireEdges); + + // build wire from wireEdges + BRepBuilderAPI_MakeWire wireBuilder; + TopTools_ListIteratorOfListOfShape eIt; + for (eIt.Initialize(wireEdges); eIt.More(); eIt.Next()) { + wireBuilder.Add(TopoDS::Edge(eIt.Value())); + } + if (!wireBuilder.IsDone()) { + LOG(ERROR) << "Error creating wire!"; + throw tigl::CTiglError("Error creating wire in BuildWiresFromConnectedEdges!"); + } + TopoDS_Wire wire = SortWireEdges(wireBuilder.Wire()); + + wireList.Append(wire); + } +} + +TopoDS_Wire CloseWire(const TopoDS_Wire& wire) +{ + // get the list of end vertices + TopTools_ListOfShape endVertices; + GetEndVertices(wire, endVertices); + + // determine number of end vertices + int numEndVertices = endVertices.Extent(); + + // check if wire is already closed + if (numEndVertices == 0) { + return wire; + } + + // check if we have exatcly two end vertices + if (numEndVertices != 2) { + LOG(ERROR) << "invalid number of end vertices found!"; + throw tigl::CTiglError("invalid number of end vertices found in CloseWire!"); + } + + // next generate an edge between the end vertices + TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(TopoDS::Vertex(endVertices.First()), TopoDS::Vertex(endVertices.Last())); + + // build new wire + BRepBuilderAPI_MakeWire makeWire; + makeWire.Add(wire); + makeWire.Add(edge); + if (!makeWire.IsDone()) { + LOG(ERROR) << "unable to build closed wire!"; + throw tigl::CTiglError("unable to build closed wire in CloseWire!"); + } + TopoDS_Wire result = SortWireEdges(makeWire.Wire()); + return result; +} + +// determine direction from wire1 by using end vertices +TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) +{ + // get a map of vertices with connected edges + TopTools_IndexedDataMapOfShapeListOfShape vertexMap; + TopTools_ListOfShape endVertices1, endVertices2; + + TopExp::MapShapesAndAncestors(wire1, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); + // filter out all vertices which have only a single edge connected (end vertices) + for (int i = 1; i <= vertexMap.Extent(); i++) { + const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); + if (edgeList.Extent() == 1) { + endVertices1.Append(vertexMap.FindKey(i)); + } + } + + // check for correct number of end vertices + if (endVertices1.Extent() != 2) { + LOG(ERROR) << "Unable to close wires because invalid number of end-vertices found!"; + throw tigl::CTiglError("Unable to close wires because invalid number of end-vertices found!"); + } + + TopoDS_Vertex& v1 = TopoDS::Vertex(endVertices1.First()); + TopoDS_Vertex& v2 = TopoDS::Vertex(endVertices1.Last()); + gp_Pnt p1 = BRep_Tool::Pnt(v1); + gp_Pnt p2 = BRep_Tool::Pnt(v2); + gp_Vec dir(p1, p2); + + return CloseWires(wire1, wire2, dir); +} + +TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir) +{ + // get a map of vertices with connected edges + TopTools_IndexedDataMapOfShapeListOfShape vertexMap; + TopTools_ListOfShape endVertices1, endVertices2; + + TopExp::MapShapesAndAncestors(wire1, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); + // filter out all vertices which have only a single edge connected (end vertices) + for (int i = 1; i <= vertexMap.Extent(); i++) { + const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); + if (edgeList.Extent() == 1) { + endVertices1.Append(vertexMap.FindKey(i)); + } + } + vertexMap.Clear(); + TopExp::MapShapesAndAncestors(wire2, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); + // filter out all vertices which have only a single edge connected (end vertices) + for (int i = 1; i <= vertexMap.Extent(); i++) { + const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); + if (edgeList.Extent() == 1) { + endVertices2.Append(vertexMap.FindKey(i)); + } + } + + // check if number of end vertices is correct + int numEndVertices1 = endVertices1.Extent(); + int numEndVertices2 = endVertices2.Extent(); + if (numEndVertices1 != 2 || numEndVertices2 != 2) { + LOG(ERROR) << "Unable to close wires because invalid number of end-vertices found!"; + throw tigl::CTiglError("Unable to close wires because invalid number of end-vertices found!"); + } + + // sort end vertices according to direction vector + TopoDS_Vertex vUpper1 = TopoDS::Vertex(endVertices1.First()); + TopoDS_Vertex vLower1 = TopoDS::Vertex(endVertices1.Last()); + gp_Pnt pUpper = BRep_Tool::Pnt(vUpper1); + gp_Pnt pLower = BRep_Tool::Pnt(vLower1); + gp_Vec vDiff(pLower, pUpper); + if (vDiff.Normalized().Dot(dir.Normalized()) < 0) { + vUpper1 = TopoDS::Vertex(endVertices1.Last()); + vLower1 = TopoDS::Vertex(endVertices1.First()); + } + TopoDS_Vertex vUpper2 = TopoDS::Vertex(endVertices2.First()); + TopoDS_Vertex vLower2 = TopoDS::Vertex(endVertices2.Last()); + pUpper = BRep_Tool::Pnt(vUpper2); + pLower = BRep_Tool::Pnt(vLower2); + vDiff = gp_Vec(pLower, pUpper); + if (vDiff.Normalized().Dot(dir.Normalized()) < 0) { + vUpper2 = TopoDS::Vertex(endVertices2.Last()); + vLower2 = TopoDS::Vertex(endVertices2.First()); + } + + // next build the edges and combine the wires to a single wire + TopoDS_Edge edge1 = BRepBuilderAPI_MakeEdge(vUpper1, vUpper2); + TopoDS_Edge edge2 = BRepBuilderAPI_MakeEdge(vLower1, vLower2); + + // put all edges into a large list + TopTools_ListOfShape edgeList; + edgeList.Append(edge1); + edgeList.Append(edge2); + TopoDS_Iterator edgeIt; + for (edgeIt.Initialize(wire1); edgeIt.More(); edgeIt.Next()) { + edgeList.Append(edgeIt.Value()); + } + for (edgeIt.Initialize(wire2); edgeIt.More(); edgeIt.Next()) { + edgeList.Append(edgeIt.Value()); + } + + BRepBuilderAPI_MakeWire makeWire; + makeWire.Add(edgeList); + if (!makeWire.IsDone()) { + LOG(ERROR) << "error during creation of closed wire!"; + throw tigl::CTiglError("error during creation of closed wire in CloseWires!"); + } + + TopoDS_Wire result = SortWireEdges(makeWire.Wire()); + + return result; +} + +TopoDS_Wire SortWireEdges(const TopoDS_Wire& wire) +{ + ShapeFix_Wire fixWire; + fixWire.Load(wire); + fixWire.FixReorder(); + TopoDS_Wire result = fixWire.Wire(); + return result; +} + +bool GetMinMaxPoint(const TopoDS_Shape& shape, const gp_Vec& dir, gp_Pnt& minPnt, gp_Pnt& maxPnt) +{ + TopExp_Explorer explorer(shape, TopAbs_VERTEX); + + // return false in case shape has no vertices + if (!explorer.More()) { + return false; + } + + // initialize values + const TopoDS_Vertex& v = TopoDS::Vertex(explorer.Current()); + gp_Pnt p = BRep_Tool::Pnt(v); + minPnt = p; + maxPnt = p; + explorer.Next(); + + for (; explorer.More(); explorer.Next()) { + const TopoDS_Vertex& v = TopoDS::Vertex(explorer.Current()); + p = BRep_Tool::Pnt(v); + gp_Vec offset(minPnt, p); + if (offset.Dot(dir) < 0) { + minPnt = p; + } + offset = gp_Vec(p, maxPnt); + if (offset.Dot(dir) < 0) { + maxPnt = p; + } + } + + return true; +} + +void GetListOfShape(const TopoDS_Shape& shape, TopAbs_ShapeEnum type, TopTools_ListOfShape& result) +{ + TopTools_IndexedMapOfShape typeMap; + TopExp::MapShapes(shape, type, typeMap); + for (int i = 1; i <= typeMap.Extent(); i++) { + result.Append(typeMap.FindKey(i)); + } +} + +std::vector GetSubShapes(const TopoDS_Shape& shape, TopAbs_ShapeEnum type) { + std::vector result; + + TopTools_IndexedMapOfShape typeMap; + TopExp::MapShapes(shape, type, typeMap); + for (int i = 1; i <= typeMap.Extent(); i++) { + result.push_back(typeMap.FindKey(i)); + } + + return result; +} + +TopoDS_Shape CutShapes(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2) +{ + BRepAlgoAPI_Section cutter(shape1, shape2, Standard_False); + cutter.ComputePCurveOn1(Standard_True); + cutter.Approximation(Standard_True); + cutter.Build(); + if (!cutter.IsDone()) { + LOG(ERROR) << "Error cutting shapes in method CutShapes!"; + throw tigl::CTiglError("Error cutting shapes in method CutShapes!"); + } + return cutter.Shape(); +} + +TopoDS_Shape SplitShape(const TopoDS_Shape& src, const TopoDS_Shape& tool) +{ +#if OCC_VERSION_HEX >= VERSION_HEX_CODE(6,9,0) + double fuzzyValue = Precision::Confusion(); + const int c_tries = 3; +#endif + + for (int i = 0;; i++) { + GEOMAlgo_Splitter splitter; + splitter.AddArgument(src); + splitter.AddTool(tool); +#if OCC_VERSION_HEX >= VERSION_HEX_CODE(6,9,0) + splitter.SetFuzzyValue(fuzzyValue); +#endif + try { + splitter.Perform(); + } + catch (const Standard_Failure& f) { + std::stringstream ss; + ss << "ERROR: splitting of shapes failed: " << f.GetMessageString(); + LOG(ERROR) << ss.str(); + throw tigl::CTiglError(ss.str()); + } + +#if OCC_VERSION_HEX >= VERSION_HEX_CODE(7,2,0) + if (splitter.HasErrors()) { + if (i < c_tries - 1) { + fuzzyValue *= 10; + LOG(WARNING) << "SplitShape failed, retrying with fuzzyValue: " << fuzzyValue; + continue; + } + + std::ostringstream oss; + splitter.GetReport()->Dump(oss); + LOG(ERROR) << "unable to split passed shapes: " << oss.str(); + throw tigl::CTiglError("unable to split passed shapes: " + oss.str()); + } +#elif OCC_VERSION_HEX >= VERSION_HEX_CODE(6,9,0) + if (splitter.ErrorStatus() != 0) { + if (i < c_tries - 1) { + fuzzyValue *= 10; + LOG(WARNING) << "SplitShape failed, retrying with fuzzyValue: " << fuzzyValue; + continue; + } + + LOG(ERROR) << "unable to split passed shapes!"; + throw tigl::CTiglError("unable to split passed shapes!"); + } +#else + if (splitter.ErrorStatus() != 0) { + LOG(ERROR) << "unable to split passed shapes!"; + throw tigl::CTiglError("unable to split passed shapes!"); + } +#endif + return splitter.Shape(); + } +} + +void FindAllConnectedEdges(const TopoDS_Edge& edge, TopTools_ListOfShape& edgeList, TopTools_ListOfShape& targetList) +{ + TopTools_ListIteratorOfListOfShape edgeIt; + TopoDS_Vertex tempVertex; + TopoDS_Edge connectedEdge; + + // finished gets true as soon as no more connected edge is found in the edgeList + bool finished = false; + // loop until all connected e + while (!finished) { + connectedEdge.Nullify(); + // iterate over all edges in edgeList, and break when a connected edge was found + for (edgeIt.Initialize(edgeList); edgeIt.More(); edgeIt.Next()) { + TopoDS_Edge testEdge = TopoDS::Edge(edgeIt.Value()); + + // check if edges are connected + if (CheckCommonVertex(edge, testEdge)) { + connectedEdge = testEdge; + break; + } + } + // check if a connected edge was found + if (!connectedEdge.IsNull()) { + // remove connected edge from edgeList + edgeList.Remove(edgeIt); + // append connected edge to connectedEdge list + targetList.Append(connectedEdge); + // append all edges which are connected to the new edge to the list + FindAllConnectedEdges(connectedEdge, edgeList, targetList); + } + else { + finished = true; + } + } +} + +bool CheckCommonVertex(const TopoDS_Edge& e1, const TopoDS_Edge& e2) +{ + TopoDS_Vertex v1First, v1Last, v2First, v2Last; + TopExp::Vertices(e1, v1First, v1Last); + TopExp::Vertices(e2, v2First, v2Last); + + gp_Pnt p1First = BRep_Tool::Pnt(v1First); + gp_Pnt p1Last = BRep_Tool::Pnt(v1Last); + gp_Pnt p2First = BRep_Tool::Pnt(v2First); + gp_Pnt p2Last = BRep_Tool::Pnt(v2Last); + + return (p1First.Distance(p2First) < Precision::Confusion() || + p1First.Distance(p2Last) < Precision::Confusion() || + p1Last.Distance(p2First) < Precision::Confusion() || + p1Last.Distance(p2Last) < Precision::Confusion()); +} + +void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices) +{ + // get a map of vertices with connected edges + TopTools_IndexedDataMapOfShapeListOfShape vertexMap; + TopExp::MapShapesAndAncestors(shape, TopAbs_VERTEX, TopAbs_EDGE, vertexMap); + + // filter out all vertices which have only a single edge connected (end vertices) + for (int i = 1; i <= vertexMap.Extent(); i++) { + const TopTools_ListOfShape& edgeList = vertexMap.FindFromIndex(i); + if (edgeList.Extent() == 1) { + endVertices.Append(vertexMap.FindKey(i)); + } + } +} + +TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& edge) +{ + TopTools_ListOfShape edgeList; + GetEndVertices(edge, edgeList); + return TopoDS::Vertex(edgeList.First()); +} + +TopoDS_Vertex GetLastVertex(const TopoDS_Edge& edge) +{ + TopTools_ListOfShape edgeList; + GetEndVertices(edge, edgeList); + return TopoDS::Vertex(edgeList.Last()); +} + +TopoDS_Face GetNearestFace(const TopoDS_Shape& shape, const gp_Pnt& pnt) +{ + TopExp_Explorer explorer; + TopoDS_Vertex v = BRepBuilderAPI_MakeVertex(pnt); + TopoDS_Face resultFace; + float resultDistance = std::numeric_limits::max(); + for (explorer.Init(shape, TopAbs_FACE); explorer.More(); explorer.Next()) { + TopoDS_Face checkFace = TopoDS::Face(explorer.Current()); + BRepExtrema_DistShapeShape extrema(checkFace, v); + if (!extrema.IsDone() || extrema.NbSolution() < 1) { + LOG(ERROR) << "unable to determine nearest point between face and vertex!"; + throw tigl::CTiglError("unable to determine nearest point between face and vertex!"); + } + if (extrema.Value() < resultDistance) { + resultFace = checkFace; + resultDistance = static_cast(extrema.Value()); + } + } + return resultFace; +} + +gp_Pnt GetCenterOfMass(const TopoDS_Shape &shape) +{ + // get linear properties of the shape + GProp_GProps LProps; + BRepGProp::LinearProperties(shape, LProps); + + // compute center of the shape + gp_Pnt centerPoint = LProps.CentreOfMass(); + + if (LProps.Mass() < 1e-13) { + // Fallback using center of boundary box, fixes #551 + double minx, maxx, miny, maxy, minz, maxz; + GetShapeExtension(shape, minx, maxx, + miny, maxy, + minz, maxz); + + return gp_Pnt((maxx+minx)*0.5, + (maxy+miny)*0.5, + (maxz+minz)*0.5); + } + + return centerPoint; +} + +double GetArea(const TopoDS_Shape &shape) +{ + // get surface properties of the shape + GProp_GProps SProps; + BRepGProp::SurfaceProperties(shape, SProps); + + // compute the area of the shape or the area that is framed by the shape + double area = SProps.Mass(); + + return area; +} + +TopoDS_Shape RemoveDuplicateEdges(const TopoDS_Shape& shape) +{ + TopTools_ListOfShape initialEdgeList, newEdgeList; + TopTools_ListIteratorOfListOfShape initialEdgeIt, newEdgeIt; + + TopoDS_Vertex v1First, v1Last, v2First, v2Last; + gp_Pnt p1First, p1Mid, p1Last, p2First, p2Mid, p2Last; + + // get list of all edges of passed shape + GetListOfShape(shape, TopAbs_EDGE, initialEdgeList); + + // iterate over all edges + for (initialEdgeIt.Initialize(initialEdgeList); initialEdgeIt.More(); initialEdgeIt.Next()) { + TopoDS_Edge& edge = TopoDS::Edge(initialEdgeIt.Value()); + TopExp::Vertices(edge, v1First, v1Last); + p1First = BRep_Tool::Pnt(v1First); + p1Last = BRep_Tool::Pnt(v1Last); + + // if identical edge is not found already in newEdgeList then add it to this list + bool duplicate = false; + for (newEdgeIt.Initialize(newEdgeList); newEdgeIt.More(); newEdgeIt.Next()) { + TopoDS_Edge& checkEdge = TopoDS::Edge(newEdgeIt.Value()); + TopExp::Vertices(checkEdge, v2First, v2Last); + p2First = BRep_Tool::Pnt(v2First); + p2Last = BRep_Tool::Pnt(v2Last); + + if ((p1First.Distance(p2First) < Precision::Confusion() && + p1Last.Distance(p2Last) < Precision::Confusion()) || + (p1First.Distance(p2Last) < Precision::Confusion() && + p1Last.Distance(p2First) < Precision::Confusion())) { + + // now check for identical mid point + Handle(Geom_Curve) curve; + Standard_Real uStart, uEnd; + // get midpoint of edge + curve = BRep_Tool::Curve(edge, uStart, uEnd); + curve->D0((uStart + uEnd) / 2.0, p1Mid); + // get midpoint of checkEdge + curve = BRep_Tool::Curve(checkEdge, uStart, uEnd); + curve->D0((uStart + uEnd) / 2.0, p2Mid); + + if (p1Mid.Distance(p2Mid) < 1E-5) { + duplicate = true; + break; + } + } + } + // only add edge to newEdgeList if no identical edge already exists in there + if (!duplicate) { + newEdgeList.Append(edge); + } + } + + // finally rebuild a compound of all edges from the newEdgeList + TopoDS_Compound result; + BRep_Builder builder; + builder.MakeCompound(result); + + for (newEdgeIt.Initialize(newEdgeList); newEdgeIt.More(); newEdgeIt.Next()) { + builder.Add(result, TopoDS::Edge(newEdgeIt.Value())); + } + + return result; +} + + +bool IsPointInsideShape(const TopoDS_Shape &solid, gp_Pnt point, Bnd_Box const* bounding_box) +{ + double tol = 1e-3; + // check if solid + if (solid.ShapeType() != TopAbs_SOLID) { + throw tigl::CTiglError("The shape is not a solid"); + } + + TopoDS_Solid s = TopoDS::Solid(solid); + + // first, check if the point is in the bounding box + if (bounding_box) { + // create a copy of the const bounding box to be able to enlarge by tolerance + Bnd_Box bb; + bb.Add(*bounding_box); + bb.Enlarge(tol); + if ( bb.IsOut(point) ) { + return false; + } + } + + // if the point is inside the bounding box, classify the point using BRepClass3d_SolidClassifier + BRepClass3d_SolidClassifier algo(s); + + // test whether a point at infinity lies inside. If yes, then the shape is reversed + algo.PerformInfinitePoint(tol); + + bool shapeIsReversed = (algo.State() == TopAbs_IN); + + algo.Perform(point, tol); + + return ((algo.State() == TopAbs_IN) != shapeIsReversed ) || (algo.State() == TopAbs_ON); +} + +// Checks, whether a point lies inside a given face +bool IsPointInsideFace(const TopoDS_Face& face, gp_Pnt point) +{ + //project point onto surface of face + TopoDS_Vertex v = BRepBuilderAPI_MakeVertex(point); + BRepExtrema_ExtPF proj(v, face); + if (proj.IsDone() && proj.NbExt() > 0 && proj.SquareDistance(1)> Precision::SquareConfusion()) { + return false; + } + + //point is in surface of face. Check if it is inside + BRepClass_FaceClassifier faceClassifier; + faceClassifier.Perform(face, point, Precision::Confusion()); + const TopAbs_State state = faceClassifier.State(); + + if (state == TopAbs_ON || state == TopAbs_IN) { + return true; + } + return false; +} + +// Checks whether a point lies above or below a plane (determined by direction of normal) +bool IsPointAbovePlane(const gp_Pln& pln, gp_Pnt point) +{ + return gp_Vec(pln.Location(), point).Dot(gp_Vec(pln.Axis().Direction())) > 0; +} + +std::vector LinspaceWithBreaks(double umin, double umax, size_t n_values, const std::vector& breaks) +{ + double du = (umax - umin) / static_cast(n_values - 1); + + std::vector result(n_values); + for (int i = 0; i < n_values; ++i) { + result[i] = i * du + umin; + } + + // now insert the break + + double eps = 0.3; + // remove points, that are closer to each break point than du*eps + for (std::vector::const_iterator it = breaks.begin(); it != breaks.end(); ++it) { + double breakpoint = *it; + std::vector::iterator pos = std::find_if(result.begin(), result.end(), IsInsideTolerance(breakpoint, du*eps)); + if (pos != result.end()) { + // point found, replace it + *pos = breakpoint; + } + else { + // find closest element + pos = std::find_if(result.begin(), result.end(), IsInsideTolerance(breakpoint, (0.5 + 1e-8)*du)); + + if (*pos > breakpoint) { + result.insert(pos, breakpoint); + } + else { + result.insert(pos+1, breakpoint); + } + } + } + + return result; +} + +template +T Clamp(T val, T min, T max) +{ + if (min > max) { + throw tigl::CTiglError("Minimum may not be larger than maximum in clamp!"); + } + + return std::max(min, std::min(val, max)); +} + +double Clamp(double val, double min, double max) +{ + return Clamp<>(val, min, max); +} + +int Clamp(int val, int min, int max) +{ + return Clamp<>(val, min, max); +} + +size_t Clamp(size_t val, size_t min, size_t max) +{ + return Clamp<>(val, min, max); +} + +TopoDS_Shape TransformedShape(const tigl::CTiglTransformation& transformationToGlobal, TiglCoordinateSystem cs, const TopoDS_Shape& shape) +{ + switch (cs) { + case WING_COORDINATE_SYSTEM: + case FUSELAGE_COORDINATE_SYSTEM: + return shape; + case GLOBAL_COORDINATE_SYSTEM: + return transformationToGlobal.Transform(shape); + default: + throw tigl::CTiglError("Invalid coordinate system"); + } +} + +TopoDS_Shape TransformedShape(const tigl::CTiglRelativelyPositionedComponent& component, TiglCoordinateSystem cs, const TopoDS_Shape& shape) +{ + return TransformedShape(component.GetTransformationMatrix(), cs, shape); +} + +TopoDS_Shape GetFacesByName(const PNamedShape shape, const std::string &name) +{ + std::vector faces; + for (int i = 0; i < static_cast(shape->GetFaceCount()); i++) { + if (shape->GetFaceTraits(i).Name() == name) { + faces.push_back(GetFace(shape->Shape(), i)); + } + } + + if (faces.empty()) + throw tigl::CTiglError("Could not find faces named " + name); + if (faces.size() == 1) + return faces[0]; + + TopoDS_Compound c; + TopoDS_Builder b; + b.MakeCompound(c); + for (std::size_t i = 0; i < faces.size(); i++) + b.Add(c, faces[i]); + return c; +} + +/// Converters between std::vectors and opencascade vectors +Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts) +{ + Handle(TColgp_HArray1OfPnt) result = new TColgp_HArray1OfPnt(1, static_cast(pnts.size())); + int idx = 1; + for (std::vector::const_iterator it = pnts.begin(); it != pnts.end(); ++it, ++idx) { + result->SetValue(idx, *it); + } + return result; +} + +Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts) +{ + Handle(TColgp_HArray1OfPnt) result = new TColgp_HArray1OfPnt(1, static_cast(pnts.size())); + int idx = 1; + for (std::vector::const_iterator it = pnts.begin(); it != pnts.end(); ++it, ++idx) { + result->SetValue(idx, it->Get_gp_Pnt()); + } + return result; +} + +Handle(TColStd_HArray1OfReal) OccFArray(const std::vector& vector) +{ + Handle(TColStd_HArray1OfReal) array = new TColStd_HArray1OfReal(1, static_cast(vector.size())); + int ipos = 1; + for (const auto& value : vector) { + array->SetValue(ipos, value); + ipos++; + } + + return array; +} + +Handle(TColStd_HArray1OfInteger) OccIArray(const std::vector& vector) +{ + Handle(TColStd_HArray1OfInteger) array = new TColStd_HArray1OfInteger(1, static_cast(vector.size())); + int ipos = 1; + for (const auto& value : vector) { + array->SetValue(ipos++, value); + } + + return array; +} + +bool IsFaceBetweenPoints(const TopoDS_Face& face, gp_Pnt p1, gp_Pnt p2) +{ + BRepExtrema_ExtPF projector1(BRepBuilderAPI_MakeVertex(p1).Vertex(), + face, + Extrema_ExtFlag_MIN); + + gp_Pnt p1Proj; + if (projector1.IsDone() && projector1.NbExt() > 0) { + p1Proj = projector1.Point(1); + } + + // compute the projection of p1 + BRepExtrema_ExtPF projector2(BRepBuilderAPI_MakeVertex(p2).Vertex(), + face, + Extrema_ExtFlag_MIN); + + gp_Pnt p2Proj; + if (projector2.IsDone() && projector2.NbExt() > 0) { + p2Proj = projector2.Point(1); + } + + return gp_Vec(p1Proj, p1).Dot(gp_Vec(p2Proj, p2)) < 0.; +} + +double Mix(double x, double y, double a) +{ + return x*(1.-a) + y*a; +} + +double NormalizeAngleDeg(double angleDeg) +{ + angleDeg = fmod(angleDeg, 360.); + if (angleDeg < 0.) + angleDeg += 360.; + + return angleDeg; +} diff --git a/src/common/tiglcommonfunctions.h b/src/common/tiglcommonfunctions.h index 5c4b2936b2..c2234b5c3c 100644 --- a/src/common/tiglcommonfunctions.h +++ b/src/common/tiglcommonfunctions.h @@ -1,457 +1,457 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2013-06-01 Martin Siggel -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef TIGLCOMMONFUNCTIONS_H -#define TIGLCOMMONFUNCTIONS_H - - - -#include "CCPACSImportExport.h" -#include "Standard.hxx" -#include "Standard_values.h" -#include "tigl_internal.h" -#include "gp_Pnt.hxx" -#include "gp_Vec.hxx" -#include "gp_Pln.hxx" -#include "TopoDS_Shape.hxx" -#include -#include "PNamedShape.h" -#include "ListPNamedShape.h" -#include "CTiglIntersectionPoint.h" -#include "CCPACSConfiguration.h" -#include "CTiglRelativelyPositionedComponent.h" -#include -#include -#include -#include "TColgp_HArray1OfPnt.hxx" - -#include -#include -#include -#include -#include "UniquePtr.h" - -typedef std::map ShapeMap; - -// helper function for std::find -struct IsInsideTolerance -{ - IsInsideTolerance(double value, double tolerance = 1e-15) - : _a(value), _tol(tolerance) - {} - - bool operator()(double v) - { - return (fabs(_a - v) <= _tol); - } - - double _a; - double _tol; -}; - -// calculates a wire's circumfence -TIGL_EXPORT Standard_Real GetLength(const TopoDS_Wire& wire); - -TIGL_EXPORT Standard_Real GetLength(const TopoDS_Edge& edge); - -// returns a point on the wire (0 <= alpha <= 1) -TIGL_EXPORT gp_Pnt WireGetPoint(const TopoDS_Wire& wire, double alpha); -TIGL_EXPORT void WireGetPointTangent(const TopoDS_Wire& wire, double alpha, gp_Pnt& point, gp_Vec& normal); - -// returns the starting point of the wire/edge -TIGL_EXPORT gp_Pnt GetFirstPoint(const TopoDS_Shape& wireOrEdge); -TIGL_EXPORT gp_Pnt GetFirstPoint(const TopoDS_Wire& w); -TIGL_EXPORT gp_Pnt GetFirstPoint(const TopoDS_Edge& e); - -// returns the end point of the wire/edge -TIGL_EXPORT gp_Pnt GetLastPoint(const TopoDS_Shape& wireOrEdge); -TIGL_EXPORT gp_Pnt GetLastPoint(const TopoDS_Wire& w); -TIGL_EXPORT gp_Pnt GetLastPoint(const TopoDS_Edge& e); - -TIGL_EXPORT gp_Pnt EdgeGetPoint(const TopoDS_Edge& edge, double alpha); -TIGL_EXPORT void EdgeGetPointTangent(const TopoDS_Edge& edge, double alpha, gp_Pnt& point, gp_Vec& normal); - -// calculates the alpha value for a given point on a wire -TIGL_EXPORT Standard_Real ProjectPointOnWire(const TopoDS_Wire& wire, gp_Pnt p); - -// projects a point onto the line (lineStart<->lineStop) and returns the projection parameter -TIGL_EXPORT Standard_Real ProjectPointOnLine(gp_Pnt p, gp_Pnt lineStart, gp_Pnt lineStop); - -// calculates the alpha value for a given point on a wire -TIGL_EXPORT Standard_Real ProjectPointOnWireAtAngle(const TopoDS_Wire& wire, gp_Pnt p, gp_Dir rotationAxisAroundP, double angle); - -// projects a point onto a plane and returns the point in parameters of the plane -TIGL_EXPORT gp_Pnt2d ProjectPointOnPlane(gp_Pln pln, gp_Pnt p); - -TIGL_EXPORT gp_Pnt ProjectPointOnShape(const TopoDS_Shape& shape, const gp_Pnt& point, const gp_Vec& direction); - -/** - * @brief The UVResult struct is used as an output for GetFaceAndUV - */ -struct UVResult -{ - TopoDS_Face face; - double u, v; -}; - -/** - * @brief Given a point on a shape, GetFaceAndUV finds all faces - * which contain the point and determines its (u,v)-coordinates on that face. - * - * It is assumes that the point is on the shape. Typically this function would - * be used on the output of ProjectPointOnShape. - * - * @param shape Input shape - * @param pnt Input point - * @param tol a tolerance for the squared distance of the point - * @return a boost::optional instance containing the face together with the - * (u,v) coordinates of the point on that face, if the algorithm succeeded - */ -TIGL_EXPORT boost::optional GetFaceAndUV(TopoDS_Shape const& shape, - gp_Pnt const& pnt, - double tol = 1e-3); - - -/** - * @brief TrimFace trims a face given new minimum and maximum values for the (u,v)- - * coordinates - * @param face The face to be trimmed - * @param umin new minimum u value - * @param umax new maximum u value - * @param vmin new minimum v value - * @param vmax new maximum v value - * @return the trimmed face - */ -TIGL_EXPORT TopoDS_Face TrimFace(TopoDS_Face const& face, - double umin, - double umax, - double vmin, - double vmax); - - -/** - * @brief ReplaceFaceInShape returns a new shape that corresponds to - * the input shape, except that old_face is replaced by new_face - * @param shape The input shape - * @param new_face the new face that shall take the place of the old shape - * @param old_face the old face to be replaced - * @return the shape with the replaced faces - */ -TIGL_EXPORT TopoDS_Shape ReplaceFaceInShape(TopoDS_Shape const& shape, - TopoDS_Face const& new_face, - TopoDS_Face const& old_face); - -// checks, whether a face is in between two points -TIGL_EXPORT bool IsFaceBetweenPoints(const TopoDS_Face& face, gp_Pnt p1, gp_Pnt p2); - -enum IntStatus -{ - BetweenPoints, // The intersection point lies between p1 and p2 - OutsideBefore, // The intersection point lies before p1 - OutsideAfter, // The intersection point lies after p2 - NoIntersection // the plane and the line are parallel to each other -}; - -// returns the intersection point between a line (p1-p2) and the plane -TIGL_EXPORT IntStatus IntersectLinePlane(gp_Pnt p1, gp_Pnt p2, gp_Pln plane, gp_Pnt& result); - -// returns the number of edges of the current shape -TIGL_EXPORT unsigned int GetNumberOfEdges(const TopoDS_Shape& shape); - -// returns the number of faces of the current shape -TIGL_EXPORT unsigned int GetNumberOfFaces(const TopoDS_Shape& shape); - -TIGL_EXPORT TopoDS_Edge GetEdge(const TopoDS_Shape& shape, int iEdge); - -TIGL_EXPORT TopoDS_Face GetFace(const TopoDS_Shape& shape, int iFace); - -TIGL_EXPORT Handle(Geom_BSplineCurve) GetBSplineCurve(const TopoDS_Edge& e); - -// Returns the number of subshapes, if the shape is a compound -TIGL_EXPORT unsigned int GetNumberOfSubshapes(const TopoDS_Shape& shape); - -// returns the central point of the face -TIGL_EXPORT gp_Pnt GetCentralFacePoint(const class TopoDS_Face& face); - -// puts all faces with the same origin to one TopoDS_Compound -// Maps all compounds with its name in the map -TIGL_EXPORT ListPNamedShape GroupFaces(const PNamedShape shape, tigl::ShapeGroupMode groupType); - -TIGL_EXPORT TopoDS_Shape GetFacesByName(const PNamedShape shape, const std::string& name); - -// Returns the coordinates of the bounding box of the shape -TIGL_EXPORT void GetShapeExtension(const TopoDS_Shape& shape, - double& minx, double& maxx, - double& miny, double& maxy, - double& minz, double& maxz); - -// Returns a unique Hashcode for a specific geometric component based on its loft -TIGL_EXPORT int GetComponentHashCode(tigl::ITiglGeometricComponent&); - -// Creates an Edge from the given Points by B-Spline interpolation -TIGL_EXPORT TopoDS_Edge EdgeSplineFromPoints(const std::vector& points); - -// Computes the intersection point of a face and an edge -TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Edge& edge, gp_Pnt& dst, double tolerance = Precision::Confusion()); - -// Computes the intersection point of a face and a wire -TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Wire& wire, gp_Pnt& dst, double tolerance = Precision::Confusion()); - -// Comuptes the intersection points of two wires -TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, intersectionPointList& intersectionPoints, const double tolerance=Precision::SquareConfusion()); - -// Checks, whether a points lies inside a given shape, which must be a solid. -// An optional bounding box can be passed to include a bounding box test as a prephase -TIGL_EXPORT bool IsPointInsideShape(const TopoDS_Shape& solid, gp_Pnt point, Bnd_Box const* bounding_box = nullptr); - -// Checks, whether a point lies inside a given face -TIGL_EXPORT bool IsPointInsideFace(const TopoDS_Face& face, gp_Pnt point); - -// Checks whether a point lies above or below a plane (determined by direction of normal) -TIGL_EXPORT bool IsPointAbovePlane(const gp_Pln& pln, gp_Pnt point); - -// Returns the single face contained in the passed shape -// Throws an exception when number of faces != 1 -TIGL_EXPORT TopoDS_Face GetSingleFace(const TopoDS_Shape& shape); - -// Builds a face out of 4 points -TIGL_EXPORT TopoDS_Face BuildFace(const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3, const gp_Pnt& p4); - -// Returns true, if a path is relative -TIGL_EXPORT bool IsPathRelative(const std::string&); - -// Returns true, if a file is readable -TIGL_EXPORT bool IsFileReadable(const std::string& filename); - -TIGL_EXPORT std::string FileExtension(const std::string& filename); - -// get the continuity of two edges which share a common vertex -TIGL_EXPORT TiglContinuity getEdgeContinuity(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2); - -TIGL_EXPORT Standard_Boolean IsEqual(const TopoDS_Shape& s1, const TopoDS_Shape& s2); - -// Method for building a face out of two wires -TIGL_EXPORT TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2); - -// Method for building a face out of two wires and a direction vector -TIGL_EXPORT TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir); - -// Method for building a face out of closed wire. -// The algorithm tries to build a face using a plane as surface, in case this fails -// the BRepFill_Filling class is used. -TIGL_EXPORT TopoDS_Face BuildFace(const TopoDS_Wire& wire); - -// Method for building a ruled face between the two wires. The method -// approximates the two wires by curves, and generates a single face -// between these curves. -// This can be used for generating non-planar faces. For planar faces -// see buildFace method -TIGL_EXPORT TopoDS_Face BuildRuledFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2); - -// Method for building a wire out of two points -TIGL_EXPORT TopoDS_Wire BuildWire(const gp_Pnt& p1, const gp_Pnt& p2); - -// Method for building a wire out of the edges from the passed geometry -TIGL_EXPORT TopoDS_Wire BuildWireFromEdges(const TopoDS_Shape& edges); - -// Returns a list of wires built from all connected edges in the passed shape -TIGL_EXPORT void BuildWiresFromConnectedEdges(const TopoDS_Shape& shape, TopTools_ListOfShape& wireList); - -// Method for creating a face from an opened wire -TIGL_EXPORT TopoDS_Wire CloseWire(const TopoDS_Wire& wire); - -// Method for closing two wires to a single one, -// The method determines a direction vector based on the end vertices of wire1 -// and calls the second closeWires method -TIGL_EXPORT TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2); - -// Method for closing two wires to a single one, -// the passed vector is used to define the upper and lower end vertices of the wires -TIGL_EXPORT TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir); - -// Method for sorting the edges of a wire -TIGL_EXPORT TopoDS_Wire SortWireEdges(const TopoDS_Wire& wire); - -// Returns the first and last vertex of the passed shape along the passed -// direction -TIGL_EXPORT bool GetMinMaxPoint(const TopoDS_Shape& shape, const gp_Vec& dir, gp_Pnt& minPnt, gp_Pnt& maxPnt); - -// Returns the list of shapes of the passed type from the passed shape -TIGL_EXPORT void GetListOfShape(const TopoDS_Shape& shape, TopAbs_ShapeEnum type, TopTools_ListOfShape& result); - -// Returns all shapes with the given type contained in the given shape -TIGL_EXPORT std::vector GetSubShapes(const TopoDS_Shape& shape, TopAbs_ShapeEnum type); - -// Cuts two shapes and returns the common geometry (e.g. intersection edges) -// Throws an exception in case the intersection failed -TIGL_EXPORT TopoDS_Shape CutShapes(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2); - -// Helper for splitting a shape by another shape -TIGL_EXPORT TopoDS_Shape SplitShape(const TopoDS_Shape& src, const TopoDS_Shape& tool); - -// Method for finding all directly and indirectly connected edges -// The method loops over the passed edgeList and checks for each element if it -// is connected to the passed edge. When an edge is found it is removed from -// the edgeList and added to the targetList. Additionally for this edge all -// connected edges are also added to the targetList by recursively calling this -// method. Finally all directly or indirectly connected edges to the passed -// edge are moved from the edgeList to the targetList -TIGL_EXPORT void FindAllConnectedEdges(const TopoDS_Edge& edge, TopTools_ListOfShape& edgeList, TopTools_ListOfShape& targetList); - -// Method for checking if two edges have a common vertex (same position) -TIGL_EXPORT bool CheckCommonVertex(const TopoDS_Edge& e1, const TopoDS_Edge& e2); - -// Method for searching all vertices which are only connected to a single edge -TIGL_EXPORT void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices); - -// Method to return the first vertex of an edge -TIGL_EXPORT TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& e); - -// Method to return the last vertex of an edge -TIGL_EXPORT TopoDS_Vertex GetLastVertex(const TopoDS_Edge& e); - -// Method for finding the face which has the lowest distance to the passed point -TIGL_EXPORT TopoDS_Face GetNearestFace(const TopoDS_Shape& src, const gp_Pnt& pnt); - -// Method for finding the center of mass of a shape -TIGL_EXPORT gp_Pnt GetCenterOfMass(const TopoDS_Shape& shape); - -// Method for finding the area of a shape or the area that is framed by the shape -TIGL_EXPORT double GetArea(const TopoDS_Shape &shape); - -// Method for checking for duplicate edges in the passed shape. -// The method returns a shape with only unique edges -// NOTE: THIS METHOD ONLY CHECKS THE VERTEX POSITIONS, AND THE MIDDLE POINT -// OF THE EDGES, BUT DOES NOT COMPARE THE CURVES EXACTLY -TIGL_EXPORT TopoDS_Shape RemoveDuplicateEdges(const TopoDS_Shape& shape); - -inline double Radians(double degree) -{ - return degree / 180. * M_PI; -} - -inline double Degrees(double radians) -{ - return 180.*radians / M_PI; -} - -// Clamps val between min and max -TIGL_EXPORT int Clamp(int val, int min, int max); -TIGL_EXPORT double Clamp(double val, double min, double max); -TIGL_EXPORT size_t Clamp(size_t val, size_t min, size_t max); - -// linearly interpolate between two values result = x*(1−a)+y*a. -TIGL_EXPORT double Mix(double x, double y, double a); - -// Normalizes the input angle into the range [0, 360) -TIGL_EXPORT double NormalizeAngleDeg(double angleDeg); - -// Creates a linear spaces array but with some additional breaking points -// If the breaking points are very close to a point, the point will be replaced -// Else, the breaking point will be inserted -TIGL_EXPORT std::vector LinspaceWithBreaks(double umin, double umax, size_t n_values, const std::vector& breaks); - -// Transforms a shape accourding to the given coordinate transformation -TIGL_EXPORT TopoDS_Shape TransformedShape(const tigl::CTiglTransformation& transformationToGlobal, TiglCoordinateSystem cs, const TopoDS_Shape& shape); -TIGL_EXPORT TopoDS_Shape TransformedShape(const tigl::CTiglRelativelyPositionedComponent& component, TiglCoordinateSystem cs, const TopoDS_Shape& shape); - -/// Converters between std::vectors and opencascade vectors -TIGL_EXPORT Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts); -TIGL_EXPORT Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts); - -TIGL_EXPORT Handle(TColStd_HArray1OfReal) OccFArray(const std::vector& vector); -TIGL_EXPORT Handle(TColStd_HArray1OfInteger) OccIArray(const std::vector& vector); - -template -size_t IndexFromUid(const std::vector >& vectorOfPointers, const std::string& uid) -{ - const auto found = std::find_if(vectorOfPointers.begin(), vectorOfPointers.end(), [&uid](const std::unique_ptr& ptr) { - return ptr->GetUID() == uid; - }); - return found - vectorOfPointers.begin(); -} - -/** - * @brief Searches for a entry in a range and returns its index - * - * This function can be used with std::arrays, std::vectors - * and also possible other containers supported by std::distance - * - * If the index is not found, the size of the range will be returned instead - */ -template -size_t FindIndex(ForwardIter begin, ForwardIter end, Compare comp) -{ - const auto it = std::find_if(begin, end, comp); - if (it != end) { - return std::distance(begin, it); - } - else { - return std::distance(begin, end); - } -} - -/** - * @brief Checks, whether an array contains a value or not - * - * @param array The array to be searched in - * @param val The value to be saerched for - * @param tolerance This functions is typically used with floating point values. The tolerance allows - * to search for a value within the specified tolerance. - */ -template -bool Contains(const ArrayLike& array, ValueType val, ValueType tolerance) -{ - auto idx = FindIndex(std::begin(array), std::end(array), [val, tolerance](const typename ArrayLike::value_type& cval) { - return fabs(cval - val) < tolerance; - }); - - return idx < array.size(); -} - -/** - * Returns true, if all elements are the same - */ -template -bool AllSame(ForwardIter begin, ForwardIter end) -{ - return std::adjacent_find( begin, end, std::not_equal_to::value_type>() ) == end; -} - -template -void ReplaceAdjacentWithMerged(ArrayType& list, BinaryPredicate is_adjacent, BinaryMerge merged) -{ - for (auto it = std::begin(list); it != std::end(list);) { - auto nextIt = it; - - if (++nextIt == std::end(list)) { - return; - } - - if (is_adjacent(*it, *nextIt)) { - const auto merged_val = merged(*it, *nextIt); - it = list.erase(it, ++nextIt); - it = list.insert(it, merged_val); - } - else { - it = nextIt; - } - } -} - -#endif // TIGLCOMMONFUNCTIONS_H +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2013-06-01 Martin Siggel +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef TIGLCOMMONFUNCTIONS_H +#define TIGLCOMMONFUNCTIONS_H + + + +#include "CCPACSImportExport.h" +#include "Standard.hxx" +#include "Standard_values.h" +#include "tigl_internal.h" +#include "gp_Pnt.hxx" +#include "gp_Vec.hxx" +#include "gp_Pln.hxx" +#include "TopoDS_Shape.hxx" +#include +#include "PNamedShape.h" +#include "ListPNamedShape.h" +#include "CTiglIntersectionPoint.h" +#include "CCPACSConfiguration.h" +#include "CTiglRelativelyPositionedComponent.h" +#include +#include +#include +#include "TColgp_HArray1OfPnt.hxx" + +#include +#include +#include +#include +#include "UniquePtr.h" + +typedef std::map ShapeMap; + +// helper function for std::find +struct IsInsideTolerance +{ + IsInsideTolerance(double value, double tolerance = 1e-15) + : _a(value), _tol(tolerance) + {} + + bool operator()(double v) + { + return (fabs(_a - v) <= _tol); + } + + double _a; + double _tol; +}; + +// calculates a wire's circumfence +TIGL_EXPORT Standard_Real GetLength(const TopoDS_Wire& wire); + +TIGL_EXPORT Standard_Real GetLength(const TopoDS_Edge& edge); + +// returns a point on the wire (0 <= alpha <= 1) +TIGL_EXPORT gp_Pnt WireGetPoint(const TopoDS_Wire& wire, double alpha); +TIGL_EXPORT void WireGetPointTangent(const TopoDS_Wire& wire, double alpha, gp_Pnt& point, gp_Vec& normal); + +// returns the starting point of the wire/edge +TIGL_EXPORT gp_Pnt GetFirstPoint(const TopoDS_Shape& wireOrEdge); +TIGL_EXPORT gp_Pnt GetFirstPoint(const TopoDS_Wire& w); +TIGL_EXPORT gp_Pnt GetFirstPoint(const TopoDS_Edge& e); + +// returns the end point of the wire/edge +TIGL_EXPORT gp_Pnt GetLastPoint(const TopoDS_Shape& wireOrEdge); +TIGL_EXPORT gp_Pnt GetLastPoint(const TopoDS_Wire& w); +TIGL_EXPORT gp_Pnt GetLastPoint(const TopoDS_Edge& e); + +TIGL_EXPORT gp_Pnt EdgeGetPoint(const TopoDS_Edge& edge, double alpha); +TIGL_EXPORT void EdgeGetPointTangent(const TopoDS_Edge& edge, double alpha, gp_Pnt& point, gp_Vec& normal); + +// calculates the alpha value for a given point on a wire +TIGL_EXPORT Standard_Real ProjectPointOnWire(const TopoDS_Wire& wire, gp_Pnt p); + +// projects a point onto the line (lineStart<->lineStop) and returns the projection parameter +TIGL_EXPORT Standard_Real ProjectPointOnLine(gp_Pnt p, gp_Pnt lineStart, gp_Pnt lineStop); + +// calculates the alpha value for a given point on a wire +TIGL_EXPORT Standard_Real ProjectPointOnWireAtAngle(const TopoDS_Wire& wire, gp_Pnt p, gp_Dir rotationAxisAroundP, double angle); + +// projects a point onto a plane and returns the point in parameters of the plane +TIGL_EXPORT gp_Pnt2d ProjectPointOnPlane(gp_Pln pln, gp_Pnt p); + +TIGL_EXPORT gp_Pnt ProjectPointOnShape(const TopoDS_Shape& shape, const gp_Pnt& point, const gp_Vec& direction); + +/** + * @brief The UVResult struct is used as an output for GetFaceAndUV + */ +struct UVResult +{ + TopoDS_Face face; + double u, v; +}; + +/** + * @brief Given a point on a shape, GetFaceAndUV finds all faces + * which contain the point and determines its (u,v)-coordinates on that face. + * + * It is assumes that the point is on the shape. Typically this function would + * be used on the output of ProjectPointOnShape. + * + * @param shape Input shape + * @param pnt Input point + * @param tol a tolerance for the squared distance of the point + * @return a boost::optional instance containing the face together with the + * (u,v) coordinates of the point on that face, if the algorithm succeeded + */ +TIGL_EXPORT boost::optional GetFaceAndUV(TopoDS_Shape const& shape, + gp_Pnt const& pnt, + double tol = 1e-3); + + +/** + * @brief TrimFace trims a face given new minimum and maximum values for the (u,v)- + * coordinates + * @param face The face to be trimmed + * @param umin new minimum u value + * @param umax new maximum u value + * @param vmin new minimum v value + * @param vmax new maximum v value + * @return the trimmed face + */ +TIGL_EXPORT TopoDS_Face TrimFace(TopoDS_Face const& face, + double umin, + double umax, + double vmin, + double vmax); + + +/** + * @brief ReplaceFaceInShape returns a new shape that corresponds to + * the input shape, except that old_face is replaced by new_face + * @param shape The input shape + * @param new_face the new face that shall take the place of the old shape + * @param old_face the old face to be replaced + * @return the shape with the replaced faces + */ +TIGL_EXPORT TopoDS_Shape ReplaceFaceInShape(TopoDS_Shape const& shape, + TopoDS_Face const& new_face, + TopoDS_Face const& old_face); + +// checks, whether a face is in between two points +TIGL_EXPORT bool IsFaceBetweenPoints(const TopoDS_Face& face, gp_Pnt p1, gp_Pnt p2); + +enum IntStatus +{ + BetweenPoints, // The intersection point lies between p1 and p2 + OutsideBefore, // The intersection point lies before p1 + OutsideAfter, // The intersection point lies after p2 + NoIntersection // the plane and the line are parallel to each other +}; + +// returns the intersection point between a line (p1-p2) and the plane +TIGL_EXPORT IntStatus IntersectLinePlane(gp_Pnt p1, gp_Pnt p2, gp_Pln plane, gp_Pnt& result); + +// returns the number of edges of the current shape +TIGL_EXPORT unsigned int GetNumberOfEdges(const TopoDS_Shape& shape); + +// returns the number of faces of the current shape +TIGL_EXPORT unsigned int GetNumberOfFaces(const TopoDS_Shape& shape); + +TIGL_EXPORT TopoDS_Edge GetEdge(const TopoDS_Shape& shape, int iEdge); + +TIGL_EXPORT TopoDS_Face GetFace(const TopoDS_Shape& shape, int iFace); + +TIGL_EXPORT Handle(Geom_BSplineCurve) GetBSplineCurve(const TopoDS_Edge& e); + +// Returns the number of subshapes, if the shape is a compound +TIGL_EXPORT unsigned int GetNumberOfSubshapes(const TopoDS_Shape& shape); + +// returns the central point of the face +TIGL_EXPORT gp_Pnt GetCentralFacePoint(const class TopoDS_Face& face); + +// puts all faces with the same origin to one TopoDS_Compound +// Maps all compounds with its name in the map +TIGL_EXPORT ListPNamedShape GroupFaces(const PNamedShape shape, tigl::ShapeGroupMode groupType); + +TIGL_EXPORT TopoDS_Shape GetFacesByName(const PNamedShape shape, const std::string& name); + +// Returns the coordinates of the bounding box of the shape +TIGL_EXPORT void GetShapeExtension(const TopoDS_Shape& shape, + double& minx, double& maxx, + double& miny, double& maxy, + double& minz, double& maxz); + +// Returns a unique Hashcode for a specific geometric component based on its loft +TIGL_EXPORT int GetComponentHashCode(tigl::ITiglGeometricComponent&); + +// Creates an Edge from the given Points by B-Spline interpolation +TIGL_EXPORT TopoDS_Edge EdgeSplineFromPoints(const std::vector& points); + +// Computes the intersection point of a face and an edge +TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Edge& edge, gp_Pnt& dst, double tolerance = Precision::Confusion()); + +// Computes the intersection point of a face and a wire +TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Face& face, const TopoDS_Wire& wire, gp_Pnt& dst, double tolerance = Precision::Confusion()); + +// Comuptes the intersection points of two wires +TIGL_EXPORT bool GetIntersectionPoint(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, intersectionPointList& intersectionPoints, const double tolerance=Precision::SquareConfusion()); + +// Checks, whether a points lies inside a given shape, which must be a solid. +// An optional bounding box can be passed to include a bounding box test as a prephase +TIGL_EXPORT bool IsPointInsideShape(const TopoDS_Shape& solid, gp_Pnt point, Bnd_Box const* bounding_box = nullptr); + +// Checks, whether a point lies inside a given face +TIGL_EXPORT bool IsPointInsideFace(const TopoDS_Face& face, gp_Pnt point); + +// Checks whether a point lies above or below a plane (determined by direction of normal) +TIGL_EXPORT bool IsPointAbovePlane(const gp_Pln& pln, gp_Pnt point); + +// Returns the single face contained in the passed shape +// Throws an exception when number of faces != 1 +TIGL_EXPORT TopoDS_Face GetSingleFace(const TopoDS_Shape& shape); + +// Builds a face out of 4 points +TIGL_EXPORT TopoDS_Face BuildFace(const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3, const gp_Pnt& p4); + +// Returns true, if a path is relative +TIGL_EXPORT bool IsPathRelative(const std::string&); + +// Returns true, if a file is readable +TIGL_EXPORT bool IsFileReadable(const std::string& filename); + +TIGL_EXPORT std::string FileExtension(const std::string& filename); + +// get the continuity of two edges which share a common vertex +TIGL_EXPORT TiglContinuity getEdgeContinuity(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2); + +TIGL_EXPORT Standard_Boolean IsEqual(const TopoDS_Shape& s1, const TopoDS_Shape& s2); + +// Method for building a face out of two wires +TIGL_EXPORT TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2); + +// Method for building a face out of two wires and a direction vector +TIGL_EXPORT TopoDS_Face BuildFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir); + +// Method for building a face out of closed wire. +// The algorithm tries to build a face using a plane as surface, in case this fails +// the BRepFill_Filling class is used. +TIGL_EXPORT TopoDS_Face BuildFace(const TopoDS_Wire& wire); + +// Method for building a ruled face between the two wires. The method +// approximates the two wires by curves, and generates a single face +// between these curves. +// This can be used for generating non-planar faces. For planar faces +// see buildFace method +TIGL_EXPORT TopoDS_Face BuildRuledFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2); + +// Method for building a wire out of two points +TIGL_EXPORT TopoDS_Wire BuildWire(const gp_Pnt& p1, const gp_Pnt& p2); + +// Method for building a wire out of the edges from the passed geometry +TIGL_EXPORT TopoDS_Wire BuildWireFromEdges(const TopoDS_Shape& edges); + +// Returns a list of wires built from all connected edges in the passed shape +TIGL_EXPORT void BuildWiresFromConnectedEdges(const TopoDS_Shape& shape, TopTools_ListOfShape& wireList); + +// Method for creating a face from an opened wire +TIGL_EXPORT TopoDS_Wire CloseWire(const TopoDS_Wire& wire); + +// Method for closing two wires to a single one, +// The method determines a direction vector based on the end vertices of wire1 +// and calls the second closeWires method +TIGL_EXPORT TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2); + +// Method for closing two wires to a single one, +// the passed vector is used to define the upper and lower end vertices of the wires +TIGL_EXPORT TopoDS_Wire CloseWires(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2, const gp_Vec& dir); + +// Method for sorting the edges of a wire +TIGL_EXPORT TopoDS_Wire SortWireEdges(const TopoDS_Wire& wire); + +// Returns the first and last vertex of the passed shape along the passed +// direction +TIGL_EXPORT bool GetMinMaxPoint(const TopoDS_Shape& shape, const gp_Vec& dir, gp_Pnt& minPnt, gp_Pnt& maxPnt); + +// Returns the list of shapes of the passed type from the passed shape +TIGL_EXPORT void GetListOfShape(const TopoDS_Shape& shape, TopAbs_ShapeEnum type, TopTools_ListOfShape& result); + +// Returns all shapes with the given type contained in the given shape +TIGL_EXPORT std::vector GetSubShapes(const TopoDS_Shape& shape, TopAbs_ShapeEnum type); + +// Cuts two shapes and returns the common geometry (e.g. intersection edges) +// Throws an exception in case the intersection failed +TIGL_EXPORT TopoDS_Shape CutShapes(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2); + +// Helper for splitting a shape by another shape +TIGL_EXPORT TopoDS_Shape SplitShape(const TopoDS_Shape& src, const TopoDS_Shape& tool); + +// Method for finding all directly and indirectly connected edges +// The method loops over the passed edgeList and checks for each element if it +// is connected to the passed edge. When an edge is found it is removed from +// the edgeList and added to the targetList. Additionally for this edge all +// connected edges are also added to the targetList by recursively calling this +// method. Finally all directly or indirectly connected edges to the passed +// edge are moved from the edgeList to the targetList +TIGL_EXPORT void FindAllConnectedEdges(const TopoDS_Edge& edge, TopTools_ListOfShape& edgeList, TopTools_ListOfShape& targetList); + +// Method for checking if two edges have a common vertex (same position) +TIGL_EXPORT bool CheckCommonVertex(const TopoDS_Edge& e1, const TopoDS_Edge& e2); + +// Method for searching all vertices which are only connected to a single edge +TIGL_EXPORT void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices); + +// Method to return the first vertex of an edge +TIGL_EXPORT TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& e); + +// Method to return the last vertex of an edge +TIGL_EXPORT TopoDS_Vertex GetLastVertex(const TopoDS_Edge& e); + +// Method for finding the face which has the lowest distance to the passed point +TIGL_EXPORT TopoDS_Face GetNearestFace(const TopoDS_Shape& src, const gp_Pnt& pnt); + +// Method for finding the center of mass of a shape +TIGL_EXPORT gp_Pnt GetCenterOfMass(const TopoDS_Shape& shape); + +// Method for finding the area of a shape or the area that is framed by the shape +TIGL_EXPORT double GetArea(const TopoDS_Shape &shape); + +// Method for checking for duplicate edges in the passed shape. +// The method returns a shape with only unique edges +// NOTE: THIS METHOD ONLY CHECKS THE VERTEX POSITIONS, AND THE MIDDLE POINT +// OF THE EDGES, BUT DOES NOT COMPARE THE CURVES EXACTLY +TIGL_EXPORT TopoDS_Shape RemoveDuplicateEdges(const TopoDS_Shape& shape); + +inline double Radians(double degree) +{ + return degree / 180. * M_PI; +} + +inline double Degrees(double radians) +{ + return 180.*radians / M_PI; +} + +// Clamps val between min and max +TIGL_EXPORT int Clamp(int val, int min, int max); +TIGL_EXPORT double Clamp(double val, double min, double max); +TIGL_EXPORT size_t Clamp(size_t val, size_t min, size_t max); + +// linearly interpolate between two values result = x*(1−a)+y*a. +TIGL_EXPORT double Mix(double x, double y, double a); + +// Normalizes the input angle into the range [0, 360) +TIGL_EXPORT double NormalizeAngleDeg(double angleDeg); + +// Creates a linear spaces array but with some additional breaking points +// If the breaking points are very close to a point, the point will be replaced +// Else, the breaking point will be inserted +TIGL_EXPORT std::vector LinspaceWithBreaks(double umin, double umax, size_t n_values, const std::vector& breaks); + +// Transforms a shape accourding to the given coordinate transformation +TIGL_EXPORT TopoDS_Shape TransformedShape(const tigl::CTiglTransformation& transformationToGlobal, TiglCoordinateSystem cs, const TopoDS_Shape& shape); +TIGL_EXPORT TopoDS_Shape TransformedShape(const tigl::CTiglRelativelyPositionedComponent& component, TiglCoordinateSystem cs, const TopoDS_Shape& shape); + +/// Converters between std::vectors and opencascade vectors +TIGL_EXPORT Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts); +TIGL_EXPORT Handle(TColgp_HArray1OfPnt) OccArray(const std::vector& pnts); + +TIGL_EXPORT Handle(TColStd_HArray1OfReal) OccFArray(const std::vector& vector); +TIGL_EXPORT Handle(TColStd_HArray1OfInteger) OccIArray(const std::vector& vector); + +template +size_t IndexFromUid(const std::vector >& vectorOfPointers, const std::string& uid) +{ + const auto found = std::find_if(vectorOfPointers.begin(), vectorOfPointers.end(), [&uid](const std::unique_ptr& ptr) { + return ptr->GetUID() == uid; + }); + return found - vectorOfPointers.begin(); +} + +/** + * @brief Searches for a entry in a range and returns its index + * + * This function can be used with std::arrays, std::vectors + * and also possible other containers supported by std::distance + * + * If the index is not found, the size of the range will be returned instead + */ +template +size_t FindIndex(ForwardIter begin, ForwardIter end, Compare comp) +{ + const auto it = std::find_if(begin, end, comp); + if (it != end) { + return std::distance(begin, it); + } + else { + return std::distance(begin, end); + } +} + +/** + * @brief Checks, whether an array contains a value or not + * + * @param array The array to be searched in + * @param val The value to be saerched for + * @param tolerance This functions is typically used with floating point values. The tolerance allows + * to search for a value within the specified tolerance. + */ +template +bool Contains(const ArrayLike& array, ValueType val, ValueType tolerance) +{ + auto idx = FindIndex(std::begin(array), std::end(array), [val, tolerance](const typename ArrayLike::value_type& cval) { + return fabs(cval - val) < tolerance; + }); + + return idx < array.size(); +} + +/** + * Returns true, if all elements are the same + */ +template +bool AllSame(ForwardIter begin, ForwardIter end) +{ + return std::adjacent_find( begin, end, std::not_equal_to::value_type>() ) == end; +} + +template +void ReplaceAdjacentWithMerged(ArrayType& list, BinaryPredicate is_adjacent, BinaryMerge merged) +{ + for (auto it = std::begin(list); it != std::end(list);) { + auto nextIt = it; + + if (++nextIt == std::end(list)) { + return; + } + + if (is_adjacent(*it, *nextIt)) { + const auto merged_val = merged(*it, *nextIt); + it = list.erase(it, ++nextIt); + it = list.insert(it, merged_val); + } + else { + it = nextIt; + } + } +} + +#endif // TIGLCOMMONFUNCTIONS_H diff --git a/src/cpacs_other/CCPACSMaterialDefinition.cpp b/src/cpacs_other/CCPACSMaterialDefinition.cpp index db0f743b40..34befce0d7 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.cpp +++ b/src/cpacs_other/CCPACSMaterialDefinition.cpp @@ -1,62 +1,62 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2013-05-28 Martin Siggel -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "CCPACSMaterialDefinition.h" - -#include "CTiglError.h" - -namespace tigl -{ -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} - - -bool CCPACSMaterialDefinition::isComposite() const -{ - if (m_compositeUID_choice1) { - return true; - } else if (m_materialUID_choice2) { - return false; - } else { - throw CTiglError("Neither materialUID nor compositeUID specified", TIGL_ERROR); - } -} - -const std::string& CCPACSMaterialDefinition::GetUID() const -{ - if (isComposite()) - return *GetCompositeUID_choice1(); - else - return *GetMaterialUID_choice2(); -} - -void CCPACSMaterialDefinition::SetUID(const std::string& uid) -{ - if (isComposite()) - return SetCompositeUID_choice1(uid); - else - return SetMaterialUID_choice2(uid); -} - -} // namespace tigl +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2013-05-28 Martin Siggel +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "CCPACSMaterialDefinition.h" + +#include "CTiglError.h" + +namespace tigl +{ +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} + + +bool CCPACSMaterialDefinition::isComposite() const +{ + if (m_compositeUID_choice1) { + return true; + } else if (m_materialUID_choice2) { + return false; + } else { + throw CTiglError("Neither materialUID nor compositeUID specified", TIGL_ERROR); + } +} + +const std::string& CCPACSMaterialDefinition::GetUID() const +{ + if (isComposite()) + return *GetCompositeUID_choice1(); + else + return *GetMaterialUID_choice2(); +} + +void CCPACSMaterialDefinition::SetUID(const std::string& uid) +{ + if (isComposite()) + return SetCompositeUID_choice1(uid); + else + return SetMaterialUID_choice2(uid); +} + +} // namespace tigl diff --git a/src/cpacs_other/CCPACSMaterialDefinition.h b/src/cpacs_other/CCPACSMaterialDefinition.h index 58de1219df..173260dfaf 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.h +++ b/src/cpacs_other/CCPACSMaterialDefinition.h @@ -1,52 +1,52 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2013-05-28 Martin Siggel -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef CCPACSMATERIAL_H -#define CCPACSMATERIAL_H - -#include "generated/CPACSMaterialDefinition.h" -#include -#include "tixi.h" -#include "tigl_internal.h" -#include "CTiglPoint.h" - -namespace tigl -{ - -class CCPACSMaterialDefinition : public generated::CPACSMaterialDefinition -{ -public: - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT bool isComposite() const; - - TIGL_EXPORT const std::string& GetUID() const; - - TIGL_EXPORT void SetUID(const std::string& uid); -}; - -} // namespace tigl - -#endif // CCPACSMATERIAL_H +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2013-05-28 Martin Siggel +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef CCPACSMATERIAL_H +#define CCPACSMATERIAL_H + +#include "generated/CPACSMaterialDefinition.h" +#include +#include "tixi.h" +#include "tigl_internal.h" +#include "CTiglPoint.h" + +namespace tigl +{ + +class CCPACSMaterialDefinition : public generated::CPACSMaterialDefinition +{ +public: + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT bool isComposite() const; + + TIGL_EXPORT const std::string& GetUID() const; + + TIGL_EXPORT void SetUID(const std::string& uid); +}; + +} // namespace tigl + +#endif // CCPACSMATERIAL_H diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp index e2232dbbd6..3bc2a2111e 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -1,89 +1,100 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS genericFuelTank handling routines. -*/ - -#include "CCPACSGenericFuelTank.h" -#include "CCPACSHull.h" -#include "CTiglError.h" -#include "CGroupShapes.h" - -namespace tigl -{ - -CCPACSGenericFuelTank::CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) - : generated::CPACSGenericFuelTank(parent, uidMgr) - , CTiglRelativelyPositionedComponent(GetParent()->GetParent()->GetParent(), &m_transformation) -{ -} - -CCPACSConfiguration& CCPACSGenericFuelTank::GetConfiguration() const -{ - return GetParent()->GetParent()->GetParent()->GetConfiguration(); -} - -std::string CCPACSGenericFuelTank::GetDefaultedUID() const -{ - return generated::CPACSGenericFuelTank::GetUID(); -} - -TiglGeometricComponentType CCPACSGenericFuelTank::GetComponentType() const -{ - return TIGL_COMPONENT_FUSELAGE_TANK; -} - -TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const -{ - // needs to be physical, so that transformation relative to parent works - return TIGL_INTENT_PHYSICAL; -} - -PNamedShape CCPACSGenericFuelTank::BuildLoft() const -{ - const auto& hulls = GetHulls().GetHulls(); - ListPNamedShape shapes; - - for (const auto& hull : hulls) { - auto loft = hull->GetLoft(); - shapes.push_back(loft); - } - - PNamedShape groupedShape = CGroupShapes(shapes); - - return groupedShape; -} - -std::string CCPACSGenericFuelTank::GetShortShapeName() const -{ - unsigned int findex = 0; - unsigned int i = 0; - - for (auto& t : GetParent()->GetGenericFuelTanks()) { - ++i; - if (GetUID() == t->GetUID()) { - findex = i; - std::stringstream shortName; - shortName << "D" << findex; - return shortName.str(); - } - } - return "UNKNOWN"; -} - -} //namespace tigl +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS genericFuelTank handling routines. +*/ + +#include "CCPACSGenericFuelTank.h" +#include "CCPACSHull.h" +#include "CTiglError.h" +#include "CGroupShapes.h" + +namespace tigl +{ + +CCPACSGenericFuelTank::CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) + : generated::CPACSGenericFuelTank(parent, uidMgr) + , CTiglRelativelyPositionedComponent(GetParent()->GetParent()->GetParent(), &m_transformation) +{ +} + +CCPACSConfiguration& CCPACSGenericFuelTank::GetConfiguration() const +{ + return GetParent()->GetParent()->GetParent()->GetConfiguration(); +} + +std::string CCPACSGenericFuelTank::GetDefaultedUID() const +{ + return generated::CPACSGenericFuelTank::GetUID(); +} + +TiglGeometricComponentType CCPACSGenericFuelTank::GetComponentType() const +{ + return TIGL_COMPONENT_FUSELAGE_TANK; +} + +TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const +{ + // needs to be physical, so that transformation relative to parent works + return TIGL_INTENT_PHYSICAL; +} + +PNamedShape CCPACSGenericFuelTank::BuildLoft() const +{ + if (GetTransformation().GetScaling()) { + LOG(WARNING) << "Scaling entries were found for tank \"" + GetName() + "\" (uID=\"" + GetUID() + + "\"). Currently TiGL only supports the translation of tanks, " + "while scaling of a tank is not applied to its hulls."; + } + if (GetTransformation().GetRotation()) { + LOG(WARNING) << "Rotation entries were found for tank \"" + GetName() + "\" (uID=\"" + GetUID() + + "\"). Currently TiGL only supports the translation of tanks, " + "while rotation of a tank is not applied to its hulls."; + } + + const auto& hulls = GetHulls().GetHulls(); + ListPNamedShape shapes; + + for (const auto& hull : hulls) { + auto loft = hull->GetLoft(); + shapes.push_back(loft); + } + + PNamedShape groupedShape = CGroupShapes(shapes); + + return groupedShape; +} + +std::string CCPACSGenericFuelTank::GetShortShapeName() const +{ + unsigned int findex = 0; + unsigned int i = 0; + + for (auto& t : GetParent()->GetGenericFuelTanks()) { + ++i; + if (GetUID() == t->GetUID()) { + findex = i; + std::stringstream shortName; + shortName << "D" << findex; + return shortName.str(); + } + } + return "UNKNOWN"; +} + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSGenericFuelTank.h index 3980032409..fd71a87187 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.h +++ b/src/fuelTanks/CCPACSGenericFuelTank.h @@ -1,49 +1,49 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS genericFuelTank handling routines. -*/ - -#pragma once - -#include "generated/CPACSGenericFuelTank.h" -#include "CTiglRelativelyPositionedComponent.h" -#include "CCPACSConfiguration.h" - -namespace tigl -{ - -class CCPACSGenericFuelTank : public generated::CPACSGenericFuelTank, public CTiglRelativelyPositionedComponent -{ -public: - TIGL_EXPORT CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; - - TIGL_EXPORT std::string GetDefaultedUID() const override; - TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; - TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; - -private: - PNamedShape BuildLoft() const override; - -private: - std::string GetShortShapeName() const; -}; - -} //namespace tigl +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS genericFuelTank handling routines. +*/ + +#pragma once + +#include "generated/CPACSGenericFuelTank.h" +#include "CTiglRelativelyPositionedComponent.h" +#include "CCPACSConfiguration.h" + +namespace tigl +{ + +class CCPACSGenericFuelTank : public generated::CPACSGenericFuelTank, public CTiglRelativelyPositionedComponent +{ +public: + TIGL_EXPORT CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + + TIGL_EXPORT std::string GetDefaultedUID() const override; + TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; + TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; + +private: + PNamedShape BuildLoft() const override; + +private: + std::string GetShortShapeName() const; +}; + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index beefe49fe8..cb40798f74 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -54,7 +54,7 @@ namespace tigl CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) : generated::CPACSHull(parent, uidMgr) - , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation) + , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation, true, true) { } @@ -332,8 +332,9 @@ void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const double polarOpeningRadius = m_domeType_choice2->GetIsotensoid_choice3().get_ptr()->GetPolarOpeningRadius(); if (polarOpeningRadius <= 0 || polarOpeningRadius >= cylinderRadius) { - throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of hull \"" + GetName() + "\" (uID=\"" + - GetUID() + "\") must be larger than 0 and smaller than the cylinder radius (" + + throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of hull \"" + + GetName() + "\" (uID=\"" + GetUID() + + "\") must be larger than 0 and smaller than the cylinder radius (" + std::to_string(cylinderRadius) + ")!"); } diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index b45ac139cb..bc7873d225 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -1,190 +1,190 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2010-08-13 Markus Litz -* Changed: $Id: CCPACSFuselageConnection.cpp 2641 2017-03-30 21:08:46Z bgruber $ -* -* Version: $Revision: 2641 $ -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS fuselage connection handling routines. -*/ - -#include "CTiglFuselageConnection.h" -#include "CTiglError.h" -#include "CCPACSFuselage.h" -#include "CCPACSDuct.h" -#include "CCPACSHull.h" -#include "CCPACSHulls.h" -#include "CCPACSGenericFuelTank.h" -#include "CCPACSFuselageSections.h" -#include "CCPACSFuselageSection.h" -#include "CCPACSFuselageSegment.h" -#include "CCPACSConfiguration.h" -#include - -namespace tigl -{ - -CTiglFuselageConnection::CTiglFuselageConnection() : elementUID(NULL), segment(NULL) {} - -// Constructor -CTiglFuselageConnection::CTiglFuselageConnection(const std::string& elementUID, CCPACSFuselageSegment* aSegment) - : elementUID(&elementUID), segment(aSegment) -{ - // find the corresponding section to this segment - int i = 0; - for (auto& section: GetParentComponentSections().GetSections()) { - ++i; - for (int j = 1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == elementUID) { - sectionUID = section->GetUID(); - sectionIndex = i; - elementIndex = j; - } - } - } -} - -// Returns the section index of this connection -const std::string& CTiglFuselageConnection::GetSectionUID() const -{ - return sectionUID; -} - -// Returns the section element index of this connection -const std::string& CTiglFuselageConnection::GetSectionElementUID() const -{ - return *elementUID; -} - - -// Returns the section index of this connection -int CTiglFuselageConnection::GetSectionIndex() const -{ - return sectionIndex; -} - -// Returns the section element index of this connection -int CTiglFuselageConnection::GetSectionElementIndex() const -{ - return elementIndex; -} - - -// Returns the fuselage profile referenced by this connection -CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() -{ - std::string profileUID; - - bool found = false; - for (auto& section: GetParentComponentSections().GetSections()) { - for (int j=1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == *elementUID ) { - CCPACSFuselageSectionElement& element = section->GetSectionElement(j); - profileUID = element.GetProfileUID(); - found = true; - break; - } - } - if ( found ) { - break; - } - } - CCPACSConfiguration const& config = segment->GetParent()->GetConfiguration(); - - return (config.GetFuselageProfile(profileUID)); -} - -const CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() const { - return const_cast(*this).GetProfile(); -} - -// Returns the positioning transformation for the referenced section -boost::optional CTiglFuselageConnection::GetPositioningTransformation() const -{ - boost::optional ret; - if (GetParentComponentPositionings()) { - ret = GetParentComponentPositionings()->GetPositioningTransformation(sectionUID); - } - return ret; -} - -// Returns the section matrix referenced by this connection -CTiglTransformation CTiglFuselageConnection::GetSectionTransformation() const -{ - CTiglTransformation transformation; - - for (auto& section: GetParentComponentSections().GetSections()) { - for (int j = 1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == *elementUID) { - transformation = section->GetSectionTransformation(); - } - } - } - return transformation; -} - -// Returns the section element matrix referenced by this connection -CTiglTransformation CTiglFuselageConnection::GetSectionElementTransformation() const -{ - CTiglTransformation transformation; - - for (auto& section: GetParentComponentSections().GetSections()) { - for (int j = 1; j <= section->GetSectionElementCount(); j++) { - if (section->GetSectionElement(j).GetUID() == *elementUID) { - CCPACSFuselageSectionElement& element = section->GetSectionElement(j); - transformation = element.GetSectionElementTransformation(); - } - } - } - return transformation; -} - -CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSections() const -{ - if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections(); - } - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections(); - } - // ToDo: add exception handling - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections_choice1().get(); - } - else { - throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); - } -} - -boost::optional& CTiglFuselageConnection::GetParentComponentPositionings() const -{ - if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetPositionings(); - } - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetPositionings(); - } - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetPositionings(); - } - else { - throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); - } -} - -} // end namespace tigl +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2010-08-13 Markus Litz +* Changed: $Id: CCPACSFuselageConnection.cpp 2641 2017-03-30 21:08:46Z bgruber $ +* +* Version: $Revision: 2641 $ +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS fuselage connection handling routines. +*/ + +#include "CTiglFuselageConnection.h" +#include "CTiglError.h" +#include "CCPACSFuselage.h" +#include "CCPACSDuct.h" +#include "CCPACSHull.h" +#include "CCPACSHulls.h" +#include "CCPACSGenericFuelTank.h" +#include "CCPACSFuselageSections.h" +#include "CCPACSFuselageSection.h" +#include "CCPACSFuselageSegment.h" +#include "CCPACSConfiguration.h" +#include + +namespace tigl +{ + +CTiglFuselageConnection::CTiglFuselageConnection() : elementUID(NULL), segment(NULL) {} + +// Constructor +CTiglFuselageConnection::CTiglFuselageConnection(const std::string& elementUID, CCPACSFuselageSegment* aSegment) + : elementUID(&elementUID), segment(aSegment) +{ + // find the corresponding section to this segment + int i = 0; + for (auto& section: GetParentComponentSections().GetSections()) { + ++i; + for (int j = 1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == elementUID) { + sectionUID = section->GetUID(); + sectionIndex = i; + elementIndex = j; + } + } + } +} + +// Returns the section index of this connection +const std::string& CTiglFuselageConnection::GetSectionUID() const +{ + return sectionUID; +} + +// Returns the section element index of this connection +const std::string& CTiglFuselageConnection::GetSectionElementUID() const +{ + return *elementUID; +} + + +// Returns the section index of this connection +int CTiglFuselageConnection::GetSectionIndex() const +{ + return sectionIndex; +} + +// Returns the section element index of this connection +int CTiglFuselageConnection::GetSectionElementIndex() const +{ + return elementIndex; +} + + +// Returns the fuselage profile referenced by this connection +CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() +{ + std::string profileUID; + + bool found = false; + for (auto& section: GetParentComponentSections().GetSections()) { + for (int j=1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == *elementUID ) { + CCPACSFuselageSectionElement& element = section->GetSectionElement(j); + profileUID = element.GetProfileUID(); + found = true; + break; + } + } + if ( found ) { + break; + } + } + CCPACSConfiguration const& config = segment->GetParent()->GetConfiguration(); + + return (config.GetFuselageProfile(profileUID)); +} + +const CCPACSFuselageProfile& CTiglFuselageConnection::GetProfile() const { + return const_cast(*this).GetProfile(); +} + +// Returns the positioning transformation for the referenced section +boost::optional CTiglFuselageConnection::GetPositioningTransformation() const +{ + boost::optional ret; + if (GetParentComponentPositionings()) { + ret = GetParentComponentPositionings()->GetPositioningTransformation(sectionUID); + } + return ret; +} + +// Returns the section matrix referenced by this connection +CTiglTransformation CTiglFuselageConnection::GetSectionTransformation() const +{ + CTiglTransformation transformation; + + for (auto& section: GetParentComponentSections().GetSections()) { + for (int j = 1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == *elementUID) { + transformation = section->GetSectionTransformation(); + } + } + } + return transformation; +} + +// Returns the section element matrix referenced by this connection +CTiglTransformation CTiglFuselageConnection::GetSectionElementTransformation() const +{ + CTiglTransformation transformation; + + for (auto& section: GetParentComponentSections().GetSections()) { + for (int j = 1; j <= section->GetSectionElementCount(); j++) { + if (section->GetSectionElement(j).GetUID() == *elementUID) { + CCPACSFuselageSectionElement& element = section->GetSectionElement(j); + transformation = element.GetSectionElementTransformation(); + } + } + } + return transformation; +} + +CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSections() const +{ + if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections(); + } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections(); + } + // ToDo: add exception handling + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections_choice1().get(); + } + else { + throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); + } +} + +boost::optional& CTiglFuselageConnection::GetParentComponentPositionings() const +{ + if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetPositionings(); + } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetPositionings(); + } + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetPositionings(); + } + else { + throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); + } +} + +} // end namespace tigl diff --git a/src/generated/CPACSDomeType.cpp b/src/generated/CPACSDomeType.cpp index 1f58c168c5..87e3b0f1df 100644 --- a/src/generated/CPACSDomeType.cpp +++ b/src/generated/CPACSDomeType.cpp @@ -1,250 +1,250 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSHull.h" -#include "CPACSDomeType.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSDomeType::CPACSDomeType(CCPACSHull* parent) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSDomeType::~CPACSDomeType() - { - } - - const CCPACSHull* CPACSDomeType::GetParent() const - { - return m_parent; - } - - CCPACSHull* CPACSDomeType::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSDomeType::GetNextUIDParent() const - { - return m_parent; - } - - CTiglUIDObject* CPACSDomeType::GetNextUIDParent() - { - return m_parent; - } - - void CPACSDomeType::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read element ellipsoid - if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { - m_ellipsoid_choice1 = boost::in_place(this); - try { - m_ellipsoid_choice1->ReadCPACS(tixiHandle, xpath + "/ellipsoid"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read ellipsoid at xpath " << xpath << ": " << e.what(); - m_ellipsoid_choice1 = boost::none; - } - } - - // read element torispherical - if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { - m_torispherical_choice2 = boost::in_place(this); - try { - m_torispherical_choice2->ReadCPACS(tixiHandle, xpath + "/torispherical"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read torispherical at xpath " << xpath << ": " << e.what(); - m_torispherical_choice2 = boost::none; - } - } - - // read element isotensoid - if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { - m_isotensoid_choice3 = boost::in_place(this); - try { - m_isotensoid_choice3->ReadCPACS(tixiHandle, xpath + "/isotensoid"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read isotensoid at xpath " << xpath << ": " << e.what(); - m_isotensoid_choice3 = boost::none; - } - } - - if (!ValidateChoices()) { - LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; - } - } - - void CPACSDomeType::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write element ellipsoid - if (m_ellipsoid_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/ellipsoid"); - m_ellipsoid_choice1->WriteCPACS(tixiHandle, xpath + "/ellipsoid"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/ellipsoid"); - } - } - - // write element torispherical - if (m_torispherical_choice2) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/torispherical"); - m_torispherical_choice2->WriteCPACS(tixiHandle, xpath + "/torispherical"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/torispherical"); - } - } - - // write element isotensoid - if (m_isotensoid_choice3) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/isotensoid"); - m_isotensoid_choice3->WriteCPACS(tixiHandle, xpath + "/isotensoid"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/isotensoid"); - } - } - - } - - bool CPACSDomeType::ValidateChoices() const - { - return - ( - ( - ( - // mandatory elements of this choice must be there - m_ellipsoid_choice1.is_initialized() - && - // elements of other choices must not be there - !( - m_torispherical_choice2.is_initialized() - || - m_isotensoid_choice3.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_torispherical_choice2.is_initialized() - && - // elements of other choices must not be there - !( - m_ellipsoid_choice1.is_initialized() - || - m_isotensoid_choice3.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_isotensoid_choice3.is_initialized() - && - // elements of other choices must not be there - !( - m_ellipsoid_choice1.is_initialized() - || - m_torispherical_choice2.is_initialized() - ) - ) - == 1 - ) - ) - ; - } - - const boost::optional& CPACSDomeType::GetEllipsoid_choice1() const - { - return m_ellipsoid_choice1; - } - - boost::optional& CPACSDomeType::GetEllipsoid_choice1() - { - return m_ellipsoid_choice1; - } - - const boost::optional& CPACSDomeType::GetTorispherical_choice2() const - { - return m_torispherical_choice2; - } - - boost::optional& CPACSDomeType::GetTorispherical_choice2() - { - return m_torispherical_choice2; - } - - const boost::optional& CPACSDomeType::GetIsotensoid_choice3() const - { - return m_isotensoid_choice3; - } - - boost::optional& CPACSDomeType::GetIsotensoid_choice3() - { - return m_isotensoid_choice3; - } - - CPACSEllipsoidDome& CPACSDomeType::GetEllipsoid_choice1(CreateIfNotExistsTag) - { - if (!m_ellipsoid_choice1) - m_ellipsoid_choice1 = boost::in_place(this); - return *m_ellipsoid_choice1; - } - - void CPACSDomeType::RemoveEllipsoid_choice1() - { - m_ellipsoid_choice1 = boost::none; - } - - CPACSTorisphericalDome& CPACSDomeType::GetTorispherical_choice2(CreateIfNotExistsTag) - { - if (!m_torispherical_choice2) - m_torispherical_choice2 = boost::in_place(this); - return *m_torispherical_choice2; - } - - void CPACSDomeType::RemoveTorispherical_choice2() - { - m_torispherical_choice2 = boost::none; - } - - CPACSIsotensoidDome& CPACSDomeType::GetIsotensoid_choice3(CreateIfNotExistsTag) - { - if (!m_isotensoid_choice3) - m_isotensoid_choice3 = boost::in_place(this); - return *m_isotensoid_choice3; - } - - void CPACSDomeType::RemoveIsotensoid_choice3() - { - m_isotensoid_choice3 = boost::none; - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSHull.h" +#include "CPACSDomeType.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDomeType::CPACSDomeType(CCPACSHull* parent) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSDomeType::~CPACSDomeType() + { + } + + const CCPACSHull* CPACSDomeType::GetParent() const + { + return m_parent; + } + + CCPACSHull* CPACSDomeType::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSDomeType::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSDomeType::GetNextUIDParent() + { + return m_parent; + } + + void CPACSDomeType::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element ellipsoid + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { + m_ellipsoid_choice1 = boost::in_place(this); + try { + m_ellipsoid_choice1->ReadCPACS(tixiHandle, xpath + "/ellipsoid"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read ellipsoid at xpath " << xpath << ": " << e.what(); + m_ellipsoid_choice1 = boost::none; + } + } + + // read element torispherical + if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { + m_torispherical_choice2 = boost::in_place(this); + try { + m_torispherical_choice2->ReadCPACS(tixiHandle, xpath + "/torispherical"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read torispherical at xpath " << xpath << ": " << e.what(); + m_torispherical_choice2 = boost::none; + } + } + + // read element isotensoid + if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { + m_isotensoid_choice3 = boost::in_place(this); + try { + m_isotensoid_choice3->ReadCPACS(tixiHandle, xpath + "/isotensoid"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read isotensoid at xpath " << xpath << ": " << e.what(); + m_isotensoid_choice3 = boost::none; + } + } + + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSDomeType::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element ellipsoid + if (m_ellipsoid_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/ellipsoid"); + m_ellipsoid_choice1->WriteCPACS(tixiHandle, xpath + "/ellipsoid"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/ellipsoid"); + } + } + + // write element torispherical + if (m_torispherical_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/torispherical"); + m_torispherical_choice2->WriteCPACS(tixiHandle, xpath + "/torispherical"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/torispherical"); + } + } + + // write element isotensoid + if (m_isotensoid_choice3) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/isotensoid"); + m_isotensoid_choice3->WriteCPACS(tixiHandle, xpath + "/isotensoid"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/isotensoid"); + } + } + + } + + bool CPACSDomeType::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_ellipsoid_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_torispherical_choice2.is_initialized() + || + m_isotensoid_choice3.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_torispherical_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_ellipsoid_choice1.is_initialized() + || + m_isotensoid_choice3.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_isotensoid_choice3.is_initialized() + && + // elements of other choices must not be there + !( + m_ellipsoid_choice1.is_initialized() + || + m_torispherical_choice2.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const boost::optional& CPACSDomeType::GetEllipsoid_choice1() const + { + return m_ellipsoid_choice1; + } + + boost::optional& CPACSDomeType::GetEllipsoid_choice1() + { + return m_ellipsoid_choice1; + } + + const boost::optional& CPACSDomeType::GetTorispherical_choice2() const + { + return m_torispherical_choice2; + } + + boost::optional& CPACSDomeType::GetTorispherical_choice2() + { + return m_torispherical_choice2; + } + + const boost::optional& CPACSDomeType::GetIsotensoid_choice3() const + { + return m_isotensoid_choice3; + } + + boost::optional& CPACSDomeType::GetIsotensoid_choice3() + { + return m_isotensoid_choice3; + } + + CPACSEllipsoidDome& CPACSDomeType::GetEllipsoid_choice1(CreateIfNotExistsTag) + { + if (!m_ellipsoid_choice1) + m_ellipsoid_choice1 = boost::in_place(this); + return *m_ellipsoid_choice1; + } + + void CPACSDomeType::RemoveEllipsoid_choice1() + { + m_ellipsoid_choice1 = boost::none; + } + + CPACSTorisphericalDome& CPACSDomeType::GetTorispherical_choice2(CreateIfNotExistsTag) + { + if (!m_torispherical_choice2) + m_torispherical_choice2 = boost::in_place(this); + return *m_torispherical_choice2; + } + + void CPACSDomeType::RemoveTorispherical_choice2() + { + m_torispherical_choice2 = boost::none; + } + + CPACSIsotensoidDome& CPACSDomeType::GetIsotensoid_choice3(CreateIfNotExistsTag) + { + if (!m_isotensoid_choice3) + m_isotensoid_choice3 = boost::in_place(this); + return *m_isotensoid_choice3; + } + + void CPACSDomeType::RemoveIsotensoid_choice3() + { + m_isotensoid_choice3 = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDomeType.h b/src/generated/CPACSDomeType.h index de6063dea3..e9d8f3bfe1 100644 --- a/src/generated/CPACSDomeType.h +++ b/src/generated/CPACSDomeType.h @@ -1,99 +1,99 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include "CPACSEllipsoidDome.h" -#include "CPACSIsotensoidDome.h" -#include "CPACSTorisphericalDome.h" -#include "CreateIfNotExists.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDObject; -class CCPACSHull; - -namespace generated -{ - // This class is used in: - // CPACSHull - - /// @brief Dome Type - /// - /// - /// - class CPACSDomeType - { - public: - TIGL_EXPORT CPACSDomeType(CCPACSHull* parent); - - TIGL_EXPORT virtual ~CPACSDomeType(); - - TIGL_EXPORT CCPACSHull* GetParent(); - - TIGL_EXPORT const CCPACSHull* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT bool ValidateChoices() const; - - TIGL_EXPORT virtual const boost::optional& GetEllipsoid_choice1() const; - TIGL_EXPORT virtual boost::optional& GetEllipsoid_choice1(); - - TIGL_EXPORT virtual const boost::optional& GetTorispherical_choice2() const; - TIGL_EXPORT virtual boost::optional& GetTorispherical_choice2(); - - TIGL_EXPORT virtual const boost::optional& GetIsotensoid_choice3() const; - TIGL_EXPORT virtual boost::optional& GetIsotensoid_choice3(); - - TIGL_EXPORT virtual CPACSEllipsoidDome& GetEllipsoid_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveEllipsoid_choice1(); - - TIGL_EXPORT virtual CPACSTorisphericalDome& GetTorispherical_choice2(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveTorispherical_choice2(); - - TIGL_EXPORT virtual CPACSIsotensoidDome& GetIsotensoid_choice3(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveIsotensoid_choice3(); - - protected: - CCPACSHull* m_parent; - - boost::optional m_ellipsoid_choice1; - boost::optional m_torispherical_choice2; - boost::optional m_isotensoid_choice3; - - private: - CPACSDomeType(const CPACSDomeType&) = delete; - CPACSDomeType& operator=(const CPACSDomeType&) = delete; - - CPACSDomeType(CPACSDomeType&&) = delete; - CPACSDomeType& operator=(CPACSDomeType&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSDomeType = generated::CPACSDomeType; -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CPACSEllipsoidDome.h" +#include "CPACSIsotensoidDome.h" +#include "CPACSTorisphericalDome.h" +#include "CreateIfNotExists.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; +class CCPACSHull; + +namespace generated +{ + // This class is used in: + // CPACSHull + + /// @brief Dome Type + /// + /// + /// + class CPACSDomeType + { + public: + TIGL_EXPORT CPACSDomeType(CCPACSHull* parent); + + TIGL_EXPORT virtual ~CPACSDomeType(); + + TIGL_EXPORT CCPACSHull* GetParent(); + + TIGL_EXPORT const CCPACSHull* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const boost::optional& GetEllipsoid_choice1() const; + TIGL_EXPORT virtual boost::optional& GetEllipsoid_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetTorispherical_choice2() const; + TIGL_EXPORT virtual boost::optional& GetTorispherical_choice2(); + + TIGL_EXPORT virtual const boost::optional& GetIsotensoid_choice3() const; + TIGL_EXPORT virtual boost::optional& GetIsotensoid_choice3(); + + TIGL_EXPORT virtual CPACSEllipsoidDome& GetEllipsoid_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveEllipsoid_choice1(); + + TIGL_EXPORT virtual CPACSTorisphericalDome& GetTorispherical_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveTorispherical_choice2(); + + TIGL_EXPORT virtual CPACSIsotensoidDome& GetIsotensoid_choice3(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveIsotensoid_choice3(); + + protected: + CCPACSHull* m_parent; + + boost::optional m_ellipsoid_choice1; + boost::optional m_torispherical_choice2; + boost::optional m_isotensoid_choice3; + + private: + CPACSDomeType(const CPACSDomeType&) = delete; + CPACSDomeType& operator=(const CPACSDomeType&) = delete; + + CPACSDomeType(CPACSDomeType&&) = delete; + CPACSDomeType& operator=(CPACSDomeType&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDomeType = generated::CPACSDomeType; +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTank.cpp b/src/generated/CPACSGenericFuelTank.cpp index 9acc2be3f7..b1cae30de0 100644 --- a/src/generated/CPACSGenericFuelTank.cpp +++ b/src/generated/CPACSGenericFuelTank.cpp @@ -1,298 +1,298 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSGenericFuelTanks.h" -#include "CPACSGenericFuelTank.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSGenericFuelTank::CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - , m_transformation(reinterpret_cast(this), m_uidMgr) - , m_hulls(reinterpret_cast(this), m_uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSGenericFuelTank::~CPACSGenericFuelTank() - { - if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); - } - - const CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() const - { - return m_parent; - } - - CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSGenericFuelTank::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read attribute uID - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { - m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); - if (m_uID.empty()) { - LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; - } - - // read element name - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); - if (m_name.empty()) { - LOG(WARNING) << "Required element name is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required element name is missing at xpath " << xpath; - } - - // read element description - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); - if (m_description->empty()) { - LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; - } - } - - // read element transformation - if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { - m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); - } - else { - LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; - } - - // read element hulls - if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { - m_hulls.ReadCPACS(tixiHandle, xpath + "/hulls"); - } - else { - LOG(ERROR) << "Required element hulls is missing at xpath " << xpath; - } - - // read element volume - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - m_volume = boost::in_place(reinterpret_cast(this)); - try { - m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); - m_volume = boost::none; - } - } - - // read element burstPressure - if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { - m_burstPressure = tixi::TixiGetElement(tixiHandle, xpath + "/burstPressure"); - } - - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); - } - - void CPACSGenericFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - const std::vector childElemOrder = { "name", "description", "transformation", "hulls", "volume", "burstPressure" }; - - // write attribute uID - tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); - - // write element name - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); - - // write element description - if (m_description) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); - } - } - - // write element transformation - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); - m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); - - // write element hulls - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); - m_hulls.WriteCPACS(tixiHandle, xpath + "/hulls"); - - // write element volume - if (m_volume) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); - m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); - } - } - - // write element burstPressure - if (m_burstPressure) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/burstPressure", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/burstPressure", *m_burstPressure); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/burstPressure"); - } - } - - } - - const std::string& CPACSGenericFuelTank::GetUID() const - { - return m_uID; - } - - void CPACSGenericFuelTank::SetUID(const std::string& value) - { - if (m_uidMgr && value != m_uID) { - if (m_uID.empty()) { - m_uidMgr->RegisterObject(value, *this); - } - else { - m_uidMgr->UpdateObjectUID(m_uID, value); - } - } - m_uID = value; - } - - const std::string& CPACSGenericFuelTank::GetName() const - { - return m_name; - } - - void CPACSGenericFuelTank::SetName(const std::string& value) - { - m_name = value; - } - - const boost::optional& CPACSGenericFuelTank::GetDescription() const - { - return m_description; - } - - void CPACSGenericFuelTank::SetDescription(const boost::optional& value) - { - m_description = value; - } - - const CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() const - { - return m_transformation; - } - - CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() - { - return m_transformation; - } - - const CCPACSHulls& CPACSGenericFuelTank::GetHulls() const - { - return m_hulls; - } - - CCPACSHulls& CPACSGenericFuelTank::GetHulls() - { - return m_hulls; - } - - const boost::optional& CPACSGenericFuelTank::GetVolume() const - { - return m_volume; - } - - boost::optional& CPACSGenericFuelTank::GetVolume() - { - return m_volume; - } - - const boost::optional& CPACSGenericFuelTank::GetBurstPressure() const - { - return m_burstPressure; - } - - void CPACSGenericFuelTank::SetBurstPressure(const boost::optional& value) - { - m_burstPressure = value; - } - - CPACSFuelTankVolume& CPACSGenericFuelTank::GetVolume(CreateIfNotExistsTag) - { - if (!m_volume) - m_volume = boost::in_place(reinterpret_cast(this)); - return *m_volume; - } - - void CPACSGenericFuelTank::RemoveVolume() - { - m_volume = boost::none; - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSGenericFuelTanks.h" +#include "CPACSGenericFuelTank.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGenericFuelTank::CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_transformation(reinterpret_cast(this), m_uidMgr) + , m_hulls(reinterpret_cast(this), m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGenericFuelTank::~CPACSGenericFuelTank() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() const + { + return m_parent; + } + + CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGenericFuelTank::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + + // read element hulls + if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { + m_hulls.ReadCPACS(tixiHandle, xpath + "/hulls"); + } + else { + LOG(ERROR) << "Required element hulls is missing at xpath " << xpath; + } + + // read element volume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + m_volume = boost::in_place(reinterpret_cast(this)); + try { + m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); + m_volume = boost::none; + } + } + + // read element burstPressure + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + m_burstPressure = tixi::TixiGetElement(tixiHandle, xpath + "/burstPressure"); + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSGenericFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + const std::vector childElemOrder = { "name", "description", "transformation", "hulls", "volume", "burstPressure" }; + + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element transformation + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + + // write element hulls + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); + m_hulls.WriteCPACS(tixiHandle, xpath + "/hulls"); + + // write element volume + if (m_volume) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); + m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); + } + } + + // write element burstPressure + if (m_burstPressure) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/burstPressure", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/burstPressure", *m_burstPressure); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/burstPressure"); + } + } + + } + + const std::string& CPACSGenericFuelTank::GetUID() const + { + return m_uID; + } + + void CPACSGenericFuelTank::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const std::string& CPACSGenericFuelTank::GetName() const + { + return m_name; + } + + void CPACSGenericFuelTank::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSGenericFuelTank::GetDescription() const + { + return m_description; + } + + void CPACSGenericFuelTank::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() + { + return m_transformation; + } + + const CCPACSHulls& CPACSGenericFuelTank::GetHulls() const + { + return m_hulls; + } + + CCPACSHulls& CPACSGenericFuelTank::GetHulls() + { + return m_hulls; + } + + const boost::optional& CPACSGenericFuelTank::GetVolume() const + { + return m_volume; + } + + boost::optional& CPACSGenericFuelTank::GetVolume() + { + return m_volume; + } + + const boost::optional& CPACSGenericFuelTank::GetBurstPressure() const + { + return m_burstPressure; + } + + void CPACSGenericFuelTank::SetBurstPressure(const boost::optional& value) + { + m_burstPressure = value; + } + + CPACSFuelTankVolume& CPACSGenericFuelTank::GetVolume(CreateIfNotExistsTag) + { + if (!m_volume) + m_volume = boost::in_place(reinterpret_cast(this)); + return *m_volume; + } + + void CPACSGenericFuelTank::RemoveVolume() + { + m_volume = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTank.h b/src/generated/CPACSGenericFuelTank.h index dd43b43b68..07a4f56c2e 100644 --- a/src/generated/CPACSGenericFuelTank.h +++ b/src/generated/CPACSGenericFuelTank.h @@ -1,121 +1,121 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include "CPACSFuelTankVolume.h" -#include "CreateIfNotExists.h" -#include "CTiglUIDObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; -class CCPACSGenericFuelTanks; - -namespace generated -{ - // This class is used in: - // CPACSGenericFuelTanks - - /// @brief Cryogenic tank - /// - /// - class CPACSGenericFuelTank : public CTiglReqUIDObject - { - public: - TIGL_EXPORT CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSGenericFuelTank(); - - TIGL_EXPORT CCPACSGenericFuelTanks* GetParent(); - - TIGL_EXPORT const CCPACSGenericFuelTanks* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT virtual const std::string& GetUID() const; - TIGL_EXPORT virtual void SetUID(const std::string& value); - - TIGL_EXPORT virtual const std::string& GetName() const; - TIGL_EXPORT virtual void SetName(const std::string& value); - - TIGL_EXPORT virtual const boost::optional& GetDescription() const; - TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - - TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; - TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - - TIGL_EXPORT virtual const CCPACSHulls& GetHulls() const; - TIGL_EXPORT virtual CCPACSHulls& GetHulls(); - - TIGL_EXPORT virtual const boost::optional& GetVolume() const; - TIGL_EXPORT virtual boost::optional& GetVolume(); - - TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; - TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); - - TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveVolume(); - - protected: - CCPACSGenericFuelTanks* m_parent; - - CTiglUIDManager* m_uidMgr; - - std::string m_uID; - - /// Name - std::string m_name; - - /// Description - boost::optional m_description; - - CCPACSTransformation m_transformation; - - CCPACSHulls m_hulls; - - /// Volume - boost::optional m_volume; - - /// Burst pressure - boost::optional m_burstPressure; - - private: - CPACSGenericFuelTank(const CPACSGenericFuelTank&) = delete; - CPACSGenericFuelTank& operator=(const CPACSGenericFuelTank&) = delete; - - CPACSGenericFuelTank(CPACSGenericFuelTank&&) = delete; - CPACSGenericFuelTank& operator=(CPACSGenericFuelTank&&) = delete; - }; -} // namespace generated - -// CPACSGenericFuelTank is customized, use type CCPACSGenericFuelTank directly -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include "CPACSFuelTankVolume.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CCPACSGenericFuelTanks; + +namespace generated +{ + // This class is used in: + // CPACSGenericFuelTanks + + /// @brief Cryogenic tank + /// + /// + class CPACSGenericFuelTank : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGenericFuelTank(); + + TIGL_EXPORT CCPACSGenericFuelTanks* GetParent(); + + TIGL_EXPORT const CCPACSGenericFuelTanks* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + + TIGL_EXPORT virtual const CCPACSHulls& GetHulls() const; + TIGL_EXPORT virtual CCPACSHulls& GetHulls(); + + TIGL_EXPORT virtual const boost::optional& GetVolume() const; + TIGL_EXPORT virtual boost::optional& GetVolume(); + + TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; + TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); + + TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveVolume(); + + protected: + CCPACSGenericFuelTanks* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + CCPACSTransformation m_transformation; + + CCPACSHulls m_hulls; + + /// Volume + boost::optional m_volume; + + /// Burst pressure + boost::optional m_burstPressure; + + private: + CPACSGenericFuelTank(const CPACSGenericFuelTank&) = delete; + CPACSGenericFuelTank& operator=(const CPACSGenericFuelTank&) = delete; + + CPACSGenericFuelTank(CPACSGenericFuelTank&&) = delete; + CPACSGenericFuelTank& operator=(CPACSGenericFuelTank&&) = delete; + }; +} // namespace generated + +// CPACSGenericFuelTank is customized, use type CCPACSGenericFuelTank directly +} // namespace tigl diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSHull.cpp index 36c1075005..cd7d16c4d2 100644 --- a/src/generated/CPACSHull.cpp +++ b/src/generated/CPACSHull.cpp @@ -1,478 +1,478 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSHulls.h" -#include "CPACSHull.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSHull::CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - , m_transformation(reinterpret_cast(this), m_uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSHull::~CPACSHull() - { - if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); - } - - const CCPACSHulls* CPACSHull::GetParent() const - { - return m_parent; - } - - CCPACSHulls* CPACSHull::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSHull::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSHull::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDManager& CPACSHull::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSHull::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSHull::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read attribute uID - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { - m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); - if (m_uID.empty()) { - LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; - } - - // read element name - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); - if (m_name.empty()) { - LOG(WARNING) << "Required element name is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required element name is missing at xpath " << xpath; - } - - // read element description - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); - if (m_description->empty()) { - LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; - } - } - - // read element transformation - if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { - m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); - } - else { - LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; - } - - // read element sections - if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { - m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_sections_choice1->ReadCPACS(tixiHandle, xpath + "/sections"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read sections at xpath " << xpath << ": " << e.what(); - m_sections_choice1 = boost::none; - } - } - - // read element segments - if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { - m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_segments_choice1->ReadCPACS(tixiHandle, xpath + "/segments"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read segments at xpath " << xpath << ": " << e.what(); - m_segments_choice1 = boost::none; - } - } - - // read element cylinderRadius - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { - m_cylinderRadius_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); - } - - // read element cylinderLength - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { - m_cylinderLength_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderLength"); - } - - // read element domeType - if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { - m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); - try { - m_domeType_choice2->ReadCPACS(tixiHandle, xpath + "/domeType"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read domeType at xpath " << xpath << ": " << e.what(); - m_domeType_choice2 = boost::none; - } - } - - // read element structure - if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { - m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_structure->ReadCPACS(tixiHandle, xpath + "/structure"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read structure at xpath " << xpath << ": " << e.what(); - m_structure = boost::none; - } - } - - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); - if (!ValidateChoices()) { - LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; - } - } - - void CPACSHull::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure" }; - - // write attribute uID - tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); - - // write element name - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); - - // write element description - if (m_description) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); - } - } - - // write element transformation - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); - m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); - - // write element sections - if (m_sections_choice1) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/sections", childElemOrder); - m_sections_choice1->WriteCPACS(tixiHandle, xpath + "/sections"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/sections"); - } - } - - // write element segments - if (m_segments_choice1) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/segments", childElemOrder); - m_segments_choice1->WriteCPACS(tixiHandle, xpath + "/segments"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/segments"); - } - } - - // write element cylinderRadius - if (m_cylinderRadius_choice2) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderRadius", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", *m_cylinderRadius_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderRadius"); - } - } - - // write element cylinderLength - if (m_cylinderLength_choice2) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderLength", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderLength", *m_cylinderLength_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderLength"); - } - } - - // write element domeType - if (m_domeType_choice2) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/domeType", childElemOrder); - m_domeType_choice2->WriteCPACS(tixiHandle, xpath + "/domeType"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/domeType"); - } - } - - // write element structure - if (m_structure) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/structure", childElemOrder); - m_structure->WriteCPACS(tixiHandle, xpath + "/structure"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/structure"); - } - } - - } - - bool CPACSHull::ValidateChoices() const - { - return - ( - ( - ( - // mandatory elements of this choice must be there - m_sections_choice1.is_initialized() - && - m_segments_choice1.is_initialized() - && - // elements of other choices must not be there - !( - m_cylinderRadius_choice2.is_initialized() - || - m_cylinderLength_choice2.is_initialized() - || - m_domeType_choice2.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_cylinderRadius_choice2.is_initialized() - && - m_cylinderLength_choice2.is_initialized() - && - m_domeType_choice2.is_initialized() - && - // elements of other choices must not be there - !( - m_sections_choice1.is_initialized() - || - m_segments_choice1.is_initialized() - ) - ) - == 1 - ) - ) - ; - } - - const std::string& CPACSHull::GetUID() const - { - return m_uID; - } - - void CPACSHull::SetUID(const std::string& value) - { - if (m_uidMgr && value != m_uID) { - if (m_uID.empty()) { - m_uidMgr->RegisterObject(value, *this); - } - else { - m_uidMgr->UpdateObjectUID(m_uID, value); - } - } - m_uID = value; - } - - const std::string& CPACSHull::GetName() const - { - return m_name; - } - - void CPACSHull::SetName(const std::string& value) - { - m_name = value; - } - - const boost::optional& CPACSHull::GetDescription() const - { - return m_description; - } - - void CPACSHull::SetDescription(const boost::optional& value) - { - m_description = value; - } - - const CCPACSTransformation& CPACSHull::GetTransformation() const - { - return m_transformation; - } - - CCPACSTransformation& CPACSHull::GetTransformation() - { - return m_transformation; - } - - const boost::optional& CPACSHull::GetSections_choice1() const - { - return m_sections_choice1; - } - - boost::optional& CPACSHull::GetSections_choice1() - { - return m_sections_choice1; - } - - const boost::optional& CPACSHull::GetSegments_choice1() const - { - return m_segments_choice1; - } - - boost::optional& CPACSHull::GetSegments_choice1() - { - return m_segments_choice1; - } - - const boost::optional& CPACSHull::GetCylinderRadius_choice2() const - { - return m_cylinderRadius_choice2; - } - - void CPACSHull::SetCylinderRadius_choice2(const boost::optional& value) - { - m_cylinderRadius_choice2 = value; - } - - const boost::optional& CPACSHull::GetCylinderLength_choice2() const - { - return m_cylinderLength_choice2; - } - - void CPACSHull::SetCylinderLength_choice2(const boost::optional& value) - { - m_cylinderLength_choice2 = value; - } - - const boost::optional& CPACSHull::GetDomeType_choice2() const - { - return m_domeType_choice2; - } - - boost::optional& CPACSHull::GetDomeType_choice2() - { - return m_domeType_choice2; - } - - const boost::optional& CPACSHull::GetStructure() const - { - return m_structure; - } - - boost::optional& CPACSHull::GetStructure() - { - return m_structure; - } - - CCPACSFuselageSections& CPACSHull::GetSections_choice1(CreateIfNotExistsTag) - { - if (!m_sections_choice1) - m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_sections_choice1; - } - - void CPACSHull::RemoveSections_choice1() - { - m_sections_choice1 = boost::none; - } - - CCPACSFuselageSegments& CPACSHull::GetSegments_choice1(CreateIfNotExistsTag) - { - if (!m_segments_choice1) - m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_segments_choice1; - } - - void CPACSHull::RemoveSegments_choice1() - { - m_segments_choice1 = boost::none; - } - - CPACSDomeType& CPACSHull::GetDomeType_choice2(CreateIfNotExistsTag) - { - if (!m_domeType_choice2) - m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); - return *m_domeType_choice2; - } - - void CPACSHull::RemoveDomeType_choice2() - { - m_domeType_choice2 = boost::none; - } - - CCPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) - { - if (!m_structure) - m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_structure; - } - - void CPACSHull::RemoveStructure() - { - m_structure = boost::none; - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSHulls.h" +#include "CPACSHull.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSHull::CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_transformation(reinterpret_cast(this), m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSHull::~CPACSHull() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CCPACSHulls* CPACSHull::GetParent() const + { + return m_parent; + } + + CCPACSHulls* CPACSHull::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSHull::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSHull::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSHull::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSHull::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSHull::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + + // read element sections + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_sections_choice1->ReadCPACS(tixiHandle, xpath + "/sections"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read sections at xpath " << xpath << ": " << e.what(); + m_sections_choice1 = boost::none; + } + } + + // read element segments + if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_segments_choice1->ReadCPACS(tixiHandle, xpath + "/segments"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read segments at xpath " << xpath << ": " << e.what(); + m_segments_choice1 = boost::none; + } + } + + // read element cylinderRadius + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { + m_cylinderRadius_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); + } + + // read element cylinderLength + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { + m_cylinderLength_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderLength"); + } + + // read element domeType + if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + try { + m_domeType_choice2->ReadCPACS(tixiHandle, xpath + "/domeType"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read domeType at xpath " << xpath << ": " << e.what(); + m_domeType_choice2 = boost::none; + } + } + + // read element structure + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_structure->ReadCPACS(tixiHandle, xpath + "/structure"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read structure at xpath " << xpath << ": " << e.what(); + m_structure = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSHull::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure" }; + + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element transformation + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + + // write element sections + if (m_sections_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/sections", childElemOrder); + m_sections_choice1->WriteCPACS(tixiHandle, xpath + "/sections"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/sections"); + } + } + + // write element segments + if (m_segments_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/segments", childElemOrder); + m_segments_choice1->WriteCPACS(tixiHandle, xpath + "/segments"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/segments"); + } + } + + // write element cylinderRadius + if (m_cylinderRadius_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderRadius", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", *m_cylinderRadius_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderRadius"); + } + } + + // write element cylinderLength + if (m_cylinderLength_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderLength", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderLength", *m_cylinderLength_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderLength"); + } + } + + // write element domeType + if (m_domeType_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/domeType", childElemOrder); + m_domeType_choice2->WriteCPACS(tixiHandle, xpath + "/domeType"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/domeType"); + } + } + + // write element structure + if (m_structure) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/structure", childElemOrder); + m_structure->WriteCPACS(tixiHandle, xpath + "/structure"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/structure"); + } + } + + } + + bool CPACSHull::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_sections_choice1.is_initialized() + && + m_segments_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_cylinderRadius_choice2.is_initialized() + || + m_cylinderLength_choice2.is_initialized() + || + m_domeType_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_cylinderRadius_choice2.is_initialized() + && + m_cylinderLength_choice2.is_initialized() + && + m_domeType_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_sections_choice1.is_initialized() + || + m_segments_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const std::string& CPACSHull::GetUID() const + { + return m_uID; + } + + void CPACSHull::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const std::string& CPACSHull::GetName() const + { + return m_name; + } + + void CPACSHull::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSHull::GetDescription() const + { + return m_description; + } + + void CPACSHull::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const CCPACSTransformation& CPACSHull::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSHull::GetTransformation() + { + return m_transformation; + } + + const boost::optional& CPACSHull::GetSections_choice1() const + { + return m_sections_choice1; + } + + boost::optional& CPACSHull::GetSections_choice1() + { + return m_sections_choice1; + } + + const boost::optional& CPACSHull::GetSegments_choice1() const + { + return m_segments_choice1; + } + + boost::optional& CPACSHull::GetSegments_choice1() + { + return m_segments_choice1; + } + + const boost::optional& CPACSHull::GetCylinderRadius_choice2() const + { + return m_cylinderRadius_choice2; + } + + void CPACSHull::SetCylinderRadius_choice2(const boost::optional& value) + { + m_cylinderRadius_choice2 = value; + } + + const boost::optional& CPACSHull::GetCylinderLength_choice2() const + { + return m_cylinderLength_choice2; + } + + void CPACSHull::SetCylinderLength_choice2(const boost::optional& value) + { + m_cylinderLength_choice2 = value; + } + + const boost::optional& CPACSHull::GetDomeType_choice2() const + { + return m_domeType_choice2; + } + + boost::optional& CPACSHull::GetDomeType_choice2() + { + return m_domeType_choice2; + } + + const boost::optional& CPACSHull::GetStructure() const + { + return m_structure; + } + + boost::optional& CPACSHull::GetStructure() + { + return m_structure; + } + + CCPACSFuselageSections& CPACSHull::GetSections_choice1(CreateIfNotExistsTag) + { + if (!m_sections_choice1) + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_sections_choice1; + } + + void CPACSHull::RemoveSections_choice1() + { + m_sections_choice1 = boost::none; + } + + CCPACSFuselageSegments& CPACSHull::GetSegments_choice1(CreateIfNotExistsTag) + { + if (!m_segments_choice1) + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_segments_choice1; + } + + void CPACSHull::RemoveSegments_choice1() + { + m_segments_choice1 = boost::none; + } + + CPACSDomeType& CPACSHull::GetDomeType_choice2(CreateIfNotExistsTag) + { + if (!m_domeType_choice2) + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + return *m_domeType_choice2; + } + + void CPACSHull::RemoveDomeType_choice2() + { + m_domeType_choice2 = boost::none; + } + + CCPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) + { + if (!m_structure) + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_structure; + } + + void CPACSHull::RemoveStructure() + { + m_structure = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSHull.h index 00ea512d72..dfb3942f06 100644 --- a/src/generated/CPACSHull.h +++ b/src/generated/CPACSHull.h @@ -1,149 +1,149 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include "CPACSDomeType.h" -#include "CreateIfNotExists.h" -#include "CTiglUIDObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; -class CCPACSHulls; - -namespace generated -{ - // This class is used in: - // CPACSHulls - - /// @brief Hulls - /// - /// - class CPACSHull : public CTiglReqUIDObject - { - public: - TIGL_EXPORT CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSHull(); - - TIGL_EXPORT CCPACSHulls* GetParent(); - - TIGL_EXPORT const CCPACSHulls* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT bool ValidateChoices() const; - - TIGL_EXPORT virtual const std::string& GetUID() const; - TIGL_EXPORT virtual void SetUID(const std::string& value); - - TIGL_EXPORT virtual const std::string& GetName() const; - TIGL_EXPORT virtual void SetName(const std::string& value); - - TIGL_EXPORT virtual const boost::optional& GetDescription() const; - TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - - TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; - TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - - TIGL_EXPORT virtual const boost::optional& GetSections_choice1() const; - TIGL_EXPORT virtual boost::optional& GetSections_choice1(); - - TIGL_EXPORT virtual const boost::optional& GetSegments_choice1() const; - TIGL_EXPORT virtual boost::optional& GetSegments_choice1(); - - TIGL_EXPORT virtual const boost::optional& GetCylinderRadius_choice2() const; - TIGL_EXPORT virtual void SetCylinderRadius_choice2(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetCylinderLength_choice2() const; - TIGL_EXPORT virtual void SetCylinderLength_choice2(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetDomeType_choice2() const; - TIGL_EXPORT virtual boost::optional& GetDomeType_choice2(); - - TIGL_EXPORT virtual const boost::optional& GetStructure() const; - TIGL_EXPORT virtual boost::optional& GetStructure(); - - TIGL_EXPORT virtual CCPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveSections_choice1(); - - TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveSegments_choice1(); - - TIGL_EXPORT virtual CPACSDomeType& GetDomeType_choice2(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveDomeType_choice2(); - - TIGL_EXPORT virtual CCPACSHullStructure& GetStructure(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveStructure(); - - protected: - CCPACSHulls* m_parent; - - CTiglUIDManager* m_uidMgr; - - std::string m_uID; - - /// Name - std::string m_name; - - /// Description - boost::optional m_description; - - CCPACSTransformation m_transformation; - - boost::optional m_sections_choice1; - - boost::optional m_segments_choice1; - - /// Inner radius of the cylinder - boost::optional m_cylinderRadius_choice2; - - /// Inner length of the cylinder - boost::optional m_cylinderLength_choice2; - - boost::optional m_domeType_choice2; - - boost::optional m_structure; - - private: - CPACSHull(const CPACSHull&) = delete; - CPACSHull& operator=(const CPACSHull&) = delete; - - CPACSHull(CPACSHull&&) = delete; - CPACSHull& operator=(CPACSHull&&) = delete; - }; -} // namespace generated - -// CPACSHull is customized, use type CCPACSHull directly -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include "CPACSDomeType.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CCPACSHulls; + +namespace generated +{ + // This class is used in: + // CPACSHulls + + /// @brief Hulls + /// + /// + class CPACSHull : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSHull(); + + TIGL_EXPORT CCPACSHulls* GetParent(); + + TIGL_EXPORT const CCPACSHulls* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + + TIGL_EXPORT virtual const boost::optional& GetSections_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSections_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetSegments_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSegments_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetCylinderRadius_choice2() const; + TIGL_EXPORT virtual void SetCylinderRadius_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetCylinderLength_choice2() const; + TIGL_EXPORT virtual void SetCylinderLength_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetDomeType_choice2() const; + TIGL_EXPORT virtual boost::optional& GetDomeType_choice2(); + + TIGL_EXPORT virtual const boost::optional& GetStructure() const; + TIGL_EXPORT virtual boost::optional& GetStructure(); + + TIGL_EXPORT virtual CCPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSections_choice1(); + + TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSegments_choice1(); + + TIGL_EXPORT virtual CPACSDomeType& GetDomeType_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveDomeType_choice2(); + + TIGL_EXPORT virtual CCPACSHullStructure& GetStructure(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveStructure(); + + protected: + CCPACSHulls* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + CCPACSTransformation m_transformation; + + boost::optional m_sections_choice1; + + boost::optional m_segments_choice1; + + /// Inner radius of the cylinder + boost::optional m_cylinderRadius_choice2; + + /// Inner length of the cylinder + boost::optional m_cylinderLength_choice2; + + boost::optional m_domeType_choice2; + + boost::optional m_structure; + + private: + CPACSHull(const CPACSHull&) = delete; + CPACSHull& operator=(const CPACSHull&) = delete; + + CPACSHull(CPACSHull&&) = delete; + CPACSHull& operator=(CPACSHull&&) = delete; + }; +} // namespace generated + +// CPACSHull is customized, use type CCPACSHull directly +} // namespace tigl diff --git a/src/generated/CPACSMaterialDefinition.cpp b/src/generated/CPACSMaterialDefinition.cpp index c2cbd8f5d0..2d24687898 100644 --- a/src/generated/CPACSMaterialDefinition.cpp +++ b/src/generated/CPACSMaterialDefinition.cpp @@ -1,403 +1,403 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSWingRibCrossSection.h" -#include "CPACSCap.h" -#include "CPACSLateralCap.h" -#include "CPACSMaterialDefinition.h" -#include "CPACSSheetBasedStructuralElement.h" -#include "CPACSTrackActuator.h" -#include "CPACSWeb.h" -#include "CPACSWingRibCell.h" -#include "CPACSWingSkin.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSCap); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSLateralCap); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSSheetBasedStructuralElement); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSTrackActuator); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSWeb); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSWingRibCell); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CCPACSWingRibCrossSection); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSWingSkin); - } - - CPACSMaterialDefinition::~CPACSMaterialDefinition() - { - if (m_uidMgr) { - if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); - if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); - } - } - - const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() const - { - if (m_parent) { - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - } - return nullptr; - } - - CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() - { - if (m_parent) { - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - } - return nullptr; - } - - CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSMaterialDefinition::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read element compositeUID - if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { - m_compositeUID_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/compositeUID"); - if (m_compositeUID_choice1->empty()) { - LOG(WARNING) << "Optional element compositeUID is present but empty at xpath " << xpath; - } - if (m_uidMgr && !m_compositeUID_choice1->empty()) m_uidMgr->RegisterReference(*m_compositeUID_choice1, *this); - } - - // read element orthotropyDirection - if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { - m_orthotropyDirection_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/orthotropyDirection"); - } - - // read element thicknessScaling - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { - m_thicknessScaling_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/thicknessScaling"); - } - - // read element materialUID - if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { - m_materialUID_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/materialUID"); - if (m_materialUID_choice2->empty()) { - LOG(WARNING) << "Optional element materialUID is present but empty at xpath " << xpath; - } - if (m_uidMgr && !m_materialUID_choice2->empty()) m_uidMgr->RegisterReference(*m_materialUID_choice2, *this); - } - - // read element thickness - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { - m_thickness_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/thickness"); - } - - if (!ValidateChoices()) { - LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; - } - } - - void CPACSMaterialDefinition::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write element compositeUID - if (m_compositeUID_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/compositeUID"); - tixi::TixiSaveElement(tixiHandle, xpath + "/compositeUID", *m_compositeUID_choice1); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/compositeUID"); - } - } - - // write element orthotropyDirection - if (m_orthotropyDirection_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/orthotropyDirection"); - tixi::TixiSaveElement(tixiHandle, xpath + "/orthotropyDirection", *m_orthotropyDirection_choice1); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/orthotropyDirection"); - } - } - - // write element thicknessScaling - if (m_thicknessScaling_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thicknessScaling"); - tixi::TixiSaveElement(tixiHandle, xpath + "/thicknessScaling", *m_thicknessScaling_choice1); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/thicknessScaling"); - } - } - - // write element materialUID - if (m_materialUID_choice2) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/materialUID"); - tixi::TixiSaveElement(tixiHandle, xpath + "/materialUID", *m_materialUID_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/materialUID"); - } - } - - // write element thickness - if (m_thickness_choice2) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thickness"); - tixi::TixiSaveElement(tixiHandle, xpath + "/thickness", *m_thickness_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/thickness"); - } - } - - } - - bool CPACSMaterialDefinition::ValidateChoices() const - { - return - ( - ( - ( - // mandatory elements of this choice must be there - m_compositeUID_choice1.is_initialized() - && - true // m_orthotropyDirection_choice1 is optional in choice - && - true // m_thicknessScaling_choice1 is optional in choice - && - // elements of other choices must not be there - !( - m_materialUID_choice2.is_initialized() - || - m_thickness_choice2.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_materialUID_choice2.is_initialized() - && - true // m_thickness_choice2 is optional in choice - && - // elements of other choices must not be there - !( - m_compositeUID_choice1.is_initialized() - || - m_orthotropyDirection_choice1.is_initialized() - || - m_thicknessScaling_choice1.is_initialized() - ) - ) - == 1 - ) - ) - ; - } - - const boost::optional& CPACSMaterialDefinition::GetCompositeUID_choice1() const - { - return m_compositeUID_choice1; - } - - void CPACSMaterialDefinition::SetCompositeUID_choice1(const boost::optional& value) - { - if (m_uidMgr) { - if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); - if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); - } - m_compositeUID_choice1 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetOrthotropyDirection_choice1() const - { - return m_orthotropyDirection_choice1; - } - - void CPACSMaterialDefinition::SetOrthotropyDirection_choice1(const boost::optional& value) - { - m_orthotropyDirection_choice1 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetThicknessScaling_choice1() const - { - return m_thicknessScaling_choice1; - } - - void CPACSMaterialDefinition::SetThicknessScaling_choice1(const boost::optional& value) - { - m_thicknessScaling_choice1 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetMaterialUID_choice2() const - { - return m_materialUID_choice2; - } - - void CPACSMaterialDefinition::SetMaterialUID_choice2(const boost::optional& value) - { - if (m_uidMgr) { - if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); - if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); - } - m_materialUID_choice2 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetThickness_choice2() const - { - return m_thickness_choice2; - } - - void CPACSMaterialDefinition::SetThickness_choice2(const boost::optional& value) - { - m_thickness_choice2 = value; - } - - const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDObject() const - { - return GetNextUIDParent(); - } - - void CPACSMaterialDefinition::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) - { - if (m_compositeUID_choice1 && *m_compositeUID_choice1 == oldUid) { - m_compositeUID_choice1 = newUid; - } - if (m_materialUID_choice2 && *m_materialUID_choice2 == oldUid) { - m_materialUID_choice2 = newUid; - } - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSWingRibCrossSection.h" +#include "CPACSCap.h" +#include "CPACSLateralCap.h" +#include "CPACSMaterialDefinition.h" +#include "CPACSSheetBasedStructuralElement.h" +#include "CPACSTrackActuator.h" +#include "CPACSWeb.h" +#include "CPACSWingRibCell.h" +#include "CPACSWingSkin.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSCap); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSLateralCap); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSSheetBasedStructuralElement); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSTrackActuator); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSWeb); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSWingRibCell); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CCPACSWingRibCrossSection); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSWingSkin); + } + + CPACSMaterialDefinition::~CPACSMaterialDefinition() + { + if (m_uidMgr) { + if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); + if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); + } + } + + const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() const + { + if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; + } + + CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() + { + if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; + } + + CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSMaterialDefinition::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element compositeUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { + m_compositeUID_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/compositeUID"); + if (m_compositeUID_choice1->empty()) { + LOG(WARNING) << "Optional element compositeUID is present but empty at xpath " << xpath; + } + if (m_uidMgr && !m_compositeUID_choice1->empty()) m_uidMgr->RegisterReference(*m_compositeUID_choice1, *this); + } + + // read element orthotropyDirection + if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { + m_orthotropyDirection_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/orthotropyDirection"); + } + + // read element thicknessScaling + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { + m_thicknessScaling_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/thicknessScaling"); + } + + // read element materialUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { + m_materialUID_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/materialUID"); + if (m_materialUID_choice2->empty()) { + LOG(WARNING) << "Optional element materialUID is present but empty at xpath " << xpath; + } + if (m_uidMgr && !m_materialUID_choice2->empty()) m_uidMgr->RegisterReference(*m_materialUID_choice2, *this); + } + + // read element thickness + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { + m_thickness_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/thickness"); + } + + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSMaterialDefinition::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element compositeUID + if (m_compositeUID_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/compositeUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/compositeUID", *m_compositeUID_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/compositeUID"); + } + } + + // write element orthotropyDirection + if (m_orthotropyDirection_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/orthotropyDirection"); + tixi::TixiSaveElement(tixiHandle, xpath + "/orthotropyDirection", *m_orthotropyDirection_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/orthotropyDirection"); + } + } + + // write element thicknessScaling + if (m_thicknessScaling_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thicknessScaling"); + tixi::TixiSaveElement(tixiHandle, xpath + "/thicknessScaling", *m_thicknessScaling_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/thicknessScaling"); + } + } + + // write element materialUID + if (m_materialUID_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/materialUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/materialUID", *m_materialUID_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/materialUID"); + } + } + + // write element thickness + if (m_thickness_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thickness"); + tixi::TixiSaveElement(tixiHandle, xpath + "/thickness", *m_thickness_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/thickness"); + } + } + + } + + bool CPACSMaterialDefinition::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_compositeUID_choice1.is_initialized() + && + true // m_orthotropyDirection_choice1 is optional in choice + && + true // m_thicknessScaling_choice1 is optional in choice + && + // elements of other choices must not be there + !( + m_materialUID_choice2.is_initialized() + || + m_thickness_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_materialUID_choice2.is_initialized() + && + true // m_thickness_choice2 is optional in choice + && + // elements of other choices must not be there + !( + m_compositeUID_choice1.is_initialized() + || + m_orthotropyDirection_choice1.is_initialized() + || + m_thicknessScaling_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const boost::optional& CPACSMaterialDefinition::GetCompositeUID_choice1() const + { + return m_compositeUID_choice1; + } + + void CPACSMaterialDefinition::SetCompositeUID_choice1(const boost::optional& value) + { + if (m_uidMgr) { + if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); + if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); + } + m_compositeUID_choice1 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetOrthotropyDirection_choice1() const + { + return m_orthotropyDirection_choice1; + } + + void CPACSMaterialDefinition::SetOrthotropyDirection_choice1(const boost::optional& value) + { + m_orthotropyDirection_choice1 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetThicknessScaling_choice1() const + { + return m_thicknessScaling_choice1; + } + + void CPACSMaterialDefinition::SetThicknessScaling_choice1(const boost::optional& value) + { + m_thicknessScaling_choice1 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetMaterialUID_choice2() const + { + return m_materialUID_choice2; + } + + void CPACSMaterialDefinition::SetMaterialUID_choice2(const boost::optional& value) + { + if (m_uidMgr) { + if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); + if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); + } + m_materialUID_choice2 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetThickness_choice2() const + { + return m_thickness_choice2; + } + + void CPACSMaterialDefinition::SetThickness_choice2(const boost::optional& value) + { + m_thickness_choice2 = value; + } + + const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDObject() const + { + return GetNextUIDParent(); + } + + void CPACSMaterialDefinition::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) + { + if (m_compositeUID_choice1 && *m_compositeUID_choice1 == oldUid) { + m_compositeUID_choice1 = newUid; + } + if (m_materialUID_choice2 && *m_materialUID_choice2 == oldUid) { + m_materialUID_choice2 = newUid; + } + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSMaterialDefinition.h b/src/generated/CPACSMaterialDefinition.h index 30da55c36e..d9d94f17f7 100644 --- a/src/generated/CPACSMaterialDefinition.h +++ b/src/generated/CPACSMaterialDefinition.h @@ -1,171 +1,171 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include "CTiglError.h" -#include "ITiglUIDRefObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; -class CTiglUIDObject; -class CCPACSWingRibCrossSection; - -namespace generated -{ - class CPACSCap; - class CPACSLateralCap; - class CPACSSheetBasedStructuralElement; - class CPACSTrackActuator; - class CPACSWeb; - class CPACSWingRibCell; - class CPACSWingSkin; - - // This class is used in: - // CPACSCap - // CPACSLateralCap - // CPACSSheetBasedStructuralElement - // CPACSTrackActuator - // CPACSWeb - // CPACSWingRibCell - // CPACSWingRibCrossSection - // CPACSWingSkin - - /// @brief Material Definition - /// - /// MaterialDefinition type, containing a material - /// definition (Reference to material and thickness) - /// - class CPACSMaterialDefinition : public ITiglUIDRefObject - { - public: - TIGL_EXPORT CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSMaterialDefinition(); - - template - bool IsParent() const - { - return m_parentType != NULL && *m_parentType == typeid(P); - } - - template - P* GetParent() - { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); - if (!IsParent

()) { - throw CTiglError("bad parent"); - } - return static_cast(m_parent); - } - - template - const P* GetParent() const - { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); - if (!IsParent

()) { - throw CTiglError("bad parent"); - } - return static_cast(m_parent); - } - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT bool ValidateChoices() const; - - TIGL_EXPORT virtual const boost::optional& GetCompositeUID_choice1() const; - TIGL_EXPORT virtual void SetCompositeUID_choice1(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetOrthotropyDirection_choice1() const; - TIGL_EXPORT virtual void SetOrthotropyDirection_choice1(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetThicknessScaling_choice1() const; - TIGL_EXPORT virtual void SetThicknessScaling_choice1(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetMaterialUID_choice2() const; - TIGL_EXPORT virtual void SetMaterialUID_choice2(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetThickness_choice2() const; - TIGL_EXPORT virtual void SetThickness_choice2(const boost::optional& value); - - protected: - void* m_parent; - const std::type_info* m_parentType; - - CTiglUIDManager* m_uidMgr; - - /// uID of a composite definition. - boost::optional m_compositeUID_choice1; - - /// Orthotropy direction of the composite. - boost::optional m_orthotropyDirection_choice1; - - /// Scaling factor of the composite thickness. - /// Absolute thicknesses are defined in each composite material - /// seperatly - boost::optional m_thicknessScaling_choice1; - - /// uID of a material definition. - boost::optional m_materialUID_choice2; - - /// Absolute thickness of the material. - boost::optional m_thickness_choice2; - - private: - TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; - TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; - - CPACSMaterialDefinition(const CPACSMaterialDefinition&) = delete; - CPACSMaterialDefinition& operator=(const CPACSMaterialDefinition&) = delete; - - CPACSMaterialDefinition(CPACSMaterialDefinition&&) = delete; - CPACSMaterialDefinition& operator=(CPACSMaterialDefinition&&) = delete; - }; -} // namespace generated - -// CPACSMaterialDefinition is customized, use type CCPACSMaterialDefinition directly - -// Aliases in tigl namespace -using CCPACSCap = generated::CPACSCap; -using CCPACSLateralCap = generated::CPACSLateralCap; -using CCPACSSheetBasedStructuralElement = generated::CPACSSheetBasedStructuralElement; -using CCPACSTrackActuator = generated::CPACSTrackActuator; -using CCPACSWeb = generated::CPACSWeb; -using CCPACSWingRibCell = generated::CPACSWingRibCell; -using CCPACSWingSkin = generated::CPACSWingSkin; -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include "CTiglError.h" +#include "ITiglUIDRefObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; +class CCPACSWingRibCrossSection; + +namespace generated +{ + class CPACSCap; + class CPACSLateralCap; + class CPACSSheetBasedStructuralElement; + class CPACSTrackActuator; + class CPACSWeb; + class CPACSWingRibCell; + class CPACSWingSkin; + + // This class is used in: + // CPACSCap + // CPACSLateralCap + // CPACSSheetBasedStructuralElement + // CPACSTrackActuator + // CPACSWeb + // CPACSWingRibCell + // CPACSWingRibCrossSection + // CPACSWingSkin + + /// @brief Material Definition + /// + /// MaterialDefinition type, containing a material + /// definition (Reference to material and thickness) + /// + class CPACSMaterialDefinition : public ITiglUIDRefObject + { + public: + TIGL_EXPORT CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSMaterialDefinition(); + + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const boost::optional& GetCompositeUID_choice1() const; + TIGL_EXPORT virtual void SetCompositeUID_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetOrthotropyDirection_choice1() const; + TIGL_EXPORT virtual void SetOrthotropyDirection_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetThicknessScaling_choice1() const; + TIGL_EXPORT virtual void SetThicknessScaling_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetMaterialUID_choice2() const; + TIGL_EXPORT virtual void SetMaterialUID_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetThickness_choice2() const; + TIGL_EXPORT virtual void SetThickness_choice2(const boost::optional& value); + + protected: + void* m_parent; + const std::type_info* m_parentType; + + CTiglUIDManager* m_uidMgr; + + /// uID of a composite definition. + boost::optional m_compositeUID_choice1; + + /// Orthotropy direction of the composite. + boost::optional m_orthotropyDirection_choice1; + + /// Scaling factor of the composite thickness. + /// Absolute thicknesses are defined in each composite material + /// seperatly + boost::optional m_thicknessScaling_choice1; + + /// uID of a material definition. + boost::optional m_materialUID_choice2; + + /// Absolute thickness of the material. + boost::optional m_thickness_choice2; + + private: + TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; + TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; + + CPACSMaterialDefinition(const CPACSMaterialDefinition&) = delete; + CPACSMaterialDefinition& operator=(const CPACSMaterialDefinition&) = delete; + + CPACSMaterialDefinition(CPACSMaterialDefinition&&) = delete; + CPACSMaterialDefinition& operator=(CPACSMaterialDefinition&&) = delete; + }; +} // namespace generated + +// CPACSMaterialDefinition is customized, use type CCPACSMaterialDefinition directly + +// Aliases in tigl namespace +using CCPACSCap = generated::CPACSCap; +using CCPACSLateralCap = generated::CPACSLateralCap; +using CCPACSSheetBasedStructuralElement = generated::CPACSSheetBasedStructuralElement; +using CCPACSTrackActuator = generated::CPACSTrackActuator; +using CCPACSWeb = generated::CPACSWeb; +using CCPACSWingRibCell = generated::CPACSWingRibCell; +using CCPACSWingSkin = generated::CPACSWingSkin; +} // namespace tigl diff --git a/src/geometry/CTiglRelativelyPositionedComponent.cpp b/src/geometry/CTiglRelativelyPositionedComponent.cpp index 1ca8c80fce..517991ac4b 100644 --- a/src/geometry/CTiglRelativelyPositionedComponent.cpp +++ b/src/geometry/CTiglRelativelyPositionedComponent.cpp @@ -46,6 +46,12 @@ CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTi CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis) : _parent(parent), _transformation(trans), _symmetryAxis(symmetryAxis){} +CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, Standard_Boolean applyRotation, Standard_Boolean applyScaling) + : _parent(parent), _transformation(trans), _symmetryAxis(nullptr), _applyRotation(applyRotation), _applyScaling(applyScaling){} + +CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis, Standard_Boolean applyRotation, Standard_Boolean applyScaling) + : _parent(parent), _transformation(trans), _symmetryAxis(symmetryAxis), _applyRotation(applyRotation), _applyScaling(applyScaling){} + void CTiglRelativelyPositionedComponent::Reset() const { CTiglAbstractGeometricComponent::Reset(); @@ -76,15 +82,34 @@ CTiglTransformation CTiglRelativelyPositionedComponent::GetTransformationMatrix( const CTiglTransformation thisTransformation = GetTransform() ? GetTransform()->getTransformationMatrix() : CTiglTransformation(); if (_parent && GetTranslationType() == ABS_LOCAL) { const CTiglTransformation& parentTransformation = _parent->GetTransformationMatrix(); + CTiglTransformation transformation = thisTransformation; + + double scale[3], rotation[3], translation[3]; + parentTransformation.Decompose(&scale[0], &rotation[0], &translation[0]); + + if (_applyScaling) { + CTiglTransformation parentScaling; + parentScaling.AddScaling(scale[0],scale[1],scale[2]); + transformation = parentScaling * transformation; + } + + if (_applyRotation) { + CTiglTransformation parentRotation; + parentRotation.AddRotationX(rotation[0]); + parentRotation.AddRotationY(rotation[1]); + parentRotation.AddRotationZ(rotation[2]); + transformation = parentRotation * transformation; + } - // we only transform with the parent's translation CTiglTransformation parentTranslation; parentTranslation.AddTranslation( - parentTransformation.GetValue(0, 3), - parentTransformation.GetValue(1, 3), - parentTransformation.GetValue(2, 3) + translation[0], + translation[1], + translation[2] ); - return parentTranslation * thisTransformation; + transformation = parentTranslation * transformation; + + return transformation; } else return thisTransformation; diff --git a/src/geometry/CTiglRelativelyPositionedComponent.h b/src/geometry/CTiglRelativelyPositionedComponent.h index c9b2c70cc8..fd9cf09a50 100644 --- a/src/geometry/CTiglRelativelyPositionedComponent.h +++ b/src/geometry/CTiglRelativelyPositionedComponent.h @@ -122,6 +122,8 @@ class CTiglRelativelyPositionedComponent : public CTiglAbstractGeometricComponen TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(MaybeOptionalPtr parentUid, MaybeOptionalPtr trans, boost::optional* symmetryAxis); TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans); TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis); + TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, Standard_Boolean applyRotation, Standard_Boolean applyScaling); + TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis, Standard_Boolean applyRotation, Standard_Boolean applyScaling); TIGL_EXPORT void Reset() const; @@ -159,6 +161,9 @@ class CTiglRelativelyPositionedComponent : public CTiglAbstractGeometricComponen ChildContainerType _children; MaybeOptionalPtr _parentUID; ///< UID of the parent of this component, if supported by derived type + Standard_Boolean _applyRotation = false; + Standard_Boolean _applyScaling = false; + MaybeOptionalPtr _transformation; // references down to the transformation of the derived class (may be empty in case derived class does not have transformation) boost::optional* _symmetryAxis; // references down to the symmetryAxis of the derived class (may be empty in case derived class does not have symmetry) }; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 57b313c901..a958a151f9 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -1,616 +1,620 @@ - - -

- Fuel tanks test - Simple fuel tank for unit testing - Marko Alder - 2023-12-28T12:00:00 - 1.0.0 - 3.3 -
- - - - Test aircraft - - - Simple fuselage - - - 0.5 - - - 1.0 - 2.0 - 2.0 - - - -
- Fuselage Section 1 - - - - Fuselage Section 1 - fuselageCircleProfileuID - - - -
-
- Fuselage Section 2 - - - - Fuselage Section 2 - fuselageCircleProfileuID - - - -
-
- Fuselage Section 3 - - - - Fuselage Section 3 - fuselageCircleProfileuID - - - -
-
- - - Fuselage Positioning 1 - 0. - 90 - 0 - fuselage_1Section1ID - - - Fuselage Positioning 2 - 2. - 90 - 0 - fuselage_1Section1ID - fuselage_1Section2ID - - - Fuselage Positioning 3 - 15. - 90 - 0 - fuselage_1Section2ID - fuselage_1Section3ID - - - - - Fuselage Segment 2 - fuselage_1Section1IDElement1 - fuselage_1Section2IDElement1 - - - Fuselage Segment 3 - fuselage_1Section2IDElement1 - fuselage_1Section3IDElement1 - - - - - - Simple tank - This is a simple tank build via sections and segments with internal structure - - - 0.5 - - - - - Outer hull - - - 1 - 1.2 - 1.2 - - - -
- Section 1 - - - 0 - - - - - Section 1 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 2 - - - 1 - - - - - Section 2 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 3 - - - 1.5 - - - - - Section 3 Element 1 - fuselageCircleProfileuID - - - -
-
- - - Outer hull Segment 1 - outerHull_section1_element1 - outerHull_section2_element1 - - - Outer hull Segment 2 - outerHull_section2_element1 - outerHull_section3_element1 - - - - - - - dummyMaterial - outerHull_section2 - 0 - 0 - 45 - - - - -
- - Inner hull - - - 0.2 - - - 0.8 - 0.9 - 0.9 - - - -
- Section 1 - - - 0 - - - - - Section 1 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 2 - - - 1 - - - - - Section 2 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 3 - - - 1.5 - - - - - Section 3 Element 1 - fuselageCircleProfileuID - - - -
-
- - - Inner hull Segment 1 - innerHull_section1_element1 - innerHull_section2_element1 - - - Inner hull Segment 2 - innerHull_section2_element1 - innerHull_section3_element1 - - -
-
-
- - Simple tank 2 - Test case of a simple tank via sections and segments with guide curves - - - 2.5 - - - - - Outer hull - - - 1 - 0.8 - 0.8 - - - -
- Section 1 - - - 0 - - - - - Section 1 Element 1 - fuselageCircleProfileuID - - - 0.01 - 0.01 - - - - -
-
- Section 2 - - - 1.0 - - - - - Section 2 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 3 - - - 2 - - - - - Section 3 Element 1 - fuselageCircleProfileuID - - - 0.01 - 0.01 - - - - -
-
- - - Outer hull Segment 1 - genericTank2_outerHull_section1_element1 - genericTank2_outerHull_section2_element1 - - - Guide Segment 1 Upper - gc_upper - 0 - 0 - - - Guide Segment 1 Starbord - gc_starbord - 0.25 - 0.25 - - - Guide Segment 1 Lower - gc_lower - 0.5 - 0.5 - - - Guide Segment 1 Port - gc_port - 0.75 - 0.75 - - - - - Outer hull Segment 2 - genericTank2_outerHull_section2_element1 - genericTank2_outerHull_section3_element1 - - - Guide Segment 2 Upper - gc_upper - genericTank2_seg1_upper - 0 - - - Guide Segment 2 Starbord - gc_starbord - genericTank2_seg1_starbord - 0.25 - - - Guide Segment 2 Lower - gc_lower - genericTank2_seg1_lower - 0.5 - - - Guide Segment 2 Port - gc_port - genericTank2_seg1_port - 0.75 - - - - -
-
-
- - Simple tank 3 - Test case for simple parametrization with ellipsoid domes - - - 5. - - - - - Hull with spherical dome - - - 0. - - - 1.0 - 2.0 - - - 1 - - - - - Hull with ellipsoid dome - - - 0.5 - - - 1 - 0.8 - 0.8 - - - 1.0 - 2.0 - - - 0.5 - - - - - Hull with cylindrical dome - - - 1 - - - 1 - 0.7 - 0.7 - - - 1.0 - 2.0 - - - 0 - - - - - - - Simple tank 4 - Test case for simple parametrization - - - 9.5 - - - - - Hull with torispherical dome - - - 0. - - - 1.0 - 2.0 - - - 2.0 - 0.2 - - - - - - - Simple tank 5 - Test case for simple parametrization - - - 13. - - - - - Hull with isotensoid dome - - - 0. - - - 1.0 - 2.0 - - - 0.1 - - - - - -
-
-
-
-
-
- - - - Circle - Profile build up from set of Points on Circle where may Dimensions are 1..-1 - - 0.0;0.0;0.0;0.0;0.0 - 0.0;1.0;0.0;-1.0;0.0 - 1.0;0.0;-1.0;0.0;1.0 - - - - - - Upper Guide Curve Profile - This profile is used for tank test cases - - 0.3 - 0.5 - 0.0 - - - - Starbord Guide Curve Profile - This profile is used for tank test cases - - 0.0 - 0.5 - 0.3 - - - - Lower Guide Curve Profile - This profile is used for tank test cases - - -0.3 - 0.5 - 0.0 - - - - Port Guide Curve Profile - This profile is used for tank test cases - - 0.0 - 0.5 - -0.3 - - - - - - - - Frame structural element - - sheet - dummyMaterial - 0.05 - - T - - - - - - dummyMaterial - - - - - - - Dummy material - 1 - - 1 - - - -
+ + +
+ Fuel tanks test + Simple fuel tank for unit testing + Marko Alder + 2023-12-28T12:00:00 + 1.0.0 + 3.3 +
+ + + + Test aircraft + + + Simple fuselage + + + 0.5 + + + 1.0 + 2.0 + 2.0 + + + +
+ Fuselage Section 1 + + + + Fuselage Section 1 + fuselageCircleProfileuID + + + +
+
+ Fuselage Section 2 + + + + Fuselage Section 2 + fuselageCircleProfileuID + + + +
+
+ Fuselage Section 3 + + + + Fuselage Section 3 + fuselageCircleProfileuID + + + +
+
+ + + Fuselage Positioning 1 + 0. + 90 + 0 + fuselage_1Section1ID + + + Fuselage Positioning 2 + 2. + 90 + 0 + fuselage_1Section1ID + fuselage_1Section2ID + + + Fuselage Positioning 3 + 15. + 90 + 0 + fuselage_1Section2ID + fuselage_1Section3ID + + + + + Fuselage Segment 2 + fuselage_1Section1IDElement1 + fuselage_1Section2IDElement1 + + + Fuselage Segment 3 + fuselage_1Section2IDElement1 + fuselage_1Section3IDElement1 + + + + + + Simple tank + This is a simple tank build via sections and segments with internal structure + + + 0.5 + + + + 45 + + + + + Outer hull + + + 1 + 1.2 + 1.2 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 2 + + + 1 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 1.5 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + +
+
+ + + Outer hull Segment 1 + outerHull_section1_element1 + outerHull_section2_element1 + + + Outer hull Segment 2 + outerHull_section2_element1 + outerHull_section3_element1 + + + + + + + dummyMaterial + outerHull_section2 + 0 + 0 + 45 + + + + +
+ + Inner hull + + + 0.2 + + + 0.8 + 0.9 + 0.9 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 2 + + + 1 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 1.5 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + +
+
+ + + Inner hull Segment 1 + innerHull_section1_element1 + innerHull_section2_element1 + + + Inner hull Segment 2 + innerHull_section2_element1 + innerHull_section3_element1 + + +
+
+
+ + Simple tank 2 + Test case of a simple tank via sections and segments with guide curves + + + 2.5 + + + + + Outer hull + + + 1 + 0.8 + 0.8 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + 0.01 + 0.01 + + + + +
+
+ Section 2 + + + 1.0 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 2 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + 0.01 + 0.01 + + + + +
+
+ + + Outer hull Segment 1 + genericTank2_outerHull_section1_element1 + genericTank2_outerHull_section2_element1 + + + Guide Segment 1 Upper + gc_upper + 0 + 0 + + + Guide Segment 1 Starbord + gc_starbord + 0.25 + 0.25 + + + Guide Segment 1 Lower + gc_lower + 0.5 + 0.5 + + + Guide Segment 1 Port + gc_port + 0.75 + 0.75 + + + + + Outer hull Segment 2 + genericTank2_outerHull_section2_element1 + genericTank2_outerHull_section3_element1 + + + Guide Segment 2 Upper + gc_upper + genericTank2_seg1_upper + 0 + + + Guide Segment 2 Starbord + gc_starbord + genericTank2_seg1_starbord + 0.25 + + + Guide Segment 2 Lower + gc_lower + genericTank2_seg1_lower + 0.5 + + + Guide Segment 2 Port + gc_port + genericTank2_seg1_port + 0.75 + + + + +
+
+
+ + Simple tank 3 + Test case for simple parametrization with ellipsoid domes + + + 5. + + + + + Hull with spherical dome + + + 0. + + + 1.0 + 2.0 + + + 1 + + + + + Hull with ellipsoid dome + + + 0.5 + + + 1 + 0.8 + 0.8 + + + 1.0 + 2.0 + + + 0.5 + + + + + Hull with cylindrical dome + + + 1 + + + 1 + 0.7 + 0.7 + + + 1.0 + 2.0 + + + 0 + + + + + + + Simple tank 4 + Test case for simple parametrization + + + 9.5 + + + + + Hull with torispherical dome + + + 0. + + + 1.0 + 2.0 + + + 2.0 + 0.2 + + + + + + + Simple tank 5 + Test case for simple parametrization + + + 13. + + + + + Hull with isotensoid dome + + + 0. + + + 1.0 + 2.0 + + + 0.1 + + + + + +
+
+
+
+
+
+ + + + Circle + Profile build up from set of Points on Circle where may Dimensions are 1..-1 + + 0.0;0.0;0.0;0.0;0.0 + 0.0;1.0;0.0;-1.0;0.0 + 1.0;0.0;-1.0;0.0;1.0 + + + + + + Upper Guide Curve Profile + This profile is used for tank test cases + + 0.3 + 0.5 + 0.0 + + + + Starbord Guide Curve Profile + This profile is used for tank test cases + + 0.0 + 0.5 + 0.3 + + + + Lower Guide Curve Profile + This profile is used for tank test cases + + -0.3 + 0.5 + 0.0 + + + + Port Guide Curve Profile + This profile is used for tank test cases + + 0.0 + 0.5 + -0.3 + + + + + + + + Frame structural element + + sheet + dummyMaterial + 0.05 + + T + + + + + + dummyMaterial + + + + + + + Dummy material + 1 + + 1 + + + +
\ No newline at end of file diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 750a5236e0..950655e61c 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -166,7 +166,7 @@ TEST_F(FuselageTank, hull) TEST_F(FuselageTank, parametric_hull) { - auto &loft = hull_spheric->GetLoft(); + auto& loft = hull_spheric->GetLoft(); } TEST_F(FuselageTank, structure) From f914a806184ee04c085eefe73d5b130aecb28d41 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 30 May 2024 07:46:36 +0200 Subject: [PATCH 035/122] add tankType and domeType identifiers --- bindings/python_internal/configuration.i | 6 +- src/fuelTanks/CCPACSGenericFuelTank.cpp | 11 -- src/fuelTanks/CCPACSHull.cpp | 107 +++++++++++++----- src/fuelTanks/CCPACSHull.h | 24 ++++ .../TestData/simpletest-fuelTanks.cpacs.xml | 17 ++- tests/unittests/test_fuelTanks.py | 78 ++++++++----- tests/unittests/tiglTanks.cpp | 2 +- 7 files changed, 170 insertions(+), 75 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 9846c06d24..cbfae36f85 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -352,6 +352,10 @@ class CCPACSFuselageSegments; class CCPACSHulls; } +%include "generated/CPACSIsotensoidDome.h" +%include "generated/CPACSTorisphericalDome.h" +%include "generated/CPACSEllipsoidDome.h" +%include "generated/CPACSDomeType.h" %include "generated/CPACSHullStructure.h" %include "CCPACSHullStructure.h" %include "generated/CPACSGenericFuelTanks.h" @@ -367,7 +371,7 @@ class CCPACSHulls; %include "generated/CPACSHull.h" %include "CCPACSHull.h" %include "generated/CPACSFuselageFuelTanks.h" -%include "generated/CPACSDomeType.h" + // -------------------- Wing Structure -------------------// diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSGenericFuelTank.cpp index 3bc2a2111e..0b3dcc9e5a 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSGenericFuelTank.cpp @@ -56,17 +56,6 @@ TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const PNamedShape CCPACSGenericFuelTank::BuildLoft() const { - if (GetTransformation().GetScaling()) { - LOG(WARNING) << "Scaling entries were found for tank \"" + GetName() + "\" (uID=\"" + GetUID() + - "\"). Currently TiGL only supports the translation of tanks, " - "while scaling of a tank is not applied to its hulls."; - } - if (GetTransformation().GetRotation()) { - LOG(WARNING) << "Rotation entries were found for tank \"" + GetName() + "\" (uID=\"" + GetUID() + - "\"). Currently TiGL only supports the translation of tanks, " - "while rotation of a tank is not applied to its hulls."; - } - const auto& hulls = GetHulls().GetHulls(); ListPNamedShape shapes; diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index cb40798f74..f93046dc57 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -81,9 +81,12 @@ TiglGeometricComponentIntent CCPACSHull::GetComponentIntent() const int CCPACSHull::GetSectionCount() const { - // ToDo: add exception handling - // ToDo: .get() or .get_ptr()? - return m_sections_choice1.get().GetSectionCount(); + if (m_sections_choice1) { + return m_sections_choice1.get_ptr()->GetSectionCount(); + } + else { + return 0; + } } CCPACSFuselageSection& CCPACSHull::GetSection(int index) const @@ -111,26 +114,42 @@ TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const int CCPACSHull::GetSegmentCount() const { - // ToDo: add exception handling - return m_segments_choice1.get().GetSegmentCount(); + if (m_segments_choice1) { + return m_segments_choice1.get_ptr()->GetSegmentCount(); + } + else { + return 0; + } } CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) { - // ToDo: add exception handling - return m_segments_choice1.get().GetSegment(index); + if (m_segments_choice1) { + return m_segments_choice1.get().GetSegment(index); + } + else { + throw CTiglError("Method only available for hulls with segments."); + } } const CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) const { - // ToDo: add exception handling - return m_segments_choice1.get().GetSegment(index); + if (m_segments_choice1) { + return m_segments_choice1.get().GetSegment(index); + } + else { + throw CTiglError("Method only available for hulls with segments."); + } } CCPACSFuselageSegment& CCPACSHull::GetSegment(std::string uid) { - // ToDo: add exception handling - return m_segments_choice1.get().GetSegment(uid); + if (m_segments_choice1) { + return m_segments_choice1.get().GetSegment(uid); + } + else { + throw CTiglError("Method only available for hulls with segments."); + } } double CCPACSHull::GetVolume() @@ -167,7 +186,12 @@ double CCPACSHull::GetSurfaceArea() double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) { - return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); + if (m_segments_choice1) { + return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); + } + else { + throw CTiglError("Method only available for hulls with segments."); + } } void CCPACSHull::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, @@ -249,7 +273,7 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const double R = cylinderRadius, h = cylinderRadius; - double axRatio = m_domeType_choice2->GetEllipsoid_choice1().get_ptr()->GetHalfAxisFraction(); + double axRatio = m_ellipsoid->GetHalfAxisFraction(); if (axRatio < 0.0 || axRatio > 1.0) { throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of hull \"" + GetName() + "\" (uID=\"" + GetUID() + "\") must be between 0 and 1!"); @@ -281,10 +305,8 @@ void CCPACSHull::BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - const auto* torispherical = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); - - double R = torispherical->GetDishRadius(); // Radius of the sphere (crown radius) - double r = torispherical->GetKnuckleRadius(); // Radius of the torus (knuckle radius) + double R = m_torispherical->GetDishRadius(); // Radius of the sphere (crown radius) + double r = m_torispherical->GetKnuckleRadius(); // Radius of the torus (knuckle radius) if (R <= cylinderRadius) { throw CTiglError("The dish radius (" + std::to_string(R) + ") of hull \"" + GetName() + "\" (uID=\"" + @@ -330,7 +352,7 @@ void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double polarOpeningRadius = m_domeType_choice2->GetIsotensoid_choice3().get_ptr()->GetPolarOpeningRadius(); + double polarOpeningRadius = m_isotensoid->GetPolarOpeningRadius(); if (polarOpeningRadius <= 0 || polarOpeningRadius >= cylinderRadius) { throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of hull \"" + GetName() + "\" (uID=\"" + GetUID() + @@ -371,13 +393,13 @@ void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than 0!"); } - if (m_domeType_choice2->GetEllipsoid_choice1()) { + if (m_ellipsoid) { BuildTankWireEllipsoid(wire); } - else if (m_domeType_choice2->GetTorispherical_choice2()) { + else if (m_torispherical) { BuildTankWireTorispherical(wire); } - else if (m_domeType_choice2->GetIsotensoid_choice3()) { + else if (m_isotensoid) { BuildTankWireIsotensoid(wire); } @@ -390,25 +412,54 @@ void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const loftShape = TransformedShape; } +void CCPACSHull::DetermineTankType() const +{ + if (m_segments_choice1 && m_sections_choice1) { + tankType = TANK_VIA_SEGMENTS; + domeType = TANK_WITH_SEGMENT_DOME; + } + else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { + tankType = TANK_VIA_DESIGN_PARAMETERS; + + m_ellipsoid = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); + m_torispherical = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); + m_isotensoid = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); + + if (m_ellipsoid) { + m_ellipsoid->GetHalfAxisFraction() == 1 ? domeType = TANK_WITH_SPHERICAL_DOME + : domeType = TANK_WITH_ELLIPSOID_DOME; + } + else if (m_torispherical) { + domeType = TANK_WITH_TORISPHERICAL_DOME; + } + else if (m_isotensoid) { + domeType = TANK_WITH_ISOTENSOID_DOME; + } + } + else { + throw CTiglError("No valid combination of segments and sections or parametric specification for lofting of " + "tank hull available.", + TIGL_ERROR); + } +} + PNamedShape CCPACSHull::BuildLoft() const { + DetermineTankType(); + TopoDS_Shape loftShape; std::string loftName = GetUID(); std::string loftShortName = GetShortShapeName(); - if (m_segments_choice1 && m_sections_choice1) { + if (tankType == TANK_VIA_SEGMENTS) { + BuildShapeFromSegments(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); SetFaceTraits(loft); return loft; } - else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { - - const tigl::generated::CPACSEllipsoidDome* ellipsoid = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); - const tigl::generated::CPACSTorisphericalDome* torispherical = - m_domeType_choice2->GetTorispherical_choice2().get_ptr(); - const tigl::generated::CPACSIsotensoidDome* isotensoid = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); + else if (tankType == TANK_VIA_DESIGN_PARAMETERS) { BuildShapeFromSimpleParameters(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index edc29f3461..f9b6cd85bb 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -95,6 +95,30 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned void SetFaceTraits(PNamedShape loft) const; private: + enum TankType + { + TANK_VIA_SEGMENTS, + TANK_VIA_DESIGN_PARAMETERS, + }; + + enum DomeType + { + TANK_WITH_SPHERICAL_DOME, + TANK_WITH_ELLIPSOID_DOME, + TANK_WITH_TORISPHERICAL_DOME, + TANK_WITH_ISOTENSOID_DOME, + TANK_WITH_SEGMENT_DOME + }; + + mutable TankType tankType; + mutable DomeType domeType; + + mutable const tigl::generated::CPACSEllipsoidDome* m_ellipsoid; + mutable const tigl::generated::CPACSTorisphericalDome* m_torispherical; + mutable const tigl::generated::CPACSIsotensoidDome* m_isotensoid; + + void DetermineTankType() const; + // Get short name for loft std::string GetShortShapeName() const; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index a958a151f9..41dbe0bee5 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -101,16 +101,12 @@ - Simple tank + Simple tank 1 This is a simple tank build via sections and segments with internal structure 0.5 - - - 45 - @@ -426,6 +422,11 @@ 0. + + 1.2 + 1.2 + 1.2 + 1.0 2.0 @@ -482,8 +483,12 @@ Test case for simple parametrization - 9.5 + 11.5 + -1.388 + + 90 + diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index f84744252c..e5c867bda6 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -19,10 +19,15 @@ def setUp(self): uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() self.fuelTank = uid_mgr.get_geometric_component("genericTank1") - self.hull = uid_mgr.get_geometric_component("outerHull") + self.hull_with_segments = uid_mgr.get_geometric_component( + "genericTank1_outerHull" + ) self.hull_with_guides = uid_mgr.get_geometric_component( "genericTank2_outerHull" ) + self.hull_with_spherical_dome = uid_mgr.get_geometric_component( + "genericTank3_sphericalDome" + ) def tearDown(self): self.tigl.close() @@ -48,7 +53,7 @@ def test_genericFuelTanks(self): fuelTanks.get_generic_fuel_tank_index(tank1_uID), 1, ) - self.assertEqual(fuelTanks.get_generic_fuel_tanks_count(), 2) + self.assertEqual(fuelTanks.get_generic_fuel_tanks_count(), 5) # Test availability of generated class: self.assertIsInstance( @@ -57,16 +62,15 @@ def test_genericFuelTanks(self): def test_genericFuelTank(self): # Test custom class methods: - self.assertTrue(self.fuelTank.has_hulls(), True) self.assertIsInstance(self.fuelTank.get_hulls(), configuration.CCPACSHulls) # Test availability of generated class: - self.assertEqual(self.fuelTank.get_name(), "Simple tank") + self.assertEqual(self.fuelTank.get_name(), "Simple tank 1") def test_hulls(self): # Test custom class methods: - hulls = self.hull.get_parent() - hull1_uID = "outerHull" + hulls = self.hull_with_segments.get_parent() + hull1_uID = "genericTank1_outerHull" ## Test accessability of childs: self.assertIsInstance(hulls.get_hull(1), configuration.CCPACSHull) @@ -82,41 +86,59 @@ def test_hulls(self): self.assertIsInstance(hulls.get_parent(), configuration.CCPACSGenericFuelTank) def test_hull(self): + + hull_segments = self.hull_with_segments + hull_parametric = self.hull_with_spherical_dome + exception_msg = "Method only available for hulls with segments." + # Test custom class methods: - self.assertEqual(self.hull.get_section_count(), 3) - self.assertEqual(self.hull.get_segment_count(), 2) - self.assertAlmostEqual(round(self.hull.get_volume(), 2), 0.41) - self.assertAlmostEqual(round(self.hull.get_surface_area(), 2), 2.79) - self.assertAlmostEqual(round(self.hull.get_circumference(1, 0.5), 2), 1.86) + self.assertEqual(hull_segments.get_section_count(), 3) + self.assertEqual(hull_parametric.get_section_count(), 0) + + self.assertEqual(hull_segments.get_segment_count(), 2) + self.assertEqual(hull_parametric.get_segment_count(), 0) + + self.assertAlmostEqual(round(hull_segments.get_volume(), 2), 6.57) + self.assertAlmostEqual(round(hull_parametric.get_volume(), 2), 18.1) + + self.assertAlmostEqual(round(hull_segments.get_surface_area(), 2), 11.15) + self.assertAlmostEqual(round(hull_parametric.get_surface_area(), 2), 36.19) + + self.assertAlmostEqual(round(hull_segments.get_circumference(1, 0.5), 2), 7.43) + with self.assertRaises(RuntimeError) as context: + hull_parametric.get_circumference(1, 0.5) + self.assertEqual(str(context.exception), exception_msg) - self.assertEqual(self.hull.get_segment_count(), 2) self.assertIsInstance( - self.hull.get_segment(1), configuration.CCPACSFuselageSegment + hull_segments.get_segment(1), configuration.CCPACSFuselageSegment ) + with self.assertRaises(RuntimeError) as context: + hull_parametric.get_segment(1) + self.assertEqual(str(context.exception), exception_msg) - self.assertEqual(self.hull.get_section_count(), 3) self.assertIsInstance( - self.hull.get_section(1), configuration.CCPACSFuselageSection + hull_segments.get_section(1), configuration.CCPACSFuselageSection ) self.assertIsInstance( - self.hull.get_section_face("outerHull_section3"), TopoDS_Face + hull_segments.get_section_face("outerHull_section3"), TopoDS_Face ) - self.assertEqual(self.hull.get_defaulted_uid(), "outerHull") + self.assertEqual(hull_segments.get_defaulted_uid(), "genericTank1_outerHull") self.assertIsInstance( - self.hull.get_configuration(), configuration.CCPACSConfiguration + hull_segments.get_configuration(), + configuration.CCPACSConfiguration, ) - point = self.hull.get_point(1, 0.5, 0.5) - self.assertAlmostEqual(round(point.X(), 2), 1.34) - self.assertAlmostEqual(round(point.Y(), 2), 0) - self.assertAlmostEqual(round(point.Z(), 2), -0.3) + point = hull_segments.get_point(1, 0.5, 0.5) + self.assertAlmostEqual(round(point.X(), 2), 1.54) + self.assertAlmostEqual(round(point.Y(), 2), 0.0) + self.assertAlmostEqual(round(point.Z(), 2), -1.2) - point = self.hull_with_guides.get_guide_curve_points()[1] - self.assertAlmostEqual(round(point.X(), 2), 2.75, 1e-2) - self.assertAlmostEqual(round(point.Y(), 2), 0.0, 1e-5) - self.assertAlmostEqual(round(point.Z(), 2), -0.24, 1e-2) + # point = self.hull_with_guides.get_guide_curve_points()[1] + # self.assertAlmostEqual(round(point.X(), 2), 2.75, 1e-2) + # self.assertAlmostEqual(round(point.Y(), 2), 0.0, 1e-5) + # self.assertAlmostEqual(round(point.Z(), 2), -0.24, 1e-2) self.assertEqual( self.hull_with_guides.get_guide_curve_segment( @@ -126,10 +148,10 @@ def test_hull(self): ) # Test availability of generated class: - self.assertEqual(self.hull.get_name(), "Outer hull") + self.assertEqual(self.hull_with_segments.get_name(), "Outer hull") def test_structure(self): - structure = self.hull.get_structure() + structure = self.hull_with_segments.get_structure() # Test custom class methods: self.assertIsInstance( structure.get_frames(), configuration.CCPACSFramesAssembly diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 950655e61c..9e5cf685dd 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -102,7 +102,7 @@ TiglCPACSConfigurationHandle FuselageTank::tiglHandle = 0; TEST_F(FuselageTank, getName) { const std::string name = fuelTank->GetName(); - EXPECT_EQ(name, "Simple tank"); + EXPECT_EQ(name, "Simple tank 1"); } TEST_F(FuselageTank, genericFuelTanks) From d3733d8e216f7871e356116d75285c9395a31c86 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 30 May 2024 14:26:26 +0200 Subject: [PATCH 036/122] pull fuelTanks out of fuselage --- bindings/python_internal/configuration.i | 23 +- cpacs_gen_input/CustomTypes.txt | 4 +- cpacs_gen_input/cpacs_schema.xsd | 152 ++- ...GenericFuelTank.cpp => CCPACSFuelTank.cpp} | 28 +- ...PACSGenericFuelTank.h => CCPACSFuelTank.h} | 8 +- src/fuelTanks/CCPACSFuelTanks.cpp | 75 ++ ...CSGenericFuelTanks.h => CCPACSFuelTanks.h} | 96 +- src/fuelTanks/CCPACSGenericFuelTanks.cpp | 75 -- src/fuelTanks/CCPACSHull.cpp | 20 +- src/fuelTanks/CCPACSHulls.cpp | 2 +- src/fuelTanks/CCPACSHulls.h | 2 +- src/fuselage/CTiglFuselageConnection.cpp | 7 +- src/generated/CPACSAircraftModel.cpp | 44 + src/generated/CPACSAircraftModel.h | 9 + src/generated/CPACSDomeType.cpp | 500 ++++---- src/generated/CPACSDomeType.h | 198 ++-- ...SGenericFuelTank.cpp => CPACSFuelTank.cpp} | 670 ++++++----- ...CPACSGenericFuelTank.h => CPACSFuelTank.h} | 258 ++-- src/generated/CPACSFuelTankVolume.cpp | 40 +- src/generated/CPACSFuelTankVolume.h | 44 +- src/generated/CPACSFuelTanks.cpp | 123 ++ ...ACSGenericFuelTanks.h => CPACSFuelTanks.h} | 44 +- src/generated/CPACSFuselageFuelTank.cpp | 273 +++++ src/generated/CPACSFuselageFuelTank.h | 117 ++ src/generated/CPACSFuselageFuelTanks.cpp | 52 +- src/generated/CPACSFuselageFuelTanks.h | 23 +- src/generated/CPACSGenericFuelTanks.cpp | 129 -- src/generated/CPACSHull.cpp | 956 +++++++-------- src/generated/CPACSHull.h | 298 ++--- src/generated/CPACSHulls.cpp | 8 +- src/generated/CPACSHulls.h | 12 +- src/generated/CPACSMaterialDefinition.cpp | 806 ++++++------- src/generated/CPACSMaterialDefinition.h | 342 +++--- src/generated/CPACSSymmetry.h | 1 + src/generated/CPACSTransformation.cpp | 30 +- src/generated/CPACSTransformation.h | 10 +- src/geometry/CCPACSTransformation.cpp | 2 +- src/geometry/CCPACSTransformation.h | 2 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 1046 ++++++++++------- tests/unittests/test_fuelTanks.py | 44 +- tests/unittests/tiglTanks.cpp | 42 +- 41 files changed, 3666 insertions(+), 2949 deletions(-) rename src/fuelTanks/{CCPACSGenericFuelTank.cpp => CCPACSFuelTank.cpp} (60%) rename src/fuelTanks/{CCPACSGenericFuelTank.h => CCPACSFuelTank.h} (76%) create mode 100644 src/fuelTanks/CCPACSFuelTanks.cpp rename src/fuelTanks/{CCPACSGenericFuelTanks.h => CCPACSFuelTanks.h} (58%) delete mode 100644 src/fuelTanks/CCPACSGenericFuelTanks.cpp rename src/generated/{CPACSGenericFuelTank.cpp => CPACSFuelTank.cpp} (60%) rename src/generated/{CPACSGenericFuelTank.h => CPACSFuelTank.h} (70%) create mode 100644 src/generated/CPACSFuelTanks.cpp rename src/generated/{CPACSGenericFuelTanks.h => CPACSFuelTanks.h} (56%) create mode 100644 src/generated/CPACSFuselageFuelTank.cpp create mode 100644 src/generated/CPACSFuselageFuelTank.h delete mode 100644 src/generated/CPACSGenericFuelTanks.cpp diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index cbfae36f85..35e62e9763 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -96,12 +96,11 @@ #include "CCPACSDucts.h" #include "CCPACSDuctAssembly.h" #include "CCPACSDuct.h" -#include "generated/CPACSFuselageFuelTanks.h" -#include "generated/CPACSGenericFuelTanks.h" -#include "generated/CPACSGenericFuelTank.h" +#include "generated/CPACSFuelTanks.h" +#include "generated/CPACSFuelTank.h" #include "generated/CPACSFuelTankVolume.h" -#include "CCPACSGenericFuelTanks.h" -#include "CCPACSGenericFuelTank.h" +#include "CCPACSFuelTanks.h" +#include "CCPACSFuelTank.h" #include "generated/CPACSHulls.h" #include "CCPACSHulls.h" #include "generated/CPACSHull.h" @@ -341,9 +340,9 @@ namespace tigl %include "CPACSRotorHubHinge_type.h" // --------------- Fuselage tanks -----------------// -%boost_optional(tigl::CCPACSGenericFuelTanks) %boost_optional(tigl::generated::CPACSFuselageFuelTanks) -%boost_optional(tigl::generated::CPACSGenericFuelTanks) +%boost_optional(tigl::CCPACSFuelTanks) +%boost_optional(tigl::generated::CPACSFuelTanks) %boost_optional(tigl::generated::CPACSFuelTankVolume) %boost_optional(tigl::CCPACSHullStructure) @@ -358,14 +357,14 @@ class CCPACSHulls; %include "generated/CPACSDomeType.h" %include "generated/CPACSHullStructure.h" %include "CCPACSHullStructure.h" -%include "generated/CPACSGenericFuelTanks.h" +%include "generated/CPACSFuelTanks.h" %include "generated/CPACSFuelTankVolume.h" -%include "generated/CPACSGenericFuelTank.h" +%include "generated/CPACSFuelTank.h" %include "CTiglFuselageConnection.h" %include "CCPACSFuselageSegment.h" %include "CCPACSFuselageSegments.h" -%include "CCPACSGenericFuelTanks.h" -%include "CCPACSGenericFuelTank.h" +%include "CCPACSFuelTanks.h" +%include "CCPACSFuelTank.h" %include "generated/CPACSHulls.h" %include "CCPACSHulls.h" %include "generated/CPACSHull.h" @@ -586,7 +585,7 @@ class CCPACSWingRibsPositioning; tigl::CCPACSTrailingEdgeDevice, tigl::CCPACSDuct, tigl::CCPACSDuctAssembly, - tigl::CCPACSGenericFuelTank, + tigl::CCPACSFuelTank, tigl::CCPACSHull ); diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index b9039d9459..7ade4fe975 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -153,6 +153,6 @@ CPACSDucts CCPACSDucts // Tanks CPACSHull CCPACSHull CPACSHulls CCPACSHulls -CPACSGenericFuelTank CCPACSGenericFuelTank -CPACSGenericFuelTanks CCPACSGenericFuelTanks +CPACSFuelTank CCPACSFuelTank +CPACSFuelTanks CCPACSFuelTanks CPACSHullStructure CCPACSHullStructure \ No newline at end of file diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index bd999c422e..6d7c9660ea 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -3057,6 +3057,7 @@ marko.alder@dlr.de + @@ -12615,12 +12616,58 @@ marko.alder@dlr.de + + + + + + Definition of one fuselage fuel tank. + + + The definition of fuselage tanks is still preliminary. + Currently, there is no link to any structural elements + + + + + + + + + + + Name of the fuselage fuel tank. + + + + + + Description of the fuselage fuel tank. + + + + + + Link to the tank geometry defined by a compartment. + + + + + + + + + + + + + - List of fuel tanks + List of fuselage fuel tanks. @@ -12631,13 +12678,12 @@ marko.alder@dlr.de - + The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. The fuel tank volume type should also be used for the wing fuel tank - @@ -34087,85 +34133,12 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - List of fuselage fuel tanks integrated in compartments. - - - - - - - - - - - - - The integral fuel tank geometry is defined by a link to a fuselage geometry compartment. -The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - - - Definition of one fuel tank integrated in a fuselage compartment. - - - The definition of fuselage tanks is still preliminary. - Currently, there is no link to any structural elements - - - - - - - - - - - Name of the fuselage fuel tank. - - - - - - Description of the fuselage fuel tank. - - - - - - Link to the tank geometry defined by a compartment. - - - - - - - - - - - - - - + - Generic fuel tank + Fuel tanks @@ -34176,18 +34149,18 @@ The fuel tank volume type should also be used for the wing fuel tank - + - + - Cryogenic tank + Fuel tank @@ -34207,6 +34180,12 @@ The fuel tank volume type should also be used for the wing fuel tank + + + Parent component + + + @@ -34221,6 +34200,17 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + + + + + + + diff --git a/src/fuelTanks/CCPACSGenericFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp similarity index 60% rename from src/fuelTanks/CCPACSGenericFuelTank.cpp rename to src/fuelTanks/CCPACSFuelTank.cpp index 0b3dcc9e5a..3bb0e0b0f2 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -16,10 +16,10 @@ */ /** * @file -* @brief Implementation of CPACS genericFuelTank handling routines. +* @brief Implementation of CPACS fuelTank handling routines. */ -#include "CCPACSGenericFuelTank.h" +#include "CCPACSFuelTank.h" #include "CCPACSHull.h" #include "CTiglError.h" #include "CGroupShapes.h" @@ -27,34 +27,34 @@ namespace tigl { -CCPACSGenericFuelTank::CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) - : generated::CPACSGenericFuelTank(parent, uidMgr) - , CTiglRelativelyPositionedComponent(GetParent()->GetParent()->GetParent(), &m_transformation) +CCPACSFuelTank::CCPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFuelTank(parent, uidMgr) + , CTiglRelativelyPositionedComponent(&m_parentUID, &m_transformation, &m_symmetry) { } -CCPACSConfiguration& CCPACSGenericFuelTank::GetConfiguration() const +CCPACSConfiguration& CCPACSFuelTank::GetConfiguration() const { - return GetParent()->GetParent()->GetParent()->GetConfiguration(); + return GetParent()->GetParent()->GetConfiguration(); } -std::string CCPACSGenericFuelTank::GetDefaultedUID() const +std::string CCPACSFuelTank::GetDefaultedUID() const { - return generated::CPACSGenericFuelTank::GetUID(); + return generated::CPACSFuelTank::GetUID(); } -TiglGeometricComponentType CCPACSGenericFuelTank::GetComponentType() const +TiglGeometricComponentType CCPACSFuelTank::GetComponentType() const { return TIGL_COMPONENT_FUSELAGE_TANK; } -TiglGeometricComponentIntent CCPACSGenericFuelTank::GetComponentIntent() const +TiglGeometricComponentIntent CCPACSFuelTank::GetComponentIntent() const { // needs to be physical, so that transformation relative to parent works return TIGL_INTENT_PHYSICAL; } -PNamedShape CCPACSGenericFuelTank::BuildLoft() const +PNamedShape CCPACSFuelTank::BuildLoft() const { const auto& hulls = GetHulls().GetHulls(); ListPNamedShape shapes; @@ -69,12 +69,12 @@ PNamedShape CCPACSGenericFuelTank::BuildLoft() const return groupedShape; } -std::string CCPACSGenericFuelTank::GetShortShapeName() const +std::string CCPACSFuelTank::GetShortShapeName() const { unsigned int findex = 0; unsigned int i = 0; - for (auto& t : GetParent()->GetGenericFuelTanks()) { + for (auto& t : GetParent()->GetFuelTanks()) { ++i; if (GetUID() == t->GetUID()) { findex = i; diff --git a/src/fuelTanks/CCPACSGenericFuelTank.h b/src/fuelTanks/CCPACSFuelTank.h similarity index 76% rename from src/fuelTanks/CCPACSGenericFuelTank.h rename to src/fuelTanks/CCPACSFuelTank.h index fd71a87187..e13456866c 100644 --- a/src/fuelTanks/CCPACSGenericFuelTank.h +++ b/src/fuelTanks/CCPACSFuelTank.h @@ -16,22 +16,22 @@ */ /** * @file -* @brief Implementation of CPACS genericFuelTank handling routines. +* @brief Implementation of CPACS fuelTank handling routines. */ #pragma once -#include "generated/CPACSGenericFuelTank.h" +#include "generated/CPACSFuelTank.h" #include "CTiglRelativelyPositionedComponent.h" #include "CCPACSConfiguration.h" namespace tigl { -class CCPACSGenericFuelTank : public generated::CPACSGenericFuelTank, public CTiglRelativelyPositionedComponent +class CCPACSFuelTank : public generated::CPACSFuelTank, public CTiglRelativelyPositionedComponent { public: - TIGL_EXPORT CCPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; diff --git a/src/fuelTanks/CCPACSFuelTanks.cpp b/src/fuelTanks/CCPACSFuelTanks.cpp new file mode 100644 index 0000000000..fd69dd8d56 --- /dev/null +++ b/src/fuelTanks/CCPACSFuelTanks.cpp @@ -0,0 +1,75 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS fuelTanks handling routines. +*/ + +#include "CCPACSFuelTanks.h" +#include "CCPACSFuelTank.h" +#include "CTiglError.h" + +namespace tigl +{ + +CCPACSFuelTanks::CCPACSFuelTanks(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFuelTanks(parent, uidMgr) +{ +} + +int CCPACSFuelTanks::GetFuelTanksCount() const +{ + return static_cast(m_fuelTanks.size()); +} + +CCPACSFuelTank const& CCPACSFuelTanks::GetFuelTank(std::string const& uID) const +{ + return const_cast(*this).GetFuelTank(uID); +} + +CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(std::string const& uID) +{ + auto it = std::find_if(m_fuelTanks.begin(), m_fuelTanks.end(), + [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); + + if (it != std::end(m_fuelTanks)) { + return **it; + } + throw CTiglError("Could not find fuelTank with uid" + uID); +} + +CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(int index) const +{ + index--; + if (index < 0 || index >= GetFuelTanksCount()) { + throw CTiglError("Invalid index in CCPACSFuelTanks::GetFuelTank", TIGL_INDEX_ERROR); + } + return *m_fuelTanks[index]; +} + +int CCPACSFuelTanks::GetFuelTankIndex(const std::string& uID) const +{ + for (int i = 0; i < GetFuelTanksCount(); i++) { + const std::string tmpUID(m_fuelTanks[i]->GetUID()); + if (tmpUID == uID) { + return i + 1; + } + } + throw CTiglError("Invalid UID in CCPACSFuelTanks::GetFuelTankIndex", TIGL_UID_ERROR); +} + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.h b/src/fuelTanks/CCPACSFuelTanks.h similarity index 58% rename from src/fuelTanks/CCPACSGenericFuelTanks.h rename to src/fuelTanks/CCPACSFuelTanks.h index e5bd3ef82f..7660c8139e 100644 --- a/src/fuelTanks/CCPACSGenericFuelTanks.h +++ b/src/fuelTanks/CCPACSFuelTanks.h @@ -1,48 +1,48 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS genericFuelTanks handling routines. -*/ - -#pragma once - -#include "generated/CPACSGenericFuelTanks.h" - -namespace tigl -{ - -class CCPACSGenericFuelTanks : public generated::CPACSGenericFuelTanks -{ -public: - TIGL_EXPORT CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); - - // Get a specific hull for a given uID - TIGL_EXPORT CCPACSGenericFuelTank const& GetGenericFuelTank(std::string const& uID) const; - TIGL_EXPORT CCPACSGenericFuelTank& GetGenericFuelTank(std::string const& uID); - - // Get a specific hull for a given index. - TIGL_EXPORT CCPACSGenericFuelTank& GetGenericFuelTank(int index) const; - - // Returns the hull index for a given uID. - TIGL_EXPORT int GetGenericFuelTankIndex(const std::string& uID) const; - - // Returns the total count of fuselages in a configuration - TIGL_EXPORT int GetGenericFuelTanksCount() const; -}; - -} //namespace tigl +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS fuelTanks handling routines. +*/ + +#pragma once + +#include "generated/CPACSFuelTanks.h" + +namespace tigl +{ + +class CCPACSFuelTanks : public generated::CPACSFuelTanks +{ +public: + TIGL_EXPORT CCPACSFuelTanks(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr); + + // Get a specific hull for a given uID + TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(std::string const& uID) const; + TIGL_EXPORT CCPACSFuelTank& GetFuelTank(std::string const& uID); + + // Get a specific hull for a given index. + TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index) const; + + // Returns the hull index for a given uID. + TIGL_EXPORT int GetFuelTankIndex(const std::string& uID) const; + + // Returns the total count of fuselages in a configuration + TIGL_EXPORT int GetFuelTanksCount() const; +}; + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSGenericFuelTanks.cpp b/src/fuelTanks/CCPACSGenericFuelTanks.cpp deleted file mode 100644 index 660d53113b..0000000000 --- a/src/fuelTanks/CCPACSGenericFuelTanks.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS genericFuelTanks handling routines. -*/ - -#include "CCPACSGenericFuelTanks.h" -#include "CCPACSGenericFuelTank.h" -#include "CTiglError.h" - -namespace tigl -{ - -CCPACSGenericFuelTanks::CCPACSGenericFuelTanks(generated::CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr) - : generated::CPACSGenericFuelTanks(parent, uidMgr) -{ -} - -int CCPACSGenericFuelTanks::GetGenericFuelTanksCount() const -{ - return static_cast(m_genericFuelTanks.size()); -} - -CCPACSGenericFuelTank const& CCPACSGenericFuelTanks::GetGenericFuelTank(std::string const& uID) const -{ - return const_cast(*this).GetGenericFuelTank(uID); -} - -CCPACSGenericFuelTank& CCPACSGenericFuelTanks::GetGenericFuelTank(std::string const& uID) -{ - auto it = std::find_if(m_genericFuelTanks.begin(), m_genericFuelTanks.end(), - [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); - - if (it != std::end(m_genericFuelTanks)) { - return **it; - } - throw CTiglError("Could not find genericFuelTank with uid" + uID); -} - -CCPACSGenericFuelTank& CCPACSGenericFuelTanks::GetGenericFuelTank(int index) const -{ - index--; - if (index < 0 || index >= GetGenericFuelTanksCount()) { - throw CTiglError("Invalid index in CCPACSGenericFuelTanks::GetGenericFuelTank", TIGL_INDEX_ERROR); - } - return *m_genericFuelTanks[index]; -} - -int CCPACSGenericFuelTanks::GetGenericFuelTankIndex(const std::string& uID) const -{ - for (int i = 0; i < GetGenericFuelTanksCount(); i++) { - const std::string tmpUID(m_genericFuelTanks[i]->GetUID()); - if (tmpUID == uID) { - return i + 1; - } - } - throw CTiglError("Invalid UID in CCPACSGenericFuelTanks::GetGenericFuelTankIndex", TIGL_UID_ERROR); -} - -} //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index f93046dc57..92791d45a7 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -26,8 +26,8 @@ #include "CNamedShape.h" #include "CTiglTopoAlgorithms.h" #include "tiglcommonfunctions.h" -#include "CCPACSGenericFuelTank.h" -#include "CCPACSGenericFuelTanks.h" +#include "CCPACSFuelTank.h" +#include "CCPACSFuelTanks.h" #include "generated/CPACSDomeType.h" #include "generated/CPACSEllipsoidDome.h" #include "generated/CPACSTorisphericalDome.h" @@ -291,12 +291,16 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const TopoDS_Edge dome_edge = BRepBuilderAPI_MakeEdge(arc.Value()).Edge(); - TopoDS_Vertex v1 = GetLastVertex(dome_edge); - TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + std::vector edges = {dome_edge}; - TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + if (cylinderLength > 0.0) { + TopoDS_Vertex v1 = GetLastVertex(dome_edge); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinder_edge); + } - std::vector edges = {dome_edge, cylinder_edge}; BuildTankWire(edges, wire); } @@ -388,9 +392,9 @@ void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const throw CTiglError("The cylinder radius (" + std::to_string(m_cylinderRadius_choice2.get()) + ") of hull \"" + GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than 0!"); } - if (m_cylinderLength_choice2.get() <= 0) { + if (m_cylinderLength_choice2.get() < 0) { throw CTiglError("The cylinder length (" + std::to_string(m_cylinderLength_choice2.get()) + ") of hull \"" + - GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than 0!"); + GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than or equal to 0!"); } if (m_ellipsoid) { diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp index f7328c7df3..a182219ddc 100644 --- a/src/fuelTanks/CCPACSHulls.cpp +++ b/src/fuelTanks/CCPACSHulls.cpp @@ -26,7 +26,7 @@ namespace tigl { -CCPACSHulls::CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) +CCPACSHulls::CCPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) : generated::CPACSHulls(parent, uidMgr) { } diff --git a/src/fuelTanks/CCPACSHulls.h b/src/fuelTanks/CCPACSHulls.h index 813a18d715..b666e010da 100644 --- a/src/fuelTanks/CCPACSHulls.h +++ b/src/fuelTanks/CCPACSHulls.h @@ -30,7 +30,7 @@ namespace tigl class CCPACSHulls : public generated::CPACSHulls { public: - TIGL_EXPORT CCPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); // Get a specific hull for a given uID TIGL_EXPORT CCPACSHull const& GetHull(std::string const& uID) const; diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index bc7873d225..ad5160233a 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -29,7 +29,7 @@ #include "CCPACSDuct.h" #include "CCPACSHull.h" #include "CCPACSHulls.h" -#include "CCPACSGenericFuelTank.h" +#include "CCPACSFuelTank.h" #include "CCPACSFuselageSections.h" #include "CCPACSFuselageSection.h" #include "CCPACSFuselageSegment.h" @@ -173,6 +173,9 @@ CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSection boost::optional& CTiglFuselageConnection::GetParentComponentPositionings() const { + // ToDo: is there a better implementation for Elements not having a positionings element? + static boost::optional dummyPositionings; + if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetPositionings(); } @@ -180,7 +183,7 @@ boost::optional& CTiglFuselageConnection::GetParentComponent return segment->GetParent()->GetParent()->GetPositionings(); } else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetParent()->GetPositionings(); + return dummyPositionings; } else { throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); diff --git a/src/generated/CPACSAircraftModel.cpp b/src/generated/CPACSAircraftModel.cpp index e824635100..8fa565e849 100644 --- a/src/generated/CPACSAircraftModel.cpp +++ b/src/generated/CPACSAircraftModel.cpp @@ -179,6 +179,17 @@ namespace generated } } + // read element fuelTanks + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTanks")) { + m_fuelTanks = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_fuelTanks->ReadCPACS(tixiHandle, xpath + "/fuelTanks"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read fuelTanks at xpath " << xpath << ": " << e.what(); + m_fuelTanks = boost::none; + } + } + // read element systems if (tixi::TixiCheckElement(tixiHandle, xpath + "/systems")) { m_systems = boost::in_place(reinterpret_cast(this), m_uidMgr); @@ -301,6 +312,17 @@ namespace generated } } + // write element fuelTanks + if (m_fuelTanks) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/fuelTanks"); + m_fuelTanks->WriteCPACS(tixiHandle, xpath + "/fuelTanks"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTanks")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/fuelTanks"); + } + } + // write element systems if (m_systems) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/systems"); @@ -434,6 +456,16 @@ namespace generated return m_landingGears; } + const boost::optional& CPACSAircraftModel::GetFuelTanks() const + { + return m_fuelTanks; + } + + boost::optional& CPACSAircraftModel::GetFuelTanks() + { + return m_fuelTanks; + } + const boost::optional& CPACSAircraftModel::GetSystems() const { return m_systems; @@ -536,6 +568,18 @@ namespace generated m_landingGears = boost::none; } + CCPACSFuelTanks& CPACSAircraftModel::GetFuelTanks(CreateIfNotExistsTag) + { + if (!m_fuelTanks) + m_fuelTanks = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_fuelTanks; + } + + void CPACSAircraftModel::RemoveFuelTanks() + { + m_fuelTanks = boost::none; + } + CCPACSACSystems& CPACSAircraftModel::GetSystems(CreateIfNotExistsTag) { if (!m_systems) diff --git a/src/generated/CPACSAircraftModel.h b/src/generated/CPACSAircraftModel.h index b742b456ae..f0e1395755 100644 --- a/src/generated/CPACSAircraftModel.h +++ b/src/generated/CPACSAircraftModel.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -102,6 +103,9 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetLandingGears() const; TIGL_EXPORT virtual boost::optional& GetLandingGears(); + TIGL_EXPORT virtual const boost::optional& GetFuelTanks() const; + TIGL_EXPORT virtual boost::optional& GetFuelTanks(); + TIGL_EXPORT virtual const boost::optional& GetSystems() const; TIGL_EXPORT virtual boost::optional& GetSystems(); @@ -129,6 +133,9 @@ namespace generated TIGL_EXPORT virtual CPACSLandingGears& GetLandingGears(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveLandingGears(); + TIGL_EXPORT virtual CCPACSFuelTanks& GetFuelTanks(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveFuelTanks(); + TIGL_EXPORT virtual CCPACSACSystems& GetSystems(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveSystems(); @@ -163,6 +170,8 @@ namespace generated boost::optional m_landingGears; + boost::optional m_fuelTanks; + boost::optional m_systems; boost::optional m_genericGeometryComponents; diff --git a/src/generated/CPACSDomeType.cpp b/src/generated/CPACSDomeType.cpp index 87e3b0f1df..1f58c168c5 100644 --- a/src/generated/CPACSDomeType.cpp +++ b/src/generated/CPACSDomeType.cpp @@ -1,250 +1,250 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSHull.h" -#include "CPACSDomeType.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSDomeType::CPACSDomeType(CCPACSHull* parent) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSDomeType::~CPACSDomeType() - { - } - - const CCPACSHull* CPACSDomeType::GetParent() const - { - return m_parent; - } - - CCPACSHull* CPACSDomeType::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSDomeType::GetNextUIDParent() const - { - return m_parent; - } - - CTiglUIDObject* CPACSDomeType::GetNextUIDParent() - { - return m_parent; - } - - void CPACSDomeType::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read element ellipsoid - if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { - m_ellipsoid_choice1 = boost::in_place(this); - try { - m_ellipsoid_choice1->ReadCPACS(tixiHandle, xpath + "/ellipsoid"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read ellipsoid at xpath " << xpath << ": " << e.what(); - m_ellipsoid_choice1 = boost::none; - } - } - - // read element torispherical - if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { - m_torispherical_choice2 = boost::in_place(this); - try { - m_torispherical_choice2->ReadCPACS(tixiHandle, xpath + "/torispherical"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read torispherical at xpath " << xpath << ": " << e.what(); - m_torispherical_choice2 = boost::none; - } - } - - // read element isotensoid - if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { - m_isotensoid_choice3 = boost::in_place(this); - try { - m_isotensoid_choice3->ReadCPACS(tixiHandle, xpath + "/isotensoid"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read isotensoid at xpath " << xpath << ": " << e.what(); - m_isotensoid_choice3 = boost::none; - } - } - - if (!ValidateChoices()) { - LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; - } - } - - void CPACSDomeType::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write element ellipsoid - if (m_ellipsoid_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/ellipsoid"); - m_ellipsoid_choice1->WriteCPACS(tixiHandle, xpath + "/ellipsoid"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/ellipsoid"); - } - } - - // write element torispherical - if (m_torispherical_choice2) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/torispherical"); - m_torispherical_choice2->WriteCPACS(tixiHandle, xpath + "/torispherical"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/torispherical"); - } - } - - // write element isotensoid - if (m_isotensoid_choice3) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/isotensoid"); - m_isotensoid_choice3->WriteCPACS(tixiHandle, xpath + "/isotensoid"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/isotensoid"); - } - } - - } - - bool CPACSDomeType::ValidateChoices() const - { - return - ( - ( - ( - // mandatory elements of this choice must be there - m_ellipsoid_choice1.is_initialized() - && - // elements of other choices must not be there - !( - m_torispherical_choice2.is_initialized() - || - m_isotensoid_choice3.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_torispherical_choice2.is_initialized() - && - // elements of other choices must not be there - !( - m_ellipsoid_choice1.is_initialized() - || - m_isotensoid_choice3.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_isotensoid_choice3.is_initialized() - && - // elements of other choices must not be there - !( - m_ellipsoid_choice1.is_initialized() - || - m_torispherical_choice2.is_initialized() - ) - ) - == 1 - ) - ) - ; - } - - const boost::optional& CPACSDomeType::GetEllipsoid_choice1() const - { - return m_ellipsoid_choice1; - } - - boost::optional& CPACSDomeType::GetEllipsoid_choice1() - { - return m_ellipsoid_choice1; - } - - const boost::optional& CPACSDomeType::GetTorispherical_choice2() const - { - return m_torispherical_choice2; - } - - boost::optional& CPACSDomeType::GetTorispherical_choice2() - { - return m_torispherical_choice2; - } - - const boost::optional& CPACSDomeType::GetIsotensoid_choice3() const - { - return m_isotensoid_choice3; - } - - boost::optional& CPACSDomeType::GetIsotensoid_choice3() - { - return m_isotensoid_choice3; - } - - CPACSEllipsoidDome& CPACSDomeType::GetEllipsoid_choice1(CreateIfNotExistsTag) - { - if (!m_ellipsoid_choice1) - m_ellipsoid_choice1 = boost::in_place(this); - return *m_ellipsoid_choice1; - } - - void CPACSDomeType::RemoveEllipsoid_choice1() - { - m_ellipsoid_choice1 = boost::none; - } - - CPACSTorisphericalDome& CPACSDomeType::GetTorispherical_choice2(CreateIfNotExistsTag) - { - if (!m_torispherical_choice2) - m_torispherical_choice2 = boost::in_place(this); - return *m_torispherical_choice2; - } - - void CPACSDomeType::RemoveTorispherical_choice2() - { - m_torispherical_choice2 = boost::none; - } - - CPACSIsotensoidDome& CPACSDomeType::GetIsotensoid_choice3(CreateIfNotExistsTag) - { - if (!m_isotensoid_choice3) - m_isotensoid_choice3 = boost::in_place(this); - return *m_isotensoid_choice3; - } - - void CPACSDomeType::RemoveIsotensoid_choice3() - { - m_isotensoid_choice3 = boost::none; - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSHull.h" +#include "CPACSDomeType.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDomeType::CPACSDomeType(CCPACSHull* parent) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSDomeType::~CPACSDomeType() + { + } + + const CCPACSHull* CPACSDomeType::GetParent() const + { + return m_parent; + } + + CCPACSHull* CPACSDomeType::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSDomeType::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSDomeType::GetNextUIDParent() + { + return m_parent; + } + + void CPACSDomeType::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element ellipsoid + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { + m_ellipsoid_choice1 = boost::in_place(this); + try { + m_ellipsoid_choice1->ReadCPACS(tixiHandle, xpath + "/ellipsoid"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read ellipsoid at xpath " << xpath << ": " << e.what(); + m_ellipsoid_choice1 = boost::none; + } + } + + // read element torispherical + if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { + m_torispherical_choice2 = boost::in_place(this); + try { + m_torispherical_choice2->ReadCPACS(tixiHandle, xpath + "/torispherical"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read torispherical at xpath " << xpath << ": " << e.what(); + m_torispherical_choice2 = boost::none; + } + } + + // read element isotensoid + if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { + m_isotensoid_choice3 = boost::in_place(this); + try { + m_isotensoid_choice3->ReadCPACS(tixiHandle, xpath + "/isotensoid"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read isotensoid at xpath " << xpath << ": " << e.what(); + m_isotensoid_choice3 = boost::none; + } + } + + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSDomeType::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element ellipsoid + if (m_ellipsoid_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/ellipsoid"); + m_ellipsoid_choice1->WriteCPACS(tixiHandle, xpath + "/ellipsoid"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ellipsoid")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/ellipsoid"); + } + } + + // write element torispherical + if (m_torispherical_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/torispherical"); + m_torispherical_choice2->WriteCPACS(tixiHandle, xpath + "/torispherical"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/torispherical")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/torispherical"); + } + } + + // write element isotensoid + if (m_isotensoid_choice3) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/isotensoid"); + m_isotensoid_choice3->WriteCPACS(tixiHandle, xpath + "/isotensoid"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/isotensoid")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/isotensoid"); + } + } + + } + + bool CPACSDomeType::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_ellipsoid_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_torispherical_choice2.is_initialized() + || + m_isotensoid_choice3.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_torispherical_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_ellipsoid_choice1.is_initialized() + || + m_isotensoid_choice3.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_isotensoid_choice3.is_initialized() + && + // elements of other choices must not be there + !( + m_ellipsoid_choice1.is_initialized() + || + m_torispherical_choice2.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const boost::optional& CPACSDomeType::GetEllipsoid_choice1() const + { + return m_ellipsoid_choice1; + } + + boost::optional& CPACSDomeType::GetEllipsoid_choice1() + { + return m_ellipsoid_choice1; + } + + const boost::optional& CPACSDomeType::GetTorispherical_choice2() const + { + return m_torispherical_choice2; + } + + boost::optional& CPACSDomeType::GetTorispherical_choice2() + { + return m_torispherical_choice2; + } + + const boost::optional& CPACSDomeType::GetIsotensoid_choice3() const + { + return m_isotensoid_choice3; + } + + boost::optional& CPACSDomeType::GetIsotensoid_choice3() + { + return m_isotensoid_choice3; + } + + CPACSEllipsoidDome& CPACSDomeType::GetEllipsoid_choice1(CreateIfNotExistsTag) + { + if (!m_ellipsoid_choice1) + m_ellipsoid_choice1 = boost::in_place(this); + return *m_ellipsoid_choice1; + } + + void CPACSDomeType::RemoveEllipsoid_choice1() + { + m_ellipsoid_choice1 = boost::none; + } + + CPACSTorisphericalDome& CPACSDomeType::GetTorispherical_choice2(CreateIfNotExistsTag) + { + if (!m_torispherical_choice2) + m_torispherical_choice2 = boost::in_place(this); + return *m_torispherical_choice2; + } + + void CPACSDomeType::RemoveTorispherical_choice2() + { + m_torispherical_choice2 = boost::none; + } + + CPACSIsotensoidDome& CPACSDomeType::GetIsotensoid_choice3(CreateIfNotExistsTag) + { + if (!m_isotensoid_choice3) + m_isotensoid_choice3 = boost::in_place(this); + return *m_isotensoid_choice3; + } + + void CPACSDomeType::RemoveIsotensoid_choice3() + { + m_isotensoid_choice3 = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDomeType.h b/src/generated/CPACSDomeType.h index e9d8f3bfe1..de6063dea3 100644 --- a/src/generated/CPACSDomeType.h +++ b/src/generated/CPACSDomeType.h @@ -1,99 +1,99 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include "CPACSEllipsoidDome.h" -#include "CPACSIsotensoidDome.h" -#include "CPACSTorisphericalDome.h" -#include "CreateIfNotExists.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDObject; -class CCPACSHull; - -namespace generated -{ - // This class is used in: - // CPACSHull - - /// @brief Dome Type - /// - /// - /// - class CPACSDomeType - { - public: - TIGL_EXPORT CPACSDomeType(CCPACSHull* parent); - - TIGL_EXPORT virtual ~CPACSDomeType(); - - TIGL_EXPORT CCPACSHull* GetParent(); - - TIGL_EXPORT const CCPACSHull* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT bool ValidateChoices() const; - - TIGL_EXPORT virtual const boost::optional& GetEllipsoid_choice1() const; - TIGL_EXPORT virtual boost::optional& GetEllipsoid_choice1(); - - TIGL_EXPORT virtual const boost::optional& GetTorispherical_choice2() const; - TIGL_EXPORT virtual boost::optional& GetTorispherical_choice2(); - - TIGL_EXPORT virtual const boost::optional& GetIsotensoid_choice3() const; - TIGL_EXPORT virtual boost::optional& GetIsotensoid_choice3(); - - TIGL_EXPORT virtual CPACSEllipsoidDome& GetEllipsoid_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveEllipsoid_choice1(); - - TIGL_EXPORT virtual CPACSTorisphericalDome& GetTorispherical_choice2(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveTorispherical_choice2(); - - TIGL_EXPORT virtual CPACSIsotensoidDome& GetIsotensoid_choice3(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveIsotensoid_choice3(); - - protected: - CCPACSHull* m_parent; - - boost::optional m_ellipsoid_choice1; - boost::optional m_torispherical_choice2; - boost::optional m_isotensoid_choice3; - - private: - CPACSDomeType(const CPACSDomeType&) = delete; - CPACSDomeType& operator=(const CPACSDomeType&) = delete; - - CPACSDomeType(CPACSDomeType&&) = delete; - CPACSDomeType& operator=(CPACSDomeType&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSDomeType = generated::CPACSDomeType; -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CPACSEllipsoidDome.h" +#include "CPACSIsotensoidDome.h" +#include "CPACSTorisphericalDome.h" +#include "CreateIfNotExists.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; +class CCPACSHull; + +namespace generated +{ + // This class is used in: + // CPACSHull + + /// @brief Dome Type + /// + /// + /// + class CPACSDomeType + { + public: + TIGL_EXPORT CPACSDomeType(CCPACSHull* parent); + + TIGL_EXPORT virtual ~CPACSDomeType(); + + TIGL_EXPORT CCPACSHull* GetParent(); + + TIGL_EXPORT const CCPACSHull* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const boost::optional& GetEllipsoid_choice1() const; + TIGL_EXPORT virtual boost::optional& GetEllipsoid_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetTorispherical_choice2() const; + TIGL_EXPORT virtual boost::optional& GetTorispherical_choice2(); + + TIGL_EXPORT virtual const boost::optional& GetIsotensoid_choice3() const; + TIGL_EXPORT virtual boost::optional& GetIsotensoid_choice3(); + + TIGL_EXPORT virtual CPACSEllipsoidDome& GetEllipsoid_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveEllipsoid_choice1(); + + TIGL_EXPORT virtual CPACSTorisphericalDome& GetTorispherical_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveTorispherical_choice2(); + + TIGL_EXPORT virtual CPACSIsotensoidDome& GetIsotensoid_choice3(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveIsotensoid_choice3(); + + protected: + CCPACSHull* m_parent; + + boost::optional m_ellipsoid_choice1; + boost::optional m_torispherical_choice2; + boost::optional m_isotensoid_choice3; + + private: + CPACSDomeType(const CPACSDomeType&) = delete; + CPACSDomeType& operator=(const CPACSDomeType&) = delete; + + CPACSDomeType(CPACSDomeType&&) = delete; + CPACSDomeType& operator=(CPACSDomeType&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDomeType = generated::CPACSDomeType; +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTank.cpp b/src/generated/CPACSFuelTank.cpp similarity index 60% rename from src/generated/CPACSGenericFuelTank.cpp rename to src/generated/CPACSFuelTank.cpp index b1cae30de0..c3c816e1de 100644 --- a/src/generated/CPACSGenericFuelTank.cpp +++ b/src/generated/CPACSFuelTank.cpp @@ -1,298 +1,372 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSGenericFuelTanks.h" -#include "CPACSGenericFuelTank.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSGenericFuelTank::CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - , m_transformation(reinterpret_cast(this), m_uidMgr) - , m_hulls(reinterpret_cast(this), m_uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSGenericFuelTank::~CPACSGenericFuelTank() - { - if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); - } - - const CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() const - { - return m_parent; - } - - CCPACSGenericFuelTanks* CPACSGenericFuelTank::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSGenericFuelTank::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSGenericFuelTank::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSGenericFuelTank::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read attribute uID - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { - m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); - if (m_uID.empty()) { - LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; - } - - // read element name - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); - if (m_name.empty()) { - LOG(WARNING) << "Required element name is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required element name is missing at xpath " << xpath; - } - - // read element description - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); - if (m_description->empty()) { - LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; - } - } - - // read element transformation - if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { - m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); - } - else { - LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; - } - - // read element hulls - if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { - m_hulls.ReadCPACS(tixiHandle, xpath + "/hulls"); - } - else { - LOG(ERROR) << "Required element hulls is missing at xpath " << xpath; - } - - // read element volume - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - m_volume = boost::in_place(reinterpret_cast(this)); - try { - m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); - m_volume = boost::none; - } - } - - // read element burstPressure - if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { - m_burstPressure = tixi::TixiGetElement(tixiHandle, xpath + "/burstPressure"); - } - - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); - } - - void CPACSGenericFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - const std::vector childElemOrder = { "name", "description", "transformation", "hulls", "volume", "burstPressure" }; - - // write attribute uID - tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); - - // write element name - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); - - // write element description - if (m_description) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); - } - } - - // write element transformation - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); - m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); - - // write element hulls - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); - m_hulls.WriteCPACS(tixiHandle, xpath + "/hulls"); - - // write element volume - if (m_volume) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); - m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); - } - } - - // write element burstPressure - if (m_burstPressure) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/burstPressure", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/burstPressure", *m_burstPressure); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/burstPressure"); - } - } - - } - - const std::string& CPACSGenericFuelTank::GetUID() const - { - return m_uID; - } - - void CPACSGenericFuelTank::SetUID(const std::string& value) - { - if (m_uidMgr && value != m_uID) { - if (m_uID.empty()) { - m_uidMgr->RegisterObject(value, *this); - } - else { - m_uidMgr->UpdateObjectUID(m_uID, value); - } - } - m_uID = value; - } - - const std::string& CPACSGenericFuelTank::GetName() const - { - return m_name; - } - - void CPACSGenericFuelTank::SetName(const std::string& value) - { - m_name = value; - } - - const boost::optional& CPACSGenericFuelTank::GetDescription() const - { - return m_description; - } - - void CPACSGenericFuelTank::SetDescription(const boost::optional& value) - { - m_description = value; - } - - const CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() const - { - return m_transformation; - } - - CCPACSTransformation& CPACSGenericFuelTank::GetTransformation() - { - return m_transformation; - } - - const CCPACSHulls& CPACSGenericFuelTank::GetHulls() const - { - return m_hulls; - } - - CCPACSHulls& CPACSGenericFuelTank::GetHulls() - { - return m_hulls; - } - - const boost::optional& CPACSGenericFuelTank::GetVolume() const - { - return m_volume; - } - - boost::optional& CPACSGenericFuelTank::GetVolume() - { - return m_volume; - } - - const boost::optional& CPACSGenericFuelTank::GetBurstPressure() const - { - return m_burstPressure; - } - - void CPACSGenericFuelTank::SetBurstPressure(const boost::optional& value) - { - m_burstPressure = value; - } - - CPACSFuelTankVolume& CPACSGenericFuelTank::GetVolume(CreateIfNotExistsTag) - { - if (!m_volume) - m_volume = boost::in_place(reinterpret_cast(this)); - return *m_volume; - } - - void CPACSGenericFuelTank::RemoveVolume() - { - m_volume = boost::none; - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSFuelTanks.h" +#include "CPACSFuelTank.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSFuelTank::CPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_transformation(reinterpret_cast(this), m_uidMgr) + , m_hulls(reinterpret_cast(this), m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSFuelTank::~CPACSFuelTank() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + if (m_uidMgr) { + if (m_parentUID && !m_parentUID->empty()) m_uidMgr->TryUnregisterReference(*m_parentUID, *this); + } + } + + const CCPACSFuelTanks* CPACSFuelTank::GetParent() const + { + return m_parent; + } + + CCPACSFuelTanks* CPACSFuelTank::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSFuelTank::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSFuelTank::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSFuelTank::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSFuelTank::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSFuelTank::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read attribute symmetry + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "symmetry")) { + m_symmetry = stringToTiglSymmetryAxis(tixi::TixiGetAttribute(tixiHandle, xpath, "symmetry")); + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element parentUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/parentUID")) { + m_parentUID = tixi::TixiGetElement(tixiHandle, xpath + "/parentUID"); + if (m_parentUID->empty()) { + LOG(WARNING) << "Optional element parentUID is present but empty at xpath " << xpath; + } + if (m_uidMgr && !m_parentUID->empty()) m_uidMgr->RegisterReference(*m_parentUID, *this); + } + + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + + // read element hulls + if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { + m_hulls.ReadCPACS(tixiHandle, xpath + "/hulls"); + } + else { + LOG(ERROR) << "Required element hulls is missing at xpath " << xpath; + } + + // read element volume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + m_volume = boost::in_place(reinterpret_cast(this)); + try { + m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); + m_volume = boost::none; + } + } + + // read element burstPressure + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + m_burstPressure = tixi::TixiGetElement(tixiHandle, xpath + "/burstPressure"); + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + const std::vector childElemOrder = { "name", "description", "parentUID", "transformation", "hulls", "volume", "burstPressure" }; + + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write attribute symmetry + if (m_symmetry) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "symmetry", TiglSymmetryAxisToString(*m_symmetry)); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "symmetry")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "symmetry"); + } + } + + // write element name + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element parentUID + if (m_parentUID) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/parentUID", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/parentUID", *m_parentUID); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/parentUID")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/parentUID"); + } + } + + // write element transformation + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + + // write element hulls + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); + m_hulls.WriteCPACS(tixiHandle, xpath + "/hulls"); + + // write element volume + if (m_volume) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); + m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); + } + } + + // write element burstPressure + if (m_burstPressure) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/burstPressure", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/burstPressure", *m_burstPressure); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/burstPressure"); + } + } + + } + + const std::string& CPACSFuelTank::GetUID() const + { + return m_uID; + } + + void CPACSFuelTank::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const boost::optional& CPACSFuelTank::GetSymmetry() const + { + return m_symmetry; + } + + void CPACSFuelTank::SetSymmetry(const boost::optional& value) + { + m_symmetry = value; + } + + const std::string& CPACSFuelTank::GetName() const + { + return m_name; + } + + void CPACSFuelTank::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSFuelTank::GetDescription() const + { + return m_description; + } + + void CPACSFuelTank::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const boost::optional& CPACSFuelTank::GetParentUID() const + { + return m_parentUID; + } + + void CPACSFuelTank::SetParentUID(const boost::optional& value) + { + if (m_uidMgr) { + if (m_parentUID && !m_parentUID->empty()) m_uidMgr->TryUnregisterReference(*m_parentUID, *this); + if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); + } + m_parentUID = value; + } + + const CCPACSTransformation& CPACSFuelTank::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSFuelTank::GetTransformation() + { + return m_transformation; + } + + const CCPACSHulls& CPACSFuelTank::GetHulls() const + { + return m_hulls; + } + + CCPACSHulls& CPACSFuelTank::GetHulls() + { + return m_hulls; + } + + const boost::optional& CPACSFuelTank::GetVolume() const + { + return m_volume; + } + + boost::optional& CPACSFuelTank::GetVolume() + { + return m_volume; + } + + const boost::optional& CPACSFuelTank::GetBurstPressure() const + { + return m_burstPressure; + } + + void CPACSFuelTank::SetBurstPressure(const boost::optional& value) + { + m_burstPressure = value; + } + + CPACSFuelTankVolume& CPACSFuelTank::GetVolume(CreateIfNotExistsTag) + { + if (!m_volume) + m_volume = boost::in_place(reinterpret_cast(this)); + return *m_volume; + } + + void CPACSFuelTank::RemoveVolume() + { + m_volume = boost::none; + } + + const CTiglUIDObject* CPACSFuelTank::GetNextUIDObject() const + { + return this; + } + + void CPACSFuelTank::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) + { + if (m_parentUID && *m_parentUID == oldUid) { + m_parentUID = newUid; + } + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTank.h b/src/generated/CPACSFuelTank.h similarity index 70% rename from src/generated/CPACSGenericFuelTank.h rename to src/generated/CPACSFuelTank.h index 07a4f56c2e..d061b03c70 100644 --- a/src/generated/CPACSGenericFuelTank.h +++ b/src/generated/CPACSFuelTank.h @@ -1,121 +1,137 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include "CPACSFuelTankVolume.h" -#include "CreateIfNotExists.h" -#include "CTiglUIDObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; -class CCPACSGenericFuelTanks; - -namespace generated -{ - // This class is used in: - // CPACSGenericFuelTanks - - /// @brief Cryogenic tank - /// - /// - class CPACSGenericFuelTank : public CTiglReqUIDObject - { - public: - TIGL_EXPORT CPACSGenericFuelTank(CCPACSGenericFuelTanks* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSGenericFuelTank(); - - TIGL_EXPORT CCPACSGenericFuelTanks* GetParent(); - - TIGL_EXPORT const CCPACSGenericFuelTanks* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT virtual const std::string& GetUID() const; - TIGL_EXPORT virtual void SetUID(const std::string& value); - - TIGL_EXPORT virtual const std::string& GetName() const; - TIGL_EXPORT virtual void SetName(const std::string& value); - - TIGL_EXPORT virtual const boost::optional& GetDescription() const; - TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - - TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; - TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - - TIGL_EXPORT virtual const CCPACSHulls& GetHulls() const; - TIGL_EXPORT virtual CCPACSHulls& GetHulls(); - - TIGL_EXPORT virtual const boost::optional& GetVolume() const; - TIGL_EXPORT virtual boost::optional& GetVolume(); - - TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; - TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); - - TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveVolume(); - - protected: - CCPACSGenericFuelTanks* m_parent; - - CTiglUIDManager* m_uidMgr; - - std::string m_uID; - - /// Name - std::string m_name; - - /// Description - boost::optional m_description; - - CCPACSTransformation m_transformation; - - CCPACSHulls m_hulls; - - /// Volume - boost::optional m_volume; - - /// Burst pressure - boost::optional m_burstPressure; - - private: - CPACSGenericFuelTank(const CPACSGenericFuelTank&) = delete; - CPACSGenericFuelTank& operator=(const CPACSGenericFuelTank&) = delete; - - CPACSGenericFuelTank(CPACSGenericFuelTank&&) = delete; - CPACSGenericFuelTank& operator=(CPACSGenericFuelTank&&) = delete; - }; -} // namespace generated - -// CPACSGenericFuelTank is customized, use type CCPACSGenericFuelTank directly -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include "CPACSFuelTankVolume.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "ITiglUIDRefObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CCPACSFuelTanks; + +namespace generated +{ + // This class is used in: + // CPACSFuelTanks + + /// @brief Fuel tank + /// + /// + class CPACSFuelTank : public CTiglReqUIDObject, public ITiglUIDRefObject + { + public: + TIGL_EXPORT CPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSFuelTank(); + + TIGL_EXPORT CCPACSFuelTanks* GetParent(); + + TIGL_EXPORT const CCPACSFuelTanks* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetSymmetry() const; + TIGL_EXPORT virtual void SetSymmetry(const boost::optional& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetParentUID() const; + TIGL_EXPORT virtual void SetParentUID(const boost::optional& value); + + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + + TIGL_EXPORT virtual const CCPACSHulls& GetHulls() const; + TIGL_EXPORT virtual CCPACSHulls& GetHulls(); + + TIGL_EXPORT virtual const boost::optional& GetVolume() const; + TIGL_EXPORT virtual boost::optional& GetVolume(); + + TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; + TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); + + TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveVolume(); + + protected: + CCPACSFuelTanks* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + boost::optional m_symmetry; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + /// Parent component + boost::optional m_parentUID; + + CCPACSTransformation m_transformation; + + CCPACSHulls m_hulls; + + /// Volume + boost::optional m_volume; + + /// Burst pressure + boost::optional m_burstPressure; + + private: + TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; + TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; + + CPACSFuelTank(const CPACSFuelTank&) = delete; + CPACSFuelTank& operator=(const CPACSFuelTank&) = delete; + + CPACSFuelTank(CPACSFuelTank&&) = delete; + CPACSFuelTank& operator=(CPACSFuelTank&&) = delete; + }; +} // namespace generated + +// CPACSFuelTank is customized, use type CCPACSFuelTank directly +} // namespace tigl diff --git a/src/generated/CPACSFuelTankVolume.cpp b/src/generated/CPACSFuelTankVolume.cpp index 55a29da7ca..c2a338e1f7 100644 --- a/src/generated/CPACSFuelTankVolume.cpp +++ b/src/generated/CPACSFuelTankVolume.cpp @@ -16,8 +16,9 @@ // limitations under the License. #include -#include "CCPACSGenericFuelTank.h" +#include "CCPACSFuelTank.h" #include "CPACSFuelTankVolume.h" +#include "CPACSFuselageFuelTank.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDObject.h" @@ -27,35 +28,50 @@ namespace tigl { namespace generated { - CPACSFuelTankVolume::CPACSFuelTankVolume(CCPACSGenericFuelTank* parent) + CPACSFuelTankVolume::CPACSFuelTankVolume(CCPACSFuelTank* parent) : m_optimalVolume(0) { //assert(parent != NULL); m_parent = parent; + m_parentType = &typeid(CCPACSFuelTank); } - CPACSFuelTankVolume::~CPACSFuelTankVolume() - { - } - - const CCPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() const + CPACSFuelTankVolume::CPACSFuelTankVolume(CPACSFuselageFuelTank* parent) + : m_optimalVolume(0) { - return m_parent; + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSFuselageFuelTank); } - CCPACSGenericFuelTank* CPACSFuelTankVolume::GetParent() + CPACSFuelTankVolume::~CPACSFuelTankVolume() { - return m_parent; } const CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() const { - return m_parent; + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; } CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() { - return m_parent; + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; } void CPACSFuelTankVolume::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) diff --git a/src/generated/CPACSFuelTankVolume.h b/src/generated/CPACSFuelTankVolume.h index 763c5efe96..88038b81c8 100644 --- a/src/generated/CPACSFuelTankVolume.h +++ b/src/generated/CPACSFuelTankVolume.h @@ -21,17 +21,22 @@ #include #include #include +#include +#include "CTiglError.h" #include "tigl_internal.h" namespace tigl { class CTiglUIDObject; -class CCPACSGenericFuelTank; +class CCPACSFuelTank; namespace generated { + class CPACSFuselageFuelTank; + // This class is used in: - // CPACSGenericFuelTank + // CPACSFuelTank + // CPACSFuselageFuelTank /// @brief Definition of different volumes of the fuel tank. /// @@ -40,13 +45,36 @@ namespace generated class CPACSFuelTankVolume { public: - TIGL_EXPORT CPACSFuelTankVolume(CCPACSGenericFuelTank* parent); + TIGL_EXPORT CPACSFuelTankVolume(CCPACSFuelTank* parent); + TIGL_EXPORT CPACSFuelTankVolume(CPACSFuselageFuelTank* parent); TIGL_EXPORT virtual ~CPACSFuelTankVolume(); - TIGL_EXPORT CCPACSGenericFuelTank* GetParent(); - - TIGL_EXPORT const CCPACSGenericFuelTank* GetParent() const; + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -72,7 +100,8 @@ namespace generated TIGL_EXPORT virtual void SetRealVolumeFactor_choice2(const boost::optional& value); protected: - CCPACSGenericFuelTank* m_parent; + void* m_parent; + const std::type_info* m_parentType; /// Theoretical volume if material thicknesses /// (ribs, spars, skins, stringers) and systems (fuel pumps, @@ -104,4 +133,5 @@ namespace generated // Aliases in tigl namespace using CCPACSFuelTankVolume = generated::CPACSFuelTankVolume; +using CCPACSFuselageFuelTank = generated::CPACSFuselageFuelTank; } // namespace tigl diff --git a/src/generated/CPACSFuelTanks.cpp b/src/generated/CPACSFuelTanks.cpp new file mode 100644 index 0000000000..32000d55a3 --- /dev/null +++ b/src/generated/CPACSFuelTanks.cpp @@ -0,0 +1,123 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include "CCPACSAircraftModel.h" +#include "CPACSFuelTanks.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSFuelTanks::CPACSFuelTanks(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSFuelTanks::~CPACSFuelTanks() + { + } + + const CCPACSAircraftModel* CPACSFuelTanks::GetParent() const + { + return m_parent; + } + + CCPACSAircraftModel* CPACSFuelTanks::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSFuelTanks::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSFuelTanks::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSFuelTanks::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSFuelTanks::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSFuelTanks::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element fuelTank + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTank")) { + tixi::TixiReadElements(tixiHandle, xpath + "/fuelTank", m_fuelTanks, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + } + + } + + void CPACSFuelTanks::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element fuelTank + tixi::TixiSaveElements(tixiHandle, xpath + "/fuelTank", m_fuelTanks); + + } + + const std::vector>& CPACSFuelTanks::GetFuelTanks() const + { + return m_fuelTanks; + } + + std::vector>& CPACSFuelTanks::GetFuelTanks() + { + return m_fuelTanks; + } + + CCPACSFuelTank& CPACSFuelTanks::AddFuelTank() + { + m_fuelTanks.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + return *m_fuelTanks.back(); + } + + void CPACSFuelTanks::RemoveFuelTank(CCPACSFuelTank& ref) + { + for (std::size_t i = 0; i < m_fuelTanks.size(); i++) { + if (m_fuelTanks[i].get() == &ref) { + m_fuelTanks.erase(m_fuelTanks.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericFuelTanks.h b/src/generated/CPACSFuelTanks.h similarity index 56% rename from src/generated/CPACSGenericFuelTanks.h rename to src/generated/CPACSFuelTanks.h index fa7587f867..27161a2d34 100644 --- a/src/generated/CPACSGenericFuelTanks.h +++ b/src/generated/CPACSFuelTanks.h @@ -27,29 +27,28 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSGenericFuelTank; +class CCPACSFuelTank; +class CCPACSAircraftModel; namespace generated { - class CPACSFuselageFuelTanks; - // This class is used in: - // CPACSFuselageFuelTanks + // CPACSAircraftModel - /// @brief Generic fuel tank + /// @brief Fuel tanks /// /// /// - class CPACSGenericFuelTanks + class CPACSFuelTanks { public: - TIGL_EXPORT CPACSGenericFuelTanks(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuelTanks(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT virtual ~CPACSGenericFuelTanks(); + TIGL_EXPORT virtual ~CPACSFuelTanks(); - TIGL_EXPORT CPACSFuselageFuelTanks* GetParent(); + TIGL_EXPORT CCPACSAircraftModel* GetParent(); - TIGL_EXPORT const CPACSFuselageFuelTanks* GetParent() const; + TIGL_EXPORT const CCPACSAircraftModel* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -60,30 +59,27 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const std::vector>& GetGenericFuelTanks() const; - TIGL_EXPORT virtual std::vector>& GetGenericFuelTanks(); + TIGL_EXPORT virtual const std::vector>& GetFuelTanks() const; + TIGL_EXPORT virtual std::vector>& GetFuelTanks(); - TIGL_EXPORT virtual CCPACSGenericFuelTank& AddGenericFuelTank(); - TIGL_EXPORT virtual void RemoveGenericFuelTank(CCPACSGenericFuelTank& ref); + TIGL_EXPORT virtual CCPACSFuelTank& AddFuelTank(); + TIGL_EXPORT virtual void RemoveFuelTank(CCPACSFuelTank& ref); protected: - CPACSFuselageFuelTanks* m_parent; + CCPACSAircraftModel* m_parent; CTiglUIDManager* m_uidMgr; - std::vector> m_genericFuelTanks; + std::vector> m_fuelTanks; private: - CPACSGenericFuelTanks(const CPACSGenericFuelTanks&) = delete; - CPACSGenericFuelTanks& operator=(const CPACSGenericFuelTanks&) = delete; + CPACSFuelTanks(const CPACSFuelTanks&) = delete; + CPACSFuelTanks& operator=(const CPACSFuelTanks&) = delete; - CPACSGenericFuelTanks(CPACSGenericFuelTanks&&) = delete; - CPACSGenericFuelTanks& operator=(CPACSGenericFuelTanks&&) = delete; + CPACSFuelTanks(CPACSFuelTanks&&) = delete; + CPACSFuelTanks& operator=(CPACSFuelTanks&&) = delete; }; } // namespace generated -// CPACSGenericFuelTanks is customized, use type CCPACSGenericFuelTanks directly - -// Aliases in tigl namespace -using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; +// CPACSFuelTanks is customized, use type CCPACSFuelTanks directly } // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTank.cpp b/src/generated/CPACSFuselageFuelTank.cpp new file mode 100644 index 0000000000..a5df59d2f1 --- /dev/null +++ b/src/generated/CPACSFuselageFuelTank.cpp @@ -0,0 +1,273 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSFuselageFuelTank.h" +#include "CPACSFuselageFuelTanks.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSFuselageFuelTank::CPACSFuselageFuelTank(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSFuselageFuelTank::~CPACSFuselageFuelTank() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + if (m_uidMgr) { + if (!m_compartmentUID.empty()) m_uidMgr->TryUnregisterReference(m_compartmentUID, *this); + } + } + + const CPACSFuselageFuelTanks* CPACSFuselageFuelTank::GetParent() const + { + return m_parent; + } + + CPACSFuselageFuelTanks* CPACSFuselageFuelTank::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSFuselageFuelTank::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSFuselageFuelTank::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSFuselageFuelTank::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSFuselageFuelTank::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSFuselageFuelTank::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name->empty()) { + LOG(WARNING) << "Optional element name is present but empty at xpath " << xpath; + } + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element compartmentUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/compartmentUID")) { + m_compartmentUID = tixi::TixiGetElement(tixiHandle, xpath + "/compartmentUID"); + if (m_compartmentUID.empty()) { + LOG(WARNING) << "Required element compartmentUID is empty at xpath " << xpath; + } + if (m_uidMgr && !m_compartmentUID.empty()) m_uidMgr->RegisterReference(m_compartmentUID, *this); + } + else { + LOG(ERROR) << "Required element compartmentUID is missing at xpath " << xpath; + } + + // read element volume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + m_volume = boost::in_place(this); + try { + m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); + m_volume = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSFuselageFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + if (m_name) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name"); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", *m_name); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/name"); + } + } + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element compartmentUID + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/compartmentUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/compartmentUID", m_compartmentUID); + + // write element volume + if (m_volume) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/volume"); + m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); + } + } + + } + + const std::string& CPACSFuselageFuelTank::GetUID() const + { + return m_uID; + } + + void CPACSFuselageFuelTank::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const boost::optional& CPACSFuselageFuelTank::GetName() const + { + return m_name; + } + + void CPACSFuselageFuelTank::SetName(const boost::optional& value) + { + m_name = value; + } + + const boost::optional& CPACSFuselageFuelTank::GetDescription() const + { + return m_description; + } + + void CPACSFuselageFuelTank::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const std::string& CPACSFuselageFuelTank::GetCompartmentUID() const + { + return m_compartmentUID; + } + + void CPACSFuselageFuelTank::SetCompartmentUID(const std::string& value) + { + if (m_uidMgr) { + if (!m_compartmentUID.empty()) m_uidMgr->TryUnregisterReference(m_compartmentUID, *this); + if (!value.empty()) m_uidMgr->RegisterReference(value, *this); + } + m_compartmentUID = value; + } + + const boost::optional& CPACSFuselageFuelTank::GetVolume() const + { + return m_volume; + } + + boost::optional& CPACSFuselageFuelTank::GetVolume() + { + return m_volume; + } + + CPACSFuelTankVolume& CPACSFuselageFuelTank::GetVolume(CreateIfNotExistsTag) + { + if (!m_volume) + m_volume = boost::in_place(this); + return *m_volume; + } + + void CPACSFuselageFuelTank::RemoveVolume() + { + m_volume = boost::none; + } + + const CTiglUIDObject* CPACSFuselageFuelTank::GetNextUIDObject() const + { + return this; + } + + void CPACSFuselageFuelTank::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) + { + if (m_compartmentUID == oldUid) { + m_compartmentUID = newUid; + } + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTank.h b/src/generated/CPACSFuselageFuelTank.h new file mode 100644 index 0000000000..2b94823177 --- /dev/null +++ b/src/generated/CPACSFuselageFuelTank.h @@ -0,0 +1,117 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CPACSFuelTankVolume.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "ITiglUIDRefObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSFuselageFuelTanks; + + // This class is used in: + // CPACSFuselageFuelTanks + + /// @brief Definition of one fuselage fuel tank. + /// + /// The definition of fuselage tanks is still preliminary. + /// Currently, there is no link to any structural elements + /// + class CPACSFuselageFuelTank : public CTiglReqUIDObject, public ITiglUIDRefObject + { + public: + TIGL_EXPORT CPACSFuselageFuelTank(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSFuselageFuelTank(); + + TIGL_EXPORT CPACSFuselageFuelTanks* GetParent(); + + TIGL_EXPORT const CPACSFuselageFuelTanks* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetName() const; + TIGL_EXPORT virtual void SetName(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const std::string& GetCompartmentUID() const; + TIGL_EXPORT virtual void SetCompartmentUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetVolume() const; + TIGL_EXPORT virtual boost::optional& GetVolume(); + + TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveVolume(); + + protected: + CPACSFuselageFuelTanks* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name of the fuselage fuel tank. + boost::optional m_name; + + /// Description of the fuselage fuel tank. + boost::optional m_description; + + /// Link to the tank geometry defined by a compartment. + std::string m_compartmentUID; + + boost::optional m_volume; + + private: + TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; + TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; + + CPACSFuselageFuelTank(const CPACSFuselageFuelTank&) = delete; + CPACSFuselageFuelTank& operator=(const CPACSFuselageFuelTank&) = delete; + + CPACSFuselageFuelTank(CPACSFuselageFuelTank&&) = delete; + CPACSFuselageFuelTank& operator=(CPACSFuselageFuelTank&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSFuselageFuelTank = generated::CPACSFuselageFuelTank; +using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; +} // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTanks.cpp b/src/generated/CPACSFuselageFuelTanks.cpp index edf8737535..6a92d2568b 100644 --- a/src/generated/CPACSFuselageFuelTanks.cpp +++ b/src/generated/CPACSFuselageFuelTanks.cpp @@ -17,6 +17,7 @@ #include #include "CCPACSFuselage.h" +#include "CPACSFuselageFuelTank.h" #include "CPACSFuselageFuelTanks.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -77,56 +78,45 @@ namespace generated void CPACSFuselageFuelTanks::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { - // read element genericFuelTanks - if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFuelTanks")) { - m_genericFuelTanks = boost::in_place(this, m_uidMgr); - try { - m_genericFuelTanks->ReadCPACS(tixiHandle, xpath + "/genericFuelTanks"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read genericFuelTanks at xpath " << xpath << ": " << e.what(); - m_genericFuelTanks = boost::none; - } + // read element fuselageFuelTank + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuselageFuelTank")) { + tixi::TixiReadElements(tixiHandle, xpath + "/fuselageFuelTank", m_fuselageFuelTanks, 1, tixi::xsdUnbounded, this, m_uidMgr); } } void CPACSFuselageFuelTanks::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "genericFuelTanks" }; - - // write element genericFuelTanks - if (m_genericFuelTanks) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/genericFuelTanks", childElemOrder); - m_genericFuelTanks->WriteCPACS(tixiHandle, xpath + "/genericFuelTanks"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFuelTanks")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/genericFuelTanks"); - } - } + // write element fuselageFuelTank + tixi::TixiSaveElements(tixiHandle, xpath + "/fuselageFuelTank", m_fuselageFuelTanks); } - const boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() const + const std::vector>& CPACSFuselageFuelTanks::GetFuselageFuelTanks() const { - return m_genericFuelTanks; + return m_fuselageFuelTanks; } - boost::optional& CPACSFuselageFuelTanks::GetGenericFuelTanks() + std::vector>& CPACSFuselageFuelTanks::GetFuselageFuelTanks() { - return m_genericFuelTanks; + return m_fuselageFuelTanks; } - CCPACSGenericFuelTanks& CPACSFuselageFuelTanks::GetGenericFuelTanks(CreateIfNotExistsTag) + CPACSFuselageFuelTank& CPACSFuselageFuelTanks::AddFuselageFuelTank() { - if (!m_genericFuelTanks) - m_genericFuelTanks = boost::in_place(this, m_uidMgr); - return *m_genericFuelTanks; + m_fuselageFuelTanks.push_back(make_unique(this, m_uidMgr)); + return *m_fuselageFuelTanks.back(); } - void CPACSFuselageFuelTanks::RemoveGenericFuelTanks() + void CPACSFuselageFuelTanks::RemoveFuselageFuelTank(CPACSFuselageFuelTank& ref) { - m_genericFuelTanks = boost::none; + for (std::size_t i = 0; i < m_fuselageFuelTanks.size(); i++) { + if (m_fuselageFuelTanks[i].get() == &ref) { + m_fuselageFuelTanks.erase(m_fuselageFuelTanks.begin() + i); + return; + } + } + throw CTiglError("Element not found"); } } // namespace generated diff --git a/src/generated/CPACSFuselageFuelTanks.h b/src/generated/CPACSFuselageFuelTanks.h index 548e5c4dee..fce254e24f 100644 --- a/src/generated/CPACSFuselageFuelTanks.h +++ b/src/generated/CPACSFuselageFuelTanks.h @@ -17,13 +17,11 @@ #pragma once -#include -#include -#include #include #include -#include "CreateIfNotExists.h" +#include #include "tigl_internal.h" +#include "UniquePtr.h" namespace tigl { @@ -33,10 +31,12 @@ class CCPACSFuselage; namespace generated { + class CPACSFuselageFuelTank; + // This class is used in: // CPACSFuselage - /// @brief List of fuel tanks + /// @brief List of fuselage fuel tanks. /// /// /// @@ -60,18 +60,20 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const boost::optional& GetGenericFuelTanks() const; - TIGL_EXPORT virtual boost::optional& GetGenericFuelTanks(); + TIGL_EXPORT virtual const std::vector>& GetFuselageFuelTanks() const; + TIGL_EXPORT virtual std::vector>& GetFuselageFuelTanks(); - TIGL_EXPORT virtual CCPACSGenericFuelTanks& GetGenericFuelTanks(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveGenericFuelTanks(); + TIGL_EXPORT virtual CPACSFuselageFuelTank& AddFuselageFuelTank(); + TIGL_EXPORT virtual void RemoveFuselageFuelTank(CPACSFuselageFuelTank& ref); protected: CCPACSFuselage* m_parent; CTiglUIDManager* m_uidMgr; - boost::optional m_genericFuelTanks; + /// The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. + /// The fuel tank volume type should also be used for the wing fuel tank + std::vector> m_fuselageFuelTanks; private: CPACSFuselageFuelTanks(const CPACSFuselageFuelTanks&) = delete; @@ -84,4 +86,5 @@ namespace generated // Aliases in tigl namespace using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; +using CCPACSFuselageFuelTank = generated::CPACSFuselageFuelTank; } // namespace tigl diff --git a/src/generated/CPACSGenericFuelTanks.cpp b/src/generated/CPACSGenericFuelTanks.cpp deleted file mode 100644 index 79a955dbb5..0000000000 --- a/src/generated/CPACSGenericFuelTanks.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include "CPACSFuselageFuelTanks.h" -#include "CPACSGenericFuelTanks.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSGenericFuelTanks::CPACSGenericFuelTanks(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSGenericFuelTanks::~CPACSGenericFuelTanks() - { - } - - const CPACSFuselageFuelTanks* CPACSGenericFuelTanks::GetParent() const - { - return m_parent; - } - - CPACSFuselageFuelTanks* CPACSGenericFuelTanks::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSGenericFuelTanks::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSGenericFuelTanks::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDManager& CPACSGenericFuelTanks::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSGenericFuelTanks::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSGenericFuelTanks::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read element genericFuelTank - if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFuelTank")) { - tixi::TixiReadElements(tixiHandle, xpath + "/genericFuelTank", m_genericFuelTanks, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); - } - - } - - void CPACSGenericFuelTanks::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write element genericFuelTank - tixi::TixiSaveElements(tixiHandle, xpath + "/genericFuelTank", m_genericFuelTanks); - - } - - const std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() const - { - return m_genericFuelTanks; - } - - std::vector>& CPACSGenericFuelTanks::GetGenericFuelTanks() - { - return m_genericFuelTanks; - } - - CCPACSGenericFuelTank& CPACSGenericFuelTanks::AddGenericFuelTank() - { - m_genericFuelTanks.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); - return *m_genericFuelTanks.back(); - } - - void CPACSGenericFuelTanks::RemoveGenericFuelTank(CCPACSGenericFuelTank& ref) - { - for (std::size_t i = 0; i < m_genericFuelTanks.size(); i++) { - if (m_genericFuelTanks[i].get() == &ref) { - m_genericFuelTanks.erase(m_genericFuelTanks.begin() + i); - return; - } - } - throw CTiglError("Element not found"); - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSHull.cpp index cd7d16c4d2..36c1075005 100644 --- a/src/generated/CPACSHull.cpp +++ b/src/generated/CPACSHull.cpp @@ -1,478 +1,478 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSHulls.h" -#include "CPACSHull.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSHull::CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - , m_transformation(reinterpret_cast(this), m_uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSHull::~CPACSHull() - { - if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); - } - - const CCPACSHulls* CPACSHull::GetParent() const - { - return m_parent; - } - - CCPACSHulls* CPACSHull::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSHull::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSHull::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDManager& CPACSHull::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSHull::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSHull::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read attribute uID - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { - m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); - if (m_uID.empty()) { - LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; - } - - // read element name - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); - if (m_name.empty()) { - LOG(WARNING) << "Required element name is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required element name is missing at xpath " << xpath; - } - - // read element description - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); - if (m_description->empty()) { - LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; - } - } - - // read element transformation - if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { - m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); - } - else { - LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; - } - - // read element sections - if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { - m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_sections_choice1->ReadCPACS(tixiHandle, xpath + "/sections"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read sections at xpath " << xpath << ": " << e.what(); - m_sections_choice1 = boost::none; - } - } - - // read element segments - if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { - m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_segments_choice1->ReadCPACS(tixiHandle, xpath + "/segments"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read segments at xpath " << xpath << ": " << e.what(); - m_segments_choice1 = boost::none; - } - } - - // read element cylinderRadius - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { - m_cylinderRadius_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); - } - - // read element cylinderLength - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { - m_cylinderLength_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderLength"); - } - - // read element domeType - if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { - m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); - try { - m_domeType_choice2->ReadCPACS(tixiHandle, xpath + "/domeType"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read domeType at xpath " << xpath << ": " << e.what(); - m_domeType_choice2 = boost::none; - } - } - - // read element structure - if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { - m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_structure->ReadCPACS(tixiHandle, xpath + "/structure"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read structure at xpath " << xpath << ": " << e.what(); - m_structure = boost::none; - } - } - - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); - if (!ValidateChoices()) { - LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; - } - } - - void CPACSHull::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure" }; - - // write attribute uID - tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); - - // write element name - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); - - // write element description - if (m_description) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); - } - } - - // write element transformation - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); - m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); - - // write element sections - if (m_sections_choice1) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/sections", childElemOrder); - m_sections_choice1->WriteCPACS(tixiHandle, xpath + "/sections"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/sections"); - } - } - - // write element segments - if (m_segments_choice1) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/segments", childElemOrder); - m_segments_choice1->WriteCPACS(tixiHandle, xpath + "/segments"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/segments"); - } - } - - // write element cylinderRadius - if (m_cylinderRadius_choice2) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderRadius", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", *m_cylinderRadius_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderRadius"); - } - } - - // write element cylinderLength - if (m_cylinderLength_choice2) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderLength", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderLength", *m_cylinderLength_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderLength"); - } - } - - // write element domeType - if (m_domeType_choice2) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/domeType", childElemOrder); - m_domeType_choice2->WriteCPACS(tixiHandle, xpath + "/domeType"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/domeType"); - } - } - - // write element structure - if (m_structure) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/structure", childElemOrder); - m_structure->WriteCPACS(tixiHandle, xpath + "/structure"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/structure"); - } - } - - } - - bool CPACSHull::ValidateChoices() const - { - return - ( - ( - ( - // mandatory elements of this choice must be there - m_sections_choice1.is_initialized() - && - m_segments_choice1.is_initialized() - && - // elements of other choices must not be there - !( - m_cylinderRadius_choice2.is_initialized() - || - m_cylinderLength_choice2.is_initialized() - || - m_domeType_choice2.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_cylinderRadius_choice2.is_initialized() - && - m_cylinderLength_choice2.is_initialized() - && - m_domeType_choice2.is_initialized() - && - // elements of other choices must not be there - !( - m_sections_choice1.is_initialized() - || - m_segments_choice1.is_initialized() - ) - ) - == 1 - ) - ) - ; - } - - const std::string& CPACSHull::GetUID() const - { - return m_uID; - } - - void CPACSHull::SetUID(const std::string& value) - { - if (m_uidMgr && value != m_uID) { - if (m_uID.empty()) { - m_uidMgr->RegisterObject(value, *this); - } - else { - m_uidMgr->UpdateObjectUID(m_uID, value); - } - } - m_uID = value; - } - - const std::string& CPACSHull::GetName() const - { - return m_name; - } - - void CPACSHull::SetName(const std::string& value) - { - m_name = value; - } - - const boost::optional& CPACSHull::GetDescription() const - { - return m_description; - } - - void CPACSHull::SetDescription(const boost::optional& value) - { - m_description = value; - } - - const CCPACSTransformation& CPACSHull::GetTransformation() const - { - return m_transformation; - } - - CCPACSTransformation& CPACSHull::GetTransformation() - { - return m_transformation; - } - - const boost::optional& CPACSHull::GetSections_choice1() const - { - return m_sections_choice1; - } - - boost::optional& CPACSHull::GetSections_choice1() - { - return m_sections_choice1; - } - - const boost::optional& CPACSHull::GetSegments_choice1() const - { - return m_segments_choice1; - } - - boost::optional& CPACSHull::GetSegments_choice1() - { - return m_segments_choice1; - } - - const boost::optional& CPACSHull::GetCylinderRadius_choice2() const - { - return m_cylinderRadius_choice2; - } - - void CPACSHull::SetCylinderRadius_choice2(const boost::optional& value) - { - m_cylinderRadius_choice2 = value; - } - - const boost::optional& CPACSHull::GetCylinderLength_choice2() const - { - return m_cylinderLength_choice2; - } - - void CPACSHull::SetCylinderLength_choice2(const boost::optional& value) - { - m_cylinderLength_choice2 = value; - } - - const boost::optional& CPACSHull::GetDomeType_choice2() const - { - return m_domeType_choice2; - } - - boost::optional& CPACSHull::GetDomeType_choice2() - { - return m_domeType_choice2; - } - - const boost::optional& CPACSHull::GetStructure() const - { - return m_structure; - } - - boost::optional& CPACSHull::GetStructure() - { - return m_structure; - } - - CCPACSFuselageSections& CPACSHull::GetSections_choice1(CreateIfNotExistsTag) - { - if (!m_sections_choice1) - m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_sections_choice1; - } - - void CPACSHull::RemoveSections_choice1() - { - m_sections_choice1 = boost::none; - } - - CCPACSFuselageSegments& CPACSHull::GetSegments_choice1(CreateIfNotExistsTag) - { - if (!m_segments_choice1) - m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_segments_choice1; - } - - void CPACSHull::RemoveSegments_choice1() - { - m_segments_choice1 = boost::none; - } - - CPACSDomeType& CPACSHull::GetDomeType_choice2(CreateIfNotExistsTag) - { - if (!m_domeType_choice2) - m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); - return *m_domeType_choice2; - } - - void CPACSHull::RemoveDomeType_choice2() - { - m_domeType_choice2 = boost::none; - } - - CCPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) - { - if (!m_structure) - m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_structure; - } - - void CPACSHull::RemoveStructure() - { - m_structure = boost::none; - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSHulls.h" +#include "CPACSHull.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSHull::CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_transformation(reinterpret_cast(this), m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSHull::~CPACSHull() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CCPACSHulls* CPACSHull::GetParent() const + { + return m_parent; + } + + CCPACSHulls* CPACSHull::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSHull::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSHull::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSHull::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSHull::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSHull::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + + // read element sections + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_sections_choice1->ReadCPACS(tixiHandle, xpath + "/sections"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read sections at xpath " << xpath << ": " << e.what(); + m_sections_choice1 = boost::none; + } + } + + // read element segments + if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_segments_choice1->ReadCPACS(tixiHandle, xpath + "/segments"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read segments at xpath " << xpath << ": " << e.what(); + m_segments_choice1 = boost::none; + } + } + + // read element cylinderRadius + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { + m_cylinderRadius_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderRadius"); + } + + // read element cylinderLength + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { + m_cylinderLength_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/cylinderLength"); + } + + // read element domeType + if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + try { + m_domeType_choice2->ReadCPACS(tixiHandle, xpath + "/domeType"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read domeType at xpath " << xpath << ": " << e.what(); + m_domeType_choice2 = boost::none; + } + } + + // read element structure + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_structure->ReadCPACS(tixiHandle, xpath + "/structure"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read structure at xpath " << xpath << ": " << e.what(); + m_structure = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSHull::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure" }; + + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/name", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/description", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element transformation + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + + // write element sections + if (m_sections_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/sections", childElemOrder); + m_sections_choice1->WriteCPACS(tixiHandle, xpath + "/sections"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/sections"); + } + } + + // write element segments + if (m_segments_choice1) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/segments", childElemOrder); + m_segments_choice1->WriteCPACS(tixiHandle, xpath + "/segments"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/segments"); + } + } + + // write element cylinderRadius + if (m_cylinderRadius_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderRadius", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderRadius", *m_cylinderRadius_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderRadius")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderRadius"); + } + } + + // write element cylinderLength + if (m_cylinderLength_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/cylinderLength", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/cylinderLength", *m_cylinderLength_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cylinderLength")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/cylinderLength"); + } + } + + // write element domeType + if (m_domeType_choice2) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/domeType", childElemOrder); + m_domeType_choice2->WriteCPACS(tixiHandle, xpath + "/domeType"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/domeType"); + } + } + + // write element structure + if (m_structure) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/structure", childElemOrder); + m_structure->WriteCPACS(tixiHandle, xpath + "/structure"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/structure"); + } + } + + } + + bool CPACSHull::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_sections_choice1.is_initialized() + && + m_segments_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_cylinderRadius_choice2.is_initialized() + || + m_cylinderLength_choice2.is_initialized() + || + m_domeType_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_cylinderRadius_choice2.is_initialized() + && + m_cylinderLength_choice2.is_initialized() + && + m_domeType_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_sections_choice1.is_initialized() + || + m_segments_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const std::string& CPACSHull::GetUID() const + { + return m_uID; + } + + void CPACSHull::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const std::string& CPACSHull::GetName() const + { + return m_name; + } + + void CPACSHull::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSHull::GetDescription() const + { + return m_description; + } + + void CPACSHull::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const CCPACSTransformation& CPACSHull::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSHull::GetTransformation() + { + return m_transformation; + } + + const boost::optional& CPACSHull::GetSections_choice1() const + { + return m_sections_choice1; + } + + boost::optional& CPACSHull::GetSections_choice1() + { + return m_sections_choice1; + } + + const boost::optional& CPACSHull::GetSegments_choice1() const + { + return m_segments_choice1; + } + + boost::optional& CPACSHull::GetSegments_choice1() + { + return m_segments_choice1; + } + + const boost::optional& CPACSHull::GetCylinderRadius_choice2() const + { + return m_cylinderRadius_choice2; + } + + void CPACSHull::SetCylinderRadius_choice2(const boost::optional& value) + { + m_cylinderRadius_choice2 = value; + } + + const boost::optional& CPACSHull::GetCylinderLength_choice2() const + { + return m_cylinderLength_choice2; + } + + void CPACSHull::SetCylinderLength_choice2(const boost::optional& value) + { + m_cylinderLength_choice2 = value; + } + + const boost::optional& CPACSHull::GetDomeType_choice2() const + { + return m_domeType_choice2; + } + + boost::optional& CPACSHull::GetDomeType_choice2() + { + return m_domeType_choice2; + } + + const boost::optional& CPACSHull::GetStructure() const + { + return m_structure; + } + + boost::optional& CPACSHull::GetStructure() + { + return m_structure; + } + + CCPACSFuselageSections& CPACSHull::GetSections_choice1(CreateIfNotExistsTag) + { + if (!m_sections_choice1) + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_sections_choice1; + } + + void CPACSHull::RemoveSections_choice1() + { + m_sections_choice1 = boost::none; + } + + CCPACSFuselageSegments& CPACSHull::GetSegments_choice1(CreateIfNotExistsTag) + { + if (!m_segments_choice1) + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_segments_choice1; + } + + void CPACSHull::RemoveSegments_choice1() + { + m_segments_choice1 = boost::none; + } + + CPACSDomeType& CPACSHull::GetDomeType_choice2(CreateIfNotExistsTag) + { + if (!m_domeType_choice2) + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + return *m_domeType_choice2; + } + + void CPACSHull::RemoveDomeType_choice2() + { + m_domeType_choice2 = boost::none; + } + + CCPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) + { + if (!m_structure) + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_structure; + } + + void CPACSHull::RemoveStructure() + { + m_structure = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSHull.h index dfb3942f06..00ea512d72 100644 --- a/src/generated/CPACSHull.h +++ b/src/generated/CPACSHull.h @@ -1,149 +1,149 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include "CPACSDomeType.h" -#include "CreateIfNotExists.h" -#include "CTiglUIDObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; -class CCPACSHulls; - -namespace generated -{ - // This class is used in: - // CPACSHulls - - /// @brief Hulls - /// - /// - class CPACSHull : public CTiglReqUIDObject - { - public: - TIGL_EXPORT CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSHull(); - - TIGL_EXPORT CCPACSHulls* GetParent(); - - TIGL_EXPORT const CCPACSHulls* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT bool ValidateChoices() const; - - TIGL_EXPORT virtual const std::string& GetUID() const; - TIGL_EXPORT virtual void SetUID(const std::string& value); - - TIGL_EXPORT virtual const std::string& GetName() const; - TIGL_EXPORT virtual void SetName(const std::string& value); - - TIGL_EXPORT virtual const boost::optional& GetDescription() const; - TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - - TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; - TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - - TIGL_EXPORT virtual const boost::optional& GetSections_choice1() const; - TIGL_EXPORT virtual boost::optional& GetSections_choice1(); - - TIGL_EXPORT virtual const boost::optional& GetSegments_choice1() const; - TIGL_EXPORT virtual boost::optional& GetSegments_choice1(); - - TIGL_EXPORT virtual const boost::optional& GetCylinderRadius_choice2() const; - TIGL_EXPORT virtual void SetCylinderRadius_choice2(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetCylinderLength_choice2() const; - TIGL_EXPORT virtual void SetCylinderLength_choice2(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetDomeType_choice2() const; - TIGL_EXPORT virtual boost::optional& GetDomeType_choice2(); - - TIGL_EXPORT virtual const boost::optional& GetStructure() const; - TIGL_EXPORT virtual boost::optional& GetStructure(); - - TIGL_EXPORT virtual CCPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveSections_choice1(); - - TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments_choice1(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveSegments_choice1(); - - TIGL_EXPORT virtual CPACSDomeType& GetDomeType_choice2(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveDomeType_choice2(); - - TIGL_EXPORT virtual CCPACSHullStructure& GetStructure(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveStructure(); - - protected: - CCPACSHulls* m_parent; - - CTiglUIDManager* m_uidMgr; - - std::string m_uID; - - /// Name - std::string m_name; - - /// Description - boost::optional m_description; - - CCPACSTransformation m_transformation; - - boost::optional m_sections_choice1; - - boost::optional m_segments_choice1; - - /// Inner radius of the cylinder - boost::optional m_cylinderRadius_choice2; - - /// Inner length of the cylinder - boost::optional m_cylinderLength_choice2; - - boost::optional m_domeType_choice2; - - boost::optional m_structure; - - private: - CPACSHull(const CPACSHull&) = delete; - CPACSHull& operator=(const CPACSHull&) = delete; - - CPACSHull(CPACSHull&&) = delete; - CPACSHull& operator=(CPACSHull&&) = delete; - }; -} // namespace generated - -// CPACSHull is customized, use type CCPACSHull directly -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include "CPACSDomeType.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CCPACSHulls; + +namespace generated +{ + // This class is used in: + // CPACSHulls + + /// @brief Hulls + /// + /// + class CPACSHull : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSHull(); + + TIGL_EXPORT CCPACSHulls* GetParent(); + + TIGL_EXPORT const CCPACSHulls* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + + TIGL_EXPORT virtual const boost::optional& GetSections_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSections_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetSegments_choice1() const; + TIGL_EXPORT virtual boost::optional& GetSegments_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetCylinderRadius_choice2() const; + TIGL_EXPORT virtual void SetCylinderRadius_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetCylinderLength_choice2() const; + TIGL_EXPORT virtual void SetCylinderLength_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetDomeType_choice2() const; + TIGL_EXPORT virtual boost::optional& GetDomeType_choice2(); + + TIGL_EXPORT virtual const boost::optional& GetStructure() const; + TIGL_EXPORT virtual boost::optional& GetStructure(); + + TIGL_EXPORT virtual CCPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSections_choice1(); + + TIGL_EXPORT virtual CCPACSFuselageSegments& GetSegments_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSegments_choice1(); + + TIGL_EXPORT virtual CPACSDomeType& GetDomeType_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveDomeType_choice2(); + + TIGL_EXPORT virtual CCPACSHullStructure& GetStructure(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveStructure(); + + protected: + CCPACSHulls* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + CCPACSTransformation m_transformation; + + boost::optional m_sections_choice1; + + boost::optional m_segments_choice1; + + /// Inner radius of the cylinder + boost::optional m_cylinderRadius_choice2; + + /// Inner length of the cylinder + boost::optional m_cylinderLength_choice2; + + boost::optional m_domeType_choice2; + + boost::optional m_structure; + + private: + CPACSHull(const CPACSHull&) = delete; + CPACSHull& operator=(const CPACSHull&) = delete; + + CPACSHull(CPACSHull&&) = delete; + CPACSHull& operator=(CPACSHull&&) = delete; + }; +} // namespace generated + +// CPACSHull is customized, use type CCPACSHull directly +} // namespace tigl diff --git a/src/generated/CPACSHulls.cpp b/src/generated/CPACSHulls.cpp index f3b6570de6..28858fa931 100644 --- a/src/generated/CPACSHulls.cpp +++ b/src/generated/CPACSHulls.cpp @@ -17,7 +17,7 @@ #include #include -#include "CCPACSGenericFuelTank.h" +#include "CCPACSFuelTank.h" #include "CPACSHulls.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -29,7 +29,7 @@ namespace tigl { namespace generated { - CPACSHulls::CPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) + CPACSHulls::CPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -40,12 +40,12 @@ namespace generated { } - const CCPACSGenericFuelTank* CPACSHulls::GetParent() const + const CCPACSFuelTank* CPACSHulls::GetParent() const { return m_parent; } - CCPACSGenericFuelTank* CPACSHulls::GetParent() + CCPACSFuelTank* CPACSHulls::GetParent() { return m_parent; } diff --git a/src/generated/CPACSHulls.h b/src/generated/CPACSHulls.h index e82d8de7ca..c408554cd7 100644 --- a/src/generated/CPACSHulls.h +++ b/src/generated/CPACSHulls.h @@ -28,12 +28,12 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSHull; -class CCPACSGenericFuelTank; +class CCPACSFuelTank; namespace generated { // This class is used in: - // CPACSGenericFuelTank + // CPACSFuelTank /// @brief Hulls /// @@ -41,13 +41,13 @@ namespace generated class CPACSHulls { public: - TIGL_EXPORT CPACSHulls(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSHulls(); - TIGL_EXPORT CCPACSGenericFuelTank* GetParent(); + TIGL_EXPORT CCPACSFuelTank* GetParent(); - TIGL_EXPORT const CCPACSGenericFuelTank* GetParent() const; + TIGL_EXPORT const CCPACSFuelTank* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -65,7 +65,7 @@ namespace generated TIGL_EXPORT virtual void RemoveHull(CCPACSHull& ref); protected: - CCPACSGenericFuelTank* m_parent; + CCPACSFuelTank* m_parent; CTiglUIDManager* m_uidMgr; diff --git a/src/generated/CPACSMaterialDefinition.cpp b/src/generated/CPACSMaterialDefinition.cpp index 2d24687898..c2cbd8f5d0 100644 --- a/src/generated/CPACSMaterialDefinition.cpp +++ b/src/generated/CPACSMaterialDefinition.cpp @@ -1,403 +1,403 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSWingRibCrossSection.h" -#include "CPACSCap.h" -#include "CPACSLateralCap.h" -#include "CPACSMaterialDefinition.h" -#include "CPACSSheetBasedStructuralElement.h" -#include "CPACSTrackActuator.h" -#include "CPACSWeb.h" -#include "CPACSWingRibCell.h" -#include "CPACSWingSkin.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSCap); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSLateralCap); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSSheetBasedStructuralElement); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSTrackActuator); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSWeb); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSWingRibCell); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CCPACSWingRibCrossSection); - } - - CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CPACSWingSkin); - } - - CPACSMaterialDefinition::~CPACSMaterialDefinition() - { - if (m_uidMgr) { - if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); - if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); - } - } - - const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() const - { - if (m_parent) { - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - } - return nullptr; - } - - CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() - { - if (m_parent) { - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); - } - } - return nullptr; - } - - CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSMaterialDefinition::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read element compositeUID - if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { - m_compositeUID_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/compositeUID"); - if (m_compositeUID_choice1->empty()) { - LOG(WARNING) << "Optional element compositeUID is present but empty at xpath " << xpath; - } - if (m_uidMgr && !m_compositeUID_choice1->empty()) m_uidMgr->RegisterReference(*m_compositeUID_choice1, *this); - } - - // read element orthotropyDirection - if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { - m_orthotropyDirection_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/orthotropyDirection"); - } - - // read element thicknessScaling - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { - m_thicknessScaling_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/thicknessScaling"); - } - - // read element materialUID - if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { - m_materialUID_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/materialUID"); - if (m_materialUID_choice2->empty()) { - LOG(WARNING) << "Optional element materialUID is present but empty at xpath " << xpath; - } - if (m_uidMgr && !m_materialUID_choice2->empty()) m_uidMgr->RegisterReference(*m_materialUID_choice2, *this); - } - - // read element thickness - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { - m_thickness_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/thickness"); - } - - if (!ValidateChoices()) { - LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; - } - } - - void CPACSMaterialDefinition::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write element compositeUID - if (m_compositeUID_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/compositeUID"); - tixi::TixiSaveElement(tixiHandle, xpath + "/compositeUID", *m_compositeUID_choice1); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/compositeUID"); - } - } - - // write element orthotropyDirection - if (m_orthotropyDirection_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/orthotropyDirection"); - tixi::TixiSaveElement(tixiHandle, xpath + "/orthotropyDirection", *m_orthotropyDirection_choice1); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/orthotropyDirection"); - } - } - - // write element thicknessScaling - if (m_thicknessScaling_choice1) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thicknessScaling"); - tixi::TixiSaveElement(tixiHandle, xpath + "/thicknessScaling", *m_thicknessScaling_choice1); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/thicknessScaling"); - } - } - - // write element materialUID - if (m_materialUID_choice2) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/materialUID"); - tixi::TixiSaveElement(tixiHandle, xpath + "/materialUID", *m_materialUID_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/materialUID"); - } - } - - // write element thickness - if (m_thickness_choice2) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thickness"); - tixi::TixiSaveElement(tixiHandle, xpath + "/thickness", *m_thickness_choice2); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/thickness"); - } - } - - } - - bool CPACSMaterialDefinition::ValidateChoices() const - { - return - ( - ( - ( - // mandatory elements of this choice must be there - m_compositeUID_choice1.is_initialized() - && - true // m_orthotropyDirection_choice1 is optional in choice - && - true // m_thicknessScaling_choice1 is optional in choice - && - // elements of other choices must not be there - !( - m_materialUID_choice2.is_initialized() - || - m_thickness_choice2.is_initialized() - ) - ) - + - ( - // mandatory elements of this choice must be there - m_materialUID_choice2.is_initialized() - && - true // m_thickness_choice2 is optional in choice - && - // elements of other choices must not be there - !( - m_compositeUID_choice1.is_initialized() - || - m_orthotropyDirection_choice1.is_initialized() - || - m_thicknessScaling_choice1.is_initialized() - ) - ) - == 1 - ) - ) - ; - } - - const boost::optional& CPACSMaterialDefinition::GetCompositeUID_choice1() const - { - return m_compositeUID_choice1; - } - - void CPACSMaterialDefinition::SetCompositeUID_choice1(const boost::optional& value) - { - if (m_uidMgr) { - if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); - if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); - } - m_compositeUID_choice1 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetOrthotropyDirection_choice1() const - { - return m_orthotropyDirection_choice1; - } - - void CPACSMaterialDefinition::SetOrthotropyDirection_choice1(const boost::optional& value) - { - m_orthotropyDirection_choice1 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetThicknessScaling_choice1() const - { - return m_thicknessScaling_choice1; - } - - void CPACSMaterialDefinition::SetThicknessScaling_choice1(const boost::optional& value) - { - m_thicknessScaling_choice1 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetMaterialUID_choice2() const - { - return m_materialUID_choice2; - } - - void CPACSMaterialDefinition::SetMaterialUID_choice2(const boost::optional& value) - { - if (m_uidMgr) { - if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); - if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); - } - m_materialUID_choice2 = value; - } - - const boost::optional& CPACSMaterialDefinition::GetThickness_choice2() const - { - return m_thickness_choice2; - } - - void CPACSMaterialDefinition::SetThickness_choice2(const boost::optional& value) - { - m_thickness_choice2 = value; - } - - const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDObject() const - { - return GetNextUIDParent(); - } - - void CPACSMaterialDefinition::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) - { - if (m_compositeUID_choice1 && *m_compositeUID_choice1 == oldUid) { - m_compositeUID_choice1 = newUid; - } - if (m_materialUID_choice2 && *m_materialUID_choice2 == oldUid) { - m_materialUID_choice2 = newUid; - } - } - -} // namespace generated -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSWingRibCrossSection.h" +#include "CPACSCap.h" +#include "CPACSLateralCap.h" +#include "CPACSMaterialDefinition.h" +#include "CPACSSheetBasedStructuralElement.h" +#include "CPACSTrackActuator.h" +#include "CPACSWeb.h" +#include "CPACSWingRibCell.h" +#include "CPACSWingSkin.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSCap); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSLateralCap); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSSheetBasedStructuralElement); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSTrackActuator); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSWeb); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSWingRibCell); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CCPACSWingRibCrossSection); + } + + CPACSMaterialDefinition::CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSWingSkin); + } + + CPACSMaterialDefinition::~CPACSMaterialDefinition() + { + if (m_uidMgr) { + if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); + if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); + } + } + + const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() const + { + if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; + } + + CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDParent() + { + if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; + } + + CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSMaterialDefinition::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSMaterialDefinition::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element compositeUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { + m_compositeUID_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/compositeUID"); + if (m_compositeUID_choice1->empty()) { + LOG(WARNING) << "Optional element compositeUID is present but empty at xpath " << xpath; + } + if (m_uidMgr && !m_compositeUID_choice1->empty()) m_uidMgr->RegisterReference(*m_compositeUID_choice1, *this); + } + + // read element orthotropyDirection + if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { + m_orthotropyDirection_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/orthotropyDirection"); + } + + // read element thicknessScaling + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { + m_thicknessScaling_choice1 = tixi::TixiGetElement(tixiHandle, xpath + "/thicknessScaling"); + } + + // read element materialUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { + m_materialUID_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/materialUID"); + if (m_materialUID_choice2->empty()) { + LOG(WARNING) << "Optional element materialUID is present but empty at xpath " << xpath; + } + if (m_uidMgr && !m_materialUID_choice2->empty()) m_uidMgr->RegisterReference(*m_materialUID_choice2, *this); + } + + // read element thickness + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { + m_thickness_choice2 = tixi::TixiGetElement(tixiHandle, xpath + "/thickness"); + } + + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSMaterialDefinition::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element compositeUID + if (m_compositeUID_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/compositeUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/compositeUID", *m_compositeUID_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/compositeUID")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/compositeUID"); + } + } + + // write element orthotropyDirection + if (m_orthotropyDirection_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/orthotropyDirection"); + tixi::TixiSaveElement(tixiHandle, xpath + "/orthotropyDirection", *m_orthotropyDirection_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/orthotropyDirection")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/orthotropyDirection"); + } + } + + // write element thicknessScaling + if (m_thicknessScaling_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thicknessScaling"); + tixi::TixiSaveElement(tixiHandle, xpath + "/thicknessScaling", *m_thicknessScaling_choice1); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thicknessScaling")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/thicknessScaling"); + } + } + + // write element materialUID + if (m_materialUID_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/materialUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/materialUID", *m_materialUID_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/materialUID")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/materialUID"); + } + } + + // write element thickness + if (m_thickness_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/thickness"); + tixi::TixiSaveElement(tixiHandle, xpath + "/thickness", *m_thickness_choice2); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/thickness")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/thickness"); + } + } + + } + + bool CPACSMaterialDefinition::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_compositeUID_choice1.is_initialized() + && + true // m_orthotropyDirection_choice1 is optional in choice + && + true // m_thicknessScaling_choice1 is optional in choice + && + // elements of other choices must not be there + !( + m_materialUID_choice2.is_initialized() + || + m_thickness_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_materialUID_choice2.is_initialized() + && + true // m_thickness_choice2 is optional in choice + && + // elements of other choices must not be there + !( + m_compositeUID_choice1.is_initialized() + || + m_orthotropyDirection_choice1.is_initialized() + || + m_thicknessScaling_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const boost::optional& CPACSMaterialDefinition::GetCompositeUID_choice1() const + { + return m_compositeUID_choice1; + } + + void CPACSMaterialDefinition::SetCompositeUID_choice1(const boost::optional& value) + { + if (m_uidMgr) { + if (m_compositeUID_choice1 && !m_compositeUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_compositeUID_choice1, *this); + if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); + } + m_compositeUID_choice1 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetOrthotropyDirection_choice1() const + { + return m_orthotropyDirection_choice1; + } + + void CPACSMaterialDefinition::SetOrthotropyDirection_choice1(const boost::optional& value) + { + m_orthotropyDirection_choice1 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetThicknessScaling_choice1() const + { + return m_thicknessScaling_choice1; + } + + void CPACSMaterialDefinition::SetThicknessScaling_choice1(const boost::optional& value) + { + m_thicknessScaling_choice1 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetMaterialUID_choice2() const + { + return m_materialUID_choice2; + } + + void CPACSMaterialDefinition::SetMaterialUID_choice2(const boost::optional& value) + { + if (m_uidMgr) { + if (m_materialUID_choice2 && !m_materialUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_materialUID_choice2, *this); + if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); + } + m_materialUID_choice2 = value; + } + + const boost::optional& CPACSMaterialDefinition::GetThickness_choice2() const + { + return m_thickness_choice2; + } + + void CPACSMaterialDefinition::SetThickness_choice2(const boost::optional& value) + { + m_thickness_choice2 = value; + } + + const CTiglUIDObject* CPACSMaterialDefinition::GetNextUIDObject() const + { + return GetNextUIDParent(); + } + + void CPACSMaterialDefinition::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) + { + if (m_compositeUID_choice1 && *m_compositeUID_choice1 == oldUid) { + m_compositeUID_choice1 = newUid; + } + if (m_materialUID_choice2 && *m_materialUID_choice2 == oldUid) { + m_materialUID_choice2 = newUid; + } + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSMaterialDefinition.h b/src/generated/CPACSMaterialDefinition.h index d9d94f17f7..30da55c36e 100644 --- a/src/generated/CPACSMaterialDefinition.h +++ b/src/generated/CPACSMaterialDefinition.h @@ -1,171 +1,171 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include "CTiglError.h" -#include "ITiglUIDRefObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; -class CTiglUIDObject; -class CCPACSWingRibCrossSection; - -namespace generated -{ - class CPACSCap; - class CPACSLateralCap; - class CPACSSheetBasedStructuralElement; - class CPACSTrackActuator; - class CPACSWeb; - class CPACSWingRibCell; - class CPACSWingSkin; - - // This class is used in: - // CPACSCap - // CPACSLateralCap - // CPACSSheetBasedStructuralElement - // CPACSTrackActuator - // CPACSWeb - // CPACSWingRibCell - // CPACSWingRibCrossSection - // CPACSWingSkin - - /// @brief Material Definition - /// - /// MaterialDefinition type, containing a material - /// definition (Reference to material and thickness) - /// - class CPACSMaterialDefinition : public ITiglUIDRefObject - { - public: - TIGL_EXPORT CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSMaterialDefinition(); - - template - bool IsParent() const - { - return m_parentType != NULL && *m_parentType == typeid(P); - } - - template - P* GetParent() - { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); - if (!IsParent

()) { - throw CTiglError("bad parent"); - } - return static_cast(m_parent); - } - - template - const P* GetParent() const - { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); - if (!IsParent

()) { - throw CTiglError("bad parent"); - } - return static_cast(m_parent); - } - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT bool ValidateChoices() const; - - TIGL_EXPORT virtual const boost::optional& GetCompositeUID_choice1() const; - TIGL_EXPORT virtual void SetCompositeUID_choice1(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetOrthotropyDirection_choice1() const; - TIGL_EXPORT virtual void SetOrthotropyDirection_choice1(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetThicknessScaling_choice1() const; - TIGL_EXPORT virtual void SetThicknessScaling_choice1(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetMaterialUID_choice2() const; - TIGL_EXPORT virtual void SetMaterialUID_choice2(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetThickness_choice2() const; - TIGL_EXPORT virtual void SetThickness_choice2(const boost::optional& value); - - protected: - void* m_parent; - const std::type_info* m_parentType; - - CTiglUIDManager* m_uidMgr; - - /// uID of a composite definition. - boost::optional m_compositeUID_choice1; - - /// Orthotropy direction of the composite. - boost::optional m_orthotropyDirection_choice1; - - /// Scaling factor of the composite thickness. - /// Absolute thicknesses are defined in each composite material - /// seperatly - boost::optional m_thicknessScaling_choice1; - - /// uID of a material definition. - boost::optional m_materialUID_choice2; - - /// Absolute thickness of the material. - boost::optional m_thickness_choice2; - - private: - TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; - TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; - - CPACSMaterialDefinition(const CPACSMaterialDefinition&) = delete; - CPACSMaterialDefinition& operator=(const CPACSMaterialDefinition&) = delete; - - CPACSMaterialDefinition(CPACSMaterialDefinition&&) = delete; - CPACSMaterialDefinition& operator=(CPACSMaterialDefinition&&) = delete; - }; -} // namespace generated - -// CPACSMaterialDefinition is customized, use type CCPACSMaterialDefinition directly - -// Aliases in tigl namespace -using CCPACSCap = generated::CPACSCap; -using CCPACSLateralCap = generated::CPACSLateralCap; -using CCPACSSheetBasedStructuralElement = generated::CPACSSheetBasedStructuralElement; -using CCPACSTrackActuator = generated::CPACSTrackActuator; -using CCPACSWeb = generated::CPACSWeb; -using CCPACSWingRibCell = generated::CPACSWingRibCell; -using CCPACSWingSkin = generated::CPACSWingSkin; -} // namespace tigl +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include +#include "CTiglError.h" +#include "ITiglUIDRefObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; +class CCPACSWingRibCrossSection; + +namespace generated +{ + class CPACSCap; + class CPACSLateralCap; + class CPACSSheetBasedStructuralElement; + class CPACSTrackActuator; + class CPACSWeb; + class CPACSWingRibCell; + class CPACSWingSkin; + + // This class is used in: + // CPACSCap + // CPACSLateralCap + // CPACSSheetBasedStructuralElement + // CPACSTrackActuator + // CPACSWeb + // CPACSWingRibCell + // CPACSWingRibCrossSection + // CPACSWingSkin + + /// @brief Material Definition + /// + /// MaterialDefinition type, containing a material + /// definition (Reference to material and thickness) + /// + class CPACSMaterialDefinition : public ITiglUIDRefObject + { + public: + TIGL_EXPORT CPACSMaterialDefinition(CPACSCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSLateralCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSTrackActuator* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSWeb* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSWingRibCell* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSMaterialDefinition(CPACSWingSkin* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSMaterialDefinition(); + + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSMaterialDefinition"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const boost::optional& GetCompositeUID_choice1() const; + TIGL_EXPORT virtual void SetCompositeUID_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetOrthotropyDirection_choice1() const; + TIGL_EXPORT virtual void SetOrthotropyDirection_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetThicknessScaling_choice1() const; + TIGL_EXPORT virtual void SetThicknessScaling_choice1(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetMaterialUID_choice2() const; + TIGL_EXPORT virtual void SetMaterialUID_choice2(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetThickness_choice2() const; + TIGL_EXPORT virtual void SetThickness_choice2(const boost::optional& value); + + protected: + void* m_parent; + const std::type_info* m_parentType; + + CTiglUIDManager* m_uidMgr; + + /// uID of a composite definition. + boost::optional m_compositeUID_choice1; + + /// Orthotropy direction of the composite. + boost::optional m_orthotropyDirection_choice1; + + /// Scaling factor of the composite thickness. + /// Absolute thicknesses are defined in each composite material + /// seperatly + boost::optional m_thicknessScaling_choice1; + + /// uID of a material definition. + boost::optional m_materialUID_choice2; + + /// Absolute thickness of the material. + boost::optional m_thickness_choice2; + + private: + TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; + TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; + + CPACSMaterialDefinition(const CPACSMaterialDefinition&) = delete; + CPACSMaterialDefinition& operator=(const CPACSMaterialDefinition&) = delete; + + CPACSMaterialDefinition(CPACSMaterialDefinition&&) = delete; + CPACSMaterialDefinition& operator=(CPACSMaterialDefinition&&) = delete; + }; +} // namespace generated + +// CPACSMaterialDefinition is customized, use type CCPACSMaterialDefinition directly + +// Aliases in tigl namespace +using CCPACSCap = generated::CPACSCap; +using CCPACSLateralCap = generated::CPACSLateralCap; +using CCPACSSheetBasedStructuralElement = generated::CPACSSheetBasedStructuralElement; +using CCPACSTrackActuator = generated::CPACSTrackActuator; +using CCPACSWeb = generated::CPACSWeb; +using CCPACSWingRibCell = generated::CPACSWingRibCell; +using CCPACSWingSkin = generated::CPACSWingSkin; +} // namespace tigl diff --git a/src/generated/CPACSSymmetry.h b/src/generated/CPACSSymmetry.h index fc97d80886..406c61fb7a 100644 --- a/src/generated/CPACSSymmetry.h +++ b/src/generated/CPACSSymmetry.h @@ -31,6 +31,7 @@ namespace generated // CPACSDuct // CPACSEnginePosition // CPACSEnginePylon + // CPACSFuelTank // CPACSFuselage // CPACSGenericGeometricComponent // CPACSGenericSystem diff --git a/src/generated/CPACSTransformation.cpp b/src/generated/CPACSTransformation.cpp index df5f3cff13..f80711c964 100644 --- a/src/generated/CPACSTransformation.cpp +++ b/src/generated/CPACSTransformation.cpp @@ -21,10 +21,10 @@ #include "CCPACSEnginePosition.h" #include "CCPACSEnginePylon.h" #include "CCPACSExternalObject.h" +#include "CCPACSFuelTank.h" #include "CCPACSFuselage.h" #include "CCPACSFuselageSection.h" #include "CCPACSFuselageSectionElement.h" -#include "CCPACSGenericFuelTank.h" #include "CCPACSGenericSystem.h" #include "CCPACSHull.h" #include "CCPACSNacelleSection.h" @@ -76,36 +76,36 @@ namespace generated m_parentType = &typeid(CCPACSEnginePylon); } - CPACSTransformation::CPACSTransformation(CCPACSFuselage* parent, CTiglUIDManager* uidMgr) + CPACSTransformation::CPACSTransformation(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSFuselage); + m_parentType = &typeid(CCPACSFuelTank); } - CPACSTransformation::CPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr) + CPACSTransformation::CPACSTransformation(CCPACSFuselage* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSFuselageSectionElement); + m_parentType = &typeid(CCPACSFuselage); } - CPACSTransformation::CPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr) + CPACSTransformation::CPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSFuselageSection); + m_parentType = &typeid(CCPACSFuselageSectionElement); } - CPACSTransformation::CPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) + CPACSTransformation::CPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSGenericFuelTank); + m_parentType = &typeid(CCPACSFuselageSection); } CPACSTransformation::CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr) @@ -208,6 +208,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent(); } @@ -217,9 +220,6 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); - } if (IsParent()) { return GetParent(); } @@ -269,6 +269,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent(); } @@ -278,9 +281,6 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); - } if (IsParent()) { return GetParent(); } diff --git a/src/generated/CPACSTransformation.h b/src/generated/CPACSTransformation.h index 0372020cd6..68e79b7f12 100644 --- a/src/generated/CPACSTransformation.h +++ b/src/generated/CPACSTransformation.h @@ -36,10 +36,10 @@ class CCPACSDuct; class CCPACSDuctAssembly; class CCPACSEnginePosition; class CCPACSEnginePylon; +class CCPACSFuelTank; class CCPACSFuselage; class CCPACSFuselageSectionElement; class CCPACSFuselageSection; -class CCPACSGenericFuelTank; class CCPACSExternalObject; class CCPACSGenericSystem; class CCPACSHull; @@ -59,10 +59,10 @@ namespace generated // CPACSDuctAssembly // CPACSEnginePosition // CPACSEnginePylon + // CPACSFuelTank // CPACSFuselage // CPACSFuselageElement // CPACSFuselageSection - // CPACSGenericFuelTank // CPACSGenericGeometricComponent // CPACSGenericSystem // CPACSHull @@ -94,10 +94,10 @@ namespace generated TIGL_EXPORT CPACSTransformation(CCPACSDuctAssembly* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSEnginePosition* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSEnginePylon* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTransformation(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); @@ -120,7 +120,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -130,7 +130,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/geometry/CCPACSTransformation.cpp b/src/geometry/CCPACSTransformation.cpp index 487a4350b2..9f19c1c094 100644 --- a/src/geometry/CCPACSTransformation.cpp +++ b/src/geometry/CCPACSTransformation.cpp @@ -89,7 +89,7 @@ CCPACSTransformation::CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* { } -CCPACSTransformation::CCPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr) +CCPACSTransformation::CCPACSTransformation(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) { diff --git a/src/geometry/CCPACSTransformation.h b/src/geometry/CCPACSTransformation.h index 26ee631781..6d33e5749a 100644 --- a/src/geometry/CCPACSTransformation.h +++ b/src/geometry/CCPACSTransformation.h @@ -42,7 +42,7 @@ class CCPACSTransformation : public generated::CPACSTransformation TIGL_EXPORT CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSTransformation(CCPACSGenericFuelTank* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSTransformation(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSRotor* parent, CTiglUIDManager* uidMgr); diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 41dbe0bee5..0db8773a78 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -98,450 +98,618 @@ fuselage_1Section3IDElement1 - - - - Simple tank 1 - This is a simple tank build via sections and segments with internal structure - - - 0.5 - - - - - Outer hull - - - 1 - 1.2 - 1.2 - - - -

- Section 1 - - - 0 - - - - - Section 1 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 2 - - - 1 - - - - - Section 2 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 3 - - - 1.5 - - - - - Section 3 Element 1 - fuselageCircleProfileuID - - - -
- - - - Outer hull Segment 1 - outerHull_section1_element1 - outerHull_section2_element1 - - - Outer hull Segment 2 - outerHull_section2_element1 - outerHull_section3_element1 - - - - - - - dummyMaterial - outerHull_section2 - 0 - 0 - 45 - - - - -
- - Inner hull - - - 0.2 - - - 0.8 - 0.9 - 0.9 - - - -
- Section 1 - - - 0 - - - - - Section 1 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 2 - - - 1 - - - - - Section 2 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 3 - - - 1.5 - - - - - Section 3 Element 1 - fuselageCircleProfileuID - - - -
-
- - - Inner hull Segment 1 - innerHull_section1_element1 - innerHull_section2_element1 - - - Inner hull Segment 2 - innerHull_section2_element1 - innerHull_section3_element1 - - -
-
-
- - Simple tank 2 - Test case of a simple tank via sections and segments with guide curves - - - 2.5 - - - - - Outer hull - - - 1 - 0.8 - 0.8 - - - -
- Section 1 - - - 0 - - - - - Section 1 Element 1 - fuselageCircleProfileuID - - - 0.01 - 0.01 - - - - -
-
- Section 2 - - - 1.0 - - - - - Section 2 Element 1 - fuselageCircleProfileuID - - - -
-
- Section 3 - - - 2 - - - - - Section 3 Element 1 - fuselageCircleProfileuID - - - 0.01 - 0.01 - - - - -
-
- - - Outer hull Segment 1 - genericTank2_outerHull_section1_element1 - genericTank2_outerHull_section2_element1 - - - Guide Segment 1 Upper - gc_upper - 0 - 0 - - - Guide Segment 1 Starbord - gc_starbord - 0.25 - 0.25 - - - Guide Segment 1 Lower - gc_lower - 0.5 - 0.5 - - - Guide Segment 1 Port - gc_port - 0.75 - 0.75 - - - - - Outer hull Segment 2 - genericTank2_outerHull_section2_element1 - genericTank2_outerHull_section3_element1 - - - Guide Segment 2 Upper - gc_upper - genericTank2_seg1_upper - 0 - - - Guide Segment 2 Starbord - gc_starbord - genericTank2_seg1_starbord - 0.25 - - - Guide Segment 2 Lower - gc_lower - genericTank2_seg1_lower - 0.5 - - - Guide Segment 2 Port - gc_port - genericTank2_seg1_port - 0.75 - - - - -
-
-
- - Simple tank 3 - Test case for simple parametrization with ellipsoid domes - - - 5. - - - - - Hull with spherical dome - - - 0. - - - 1.2 - 1.2 - 1.2 - - - 1.0 - 2.0 - - - 1 - - - - - Hull with ellipsoid dome - - - 0.5 - - - 1 - 0.8 - 0.8 - - - 1.0 - 2.0 - - - 0.5 - - - - - Hull with cylindrical dome - - - 1 - - - 1 - 0.7 - 0.7 - - - 1.0 - 2.0 - - - 0 - - - - - - - Simple tank 4 - Test case for simple parametrization - - - 11.5 - -1.388 - - - 90 - - - - - Hull with torispherical dome - - - 0. - - - 1.0 - 2.0 - - - 2.0 - 0.2 - - - - - - - Simple tank 5 - Test case for simple parametrization - - - 13. - - - - - Hull with isotensoid dome - - - 0. - - - 1.0 - 2.0 - - - 0.1 - - - - - -
-
+ + + Simple Wing + + + 5. + 2 + + + +
+ root section + + + 0.0 + 0.0 + 0.0 + + + 1 + 1 + 1 + + + 0.0 + 0.0 + 0.0 + + + + + wing root element + NACA0009 + + + 0.0 + 0.0 + 0.0 + + + 3 + 1 + 2 + + + 0.0 + 0.0 + 0.0 + + + + +
+
+ tip section + + + 0.0 + 0.0 + 0.0 + + + 1 + 1 + 1 + + + 1.5 + 10.0 + 0.0 + + + + + wing tip element + NACA0009 + + + 0.0 + 0.0 + 0.0 + + + 1.5 + 1 + 2 + + + 0.0 + 0.0 + 0.0 + + + + +
+
+ + + wing segment + wing1section1element1 + wing1section2element1 + + +
+
+ + + Simple tank 1 + This is a simple tank build via sections and segments with internal structure + SimpleFuselage + + + 0.5 + + + + + Outer hull + + + 1 + 1.2 + 1.2 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 2 + + + 1 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 1.5 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + +
+
+ + + Outer hull Segment 1 + outerHull_section1_element1 + outerHull_section2_element1 + + + Outer hull Segment 2 + outerHull_section2_element1 + outerHull_section3_element1 + + + + + + + dummyMaterial + outerHull_section2 + 0 + 0 + 45 + + + + +
+ + Inner hull + + + 0.2 + + + 0.8 + 0.9 + 0.9 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 2 + + + 1 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 1.5 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + +
+
+ + + Inner hull Segment 1 + innerHull_section1_element1 + innerHull_section2_element1 + + + Inner hull Segment 2 + innerHull_section2_element1 + innerHull_section3_element1 + + +
+
+
+ + Simple tank 2 + Test case of a simple tank via sections and segments with guide curves + SimpleFuselage + + + 2.5 + + + + + Outer hull + + + 1 + 0.8 + 0.8 + + + +
+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageCircleProfileuID + + + 0.01 + 0.01 + + + + +
+
+ Section 2 + + + 1.0 + + + + + Section 2 Element 1 + fuselageCircleProfileuID + + + +
+
+ Section 3 + + + 2 + + + + + Section 3 Element 1 + fuselageCircleProfileuID + + + 0.01 + 0.01 + + + + +
+
+ + + Outer hull Segment 1 + tank2_outerHull_section1_element1 + tank2_outerHull_section2_element1 + + + Guide Segment 1 Upper + gc_upper + 0 + 0 + + + Guide Segment 1 Starbord + gc_starbord + 0.25 + 0.25 + + + Guide Segment 1 Lower + gc_lower + 0.5 + 0.5 + + + Guide Segment 1 Port + gc_port + 0.75 + 0.75 + + + + + Outer hull Segment 2 + tank2_outerHull_section2_element1 + tank2_outerHull_section3_element1 + + + Guide Segment 2 Upper + gc_upper + tank2_seg1_upper + 0 + + + Guide Segment 2 Starbord + gc_starbord + tank2_seg1_starbord + 0.25 + + + Guide Segment 2 Lower + gc_lower + tank2_seg1_lower + 0.5 + + + Guide Segment 2 Port + gc_port + tank2_seg1_port + 0.75 + + + + +
+
+
+ + Simple tank 3 + Test case for simple parametrization with ellipsoid domes + SimpleFuselage + + + 5. + + + + + Hull with spherical dome + + + 0. + + + 1.2 + 1.2 + 1.2 + + + 1.0 + 2.0 + + + 1 + + + + + Hull with ellipsoid dome + + + 0.5 + + + 1 + 0.8 + 0.8 + + + 1.0 + 2.0 + + + 0.5 + + + + + Hull with cylindrical dome + + + 1 + + + 1 + 0.7 + 0.7 + + + 1.0 + 2.0 + + + 0 + + + + + Hull as pure sphere + + + 1.5 + + + 0.6 + 0.6 + 0.6 + + + 1.0 + 0 + + + 1 + + + + + + + Simple tank 4 + Test case for simple parametrization + SimpleFuselage + + + 11.5 + -1.388 + + + 90 + + + + + Hull with torispherical dome + + + 0. + + + 1.0 + 2.0 + + + 2.0 + 0.2 + + + + + + + Simple tank 5 + Test case for simple parametrization + SimpleFuselage + + + 13. + + + + + Hull with isotensoid dome + + + 0. + + + 1.0 + 2.0 + + + 0.1 + + + + + + + Simple tank 6 + Test case tank referencing a wing + SimpleWing + + + 0.8 + 10. + + + + + Hull with ellipsoid dome for wing tank + + + 0. + + + 0.4 + 2.0 + + + 1 + + + + + +
+ + + NACA0009 Airfoil + NACA 4-digit symmetrical airfoil with a thickness of 9percent + + 1.0;0.99572;0.98296;0.96194;0.93301;0.89668;0.85355;0.80438;0.75;0.69134;0.62941;0.56526;0.5;0.43474;0.37059;0.33928;0.30866;0.27886;0.25;0.22221;0.19562;0.17033;0.14645;0.12408;0.10332;0.08427;0.06699;0.05156;0.03806;0.02653;0.01704;0.00961;0.00428;0.00107;0.0;0.00107;0.00428;0.00961;0.01704;0.02653;0.03806;0.05156;0.06699;0.08427;0.10332;0.12408;0.14645;0.17033;0.19562;0.22221;0.25;0.27886;0.30866;0.33928;0.37059;0.43474;0.5;0.56526;0.62941;0.69134;0.75;0.80438;0.85355;0.89668;0.93301;0.96194;0.98296;0.99572;1.0 + 0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0 + 0.0;0.00057;0.00218;0.00463;0.0077;0.01127;0.01522;0.01945;0.02384;0.02823;0.03247;0.03638;0.03978;0.04248;0.04431;0.04484;0.04509;0.04504;0.04466;0.04397;0.04295;0.04161;0.03994;0.03795;0.03564;0.03305;0.03023;0.0272;0.02395;0.02039;0.01646;0.01214;0.00767;0.00349;0.0;-0.00349;-0.00767;-0.01214;-0.01646;-0.02039;-0.02395;-0.0272;-0.03023;-0.03305;-0.03564;-0.03795;-0.03994;-0.04161;-0.04295;-0.04397;-0.04466;-0.04504;-0.04509;-0.04484;-0.04431;-0.04248;-0.03978;-0.03638;-0.03247;-0.02823;-0.02384;-0.01945;-0.01522;-0.01127;-0.0077;-0.00463;-0.00218;-0.00057;0.0 + + + Circle diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index e5c867bda6..5128148cce 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -18,47 +18,37 @@ def setUp(self): mgr = configuration.CCPACSConfigurationManager_get_instance() uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() - self.fuelTank = uid_mgr.get_geometric_component("genericTank1") - self.hull_with_segments = uid_mgr.get_geometric_component( - "genericTank1_outerHull" - ) - self.hull_with_guides = uid_mgr.get_geometric_component( - "genericTank2_outerHull" - ) + self.fuelTank = uid_mgr.get_geometric_component("tank1") + self.hull_with_segments = uid_mgr.get_geometric_component("tank1_outerHull") + self.hull_with_guides = uid_mgr.get_geometric_component("tank2_outerHull") self.hull_with_spherical_dome = uid_mgr.get_geometric_component( - "genericTank3_sphericalDome" + "tank3_sphericalDome" ) def tearDown(self): self.tigl.close() self.tixi.close() - def test_genericFuelTanks(self): + def test_fuelTanks(self): # Test custom class methods: fuelTanks = self.fuelTank.get_parent() - tank1_uID = "genericTank1" + tank1_uID = "tank1" ## Test accessability of childs: + self.assertIsInstance(fuelTanks.get_fuel_tank(1), configuration.CCPACSFuelTank) + self.assertEqual(fuelTanks.get_fuel_tank(1).get_defaulted_uid(), tank1_uID) self.assertIsInstance( - fuelTanks.get_generic_fuel_tank(1), configuration.CCPACSGenericFuelTank - ) - self.assertEqual( - fuelTanks.get_generic_fuel_tank(1).get_defaulted_uid(), tank1_uID - ) - self.assertIsInstance( - fuelTanks.get_generic_fuel_tank(tank1_uID), - configuration.CCPACSGenericFuelTank, + fuelTanks.get_fuel_tank(tank1_uID), + configuration.CCPACSFuelTank, ) self.assertEqual( - fuelTanks.get_generic_fuel_tank_index(tank1_uID), + fuelTanks.get_fuel_tank_index(tank1_uID), 1, ) - self.assertEqual(fuelTanks.get_generic_fuel_tanks_count(), 5) + self.assertEqual(fuelTanks.get_fuel_tanks_count(), 6) # Test availability of generated class: - self.assertIsInstance( - fuelTanks.get_parent(), configuration.CPACSFuselageFuelTanks - ) + self.assertIsInstance(fuelTanks, configuration.CCPACSFuelTanks) def test_genericFuelTank(self): # Test custom class methods: @@ -70,7 +60,7 @@ def test_genericFuelTank(self): def test_hulls(self): # Test custom class methods: hulls = self.hull_with_segments.get_parent() - hull1_uID = "genericTank1_outerHull" + hull1_uID = "tank1_outerHull" ## Test accessability of childs: self.assertIsInstance(hulls.get_hull(1), configuration.CCPACSHull) @@ -83,7 +73,7 @@ def test_hulls(self): self.assertEqual(hulls.get_hulls_count(), 2) # Test availability of generated class: - self.assertIsInstance(hulls.get_parent(), configuration.CCPACSGenericFuelTank) + self.assertIsInstance(hulls.get_parent(), configuration.CCPACSFuelTank) def test_hull(self): @@ -123,7 +113,7 @@ def test_hull(self): hull_segments.get_section_face("outerHull_section3"), TopoDS_Face ) - self.assertEqual(hull_segments.get_defaulted_uid(), "genericTank1_outerHull") + self.assertEqual(hull_segments.get_defaulted_uid(), "tank1_outerHull") self.assertIsInstance( hull_segments.get_configuration(), @@ -142,7 +132,7 @@ def test_hull(self): self.assertEqual( self.hull_with_guides.get_guide_curve_segment( - "genericTank2_seg1_upper" + "tank2_seg1_upper" ).get_guide_curve_profile_uid(), "gc_upper", ) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 9e5cf685dd..c5f4ee1620 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -23,8 +23,8 @@ #include "test.h" #include "tigl.h" -#include "CCPACSGenericFuelTank.h" -#include "CCPACSGenericFuelTanks.h" +#include "CCPACSFuelTank.h" +#include "CCPACSFuelTanks.h" #include "CCPACSConfigurationManager.h" #include "CTiglUIDManager.h" @@ -86,14 +86,14 @@ class FuselageTank : public ::testing::Test tigl::CTiglUIDManager& uidMgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); - // generic tank - tigl::CCPACSGenericFuelTank const* fuelTank = &uidMgr.ResolveObject("genericTank1"); + // tank + tigl::CCPACSFuelTank const* fuelTank = &uidMgr.ResolveObject("tank1"); // hulls const tigl::CCPACSHulls& hulls = fuelTank->GetHulls(); - tigl::CCPACSHull* hull = &uidMgr.ResolveObject("genericTank1_outerHull"); - tigl::CCPACSHull* hull_with_guides = &uidMgr.ResolveObject("genericTank2_outerHull"); - tigl::CCPACSHull* hull_spheric = &uidMgr.ResolveObject("genericTank3_sphericalDome"); + tigl::CCPACSHull* hull = &uidMgr.ResolveObject("tank1_outerHull"); + tigl::CCPACSHull* hull_with_guides = &uidMgr.ResolveObject("tank2_outerHull"); + tigl::CCPACSHull* hull_spheric = &uidMgr.ResolveObject("tank3_sphericalDome"); }; TixiDocumentHandle FuselageTank::tixiHandle = 0; @@ -105,17 +105,17 @@ TEST_F(FuselageTank, getName) EXPECT_EQ(name, "Simple tank 1"); } -TEST_F(FuselageTank, genericFuelTanks) +TEST_F(FuselageTank, fuelTanks) { - std::string uID = "genericTank1"; - const tigl::CCPACSGenericFuelTanks* fuelTanks = fuelTank->GetParent(); - EXPECT_EQ(fuelTanks->GetGenericFuelTank(1).GetDefaultedUID(), uID); - EXPECT_NO_THROW(fuelTanks->GetGenericFuelTank(uID)); - EXPECT_EQ(fuelTanks->GetGenericFuelTankIndex(uID), 1); - EXPECT_EQ(fuelTanks->GetGenericFuelTanksCount(), 5); + std::string uID = "tank1"; + const tigl::CCPACSFuelTanks* fuelTanks = fuelTank->GetParent(); + EXPECT_EQ(fuelTanks->GetFuelTank(1).GetDefaultedUID(), uID); + EXPECT_NO_THROW(fuelTanks->GetFuelTank(uID)); + EXPECT_EQ(fuelTanks->GetFuelTankIndex(uID), 1); + EXPECT_EQ(fuelTanks->GetFuelTanksCount(), 6); } -TEST_F(FuselageTank, genericFuelTank) +TEST_F(FuselageTank, fuelTank) { EXPECT_NO_THROW(fuelTank->GetHulls()); } @@ -124,10 +124,10 @@ TEST_F(FuselageTank, genericFuelTank) TEST_F(FuselageTank, hulls) { EXPECT_EQ(hulls.GetHullsCount(), 2); - EXPECT_EQ(hulls.GetHull(1).GetDefaultedUID(), "genericTank1_outerHull"); - EXPECT_EQ(hulls.GetHull("genericTank1_outerHull").GetDefaultedUID(), "genericTank1_outerHull"); - EXPECT_EQ(hulls.GetHullIndex("genericTank1_outerHull"), 1); - EXPECT_EQ(hulls.GetHulls().at(0)->GetDefaultedUID(), "genericTank1_outerHull"); + EXPECT_EQ(hulls.GetHull(1).GetDefaultedUID(), "tank1_outerHull"); + EXPECT_EQ(hulls.GetHull("tank1_outerHull").GetDefaultedUID(), "tank1_outerHull"); + EXPECT_EQ(hulls.GetHullIndex("tank1_outerHull"), 1); + EXPECT_EQ(hulls.GetHulls().at(0)->GetDefaultedUID(), "tank1_outerHull"); } TEST_F(FuselageTank, hull) @@ -148,7 +148,7 @@ TEST_F(FuselageTank, hull) EXPECT_NO_THROW(hull->GetSegment("outerHull_segment1")); EXPECT_THROW(hull->GetSegment(3), tigl::CTiglError); - EXPECT_EQ(hull->GetDefaultedUID(), "genericTank1_outerHull"); + EXPECT_EQ(hull->GetDefaultedUID(), "tank1_outerHull"); EXPECT_NO_THROW(hull->GetConfiguration()); EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); @@ -161,7 +161,7 @@ TEST_F(FuselageTank, hull) EXPECT_NEAR(points.at(1).Y(), 0, 1e-5); EXPECT_NEAR(points.at(1).Z(), -0.65, 1e-2); - EXPECT_EQ(hull_with_guides->GetGuideCurveSegment("genericTank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); + EXPECT_EQ(hull_with_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); } TEST_F(FuselageTank, parametric_hull) From 4cfcd4d24ba133eec6d027fa70024ad29a3dd4e1 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 30 May 2024 14:32:50 +0200 Subject: [PATCH 037/122] allow isotensoids and torispherical to have zero length --- src/fuelTanks/CCPACSHull.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 92791d45a7..03127829e5 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -342,12 +342,16 @@ void CCPACSHull::BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const TopoDS_Edge dome_edge1 = BRepBuilderAPI_MakeEdge(arc1.Value()).Edge(); TopoDS_Edge dome_edge2 = BRepBuilderAPI_MakeEdge(arc2.Value()).Edge(); - TopoDS_Vertex v1 = GetLastVertex(dome_edge2); - TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + std::vector edges = {dome_edge1, dome_edge2}; - TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + if (cylinderLength > 0.0) { + TopoDS_Vertex v1 = GetLastVertex(dome_edge2); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinder_edge); + } - std::vector edges = {dome_edge1, dome_edge2, cylinder_edge}; BuildTankWire(edges, wire); } @@ -375,12 +379,16 @@ void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); TopoDS_Edge dome_edge = BRepBuilderAPI_MakeEdge(bspline); - TopoDS_Vertex v1 = GetFirstVertex(dome_edge); - TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + std::vector edges = {dome_edge}; - TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + if (cylinderLength > 0.0) { + TopoDS_Vertex v1 = GetFirstVertex(dome_edge); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinder_edge); + } - std::vector edges = {dome_edge, cylinder_edge}; BuildTankWire(edges, wire); } From ffa35abe28f2d963f631013ce4cfb1f2c42de459 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 30 May 2024 23:48:34 +0200 Subject: [PATCH 038/122] allow half axis ratio larger 1 --- src/fuelTanks/CCPACSHull.cpp | 28 +++++++++++++------ .../TestData/simpletest-fuelTanks.cpacs.xml | 6 ++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 03127829e5..6f70edb20b 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -271,23 +271,35 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double R = cylinderRadius, h = cylinderRadius; - double axRatio = m_ellipsoid->GetHalfAxisFraction(); - if (axRatio < 0.0 || axRatio > 1.0) { + if (axRatio < 0.0) { throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of hull \"" + GetName() + "\" (uID=\"" + - GetUID() + "\") must be between 0 and 1!"); + GetUID() + "\") must be a positive value!"); } - h = R * axRatio; + double R = cylinderRadius; + double h = R * axRatio; gp_Dir dir(0.0, 1.0, 0.0); - gp_Pnt p(h, 0.0, 0.0); - gp_Elips ellips(gp_Ax2(p, dir), R, R * axRatio); + double major_ax = R; + double minor_ax = R * axRatio; + double rot_angle = 0; + double start_angle = -M_PI / 2; + double end_angle = 0.0; + + if (axRatio > 1) { + major_ax = R * axRatio; + minor_ax = R; + rot_angle = 0.5 * M_PI; + start_angle = -M_PI; + end_angle = -M_PI / 2; + } - GC_MakeArcOfEllipse arc(ellips, -M_PI / 2, 0.0, Standard_True); + gp_Elips ellips(gp_Ax2(p, dir), major_ax, minor_ax); + ellips.Rotate(gp_Ax1(p, dir), rot_angle); + GC_MakeArcOfEllipse arc(ellips, start_angle, end_angle, Standard_True); TopoDS_Edge dome_edge = BRepBuilderAPI_MakeEdge(arc.Value()).Edge(); diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 0db8773a78..06a60b70d0 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -682,14 +682,14 @@ Hull with ellipsoid dome for wing tank - 0. + -1.1 0.4 - 2.0 + 1. - 1 + 5
From a21b858acf30e847d5f2cede28d7691faa1aa68f Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 31 May 2024 15:57:54 +0200 Subject: [PATCH 039/122] add and refactor tests --- src/fuelTanks/CCPACSHull.cpp | 18 ++++--- src/fuelTanks/CCPACSHull.h | 2 + tests/unittests/test_fuelTanks.py | 86 ++++++++++++++++++------------ tests/unittests/tiglTanks.cpp | 88 +++++++++++++++++++------------ 4 files changed, 120 insertions(+), 74 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 6f70edb20b..adfea52ffb 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -91,8 +91,12 @@ int CCPACSHull::GetSectionCount() const CCPACSFuselageSection& CCPACSHull::GetSection(int index) const { - // ToDo: add exception handling - return m_sections_choice1.get().GetSection(index); + if (m_sections_choice1) { + return m_sections_choice1.get().GetSection(index); + } + else { + throw CTiglError(tank_type_error_msg); + } } TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const @@ -108,7 +112,7 @@ TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const return BuildFace(segment.GetEndWire()); } } - throw CTiglError("GetSectionFace: Could not find a section for the given UID"); + throw CTiglError(tank_type_error_msg); return TopoDS_Shape(); } @@ -128,7 +132,7 @@ CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) return m_segments_choice1.get().GetSegment(index); } else { - throw CTiglError("Method only available for hulls with segments."); + throw CTiglError(tank_type_error_msg); } } @@ -138,7 +142,7 @@ const CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) const return m_segments_choice1.get().GetSegment(index); } else { - throw CTiglError("Method only available for hulls with segments."); + throw CTiglError(tank_type_error_msg); } } @@ -148,7 +152,7 @@ CCPACSFuselageSegment& CCPACSHull::GetSegment(std::string uid) return m_segments_choice1.get().GetSegment(uid); } else { - throw CTiglError("Method only available for hulls with segments."); + throw CTiglError(tank_type_error_msg); } } @@ -190,7 +194,7 @@ double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); } else { - throw CTiglError("Method only available for hulls with segments."); + throw CTiglError(tank_type_error_msg); } } diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index f9b6cd85bb..0cb5045a02 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -113,6 +113,8 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned mutable TankType tankType; mutable DomeType domeType; + const std::string tank_type_error_msg = "GetSectionFace: Could not find a section for the given UID"; + mutable const tigl::generated::CPACSEllipsoidDome* m_ellipsoid; mutable const tigl::generated::CPACSTorisphericalDome* m_torispherical; mutable const tigl::generated::CPACSIsotensoidDome* m_isotensoid; diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 5128148cce..1d7820f7f8 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -25,6 +25,8 @@ def setUp(self): "tank3_sphericalDome" ) + self.tank_type_exception_msg = "Method only available for hulls with segments." + def tearDown(self): self.tigl.close() self.tixi.close() @@ -75,56 +77,55 @@ def test_hulls(self): # Test availability of generated class: self.assertIsInstance(hulls.get_parent(), configuration.CCPACSFuelTank) - def test_hull(self): + def test_hull_general(self): + + # Custom class methods + self.assertEqual( + self.hull_with_segments.get_configuration().get_uid(), "testAircraft" + ) + self.assertEqual(self.hull_with_segments.get_defaulted_uid(), "tank1_outerHull") + + # Generated class methods + self.assertIsInstance( + self.hull_with_segments.get_configuration(), + configuration.CCPACSConfiguration, + ) + + self.assertEqual(self.hull_with_segments.get_name(), "Outer hull") + def test_hull_sections(self): hull_segments = self.hull_with_segments hull_parametric = self.hull_with_spherical_dome - exception_msg = "Method only available for hulls with segments." - # Test custom class methods: self.assertEqual(hull_segments.get_section_count(), 3) self.assertEqual(hull_parametric.get_section_count(), 0) - self.assertEqual(hull_segments.get_segment_count(), 2) - self.assertEqual(hull_parametric.get_segment_count(), 0) - - self.assertAlmostEqual(round(hull_segments.get_volume(), 2), 6.57) - self.assertAlmostEqual(round(hull_parametric.get_volume(), 2), 18.1) - - self.assertAlmostEqual(round(hull_segments.get_surface_area(), 2), 11.15) - self.assertAlmostEqual(round(hull_parametric.get_surface_area(), 2), 36.19) - - self.assertAlmostEqual(round(hull_segments.get_circumference(1, 0.5), 2), 7.43) - with self.assertRaises(RuntimeError) as context: - hull_parametric.get_circumference(1, 0.5) - self.assertEqual(str(context.exception), exception_msg) - - self.assertIsInstance( - hull_segments.get_segment(1), configuration.CCPACSFuselageSegment - ) - with self.assertRaises(RuntimeError) as context: - hull_parametric.get_segment(1) - self.assertEqual(str(context.exception), exception_msg) - self.assertIsInstance( hull_segments.get_section(1), configuration.CCPACSFuselageSection ) + # with self.assertRaises(RuntimeError) as context: + # hull_parametric.get_section(1) + # self.assertEqual(str(context.exception), self.tank_type_exception_msg) + self.assertIsInstance( hull_segments.get_section_face("outerHull_section3"), TopoDS_Face ) - self.assertEqual(hull_segments.get_defaulted_uid(), "tank1_outerHull") + def test_hull_segments(self): + hull_segments = self.hull_with_segments + hull_parametric = self.hull_with_spherical_dome + + self.assertEqual(hull_segments.get_segment_count(), 2) + self.assertEqual(hull_parametric.get_segment_count(), 0) self.assertIsInstance( - hull_segments.get_configuration(), - configuration.CCPACSConfiguration, + hull_segments.get_segment(1), configuration.CCPACSFuselageSegment ) + # with self.assertRaises(RuntimeError) as context: + # hull_parametric.get_segment(1) + # self.assertEqual(str(context.exception), self.tank_type_exception_msg) - point = hull_segments.get_point(1, 0.5, 0.5) - self.assertAlmostEqual(round(point.X(), 2), 1.54) - self.assertAlmostEqual(round(point.Y(), 2), 0.0) - self.assertAlmostEqual(round(point.Z(), 2), -1.2) - + def test_hull_guide_curves(self): # point = self.hull_with_guides.get_guide_curve_points()[1] # self.assertAlmostEqual(round(point.X(), 2), 2.75, 1e-2) # self.assertAlmostEqual(round(point.Y(), 2), 0.0, 1e-5) @@ -137,8 +138,25 @@ def test_hull(self): "gc_upper", ) - # Test availability of generated class: - self.assertEqual(self.hull_with_segments.get_name(), "Outer hull") + def test_hull_loft_methods(self): + hull_segments = self.hull_with_segments + hull_parametric = self.hull_with_spherical_dome + + self.assertAlmostEqual(round(hull_segments.get_volume(), 2), 6.57) + self.assertAlmostEqual(round(hull_parametric.get_volume(), 2), 18.1) + + self.assertAlmostEqual(round(hull_segments.get_surface_area(), 2), 11.15) + self.assertAlmostEqual(round(hull_parametric.get_surface_area(), 2), 36.19) + + self.assertAlmostEqual(round(hull_segments.get_circumference(1, 0.5), 2), 7.43) + # with self.assertRaises(RuntimeError) as context: + # hull_parametric.get_circumference(1, 0.5) + # self.assertEqual(str(context.exception), self.tank_type_exception_msg) + + point = hull_segments.get_point(1, 0.5, 0.5) + self.assertAlmostEqual(round(point.X(), 2), 1.54) + self.assertAlmostEqual(round(point.Y(), 2), 0.0) + self.assertAlmostEqual(round(point.Z(), 2), -1.2) def test_structure(self): structure = self.hull_with_segments.get_structure() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index c5f4ee1620..e79aaa5564 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -90,10 +90,10 @@ class FuselageTank : public ::testing::Test tigl::CCPACSFuelTank const* fuelTank = &uidMgr.ResolveObject("tank1"); // hulls - const tigl::CCPACSHulls& hulls = fuelTank->GetHulls(); - tigl::CCPACSHull* hull = &uidMgr.ResolveObject("tank1_outerHull"); - tigl::CCPACSHull* hull_with_guides = &uidMgr.ResolveObject("tank2_outerHull"); - tigl::CCPACSHull* hull_spheric = &uidMgr.ResolveObject("tank3_sphericalDome"); + const tigl::CCPACSHulls& hulls = fuelTank->GetHulls(); + tigl::CCPACSHull* hull_segments = &uidMgr.ResolveObject("tank1_outerHull"); + tigl::CCPACSHull* hull_guides = &uidMgr.ResolveObject("tank2_outerHull"); + tigl::CCPACSHull* hull_parametric = &uidMgr.ResolveObject("tank3_sphericalDome"); }; TixiDocumentHandle FuselageTank::tixiHandle = 0; @@ -107,7 +107,7 @@ TEST_F(FuselageTank, getName) TEST_F(FuselageTank, fuelTanks) { - std::string uID = "tank1"; + std::string uID = "tank1"; const tigl::CCPACSFuelTanks* fuelTanks = fuelTank->GetParent(); EXPECT_EQ(fuelTanks->GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(fuelTanks->GetFuelTank(uID)); @@ -130,48 +130,70 @@ TEST_F(FuselageTank, hulls) EXPECT_EQ(hulls.GetHulls().at(0)->GetDefaultedUID(), "tank1_outerHull"); } -TEST_F(FuselageTank, hull) +TEST_F(FuselageTank, hull_general) { - EXPECT_EQ(hull->GetSectionCount(), 3); - EXPECT_EQ(hull->GetSegmentCount(), 2); - EXPECT_NEAR(hull->GetVolume(), 6.57, 1e-2); - EXPECT_NEAR(hull->GetSurfaceArea(), 11.15, 1e-2); - EXPECT_NEAR(hull->GetCircumference(1, 0.5), 7.43, 1e-2); - - EXPECT_EQ(hull->GetSectionCount(), 3); - EXPECT_NO_THROW(hull->GetSection(1)); - EXPECT_NO_THROW(hull->GetSectionFace("outerHull_section1")); - EXPECT_THROW(hull->GetSection(4), tigl::CTiglError); - - EXPECT_EQ(hull->GetSegmentCount(), 2); - EXPECT_NO_THROW(hull->GetSegment(1)); - EXPECT_NO_THROW(hull->GetSegment("outerHull_segment1")); - EXPECT_THROW(hull->GetSegment(3), tigl::CTiglError); - - EXPECT_EQ(hull->GetDefaultedUID(), "tank1_outerHull"); - EXPECT_NO_THROW(hull->GetConfiguration()); - - EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); - EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); - EXPECT_NEAR(hull->GetPoint(1, 0.5, 0.5).Z(), -1.2, 1e-1); - - auto points = hull_with_guides->GetGuideCurvePoints(); + EXPECT_EQ(hull_segments->GetConfiguration().GetUID(), "testAircraft"); + EXPECT_EQ(hull_segments->GetDefaultedUID(), "tank1_outerHull"); +} + +TEST_F(FuselageTank, hull_component_info) +{ + EXPECT_EQ(hull_segments->GetComponentType(), TIGL_COMPONENT_FUSELAGE_TANK_HULL); + EXPECT_EQ(hull_segments->GetComponentIntent(), TIGL_INTENT_PHYSICAL); +} + +TEST_F(FuselageTank, hull_sections) +{ + EXPECT_EQ(hull_segments->GetSectionCount(), 3); + EXPECT_EQ(hull_parametric->GetSectionCount(), 0); + + EXPECT_NO_THROW(hull_segments->GetSection(1)); + EXPECT_THROW(hull_parametric->GetSection(2), tigl::CTiglError); + + EXPECT_NO_THROW(hull_segments->GetSectionFace("outerHull_section1")); + EXPECT_THROW(hull_segments->GetSection(4), tigl::CTiglError); +} + +TEST_F(FuselageTank, hull_segments) +{ + EXPECT_EQ(hull_segments->GetSegmentCount(), 2); + + EXPECT_EQ(hull_segments->GetSegmentCount(), 2); + EXPECT_NO_THROW(hull_segments->GetSegment(1)); + EXPECT_NO_THROW(hull_segments->GetSegment("outerHull_segment1")); + EXPECT_THROW(hull_segments->GetSegment(3), tigl::CTiglError); +} + +TEST_F(FuselageTank, hull_guide_curves) +{ + auto points = hull_guides->GetGuideCurvePoints(); EXPECT_EQ(points.size(), 24); EXPECT_NEAR(points.at(1).X(), 3.5, 1e-2); EXPECT_NEAR(points.at(1).Y(), 0, 1e-5); EXPECT_NEAR(points.at(1).Z(), -0.65, 1e-2); - EXPECT_EQ(hull_with_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); + EXPECT_EQ(hull_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); +} + +TEST_F(FuselageTank, hull_loft_methods) +{ + EXPECT_NEAR(hull_segments->GetVolume(), 6.57, 1e-2); + EXPECT_NEAR(hull_segments->GetSurfaceArea(), 11.15, 1e-2); + EXPECT_NEAR(hull_segments->GetCircumference(1, 0.5), 7.43, 1e-2); + + EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); + EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); + EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).Z(), -1.2, 1e-1); } TEST_F(FuselageTank, parametric_hull) { - auto& loft = hull_spheric->GetLoft(); + auto& loft = hull_parametric->GetLoft(); } TEST_F(FuselageTank, structure) { - auto& structure = hull->GetStructure(); + auto& structure = hull_segments->GetStructure(); EXPECT_EQ(structure->GetFrames()->GetFrames().size(), 1); EXPECT_EQ(structure->GetUID(), "outerHullStructure"); From 8494c6d0c234319d3041c059d48dc96f5c219b7d Mon Sep 17 00:00:00 2001 From: alde_ma Date: Fri, 31 May 2024 23:43:49 +0200 Subject: [PATCH 040/122] improve tests --- src/fuelTanks/CCPACSHull.cpp | 56 ++++++++++++++++--------------- src/fuelTanks/CCPACSHull.h | 3 +- tests/unittests/test_fuelTanks.py | 25 ++++++++------ tests/unittests/tiglTanks.cpp | 29 ++++++++++++++-- 4 files changed, 71 insertions(+), 42 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index adfea52ffb..3c1477d7b1 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -95,24 +95,27 @@ CCPACSFuselageSection& CCPACSHull::GetSection(int index) const return m_sections_choice1.get().GetSection(index); } else { - throw CTiglError(tank_type_error_msg); + throw CTiglError(tankTypeException); } } -TopoDS_Shape CCPACSHull::GetSectionFace(const std::string section_uid) const +TopoDS_Shape CCPACSHull::GetSectionFace(const std::string sectionUID) const { - // search for the section in all segments - for (int n = 0; n < GetSegmentCount(); ++n) { + const int segmentCount = GetSegmentCount(); + + // Search for the section in all segments + for (int n = 0; n < segmentCount; ++n) { const CCPACSFuselageSegment& segment = GetSegment(n + 1); - if (section_uid == segment.GetStartSectionUID()) { + if (sectionUID == segment.GetStartSectionUID()) { return BuildFace(segment.GetStartWire()); } - else if (section_uid == segment.GetEndSectionUID()) { + else if (sectionUID == segment.GetEndSectionUID()) { return BuildFace(segment.GetEndWire()); } } - throw CTiglError(tank_type_error_msg); + m_sections_choice1 ? throw CTiglError("GetSectionFace: Could not find a fuselage section for the given UID") + : throw CTiglError(tankTypeException); return TopoDS_Shape(); } @@ -132,7 +135,7 @@ CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) return m_segments_choice1.get().GetSegment(index); } else { - throw CTiglError(tank_type_error_msg); + throw CTiglError(tankTypeException); } } @@ -142,7 +145,7 @@ const CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) const return m_segments_choice1.get().GetSegment(index); } else { - throw CTiglError(tank_type_error_msg); + throw CTiglError(tankTypeException); } } @@ -152,40 +155,39 @@ CCPACSFuselageSegment& CCPACSHull::GetSegment(std::string uid) return m_segments_choice1.get().GetSegment(uid); } else { - throw CTiglError(tank_type_error_msg); + throw CTiglError(tankTypeException); } } double CCPACSHull::GetVolume() { - const TopoDS_Shape fusedSegments = GetLoft()->Shape(); + const TopoDS_Shape& shape = GetLoft()->Shape(); + GProp_GProps shapeProps; + BRepGProp::VolumeProperties(shape, shapeProps); - GProp_GProps hull; - BRepGProp::VolumeProperties(fusedSegments, hull); - double myVolume = hull.Mass(); - return myVolume; + return shapeProps.Mass(); } double CCPACSHull::GetSurfaceArea() { - const PNamedShape& fusedSegments = GetLoft(); + const PNamedShape& shape = GetLoft(); - // loop over all faces that are not symmetry, front or rear - double myArea = 0.; + // Loop over all faces that are not symmetry, front or rear + double area = 0.; TopTools_IndexedMapOfShape shapeMap; - TopExp::MapShapes(fusedSegments->Shape(), TopAbs_FACE, shapeMap); + TopExp::MapShapes(shape->Shape(), TopAbs_FACE, shapeMap); for (int i = 1; i <= shapeMap.Extent(); ++i) { - if (GetUID() == fusedSegments->GetFaceTraits(i - 1).Name()) { - const TopoDS_Face& f = TopoDS::Face(shapeMap(i)); - GProp_GProps System; - BRepGProp::SurfaceProperties(f, System); - myArea += System.Mass(); + const std::string& faceName = shape->GetFaceTraits(i - 1).Name(); + if (GetUID() == faceName) { + const TopoDS_Face& face = TopoDS::Face(shapeMap(i)); + GProp_GProps shapeProps; + BRepGProp::SurfaceProperties(face, shapeProps); + area += shapeProps.Mass(); } } - // Calculate surface area - return myArea; + return area; } double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) @@ -194,7 +196,7 @@ double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); } else { - throw CTiglError(tank_type_error_msg); + throw CTiglError(tankTypeException); } } diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 0cb5045a02..2ccb48ae5e 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -113,7 +113,8 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned mutable TankType tankType; mutable DomeType domeType; - const std::string tank_type_error_msg = "GetSectionFace: Could not find a section for the given UID"; + const std::string tankTypeException = + "This method is only available for hulls with segments. No segment found."; mutable const tigl::generated::CPACSEllipsoidDome* m_ellipsoid; mutable const tigl::generated::CPACSTorisphericalDome* m_torispherical; diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 1d7820f7f8..0a9802d08b 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -7,7 +7,7 @@ from OCC.Core.TopoDS import TopoDS_Face -class FuselageTank(unittest.TestCase): +class Tank(unittest.TestCase): def setUp(self): self.tixi = Tixi3() @@ -25,7 +25,7 @@ def setUp(self): "tank3_sphericalDome" ) - self.tank_type_exception_msg = "Method only available for hulls with segments." + self.tank_type_exception_msg = "This method is only available for hulls with segments. No segment found." def tearDown(self): self.tigl.close() @@ -103,13 +103,16 @@ def test_hull_sections(self): self.assertIsInstance( hull_segments.get_section(1), configuration.CCPACSFuselageSection ) - # with self.assertRaises(RuntimeError) as context: - # hull_parametric.get_section(1) - # self.assertEqual(str(context.exception), self.tank_type_exception_msg) + with self.assertRaises(RuntimeError) as context: + hull_parametric.get_section(1) + self.assertEqual(str(context.exception), self.tank_type_exception_msg) self.assertIsInstance( hull_segments.get_section_face("outerHull_section3"), TopoDS_Face ) + with self.assertRaises(RuntimeError) as context: + hull_parametric.get_section_face("outerHull_section3") + self.assertEqual(str(context.exception), self.tank_type_exception_msg) def test_hull_segments(self): hull_segments = self.hull_with_segments @@ -121,9 +124,9 @@ def test_hull_segments(self): self.assertIsInstance( hull_segments.get_segment(1), configuration.CCPACSFuselageSegment ) - # with self.assertRaises(RuntimeError) as context: - # hull_parametric.get_segment(1) - # self.assertEqual(str(context.exception), self.tank_type_exception_msg) + with self.assertRaises(RuntimeError) as context: + hull_parametric.get_segment(1) + self.assertEqual(str(context.exception), self.tank_type_exception_msg) def test_hull_guide_curves(self): # point = self.hull_with_guides.get_guide_curve_points()[1] @@ -149,9 +152,9 @@ def test_hull_loft_methods(self): self.assertAlmostEqual(round(hull_parametric.get_surface_area(), 2), 36.19) self.assertAlmostEqual(round(hull_segments.get_circumference(1, 0.5), 2), 7.43) - # with self.assertRaises(RuntimeError) as context: - # hull_parametric.get_circumference(1, 0.5) - # self.assertEqual(str(context.exception), self.tank_type_exception_msg) + with self.assertRaises(RuntimeError) as context: + hull_parametric.get_circumference(1, 0.5) + self.assertEqual(str(context.exception), self.tank_type_exception_msg) point = hull_segments.get_point(1, 0.5, 0.5) self.assertAlmostEqual(round(point.X(), 2), 1.54) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index e79aaa5564..211989403e 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -94,11 +94,27 @@ class FuselageTank : public ::testing::Test tigl::CCPACSHull* hull_segments = &uidMgr.ResolveObject("tank1_outerHull"); tigl::CCPACSHull* hull_guides = &uidMgr.ResolveObject("tank2_outerHull"); tigl::CCPACSHull* hull_parametric = &uidMgr.ResolveObject("tank3_sphericalDome"); + + const char* tankTypeExceptionString = "This method is only available for hulls with segments. No segment found."; }; TixiDocumentHandle FuselageTank::tixiHandle = 0; TiglCPACSConfigurationHandle FuselageTank::tiglHandle = 0; +void CheckExceptionMessage(std::function func, const char* expectedMessage) +{ + try { + func(); + FAIL() << "Expected tigl::CTiglError but no exception was thrown."; + } + catch (const tigl::CTiglError& e) { + EXPECT_STREQ(e.what(), expectedMessage); + } + catch (...) { + FAIL() << "Expected tigl::CTiglError but a different exception was thrown."; + } +} + TEST_F(FuselageTank, getName) { const std::string name = fuelTank->GetName(); @@ -144,14 +160,19 @@ TEST_F(FuselageTank, hull_component_info) TEST_F(FuselageTank, hull_sections) { + const char* invalidIndexMessage = "Invalid index in CCPACSFuselageSections::GetSection"; + const char* wrongSectionUIDMessage = "GetSectionFace: Could not find a fuselage section for the given UID"; + EXPECT_EQ(hull_segments->GetSectionCount(), 3); EXPECT_EQ(hull_parametric->GetSectionCount(), 0); EXPECT_NO_THROW(hull_segments->GetSection(1)); - EXPECT_THROW(hull_parametric->GetSection(2), tigl::CTiglError); + CheckExceptionMessage([&]() { hull_segments->GetSection(4); }, invalidIndexMessage); + CheckExceptionMessage([&]() { hull_parametric->GetSection(2); }, tankTypeExceptionString); - EXPECT_NO_THROW(hull_segments->GetSectionFace("outerHull_section1")); - EXPECT_THROW(hull_segments->GetSection(4), tigl::CTiglError); + EXPECT_NO_THROW(hull_segments->GetSectionFace("outerHull_section3")); + CheckExceptionMessage([&]() { hull_segments->GetSectionFace("wrongSectionUID"); }, wrongSectionUIDMessage); + CheckExceptionMessage([&]() { hull_parametric->GetSectionFace("outerHull_section3"); }, tankTypeExceptionString); } TEST_F(FuselageTank, hull_segments) @@ -178,6 +199,8 @@ TEST_F(FuselageTank, hull_guide_curves) TEST_F(FuselageTank, hull_loft_methods) { EXPECT_NEAR(hull_segments->GetVolume(), 6.57, 1e-2); + EXPECT_NEAR(hull_parametric->GetVolume(), 18.1, 1e-2); + EXPECT_NEAR(hull_segments->GetSurfaceArea(), 11.15, 1e-2); EXPECT_NEAR(hull_segments->GetCircumference(1, 0.5), 7.43, 1e-2); From eef89798f23c06d87b5f97c983d38f93fe002dd4 Mon Sep 17 00:00:00 2001 From: Alder Date: Tue, 4 Jun 2024 10:33:36 +0200 Subject: [PATCH 041/122] simplify evaluation (remove enumes); adopt test cases --- bindings/python_internal/configuration.i | 2 - src/fuelTanks/CCPACSHull.cpp | 169 +++++++++++++++-------- src/fuelTanks/CCPACSHull.h | 48 +++---- tests/unittests/test_fuelTanks.py | 73 +++++++--- tests/unittests/tiglTanks.cpp | 38 +++++ 5 files changed, 221 insertions(+), 109 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 35e62e9763..e3dfc736b0 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -371,8 +371,6 @@ class CCPACSHulls; %include "CCPACSHull.h" %include "generated/CPACSFuselageFuelTanks.h" - - // -------------------- Wing Structure -------------------// namespace tigl { diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 3c1477d7b1..3a947f9f1a 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -95,7 +95,7 @@ CCPACSFuselageSection& CCPACSHull::GetSection(int index) const return m_sections_choice1.get().GetSection(index); } else { - throw CTiglError(tankTypeException); + throw CTiglError(_hullTypeException); } } @@ -115,7 +115,7 @@ TopoDS_Shape CCPACSHull::GetSectionFace(const std::string sectionUID) const } } m_sections_choice1 ? throw CTiglError("GetSectionFace: Could not find a fuselage section for the given UID") - : throw CTiglError(tankTypeException); + : throw CTiglError(_hullTypeException); return TopoDS_Shape(); } @@ -135,7 +135,7 @@ CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) return m_segments_choice1.get().GetSegment(index); } else { - throw CTiglError(tankTypeException); + throw CTiglError(_hullTypeException); } } @@ -145,7 +145,7 @@ const CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) const return m_segments_choice1.get().GetSegment(index); } else { - throw CTiglError(tankTypeException); + throw CTiglError(_hullTypeException); } } @@ -155,7 +155,7 @@ CCPACSFuselageSegment& CCPACSHull::GetSegment(std::string uid) return m_segments_choice1.get().GetSegment(uid); } else { - throw CTiglError(tankTypeException); + throw CTiglError(_hullTypeException); } } @@ -196,7 +196,89 @@ double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); } else { - throw CTiglError(tankTypeException); + throw CTiglError(_hullTypeException); + } +} + +bool CCPACSHull::IsHullViaSegments() const +{ + if (m_segments_choice1) { + return true; + } + else if (m_domeType_choice2) { + return false; + } + else { + throw CTiglError("Hull type could not be determined."); + } +} + +bool CCPACSHull::IsHullViaDesignParameters() const +{ + if (m_segments_choice1) { + return false; + } + else if (m_domeType_choice2) { + return true; + } + else { + throw CTiglError("Hull type could not be determined."); + } +} + +bool CCPACSHull::HasSphericalDome() const +{ + EvaluateDome(); + if (_ellipsoidPtr && _ellipsoidPtr->GetHalfAxisFraction() == 1) { + return true; + } + else { + return false; + } +} + +bool CCPACSHull::HasEllipsoidDome() const +{ + EvaluateDome(); + if (_ellipsoidPtr) { + return true; + } + else { + return false; + } +} + +bool CCPACSHull::HasIsotensoidDome() const +{ + EvaluateDome(); + if (_isotensoidPtr) { + return true; + } + else { + return false; + } +} + +bool CCPACSHull::HasTorisphericalDome() const +{ + EvaluateDome(); + if (_torisphericalPtr) { + return true; + } + else { + return false; + } +} + +void CCPACSHull::EvaluateDome() const +{ + if (!_isEvaluated) { + if (m_domeType_choice2) { + _ellipsoidPtr = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); + _torisphericalPtr = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); + _isotensoidPtr = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); + } + _isEvaluated = true; } } @@ -255,7 +337,7 @@ void CCPACSHull::BuildShapeFromSegments(TopoDS_Shape& loftShape) const loftShape = lofter.Shape(); } -void CCPACSHull::BuildTankWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const +void CCPACSHull::BuildHullWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const { for (const auto& edge : edges) { wire.Add(edge); @@ -272,12 +354,12 @@ void CCPACSHull::BuildTankWire(std::vector& edges, BRepBuilderAPI_M } } -void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const +void CCPACSHull::BuildHullWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const { double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double axRatio = m_ellipsoid->GetHalfAxisFraction(); + double axRatio = _ellipsoidPtr->GetHalfAxisFraction(); if (axRatio < 0.0) { throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of hull \"" + GetName() + "\" (uID=\"" + GetUID() + "\") must be a positive value!"); @@ -319,16 +401,16 @@ void CCPACSHull::BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const edges.push_back(cylinder_edge); } - BuildTankWire(edges, wire); + BuildHullWire(edges, wire); } -void CCPACSHull::BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const +void CCPACSHull::BuildHullWireTorispherical(BRepBuilderAPI_MakeWire& wire) const { double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double R = m_torispherical->GetDishRadius(); // Radius of the sphere (crown radius) - double r = m_torispherical->GetKnuckleRadius(); // Radius of the torus (knuckle radius) + double R = _torisphericalPtr->GetDishRadius(); // Radius of the sphere (crown radius) + double r = _torisphericalPtr->GetKnuckleRadius(); // Radius of the torus (knuckle radius) if (R <= cylinderRadius) { throw CTiglError("The dish radius (" + std::to_string(R) + ") of hull \"" + GetName() + "\" (uID=\"" + @@ -370,15 +452,15 @@ void CCPACSHull::BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const edges.push_back(cylinder_edge); } - BuildTankWire(edges, wire); + BuildHullWire(edges, wire); } -void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const +void CCPACSHull::BuildHullWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const { double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double polarOpeningRadius = m_isotensoid->GetPolarOpeningRadius(); + double polarOpeningRadius = _isotensoidPtr->GetPolarOpeningRadius(); if (polarOpeningRadius <= 0 || polarOpeningRadius >= cylinderRadius) { throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of hull \"" + GetName() + "\" (uID=\"" + GetUID() + @@ -407,7 +489,7 @@ void CCPACSHull::BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const edges.push_back(cylinder_edge); } - BuildTankWire(edges, wire); + BuildHullWire(edges, wire); } void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const @@ -423,14 +505,14 @@ void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than or equal to 0!"); } - if (m_ellipsoid) { - BuildTankWireEllipsoid(wire); + if (_ellipsoidPtr) { + BuildHullWireEllipsoid(wire); } - else if (m_torispherical) { - BuildTankWireTorispherical(wire); + else if (_torisphericalPtr) { + BuildHullWireTorispherical(wire); } - else if (m_isotensoid) { - BuildTankWireIsotensoid(wire); + else if (_isotensoidPtr) { + BuildHullWireIsotensoid(wire); } gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); @@ -442,55 +524,22 @@ void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const loftShape = TransformedShape; } -void CCPACSHull::DetermineTankType() const -{ - if (m_segments_choice1 && m_sections_choice1) { - tankType = TANK_VIA_SEGMENTS; - domeType = TANK_WITH_SEGMENT_DOME; - } - else if (m_cylinderRadius_choice2 && m_cylinderLength_choice2 && m_domeType_choice2) { - tankType = TANK_VIA_DESIGN_PARAMETERS; - - m_ellipsoid = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); - m_torispherical = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); - m_isotensoid = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); - - if (m_ellipsoid) { - m_ellipsoid->GetHalfAxisFraction() == 1 ? domeType = TANK_WITH_SPHERICAL_DOME - : domeType = TANK_WITH_ELLIPSOID_DOME; - } - else if (m_torispherical) { - domeType = TANK_WITH_TORISPHERICAL_DOME; - } - else if (m_isotensoid) { - domeType = TANK_WITH_ISOTENSOID_DOME; - } - } - else { - throw CTiglError("No valid combination of segments and sections or parametric specification for lofting of " - "tank hull available.", - TIGL_ERROR); - } -} - PNamedShape CCPACSHull::BuildLoft() const { - - DetermineTankType(); - TopoDS_Shape loftShape; std::string loftName = GetUID(); std::string loftShortName = GetShortShapeName(); - if (tankType == TANK_VIA_SEGMENTS) { + + if (m_sections_choice1) { BuildShapeFromSegments(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); SetFaceTraits(loft); return loft; } - else if (tankType == TANK_VIA_DESIGN_PARAMETERS) { - + else if (m_domeType_choice2) { + EvaluateDome(); BuildShapeFromSimpleParameters(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); return loft; diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 2ccb48ae5e..9c21fff621 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -87,6 +87,15 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned // Returns all guide curve points TIGL_EXPORT std::vector GetGuideCurvePoints() const; + // Check whether the hull is defined using segments or design parameters + TIGL_EXPORT bool IsHullViaSegments() const; + TIGL_EXPORT bool IsHullViaDesignParameters() const; + + TIGL_EXPORT bool HasSphericalDome() const; + TIGL_EXPORT bool HasEllipsoidDome() const; + TIGL_EXPORT bool HasTorisphericalDome() const; + TIGL_EXPORT bool HasIsotensoidDome() const; + protected: // Build the loft PNamedShape BuildLoft() const override; @@ -95,32 +104,13 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned void SetFaceTraits(PNamedShape loft) const; private: - enum TankType - { - TANK_VIA_SEGMENTS, - TANK_VIA_DESIGN_PARAMETERS, - }; - - enum DomeType - { - TANK_WITH_SPHERICAL_DOME, - TANK_WITH_ELLIPSOID_DOME, - TANK_WITH_TORISPHERICAL_DOME, - TANK_WITH_ISOTENSOID_DOME, - TANK_WITH_SEGMENT_DOME - }; - - mutable TankType tankType; - mutable DomeType domeType; - - const std::string tankTypeException = - "This method is only available for hulls with segments. No segment found."; - - mutable const tigl::generated::CPACSEllipsoidDome* m_ellipsoid; - mutable const tigl::generated::CPACSTorisphericalDome* m_torispherical; - mutable const tigl::generated::CPACSIsotensoidDome* m_isotensoid; + const std::string _hullTypeException = "This method is only available for hulls with segments. No segment found."; - void DetermineTankType() const; + mutable const tigl::generated::CPACSEllipsoidDome* _ellipsoidPtr = NULL; + mutable const tigl::generated::CPACSTorisphericalDome* _torisphericalPtr = NULL; + mutable const tigl::generated::CPACSIsotensoidDome* _isotensoidPtr = NULL; + mutable bool _isEvaluated = false; + void EvaluateDome() const; // Get short name for loft std::string GetShortShapeName() const; @@ -132,10 +122,10 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned void BuildShapeFromSegments(TopoDS_Shape& loftShape) const; void BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const; - void BuildTankWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const; - void BuildTankWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const; - void BuildTankWireTorispherical(BRepBuilderAPI_MakeWire& wire) const; - void BuildTankWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const; + void BuildHullWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const; + void BuildHullWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const; + void BuildHullWireTorispherical(BRepBuilderAPI_MakeWire& wire) const; + void BuildHullWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const; }; } // namespace tigl diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 0a9802d08b..be0d8505ea 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -19,13 +19,18 @@ def setUp(self): uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() self.fuelTank = uid_mgr.get_geometric_component("tank1") - self.hull_with_segments = uid_mgr.get_geometric_component("tank1_outerHull") - self.hull_with_guides = uid_mgr.get_geometric_component("tank2_outerHull") - self.hull_with_spherical_dome = uid_mgr.get_geometric_component( - "tank3_sphericalDome" + self.hull_segments = uid_mgr.get_geometric_component("tank1_outerHull") + self.hull_guides = uid_mgr.get_geometric_component("tank2_outerHull") + self.hull_spherical = uid_mgr.get_geometric_component("tank3_sphericalDome") + self.hull_ellipsoid = uid_mgr.get_geometric_component("tank3_ellipsoidDome") + self.hull_torispherical = uid_mgr.get_geometric_component( + "tank4_torisphericalDome" ) + self.hull_isotensoid = uid_mgr.get_geometric_component("tank5_isotensoidDome") - self.tank_type_exception_msg = "This method is only available for hulls with segments. No segment found." + self.tank_type_exception_msg = ( + "This method is only available for hulls with segments. No segment found." + ) def tearDown(self): self.tigl.close() @@ -61,7 +66,7 @@ def test_genericFuelTank(self): def test_hulls(self): # Test custom class methods: - hulls = self.hull_with_segments.get_parent() + hulls = self.hull_segments.get_parent() hull1_uID = "tank1_outerHull" ## Test accessability of childs: @@ -81,21 +86,53 @@ def test_hull_general(self): # Custom class methods self.assertEqual( - self.hull_with_segments.get_configuration().get_uid(), "testAircraft" + self.hull_segments.get_configuration().get_uid(), "testAircraft" ) - self.assertEqual(self.hull_with_segments.get_defaulted_uid(), "tank1_outerHull") + self.assertEqual(self.hull_segments.get_defaulted_uid(), "tank1_outerHull") # Generated class methods self.assertIsInstance( - self.hull_with_segments.get_configuration(), + self.hull_segments.get_configuration(), configuration.CCPACSConfiguration, ) - self.assertEqual(self.hull_with_segments.get_name(), "Outer hull") + self.assertEqual(self.hull_segments.get_name(), "Outer hull") + + def test_hull_type_info(self): + + self.assertTrue(self.hull_segments.is_hull_via_segments()) + self.assertFalse(self.hull_segments.is_hull_via_design_parameters()) + self.assertFalse(self.hull_spherical.is_hull_via_segments()) + self.assertTrue(self.hull_spherical.is_hull_via_design_parameters()) + + self.assertFalse(self.hull_segments.has_spherical_dome()) + self.assertFalse(self.hull_segments.has_ellipsoid_dome()) + self.assertFalse(self.hull_segments.has_torispherical_dome()) + self.assertFalse(self.hull_segments.has_isotensoid_dome()) + + self.assertTrue(self.hull_spherical.has_spherical_dome()) + self.assertTrue(self.hull_spherical.has_ellipsoid_dome()) + self.assertFalse(self.hull_spherical.has_torispherical_dome()) + self.assertFalse(self.hull_spherical.has_isotensoid_dome()) + + self.assertFalse(self.hull_ellipsoid.has_spherical_dome()) + self.assertTrue(self.hull_ellipsoid.has_ellipsoid_dome()) + self.assertFalse(self.hull_ellipsoid.has_torispherical_dome()) + self.assertFalse(self.hull_ellipsoid.has_isotensoid_dome()) + + self.assertFalse(self.hull_torispherical.has_spherical_dome()) + self.assertFalse(self.hull_torispherical.has_ellipsoid_dome()) + self.assertTrue(self.hull_torispherical.has_torispherical_dome()) + self.assertFalse(self.hull_torispherical.has_isotensoid_dome()) + + self.assertFalse(self.hull_isotensoid.has_spherical_dome()) + self.assertFalse(self.hull_isotensoid.has_ellipsoid_dome()) + self.assertFalse(self.hull_isotensoid.has_torispherical_dome()) + self.assertTrue(self.hull_isotensoid.has_isotensoid_dome()) def test_hull_sections(self): - hull_segments = self.hull_with_segments - hull_parametric = self.hull_with_spherical_dome + hull_segments = self.hull_segments + hull_parametric = self.hull_spherical self.assertEqual(hull_segments.get_section_count(), 3) self.assertEqual(hull_parametric.get_section_count(), 0) @@ -115,8 +152,8 @@ def test_hull_sections(self): self.assertEqual(str(context.exception), self.tank_type_exception_msg) def test_hull_segments(self): - hull_segments = self.hull_with_segments - hull_parametric = self.hull_with_spherical_dome + hull_segments = self.hull_segments + hull_parametric = self.hull_spherical self.assertEqual(hull_segments.get_segment_count(), 2) self.assertEqual(hull_parametric.get_segment_count(), 0) @@ -135,15 +172,15 @@ def test_hull_guide_curves(self): # self.assertAlmostEqual(round(point.Z(), 2), -0.24, 1e-2) self.assertEqual( - self.hull_with_guides.get_guide_curve_segment( + self.hull_guides.get_guide_curve_segment( "tank2_seg1_upper" ).get_guide_curve_profile_uid(), "gc_upper", ) def test_hull_loft_methods(self): - hull_segments = self.hull_with_segments - hull_parametric = self.hull_with_spherical_dome + hull_segments = self.hull_segments + hull_parametric = self.hull_spherical self.assertAlmostEqual(round(hull_segments.get_volume(), 2), 6.57) self.assertAlmostEqual(round(hull_parametric.get_volume(), 2), 18.1) @@ -162,7 +199,7 @@ def test_hull_loft_methods(self): self.assertAlmostEqual(round(point.Z(), 2), -1.2) def test_structure(self): - structure = self.hull_with_segments.get_structure() + structure = self.hull_segments.get_structure() # Test custom class methods: self.assertIsInstance( structure.get_frames(), configuration.CCPACSFramesAssembly diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 211989403e..f93078f151 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -95,6 +95,11 @@ class FuselageTank : public ::testing::Test tigl::CCPACSHull* hull_guides = &uidMgr.ResolveObject("tank2_outerHull"); tigl::CCPACSHull* hull_parametric = &uidMgr.ResolveObject("tank3_sphericalDome"); + tigl::CCPACSHull* hull_spherical = &uidMgr.ResolveObject("tank3_sphericalDome"); + tigl::CCPACSHull* hull_ellipsoid = &uidMgr.ResolveObject("tank3_ellipsoidDome"); + tigl::CCPACSHull* hull_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); + tigl::CCPACSHull* hull_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); + const char* tankTypeExceptionString = "This method is only available for hulls with segments. No segment found."; }; @@ -158,6 +163,39 @@ TEST_F(FuselageTank, hull_component_info) EXPECT_EQ(hull_segments->GetComponentIntent(), TIGL_INTENT_PHYSICAL); } +TEST_F(FuselageTank, hull_type_info) +{ + EXPECT_TRUE(hull_segments->IsHullViaSegments()); + EXPECT_FALSE(hull_segments->IsHullViaDesignParameters()); + EXPECT_FALSE(hull_spherical->IsHullViaSegments()); + EXPECT_TRUE(hull_spherical->IsHullViaDesignParameters()); + + EXPECT_FALSE(hull_segments->HasSphericalDome()); + EXPECT_FALSE(hull_segments->HasEllipsoidDome()); + EXPECT_FALSE(hull_segments->HasTorisphericalDome()); + EXPECT_FALSE(hull_segments->HasIsotensoidDome()); + + EXPECT_TRUE(hull_spherical->HasSphericalDome()); + EXPECT_TRUE(hull_spherical->HasEllipsoidDome()); + EXPECT_FALSE(hull_spherical->HasTorisphericalDome()); + EXPECT_FALSE(hull_spherical->HasIsotensoidDome()); + + EXPECT_FALSE(hull_ellipsoid->HasSphericalDome()); + EXPECT_TRUE(hull_ellipsoid->HasEllipsoidDome()); + EXPECT_FALSE(hull_ellipsoid->HasTorisphericalDome()); + EXPECT_FALSE(hull_ellipsoid->HasIsotensoidDome()); + + EXPECT_FALSE(hull_torispherical->HasSphericalDome()); + EXPECT_FALSE(hull_torispherical->HasEllipsoidDome()); + EXPECT_TRUE(hull_torispherical->HasTorisphericalDome()); + EXPECT_FALSE(hull_torispherical->HasIsotensoidDome()); + + EXPECT_FALSE(hull_isotensoid->HasSphericalDome()); + EXPECT_FALSE(hull_isotensoid->HasEllipsoidDome()); + EXPECT_FALSE(hull_isotensoid->HasTorisphericalDome()); + EXPECT_TRUE(hull_isotensoid->HasIsotensoidDome()); +} + TEST_F(FuselageTank, hull_sections) { const char* invalidIndexMessage = "Invalid index in CCPACSFuselageSections::GetSection"; From c75ab046ebca2ce5efe9ba0af6e0b59fca5776f7 Mon Sep 17 00:00:00 2001 From: Alder Date: Tue, 4 Jun 2024 15:38:12 +0200 Subject: [PATCH 042/122] adopt header of test case to CPACS v3.5 --- .../unittests/TestData/simpletest-fuelTanks.cpacs.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 06a60b70d0..779c8fda40 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -4,10 +4,15 @@
Fuel tanks test Simple fuel tank for unit testing - Marko Alder - 2023-12-28T12:00:00 1.0.0 - 3.3 + + + First test set with different tank and hull types + Marko Alder + 2023-12-28T12:00:00 + 3.5 + +
From 906967d45ab7ff4eace21ab0a965c927a0d89f1a Mon Sep 17 00:00:00 2001 From: Alder Date: Wed, 5 Jun 2024 12:52:16 +0200 Subject: [PATCH 043/122] cosmetic improvements --- src/fuelTanks/CCPACSHull.cpp | 60 +++++++++++++++++------------------ src/fuelTanks/CCPACSHull.h | 8 +++-- tests/unittests/tiglTanks.cpp | 2 +- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 3a947f9f1a..74eea8cda0 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -371,34 +371,34 @@ void CCPACSHull::BuildHullWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const gp_Dir dir(0.0, 1.0, 0.0); gp_Pnt p(h, 0.0, 0.0); - double major_ax = R; - double minor_ax = R * axRatio; - double rot_angle = 0; - double start_angle = -M_PI / 2; - double end_angle = 0.0; + double majorAxis = R; + double minorAxis = R * axRatio; + double rotAngle = 0; + double startAngle = -M_PI / 2; + double endAngle = 0.0; if (axRatio > 1) { - major_ax = R * axRatio; - minor_ax = R; - rot_angle = 0.5 * M_PI; - start_angle = -M_PI; - end_angle = -M_PI / 2; + majorAxis = R * axRatio; + minorAxis = R; + rotAngle = 0.5 * M_PI; + startAngle = -M_PI; + endAngle = -M_PI / 2; } - gp_Elips ellips(gp_Ax2(p, dir), major_ax, minor_ax); - ellips.Rotate(gp_Ax1(p, dir), rot_angle); - GC_MakeArcOfEllipse arc(ellips, start_angle, end_angle, Standard_True); + gp_Elips ellips(gp_Ax2(p, dir), majorAxis, minorAxis); + ellips.Rotate(gp_Ax1(p, dir), rotAngle); + GC_MakeArcOfEllipse arc(ellips, startAngle, endAngle, Standard_True); - TopoDS_Edge dome_edge = BRepBuilderAPI_MakeEdge(arc.Value()).Edge(); + TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(arc.Value()).Edge(); - std::vector edges = {dome_edge}; + std::vector edges = {domeEdge}; if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetLastVertex(dome_edge); + TopoDS_Vertex v1 = GetLastVertex(domeEdge); TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); - TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); - edges.push_back(cylinder_edge); + TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinderEdge); } BuildHullWire(edges, wire); @@ -439,17 +439,17 @@ void CCPACSHull::BuildHullWireTorispherical(BRepBuilderAPI_MakeWire& wire) const GC_MakeArcOfCircle arc1(circ1, -M_PI / 2, -alpha, Standard_True); GC_MakeArcOfCircle arc2(circ2, -alpha, 0, Standard_True); - TopoDS_Edge dome_edge1 = BRepBuilderAPI_MakeEdge(arc1.Value()).Edge(); - TopoDS_Edge dome_edge2 = BRepBuilderAPI_MakeEdge(arc2.Value()).Edge(); + TopoDS_Edge domeEdge1 = BRepBuilderAPI_MakeEdge(arc1.Value()).Edge(); + TopoDS_Edge domeEdge2 = BRepBuilderAPI_MakeEdge(arc2.Value()).Edge(); - std::vector edges = {dome_edge1, dome_edge2}; + std::vector edges = {domeEdge1, domeEdge2}; if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetLastVertex(dome_edge2); + TopoDS_Vertex v1 = GetLastVertex(domeEdge2); TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); - TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); - edges.push_back(cylinder_edge); + TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinderEdge); } BuildHullWire(edges, wire); @@ -477,16 +477,16 @@ void CCPACSHull::BuildHullWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const array.SetValue(i + 1, gp_Pnt(-x[i], 0.0, r[i])); } Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); - TopoDS_Edge dome_edge = BRepBuilderAPI_MakeEdge(bspline); + TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(bspline); - std::vector edges = {dome_edge}; + std::vector edges = {domeEdge}; if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetFirstVertex(dome_edge); + TopoDS_Vertex v1 = GetFirstVertex(domeEdge); TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); - TopoDS_Edge cylinder_edge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); - edges.push_back(cylinder_edge); + TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinderEdge); } BuildHullWire(edges, wire); @@ -530,8 +530,6 @@ PNamedShape CCPACSHull::BuildLoft() const std::string loftName = GetUID(); std::string loftShortName = GetShortShapeName(); - - if (m_sections_choice1) { BuildShapeFromSegments(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 9c21fff621..3c72e08bb5 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -87,13 +87,17 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned // Returns all guide curve points TIGL_EXPORT std::vector GetGuideCurvePoints() const; - // Check whether the hull is defined using segments or design parameters + // Check whether the hull is defined using segments TIGL_EXPORT bool IsHullViaSegments() const; + // Check whether the hull is defined using design parameters TIGL_EXPORT bool IsHullViaDesignParameters() const; - + // Check whether the hull has spherical dome TIGL_EXPORT bool HasSphericalDome() const; + // Check whether the hull has ellipsoid dome TIGL_EXPORT bool HasEllipsoidDome() const; + // Check whether the hull has spherical dome TIGL_EXPORT bool HasTorisphericalDome() const; + // Check whether the hull has isotensoid dome TIGL_EXPORT bool HasIsotensoidDome() const; protected: diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index f93078f151..1fac7a2846 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -216,8 +216,8 @@ TEST_F(FuselageTank, hull_sections) TEST_F(FuselageTank, hull_segments) { EXPECT_EQ(hull_segments->GetSegmentCount(), 2); + EXPECT_EQ(hull_parametric->GetSegmentCount(), 0); - EXPECT_EQ(hull_segments->GetSegmentCount(), 2); EXPECT_NO_THROW(hull_segments->GetSegment(1)); EXPECT_NO_THROW(hull_segments->GetSegment("outerHull_segment1")); EXPECT_THROW(hull_segments->GetSegment(3), tigl::CTiglError); From cfb1f2830d19e47387dafba531b2d5d7a0ce09c4 Mon Sep 17 00:00:00 2001 From: Alder Date: Wed, 5 Jun 2024 14:51:36 +0200 Subject: [PATCH 044/122] add tests; code cosmetics --- bindings/python_internal/common.i | 6 ++++++ src/fuelTanks/CCPACSHull.cpp | 12 +++++++++--- src/fuelTanks/CCPACSHull.h | 6 +++--- tests/unittests/test_fuelTanks.py | 15 ++++++++++++++- tests/unittests/tiglTanks.cpp | 15 +++++++++++++-- 5 files changed, 45 insertions(+), 9 deletions(-) diff --git a/bindings/python_internal/common.i b/bindings/python_internal/common.i index 54cffd8db3..6880260000 100644 --- a/bindings/python_internal/common.i +++ b/bindings/python_internal/common.i @@ -123,6 +123,12 @@ enum TiglCoordinateSystem FUSELAGE_COORDINATE_SYSTEM = 2 }; +enum TiglGetPointBehavior { + asParameterOnSurface = 0, + onLinearLoft = 1, + numGetPointBehaviors = 2 +}; + %{ // includes are required to for compilation diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 74eea8cda0..fddab60b4a 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -551,18 +551,24 @@ PNamedShape CCPACSHull::BuildLoft() const gp_Pnt CCPACSHull::GetPoint(int segmentIndex, double eta, double zeta) { - return ((CCPACSFuselageSegment&)GetSegment(segmentIndex)).GetPoint(eta, zeta, getPointBehavior); + // ToDo: This functionality could also be implemented for parametric hulls, if needed + if (m_segments_choice1) { + return ((CCPACSFuselageSegment&)GetSegment(segmentIndex)).GetPoint(eta, zeta, _getPointBehavior); + } + else { + throw CTiglError(_hullTypeException); + } } // Sets the GetPoint behavior to asParameterOnSurface or onLinearLoft void CCPACSHull::SetGetPointBehavior(TiglGetPointBehavior behavior) { - getPointBehavior = behavior; + _getPointBehavior = behavior; } TiglGetPointBehavior CCPACSHull::GetGetPointBehavior() const { - return getPointBehavior; + return _getPointBehavior; } CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 3c72e08bb5..8d1ccbf5bd 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -76,9 +76,9 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned // profile of the segment, for eta = 1.0 on the end profile of the segment. For zeta = 0.0 // the point is the start point of the profile wire, for zeta = 1.0 the last profile wire point. TIGL_EXPORT gp_Pnt GetPoint(int segmentIndex, double eta, double zeta); - // Set the getPointBehavior to asParameterOnSurface or onLinearLoft + // Set the _getPointBehavior to asParameterOnSurface or onLinearLoft TIGL_EXPORT void SetGetPointBehavior(TiglGetPointBehavior behavior = asParameterOnSurface); - // Get the getPointBehavior + // Get the _getPointBehavior TIGL_EXPORT TiglGetPointBehavior GetGetPointBehavior() const; // Get the guide curve segment (partial guide curve) with a given uID @@ -119,7 +119,7 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned // Get short name for loft std::string GetShortShapeName() const; - TiglGetPointBehavior getPointBehavior{asParameterOnSurface}; + TiglGetPointBehavior _getPointBehavior{asParameterOnSurface}; void IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, std::vector& r) const; diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index be0d8505ea..66bb332c1b 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -178,7 +178,7 @@ def test_hull_guide_curves(self): "gc_upper", ) - def test_hull_loft_methods(self): + def test_hull_loft_evaluation(self): hull_segments = self.hull_segments hull_parametric = self.hull_spherical @@ -197,6 +197,19 @@ def test_hull_loft_methods(self): self.assertAlmostEqual(round(point.X(), 2), 1.54) self.assertAlmostEqual(round(point.Y(), 2), 0.0) self.assertAlmostEqual(round(point.Z(), 2), -1.2) + with self.assertRaises(RuntimeError) as context: + hull_parametric.get_point(1, 0.5, 0.5) + self.assertEqual(str(context.exception), self.tank_type_exception_msg) + + self.assertEqual( + hull_segments.get_get_point_behavior(), configuration.asParameterOnSurface + ) + self.assertIsNone( + hull_segments.set_get_point_behavior(configuration.onLinearLoft) + ) + self.assertEqual( + hull_segments.get_get_point_behavior(), configuration.onLinearLoft + ) def test_structure(self): structure = self.hull_segments.get_structure() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 1fac7a2846..46d4db39b1 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -219,8 +219,11 @@ TEST_F(FuselageTank, hull_segments) EXPECT_EQ(hull_parametric->GetSegmentCount(), 0); EXPECT_NO_THROW(hull_segments->GetSegment(1)); + CheckExceptionMessage([&]() { hull_parametric->GetSegment(1); }, tankTypeExceptionString); + EXPECT_NO_THROW(hull_segments->GetSegment("outerHull_segment1")); - EXPECT_THROW(hull_segments->GetSegment(3), tigl::CTiglError); + CheckExceptionMessage([&]() { hull_segments->GetSegment(3); }, + "Invalid index value in CCPACSFuselageSegments::GetSegment"); } TEST_F(FuselageTank, hull_guide_curves) @@ -234,17 +237,25 @@ TEST_F(FuselageTank, hull_guide_curves) EXPECT_EQ(hull_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); } -TEST_F(FuselageTank, hull_loft_methods) +TEST_F(FuselageTank, hull_loft_evaluation) { EXPECT_NEAR(hull_segments->GetVolume(), 6.57, 1e-2); EXPECT_NEAR(hull_parametric->GetVolume(), 18.1, 1e-2); EXPECT_NEAR(hull_segments->GetSurfaceArea(), 11.15, 1e-2); + EXPECT_NEAR(hull_parametric->GetSurfaceArea(), 36.19, 1e-2); + EXPECT_NEAR(hull_segments->GetCircumference(1, 0.5), 7.43, 1e-2); + CheckExceptionMessage([&]() { hull_parametric->GetCircumference(1, 0.5); }, tankTypeExceptionString); EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).Z(), -1.2, 1e-1); + CheckExceptionMessage([&]() { hull_parametric->GetPoint(1, 0.5, 0.5); }, tankTypeExceptionString); + + EXPECT_EQ(hull_segments->GetGetPointBehavior(), asParameterOnSurface); + EXPECT_NO_THROW(hull_segments->SetGetPointBehavior(onLinearLoft)); + EXPECT_EQ(hull_segments->GetGetPointBehavior(), onLinearLoft); } TEST_F(FuselageTank, parametric_hull) From beb3f2f5653673800ab902ab8fde5954e9e01679 Mon Sep 17 00:00:00 2001 From: Alder Date: Wed, 5 Jun 2024 15:06:40 +0200 Subject: [PATCH 045/122] add guide curve tests --- src/fuelTanks/CCPACSHull.cpp | 58 ++++++++++++++++++------------- tests/unittests/test_fuelTanks.py | 14 +++++--- tests/unittests/tiglTanks.cpp | 3 ++ 3 files changed, 47 insertions(+), 28 deletions(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index fddab60b4a..204644a52a 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -578,40 +578,50 @@ CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) const CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) const { - for (int i = 1; i <= m_segments_choice1.get().GetSegmentCount(); i++) { - const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(i); + if (m_segments_choice1) { + for (int i = 1; i <= m_segments_choice1.get().GetSegmentCount(); i++) { + const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(i); - if (!segment.GetGuideCurves()) { - continue; - } + if (!segment.GetGuideCurves()) { + continue; + } - if (segment.GetGuideCurves()->GuideCurveExists(uid)) { - return segment.GetGuideCurves()->GetGuideCurve(uid); + if (segment.GetGuideCurves()->GuideCurveExists(uid)) { + return segment.GetGuideCurves()->GetGuideCurve(uid); + } } + throw tigl::CTiglError("Guide Curve with UID " + uid + " does not exists", TIGL_ERROR); + } + else { + throw CTiglError(_hullTypeException); } - throw tigl::CTiglError("Guide Curve with UID " + uid + " does not exists", TIGL_ERROR); } std::vector CCPACSHull::GetGuideCurvePoints() const { - std::vector points; - - // connect the belonging guide curve segments - for (int isegment = 1; isegment <= GetSegmentCount(); ++isegment) { - const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(isegment); - - if (!segment.GetGuideCurves()) { - continue; - } - - const CCPACSGuideCurves& segmentCurves = *segment.GetGuideCurves(); - for (int iguide = 1; iguide <= segmentCurves.GetGuideCurveCount(); ++iguide) { - const CCPACSGuideCurve& curve = segmentCurves.GetGuideCurve(iguide); - std::vector curPoints = curve.GetCurvePoints(); - points.insert(points.end(), curPoints.begin(), curPoints.end()); + if (m_segments_choice1) { + std::vector points; + + // connect the belonging guide curve segments + for (int isegment = 1; isegment <= GetSegmentCount(); ++isegment) { + const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(isegment); + + if (!segment.GetGuideCurves()) { + continue; + } + + const CCPACSGuideCurves& segmentCurves = *segment.GetGuideCurves(); + for (int iguide = 1; iguide <= segmentCurves.GetGuideCurveCount(); ++iguide) { + const CCPACSGuideCurve& curve = segmentCurves.GetGuideCurve(iguide); + std::vector curPoints = curve.GetCurvePoints(); + points.insert(points.end(), curPoints.begin(), curPoints.end()); + } } + return points; + } + else { + throw CTiglError(_hullTypeException); } - return points; } // get short name for loft diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 66bb332c1b..e45e1a6d81 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -166,10 +166,13 @@ def test_hull_segments(self): self.assertEqual(str(context.exception), self.tank_type_exception_msg) def test_hull_guide_curves(self): - # point = self.hull_with_guides.get_guide_curve_points()[1] - # self.assertAlmostEqual(round(point.X(), 2), 2.75, 1e-2) - # self.assertAlmostEqual(round(point.Y(), 2), 0.0, 1e-5) - # self.assertAlmostEqual(round(point.Z(), 2), -0.24, 1e-2) + point = self.hull_guides.get_guide_curve_points()[1] + self.assertAlmostEqual(round(point.X(), 2), 3.5, 1e-2) + self.assertAlmostEqual(round(point.Y(), 2), 0.0, 1e-5) + self.assertAlmostEqual(round(point.Z(), 2), -0.65, 1e-2) + with self.assertRaises(RuntimeError) as context: + self.hull_spherical.get_guide_curve_points()[1] + self.assertEqual(str(context.exception), self.tank_type_exception_msg) self.assertEqual( self.hull_guides.get_guide_curve_segment( @@ -177,6 +180,9 @@ def test_hull_guide_curves(self): ).get_guide_curve_profile_uid(), "gc_upper", ) + with self.assertRaises(RuntimeError) as context: + self.hull_spherical.get_guide_curve_segment("tank2_seg1_upper") + self.assertEqual(str(context.exception), self.tank_type_exception_msg) def test_hull_loft_evaluation(self): hull_segments = self.hull_segments diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 46d4db39b1..8c246f39b3 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -233,8 +233,11 @@ TEST_F(FuselageTank, hull_guide_curves) EXPECT_NEAR(points.at(1).X(), 3.5, 1e-2); EXPECT_NEAR(points.at(1).Y(), 0, 1e-5); EXPECT_NEAR(points.at(1).Z(), -0.65, 1e-2); + CheckExceptionMessage([&]() { hull_parametric->GetGuideCurvePoints(); }, tankTypeExceptionString); EXPECT_EQ(hull_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); + CheckExceptionMessage([&]() { hull_parametric->GetGuideCurveSegment("tank2_seg1_upper"); }, + tankTypeExceptionString); } TEST_F(FuselageTank, hull_loft_evaluation) From 9caa6d449311cc9b231f474e9bdf4f9595393724 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Wed, 5 Jun 2024 22:10:58 +0200 Subject: [PATCH 046/122] XSD: add walls; generate classes --- cpacs_gen_input/cpacs_schema.xsd | 1 + src/generated/CPACSHullStructure.cpp | 44 ++++++++++++++++++++++++++++ src/generated/CPACSHullStructure.h | 8 +++++ src/generated/CPACSWalls.cpp | 32 +++++++++++++------- src/generated/CPACSWalls.h | 36 ++++++++++++++++++++--- 5 files changed, 107 insertions(+), 14 deletions(-) diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index 4064018a72..0b2f71ec0b 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -34507,6 +34507,7 @@ The fuel tank volume type should also be used for the wing fuel tank + diff --git a/src/generated/CPACSHullStructure.cpp b/src/generated/CPACSHullStructure.cpp index 1f02917129..70662bbc6d 100644 --- a/src/generated/CPACSHullStructure.cpp +++ b/src/generated/CPACSHullStructure.cpp @@ -143,6 +143,17 @@ namespace generated } } + // read element walls + if (tixi::TixiCheckElement(tixiHandle, xpath + "/walls")) { + m_walls = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_walls->ReadCPACS(tixiHandle, xpath + "/walls"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read walls at xpath " << xpath << ": " << e.what(); + m_walls = boost::none; + } + } + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); } @@ -206,6 +217,17 @@ namespace generated } } + // write element walls + if (m_walls) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/walls"); + m_walls->WriteCPACS(tixiHandle, xpath + "/walls"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/walls")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/walls"); + } + } + } const std::string& CPACSHullStructure::GetUID() const @@ -276,6 +298,16 @@ namespace generated return m_skinLayers; } + const boost::optional& CPACSHullStructure::GetWalls() const + { + return m_walls; + } + + boost::optional& CPACSHullStructure::GetWalls() + { + return m_walls; + } + CCPACSStringersAssembly& CPACSHullStructure::GetStringers(CreateIfNotExistsTag) { if (!m_stringers) @@ -336,5 +368,17 @@ namespace generated m_skinLayers = boost::none; } + CCPACSWalls& CPACSHullStructure::GetWalls(CreateIfNotExistsTag) + { + if (!m_walls) + m_walls = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_walls; + } + + void CPACSHullStructure::RemoveWalls() + { + m_walls = boost::none; + } + } // namespace generated } // namespace tigl diff --git a/src/generated/CPACSHullStructure.h b/src/generated/CPACSHullStructure.h index 8e1d4bec00..381dad40c1 100644 --- a/src/generated/CPACSHullStructure.h +++ b/src/generated/CPACSHullStructure.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "CPACSHullSkinLayers.h" @@ -79,6 +80,9 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetSkinLayers() const; TIGL_EXPORT virtual boost::optional& GetSkinLayers(); + TIGL_EXPORT virtual const boost::optional& GetWalls() const; + TIGL_EXPORT virtual boost::optional& GetWalls(); + TIGL_EXPORT virtual CCPACSStringersAssembly& GetStringers(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStringers(); @@ -94,6 +98,9 @@ namespace generated TIGL_EXPORT virtual CPACSHullSkinLayers& GetSkinLayers(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveSkinLayers(); + TIGL_EXPORT virtual CCPACSWalls& GetWalls(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveWalls(); + protected: CCPACSHull* m_parent; @@ -105,6 +112,7 @@ namespace generated boost::optional m_virtualStringers; boost::optional m_virtualFrames; boost::optional m_skinLayers; + boost::optional m_walls; private: CPACSHullStructure(const CPACSHullStructure&) = delete; diff --git a/src/generated/CPACSWalls.cpp b/src/generated/CPACSWalls.cpp index 5bd7690bf1..dba0719a87 100644 --- a/src/generated/CPACSWalls.cpp +++ b/src/generated/CPACSWalls.cpp @@ -17,6 +17,7 @@ #include #include "CCPACSFuselageStructure.h" +#include "CCPACSHullStructure.h" #include "CPACSWalls.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -35,26 +36,32 @@ namespace generated { //assert(parent != NULL); m_parent = parent; + m_parentType = &typeid(CCPACSFuselageStructure); } - CPACSWalls::~CPACSWalls() - { - } - - const CCPACSFuselageStructure* CPACSWalls::GetParent() const + CPACSWalls::CPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_wallPositions(reinterpret_cast(this), m_uidMgr) + , m_wallSegments(reinterpret_cast(this), m_uidMgr) { - return m_parent; + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CCPACSHullStructure); } - CCPACSFuselageStructure* CPACSWalls::GetParent() + CPACSWalls::~CPACSWalls() { - return m_parent; } const CTiglUIDObject* CPACSWalls::GetNextUIDParent() const { if (m_parent) { - return m_parent->GetNextUIDParent(); + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } } return nullptr; } @@ -62,7 +69,12 @@ namespace generated CTiglUIDObject* CPACSWalls::GetNextUIDParent() { if (m_parent) { - return m_parent->GetNextUIDParent(); + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent(); + } } return nullptr; } diff --git a/src/generated/CPACSWalls.h b/src/generated/CPACSWalls.h index d22fc780b6..6a5afa94d1 100644 --- a/src/generated/CPACSWalls.h +++ b/src/generated/CPACSWalls.h @@ -19,8 +19,10 @@ #include #include +#include #include "CPACSWallPositions.h" #include "CPACSWallSegments.h" +#include "CTiglError.h" #include "tigl_internal.h" namespace tigl @@ -28,22 +30,47 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSFuselageStructure; +class CCPACSHullStructure; namespace generated { // This class is used in: // CPACSFuselageStructure + // CPACSHullStructure class CPACSWalls { public: TIGL_EXPORT CPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSWalls(); - TIGL_EXPORT CCPACSFuselageStructure* GetParent(); - - TIGL_EXPORT const CCPACSFuselageStructure* GetParent() const; + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSWalls"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSWalls"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -61,7 +88,8 @@ namespace generated TIGL_EXPORT virtual CPACSWallSegments& GetWallSegments(); protected: - CCPACSFuselageStructure* m_parent; + void* m_parent; + const std::type_info* m_parentType; CTiglUIDManager* m_uidMgr; From 120e4ad0095a65563fa06087244442acb366ddc2 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 6 Jun 2024 16:32:34 +0200 Subject: [PATCH 047/122] add hullSection as additional choice for x-referencing --- cpacs_gen_input/cpacs_schema.xsd | 12 ++- src/generated/CPACSWallPosition.cpp | 86 ++++++++++++++++--- src/generated/CPACSWallPosition.h | 16 +++- .../CCPACSWallPosition.cpp | 16 ++-- src/structural_elements/CCPACSWallPosition.h | 2 +- 5 files changed, 106 insertions(+), 26 deletions(-) diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index 0b2f71ec0b..ff27509526 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -29413,7 +29413,17 @@ The fuel tank volume type should also be used for the wing fuel tank - UID of fuselage section determining the + UID of a fuselage section determining the + x-coordinate of the position with the given + y- and z-coordinates. + + + + + + + UID of a tank hull section determining the x-coordinate of the position with the given y- and z-coordinates. diff --git a/src/generated/CPACSWallPosition.cpp b/src/generated/CPACSWallPosition.cpp index 52b09566fb..e26e6733fd 100644 --- a/src/generated/CPACSWallPosition.cpp +++ b/src/generated/CPACSWallPosition.cpp @@ -43,6 +43,7 @@ namespace generated if (m_bulkheadUID_choice1 && !m_bulkheadUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_bulkheadUID_choice1, *this); if (m_wallSegmentUID_choice2 && !m_wallSegmentUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_wallSegmentUID_choice2, *this); if (m_fuselageSectionUID_choice3 && !m_fuselageSectionUID_choice3->empty()) m_uidMgr->TryUnregisterReference(*m_fuselageSectionUID_choice3, *this); + if (m_hullSectionUID_choice4 && !m_hullSectionUID_choice4->empty()) m_uidMgr->TryUnregisterReference(*m_hullSectionUID_choice4, *this); } } @@ -125,9 +126,18 @@ namespace generated if (m_uidMgr && !m_fuselageSectionUID_choice3->empty()) m_uidMgr->RegisterReference(*m_fuselageSectionUID_choice3, *this); } + // read element hullSectionUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/hullSectionUID")) { + m_hullSectionUID_choice4 = tixi::TixiGetElement(tixiHandle, xpath + "/hullSectionUID"); + if (m_hullSectionUID_choice4->empty()) { + LOG(WARNING) << "Optional element hullSectionUID is present but empty at xpath " << xpath; + } + if (m_uidMgr && !m_hullSectionUID_choice4->empty()) m_uidMgr->RegisterReference(*m_hullSectionUID_choice4, *this); + } + // read element x if (tixi::TixiCheckElement(tixiHandle, xpath + "/x")) { - m_x_choice4 = tixi::TixiGetElement(tixiHandle, xpath + "/x"); + m_x_choice5 = tixi::TixiGetElement(tixiHandle, xpath + "/x"); } // read element y @@ -154,7 +164,7 @@ namespace generated void CPACSWallPosition::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "bulkheadUID", "wallSegmentUID", "fuselageSectionUID", "x", "y", "z" }; + const std::vector childElemOrder = { "bulkheadUID", "wallSegmentUID", "fuselageSectionUID", "hullSectionUID", "x", "y", "z" }; // write attribute uID if (m_uID) { @@ -199,10 +209,21 @@ namespace generated } } + // write element hullSectionUID + if (m_hullSectionUID_choice4) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hullSectionUID", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/hullSectionUID", *m_hullSectionUID_choice4); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/hullSectionUID")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/hullSectionUID"); + } + } + // write element x - if (m_x_choice4) { + if (m_x_choice5) { tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/x", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/x", *m_x_choice4); + tixi::TixiSaveElement(tixiHandle, xpath + "/x", *m_x_choice5); } else { if (tixi::TixiCheckElement(tixiHandle, xpath + "/x")) { @@ -235,7 +256,9 @@ namespace generated || m_fuselageSectionUID_choice3.is_initialized() || - m_x_choice4.is_initialized() + m_hullSectionUID_choice4.is_initialized() + || + m_x_choice5.is_initialized() ) ) + @@ -249,7 +272,9 @@ namespace generated || m_fuselageSectionUID_choice3.is_initialized() || - m_x_choice4.is_initialized() + m_hullSectionUID_choice4.is_initialized() + || + m_x_choice5.is_initialized() ) ) + @@ -263,13 +288,31 @@ namespace generated || m_wallSegmentUID_choice2.is_initialized() || - m_x_choice4.is_initialized() + m_hullSectionUID_choice4.is_initialized() + || + m_x_choice5.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_hullSectionUID_choice4.is_initialized() + && + // elements of other choices must not be there + !( + m_bulkheadUID_choice1.is_initialized() + || + m_wallSegmentUID_choice2.is_initialized() + || + m_fuselageSectionUID_choice3.is_initialized() + || + m_x_choice5.is_initialized() ) ) + ( // mandatory elements of this choice must be there - m_x_choice4.is_initialized() + m_x_choice5.is_initialized() && // elements of other choices must not be there !( @@ -278,6 +321,8 @@ namespace generated m_wallSegmentUID_choice2.is_initialized() || m_fuselageSectionUID_choice3.is_initialized() + || + m_hullSectionUID_choice4.is_initialized() ) ) == 1 @@ -349,14 +394,28 @@ namespace generated m_fuselageSectionUID_choice3 = value; } - const boost::optional& CPACSWallPosition::GetX_choice4() const + const boost::optional& CPACSWallPosition::GetHullSectionUID_choice4() const + { + return m_hullSectionUID_choice4; + } + + void CPACSWallPosition::SetHullSectionUID_choice4(const boost::optional& value) { - return m_x_choice4; + if (m_uidMgr) { + if (m_hullSectionUID_choice4 && !m_hullSectionUID_choice4->empty()) m_uidMgr->TryUnregisterReference(*m_hullSectionUID_choice4, *this); + if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); + } + m_hullSectionUID_choice4 = value; } - void CPACSWallPosition::SetX_choice4(const boost::optional& value) + const boost::optional& CPACSWallPosition::GetX_choice5() const { - m_x_choice4 = value; + return m_x_choice5; + } + + void CPACSWallPosition::SetX_choice5(const boost::optional& value) + { + m_x_choice5 = value; } const double& CPACSWallPosition::GetY() const @@ -395,6 +454,9 @@ namespace generated if (m_fuselageSectionUID_choice3 && *m_fuselageSectionUID_choice3 == oldUid) { m_fuselageSectionUID_choice3 = newUid; } + if (m_hullSectionUID_choice4 && *m_hullSectionUID_choice4 == oldUid) { + m_hullSectionUID_choice4 = newUid; + } } } // namespace generated diff --git a/src/generated/CPACSWallPosition.h b/src/generated/CPACSWallPosition.h index 01b73c74bb..23073bcc4e 100644 --- a/src/generated/CPACSWallPosition.h +++ b/src/generated/CPACSWallPosition.h @@ -70,8 +70,11 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetFuselageSectionUID_choice3() const; TIGL_EXPORT virtual void SetFuselageSectionUID_choice3(const boost::optional& value); - TIGL_EXPORT virtual const boost::optional& GetX_choice4() const; - TIGL_EXPORT virtual void SetX_choice4(const boost::optional& value); + TIGL_EXPORT virtual const boost::optional& GetHullSectionUID_choice4() const; + TIGL_EXPORT virtual void SetHullSectionUID_choice4(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetX_choice5() const; + TIGL_EXPORT virtual void SetX_choice5(const boost::optional& value); TIGL_EXPORT virtual const double& GetY() const; TIGL_EXPORT virtual void SetY(const double& value); @@ -96,13 +99,18 @@ namespace generated /// y- and z-coordinates. boost::optional m_wallSegmentUID_choice2; - /// UID of fuselage section determining the + /// UID of a fuselage section determining the /// x-coordinate of the position with the given /// y- and z-coordinates. boost::optional m_fuselageSectionUID_choice3; + /// UID of a tank hull section determining the + /// x-coordinate of the position with the given + /// y- and z-coordinates. + boost::optional m_hullSectionUID_choice4; + /// Absolute x-coordinate of wall position in fuselage coordinate system. - boost::optional m_x_choice4; + boost::optional m_x_choice5; /// Absolute y-coordinate of wall position in fuselage coordinate system. double m_y; diff --git a/src/structural_elements/CCPACSWallPosition.cpp b/src/structural_elements/CCPACSWallPosition.cpp index ed0819e658..893b3acc30 100644 --- a/src/structural_elements/CCPACSWallPosition.cpp +++ b/src/structural_elements/CCPACSWallPosition.cpp @@ -73,12 +73,12 @@ void CCPACSWallPosition::CalcBasePointAndShape() const // calculate base point and optional shape gp_Pnt basePointTmp(0., GetY(), GetZ()); - if (GetX_choice4()) { - basePointTmp.SetX(GetX_choice4().value()); + if (GetX_choice5()) { + basePointTmp.SetX(GetX_choice5().value()); } basePointTmp = fuselage.GetTransformationMatrix().Transform(basePointTmp); - if (!GetX_choice4()) { + if (!GetX_choice5()) { if (GetBulkheadUID_choice1()) { shape = GetUIDManager().GetGeometricComponent(GetBulkheadUID_choice1().value()).GetLoft()->Shape(); } @@ -137,7 +137,7 @@ void CCPACSWallPosition::SetBulkheadUID_choice1(const boost::optional& value) +void CCPACSWallPosition::SetX_choice5(const boost::optional& value) { - CPACSWallPosition::SetX_choice4(value); + CPACSWallPosition::SetX_choice5(value); CPACSWallPosition::SetBulkheadUID_choice1(boost::none); CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); diff --git a/src/structural_elements/CCPACSWallPosition.h b/src/structural_elements/CCPACSWallPosition.h index 1829191072..687ce28349 100644 --- a/src/structural_elements/CCPACSWallPosition.h +++ b/src/structural_elements/CCPACSWallPosition.h @@ -43,7 +43,7 @@ class CCPACSWallPosition : public generated::CPACSWallPosition TIGL_EXPORT void SetBulkheadUID_choice1(const boost::optional& value) override; TIGL_EXPORT void SetWallSegmentUID_choice2(const boost::optional& value) override; TIGL_EXPORT void SetFuselageSectionUID_choice3(const boost::optional& value) override; - TIGL_EXPORT void SetX_choice4(const boost::optional& value) override; + TIGL_EXPORT void SetX_choice5(const boost::optional& value) override; TIGL_EXPORT void SetY(const double& value) override; TIGL_EXPORT void SetZ(const double& value) override; From ba1bfd4054309cf051e7b980fbba7b2c6390e8d4 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 6 Jun 2024 17:38:23 +0200 Subject: [PATCH 048/122] add accessability from configuration manager --- src/configuration/CCPACSConfiguration.cpp | 60 +++++++++++++++++++++++ src/configuration/CCPACSConfiguration.h | 16 ++++++ src/fuelTanks/CCPACSFuelTanks.h | 8 +-- tests/unittests/test_fuelTanks.py | 22 ++++++++- tests/unittests/tiglTanks.cpp | 13 +++-- 5 files changed, 111 insertions(+), 8 deletions(-) diff --git a/src/configuration/CCPACSConfiguration.cpp b/src/configuration/CCPACSConfiguration.cpp index 2cd896ca88..2e6d60e9f1 100644 --- a/src/configuration/CCPACSConfiguration.cpp +++ b/src/configuration/CCPACSConfiguration.cpp @@ -571,6 +571,66 @@ const boost::optional& CCPACSConfiguration::GetDucts() const } } +int CCPACSConfiguration::GetFuelTanksCount() const +{ + if (aircraftModel) { + if (aircraftModel->GetFuelTanks()) { + return aircraftModel->GetFuelTanks()->GetFuelTanksCount(); + } + else { + return 0; + } + } + else { + return 0; + } +} + +CCPACSFuelTank& CCPACSConfiguration::GetFuelTank(int index) const +{ + if (aircraftModel) { + return aircraftModel->GetFuelTanks()->GetFuelTank(index); + } + else { + throw CTiglError("No configuration loaded"); + } +} + +CCPACSFuelTank const& CCPACSConfiguration::GetFuelTank(const std::string& UID) const +{ + if (aircraftModel) { + return aircraftModel->GetFuelTanks()->GetFuelTank(UID); + } + else { + throw CTiglError("No configuration loaded"); + } +} + +int CCPACSConfiguration::GetFuelTankIndex(const std::string& UID) const +{ + return GetFuelTanks().GetFuelTankIndex(UID); +} + +CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() +{ + if (aircraftModel) { + return *aircraftModel->GetFuelTanks(); + } + else { + throw CTiglError("No configuration loaded"); + } +} + +const CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() const +{ + if (aircraftModel) { + return *aircraftModel->GetFuelTanks(); + } + else { + throw CTiglError("No configuration loaded"); + } +} + boost::optional& CCPACSConfiguration::GetEnginePylons() { if (aircraftModel) { diff --git a/src/configuration/CCPACSConfiguration.h b/src/configuration/CCPACSConfiguration.h index fb998b9397..8903beb31d 100644 --- a/src/configuration/CCPACSConfiguration.h +++ b/src/configuration/CCPACSConfiguration.h @@ -164,6 +164,22 @@ class CCPACSConfiguration TIGL_EXPORT boost::optional& GetDucts(); TIGL_EXPORT const boost::optional& GetDucts() const; + // Returns the total count of fuel tanks in a configuration + TIGL_EXPORT int GetFuelTanksCount() const; + + // Returns the fuel tank for a given index. + TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index) const; + + // Returns the fuel tank for a given UID. + TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(const std::string& UID) const; + + // Returns the fuel tank index for a given UID. + TIGL_EXPORT int GetFuelTankIndex(const std::string& UID) const; + + // Returns list of fuel tanks + TIGL_EXPORT CCPACSFuelTanks& GetFuelTanks(); + TIGL_EXPORT const CCPACSFuelTanks& GetFuelTanks() const; + // Returns list of engine pylons TIGL_EXPORT boost::optional& GetEnginePylons(); TIGL_EXPORT const boost::optional& GetEnginePylons() const; diff --git a/src/fuelTanks/CCPACSFuelTanks.h b/src/fuelTanks/CCPACSFuelTanks.h index 7660c8139e..7fa81fcbfe 100644 --- a/src/fuelTanks/CCPACSFuelTanks.h +++ b/src/fuelTanks/CCPACSFuelTanks.h @@ -31,17 +31,17 @@ class CCPACSFuelTanks : public generated::CPACSFuelTanks public: TIGL_EXPORT CCPACSFuelTanks(CCPACSAircraftModel* parent, CTiglUIDManager* uidMgr); - // Get a specific hull for a given uID + // Get a specific fuel tank for a given uID TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(std::string const& uID) const; TIGL_EXPORT CCPACSFuelTank& GetFuelTank(std::string const& uID); - // Get a specific hull for a given index. + // Get a specific fuel tank for a given index. TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index) const; - // Returns the hull index for a given uID. + // Returns the fuel tank index for a given uID. TIGL_EXPORT int GetFuelTankIndex(const std::string& uID) const; - // Returns the total count of fuselages in a configuration + // Returns the total count of fuel tank in a configuration TIGL_EXPORT int GetFuelTanksCount() const; }; diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index e45e1a6d81..f47722b7ad 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -16,7 +16,8 @@ def setUp(self): self.assertIsNone(self.tigl.open(self.tixi, "")) mgr = configuration.CCPACSConfigurationManager_get_instance() - uid_mgr = mgr.get_configuration(self.tigl._handle.value).get_uidmanager() + self.config = mgr.get_configuration(self.tigl._handle.value) + uid_mgr = self.config.get_uidmanager() self.fuelTank = uid_mgr.get_geometric_component("tank1") self.hull_segments = uid_mgr.get_geometric_component("tank1_outerHull") @@ -36,6 +37,25 @@ def tearDown(self): self.tigl.close() self.tixi.close() + def test_configuration(self): + + tank1_uID = "tank1" + self.assertEqual(self.config.get_fuel_tanks_count(), 6) + self.assertIsInstance( + self.config.get_fuel_tank(1), configuration.CCPACSFuelTank + ) + self.assertIsInstance( + self.config.get_fuel_tank(tank1_uID), + configuration.CCPACSFuelTank, + ) + self.assertEqual( + self.config.get_fuel_tank_index(tank1_uID), + 1, + ) + self.assertIsInstance( + self.config.get_fuel_tanks(), configuration.CCPACSFuelTanks + ) + def test_fuelTanks(self): # Test custom class methods: fuelTanks = self.fuelTank.get_parent() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 8c246f39b3..076370c61c 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -120,10 +120,14 @@ void CheckExceptionMessage(std::function func, const char* expectedMessa } } -TEST_F(FuselageTank, getName) +TEST_F(FuselageTank, configuration) { - const std::string name = fuelTank->GetName(); - EXPECT_EQ(name, "Simple tank 1"); + auto& config = fuelTank->GetConfiguration(); + std::string uID = "tank1"; + EXPECT_EQ(config.GetFuelTanksCount(), 6); + EXPECT_EQ(config.GetFuelTank(1).GetDefaultedUID(), uID); + EXPECT_NO_THROW(config.GetFuelTank(uID)); + EXPECT_EQ(config.GetFuelTankIndex(uID), 1); } TEST_F(FuselageTank, fuelTanks) @@ -139,6 +143,9 @@ TEST_F(FuselageTank, fuelTanks) TEST_F(FuselageTank, fuelTank) { EXPECT_NO_THROW(fuelTank->GetHulls()); + + const std::string name = fuelTank->GetName(); + EXPECT_EQ(name, "Simple tank 1"); } // ToDo: Check how to use pointer -> From f2aa8e29c98a47bd69bf7030c2cd366581984fbe Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 6 Jun 2024 17:48:01 +0200 Subject: [PATCH 049/122] add lid to isotensoid opening --- src/fuelTanks/CCPACSHull.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSHull.cpp index 204644a52a..3f145f1e83 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSHull.cpp @@ -479,7 +479,11 @@ void CCPACSHull::BuildHullWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(bspline); - std::vector edges = {domeEdge}; + TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-x.back(), 0.0, 0.0)); + TopoDS_Vertex v2 = GetLastVertex(domeEdge); + TopoDS_Edge lidEdge = BRepBuilderAPI_MakeEdge(v1, v2); + + std::vector edges = {lidEdge, domeEdge}; if (cylinderLength > 0.0) { TopoDS_Vertex v1 = GetFirstVertex(domeEdge); From f43c74bf4ad7deef0347ea9279c68280c9af1540 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sun, 9 Jun 2024 16:31:53 +0200 Subject: [PATCH 050/122] walls part1: implement wall positions --- cpacs_gen_input/CustomTypes.txt | 314 +- cpacs_gen_input/cpacs_schema.xsd | 69099 ++++++++-------- src/fuelTanks/CCPACSHull.h | 6 +- src/fuelTanks/CCPACSHullStructure.cpp | 56 +- src/fuelTanks/CCPACSHullStructure.h | 74 +- src/fuelTanks/CCPACSHulls.cpp | 150 +- src/fuselage/CCPACSFramesAssembly.cpp | 150 +- src/fuselage/CCPACSFramesAssembly.h | 96 +- src/fuselage/ITiglFuselageDuctStructure.h | 130 +- src/generated/CPACSBoundingElementUIDs.cpp | 8 +- src/generated/CPACSBoundingElementUIDs.h | 10 +- src/generated/CPACSWallPosition.cpp | 52 +- src/generated/CPACSWallPosition.h | 13 +- src/generated/CPACSWallPositionUIDs.cpp | 8 +- src/generated/CPACSWallPositionUIDs.h | 10 +- src/generated/CPACSWallSegment.cpp | 6 +- src/generated/CPACSWallSegment.h | 2 +- src/generated/CPACSWallSegments.cpp | 12 +- src/generated/CPACSWallSegments.h | 12 +- .../CCPACSWallPosition.cpp | 524 +- src/structural_elements/CCPACSWallPosition.h | 127 +- ...eWallSegment.cpp => CCPACSWallSegment.cpp} | 0 ...elageWallSegment.h => CCPACSWallSegment.h} | 0 src/structural_elements/CCPACSWalls.cpp | 9 +- src/structural_elements/CCPACSWalls.h | 5 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 92 +- tests/unittests/tiglTanks.cpp | 10 +- 27 files changed, 35545 insertions(+), 35430 deletions(-) rename src/structural_elements/{CCPACSFuselageWallSegment.cpp => CCPACSWallSegment.cpp} (100%) rename src/structural_elements/{CCPACSFuselageWallSegment.h => CCPACSWallSegment.h} (100%) diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index 7ade4fe975..064d4cb735 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -1,158 +1,158 @@ -// custom types in Tigl which should inherit from the generated ones (except enums) -// maps generated types to actual tigl types - -// enums -CPACSSymmetry TiglSymmetryAxis -CPACSPointAbsRelType_refType ECPACSTranslationType -CPACSFarField_type TiglFarFieldType -CPACSRotorHub_type TiglRotorHubType - -// classes -CPACSAircraftModel CCPACSAircraftModel -CPACSRotorcraftModel CCPACSRotorcraftModel -CPACSProfiles CCPACSProfiles -CPACSMaterialDefinition CCPACSMaterialDefinition -CPACSFarField CCPACSFarField -CPACSGuideCurve CCPACSGuideCurve -CPACSGuideCurves CCPACSGuideCurves -CPACSGuideCurveProfileGeometry CCPACSGuideCurveProfile -CPACSGuideCurveProfiles CCPACSGuideCurveProfiles -CPACSPositioning CCPACSPositioning -CPACSPositionings CCPACSPositionings -CPACSPoint CCPACSPoint -CPACSPointAbsRel CCPACSPointAbsRel -CPACSTransformation CCPACSTransformation -CPACSStringVectorBase CCPACSStringVector -CPACSPointListRelXYZVector CCPACSPointListRelXYZVector -CPACSPointListXYVector CCPACSPointListXYVector -CPACSPointListXY CCPACSPointListXY -CPACSGenericGeometricComponent CCPACSExternalObject -CPACSGenericGeometryComponents CCPACSExternalObjects -CPACSEtaIsoLine CCPACSEtaIsoLine -CPACSXsiIsoLine CCPACSXsiIsoLine -CPACSEtaXsiPoint CCPACSEtaXsiPoint -CPACSCurvePoint CCPACSCurvePoint -CPACSCurveParamPointMap CCPACSCurveParamPointMap -CPACSCurvePointListXYZ CCPACSCurvePointListXYZ -CPACSSystems CCPACSACSystems -CPACSGenericSystems CCPACSGenericSystems -CPACSGenericSystem CCPACSGenericSystem - -CPACSFuselage CCPACSFuselage -CPACSFuselages CCPACSFuselages -CPACSFuselageProfiles CCPACSFuselageProfiles -CPACSFuselageSegment CCPACSFuselageSegment -CPACSFuselageSegments CCPACSFuselageSegments -CPACSFuselageSection CCPACSFuselageSection -CPACSFuselageSections CCPACSFuselageSections -CPACSFuselageElement CCPACSFuselageSectionElement -CPACSFuselageElements CCPACSFuselageSectionElements - -CPACSComponentSegment CCPACSWingComponentSegment -CPACSComponentSegments CCPACSWingComponentSegments -CPACSWing CCPACSWing -CPACSWings CCPACSWings -CPACSWingAirfoils CCPACSWingProfiles -CPACSWingCell CCPACSWingCell -CPACSWingCells CCPACSWingCells -CPACSWingRibCrossSection CCPACSWingRibCrossSection -CPACSRibRotation CCPACSWingRibRotation -CPACSWingRibsDefinition CCPACSWingRibsDefinition -CPACSWingRibsDefinitions CCPACSWingRibsDefinitions -CPACSWingRibExplicitPositioning CCPACSWingRibExplicitPositioning -CPACSWingRibsPositioning CCPACSWingRibsPositioning -CPACSWingElement CCPACSWingSectionElement -CPACSWingElements CCPACSWingSectionElements -CPACSWingSection CCPACSWingSection -CPACSWingSections CCPACSWingSections -CPACSWingComponentSegmentStructure CCPACSWingCSStructure -CPACSWingShell CCPACSWingShell -CPACSWingSegment CCPACSWingSegment -CPACSWingSegments CCPACSWingSegments -CPACSWingSpar CCPACSWingSpars -CPACSSparPosition CCPACSWingSparPosition -CPACSSparPositions CCPACSWingSparPositions -CPACSSparPositionUIDs CCPACSWingSparPositionUIDs -CPACSSparSegment CCPACSWingSparSegment -CPACSSparSegments CCPACSWingSparSegments -CPACSCst2D CCPACSWingProfileCST -CPACSCellPositioningSpanwise CCPACSWingCellPositionSpanwise -CPACSCellPositioningChordwise CCPACSWingCellPositionChordwise - -CPACSRotor CCPACSRotor -CPACSRotors CCPACSRotors -CPACSRotorAirfoils CCPACSRotorProfiles -CPACSRotorBladeAttachment CCPACSRotorBladeAttachment -CPACSRotorBladeAttachments CCPACSRotorBladeAttachments -CPACSRotorBlade CCPACSRotorBlade -CPACSRotorBlades CCPACSRotorBlades -CPACSRotorHub CCPACSRotorHub -CPACSRotorHubHinge CCPACSRotorHinge -CPACSRotorHubHinges CCPACSRotorHinges - -// fuselage structure -CPACSDoorAssemblyPosition CCPACSDoorAssemblyPosition -CPACSDoors CCPACSDoors -CPACSPressureBulkhead CCPACSPressureBulkhead -CPACSPressureBulkheadAssembly CCPACSPressureBulkheadAssembly -CPACSPressureBulkheadAssemblyPosition CCPACSPressureBulkheadAssemblyPosition -CPACSPressureBulkheads CCPACSPressureBulkheads -CPACSProfileBasedStructuralElement CCPACSProfileBasedStructuralElement -CPACSSheetList CCPACSSheetList -CPACSStructuralProfiles CCPACSStructuralProfiles -CPACSCrossBeamAssemblyPosition CCPACSCrossBeamAssemblyPosition -CPACSCargoCrossBeamsAssembly CCPACSCargoCrossBeamsAssembly -CPACSCrossBeamStrutAssemblyPosition CCPACSCrossBeamStrutAssemblyPosition -CPACSCargoCrossBeamStrutsAssembly CCPACSCargoCrossBeamStrutsAssembly -CPACSFrame CCPACSFrame -CPACSFramesAssembly CCPACSFramesAssembly -CPACSLongFloorBeam CCPACSLongFloorBeam -CPACSLongFloorBeamPosition CCPACSLongFloorBeamPosition -CPACSLongFloorBeamsAssembly CCPACSLongFloorBeamsAssembly -CPACSStringersAssembly CCPACSStringersAssembly -CPACSFuselageStructure CCPACSFuselageStructure -CPACSStringer CCPACSFuselageStringer -CPACSPointXY CCPACSPointXY -CPACSStringerFramePosition CCPACSFuselageStringerFramePosition -CPACSSkin CCPACSSkin -CPACSSkinSegment CCPACSSkinSegment -CPACSWallSegment CCPACSFuselageWallSegment -CPACSWallPosition CCPACSWallPosition -CPACSWalls CCPACSWalls - -// control surfaces -CPACSControlSurfaces CCPACSControlSurfaces -CPACSControlSurfaceBorderTrailingEdge CCPACSControlSurfaceBorderTrailingEdge -CPACSTrailingEdgeDevices CCPACSTrailingEdgeDevices -CPACSTrailingEdgeDevice CCPACSTrailingEdgeDevice -CPACSControlSurfaceOuterShapeTrailingEdge CCPACSControlSurfaceOuterShapeTrailingEdge -CPACSControlSurfaceWingCutOut CCPACSControlSurfaceWingCutOut - -// Pylons -CPACSEnginePylon CCPACSEnginePylon -CPACSEnginePylons CCPACSEnginePylons - -// Engines -CPACSEnginePositions CCPACSEnginePositions -CPACSEnginePosition CCPACSEnginePosition -CPACSEngines CCPACSEngines -CPACSNacelleCowl CCPACSNacelleCowl -CPACSNacelleSections CCPACSNacelleSections -CPACSNacelleSection CCPACSNacelleSection -CPACSProfileGeometry2D CCPACSNacelleProfile -CPACSNacelleGuideCurves CCPACSNacelleGuideCurves -CPACSRotationCurve CCPACSRotationCurve -CPACSNacelleCenterCowl CCPACSNacelleCenterCowl - -// Ducts -CPACSDuct CCPACSDuct -CPACSDuctStructure CCPACSDuctStructure -CPACSDuctAssembly CCPACSDuctAssembly -CPACSDucts CCPACSDucts - -// Tanks -CPACSHull CCPACSHull -CPACSHulls CCPACSHulls -CPACSFuelTank CCPACSFuelTank -CPACSFuelTanks CCPACSFuelTanks +// custom types in Tigl which should inherit from the generated ones (except enums) +// maps generated types to actual tigl types + +// enums +CPACSSymmetry TiglSymmetryAxis +CPACSPointAbsRelType_refType ECPACSTranslationType +CPACSFarField_type TiglFarFieldType +CPACSRotorHub_type TiglRotorHubType + +// classes +CPACSAircraftModel CCPACSAircraftModel +CPACSRotorcraftModel CCPACSRotorcraftModel +CPACSProfiles CCPACSProfiles +CPACSMaterialDefinition CCPACSMaterialDefinition +CPACSFarField CCPACSFarField +CPACSGuideCurve CCPACSGuideCurve +CPACSGuideCurves CCPACSGuideCurves +CPACSGuideCurveProfileGeometry CCPACSGuideCurveProfile +CPACSGuideCurveProfiles CCPACSGuideCurveProfiles +CPACSPositioning CCPACSPositioning +CPACSPositionings CCPACSPositionings +CPACSPoint CCPACSPoint +CPACSPointAbsRel CCPACSPointAbsRel +CPACSTransformation CCPACSTransformation +CPACSStringVectorBase CCPACSStringVector +CPACSPointListRelXYZVector CCPACSPointListRelXYZVector +CPACSPointListXYVector CCPACSPointListXYVector +CPACSPointListXY CCPACSPointListXY +CPACSGenericGeometricComponent CCPACSExternalObject +CPACSGenericGeometryComponents CCPACSExternalObjects +CPACSEtaIsoLine CCPACSEtaIsoLine +CPACSXsiIsoLine CCPACSXsiIsoLine +CPACSEtaXsiPoint CCPACSEtaXsiPoint +CPACSCurvePoint CCPACSCurvePoint +CPACSCurveParamPointMap CCPACSCurveParamPointMap +CPACSCurvePointListXYZ CCPACSCurvePointListXYZ +CPACSSystems CCPACSACSystems +CPACSGenericSystems CCPACSGenericSystems +CPACSGenericSystem CCPACSGenericSystem + +CPACSFuselage CCPACSFuselage +CPACSFuselages CCPACSFuselages +CPACSFuselageProfiles CCPACSFuselageProfiles +CPACSFuselageSegment CCPACSFuselageSegment +CPACSFuselageSegments CCPACSFuselageSegments +CPACSFuselageSection CCPACSFuselageSection +CPACSFuselageSections CCPACSFuselageSections +CPACSFuselageElement CCPACSFuselageSectionElement +CPACSFuselageElements CCPACSFuselageSectionElements + +CPACSComponentSegment CCPACSWingComponentSegment +CPACSComponentSegments CCPACSWingComponentSegments +CPACSWing CCPACSWing +CPACSWings CCPACSWings +CPACSWingAirfoils CCPACSWingProfiles +CPACSWingCell CCPACSWingCell +CPACSWingCells CCPACSWingCells +CPACSWingRibCrossSection CCPACSWingRibCrossSection +CPACSRibRotation CCPACSWingRibRotation +CPACSWingRibsDefinition CCPACSWingRibsDefinition +CPACSWingRibsDefinitions CCPACSWingRibsDefinitions +CPACSWingRibExplicitPositioning CCPACSWingRibExplicitPositioning +CPACSWingRibsPositioning CCPACSWingRibsPositioning +CPACSWingElement CCPACSWingSectionElement +CPACSWingElements CCPACSWingSectionElements +CPACSWingSection CCPACSWingSection +CPACSWingSections CCPACSWingSections +CPACSWingComponentSegmentStructure CCPACSWingCSStructure +CPACSWingShell CCPACSWingShell +CPACSWingSegment CCPACSWingSegment +CPACSWingSegments CCPACSWingSegments +CPACSWingSpar CCPACSWingSpars +CPACSSparPosition CCPACSWingSparPosition +CPACSSparPositions CCPACSWingSparPositions +CPACSSparPositionUIDs CCPACSWingSparPositionUIDs +CPACSSparSegment CCPACSWingSparSegment +CPACSSparSegments CCPACSWingSparSegments +CPACSCst2D CCPACSWingProfileCST +CPACSCellPositioningSpanwise CCPACSWingCellPositionSpanwise +CPACSCellPositioningChordwise CCPACSWingCellPositionChordwise + +CPACSRotor CCPACSRotor +CPACSRotors CCPACSRotors +CPACSRotorAirfoils CCPACSRotorProfiles +CPACSRotorBladeAttachment CCPACSRotorBladeAttachment +CPACSRotorBladeAttachments CCPACSRotorBladeAttachments +CPACSRotorBlade CCPACSRotorBlade +CPACSRotorBlades CCPACSRotorBlades +CPACSRotorHub CCPACSRotorHub +CPACSRotorHubHinge CCPACSRotorHinge +CPACSRotorHubHinges CCPACSRotorHinges + +// fuselage structure +CPACSDoorAssemblyPosition CCPACSDoorAssemblyPosition +CPACSDoors CCPACSDoors +CPACSPressureBulkhead CCPACSPressureBulkhead +CPACSPressureBulkheadAssembly CCPACSPressureBulkheadAssembly +CPACSPressureBulkheadAssemblyPosition CCPACSPressureBulkheadAssemblyPosition +CPACSPressureBulkheads CCPACSPressureBulkheads +CPACSProfileBasedStructuralElement CCPACSProfileBasedStructuralElement +CPACSSheetList CCPACSSheetList +CPACSStructuralProfiles CCPACSStructuralProfiles +CPACSCrossBeamAssemblyPosition CCPACSCrossBeamAssemblyPosition +CPACSCargoCrossBeamsAssembly CCPACSCargoCrossBeamsAssembly +CPACSCrossBeamStrutAssemblyPosition CCPACSCrossBeamStrutAssemblyPosition +CPACSCargoCrossBeamStrutsAssembly CCPACSCargoCrossBeamStrutsAssembly +CPACSFrame CCPACSFrame +CPACSFramesAssembly CCPACSFramesAssembly +CPACSLongFloorBeam CCPACSLongFloorBeam +CPACSLongFloorBeamPosition CCPACSLongFloorBeamPosition +CPACSLongFloorBeamsAssembly CCPACSLongFloorBeamsAssembly +CPACSStringersAssembly CCPACSStringersAssembly +CPACSFuselageStructure CCPACSFuselageStructure +CPACSStringer CCPACSFuselageStringer +CPACSPointXY CCPACSPointXY +CPACSStringerFramePosition CCPACSFuselageStringerFramePosition +CPACSSkin CCPACSSkin +CPACSSkinSegment CCPACSSkinSegment +CPACSWallSegment CCPACSWallSegment +CPACSWallPosition CCPACSWallPosition +CPACSWalls CCPACSWalls + +// control surfaces +CPACSControlSurfaces CCPACSControlSurfaces +CPACSControlSurfaceBorderTrailingEdge CCPACSControlSurfaceBorderTrailingEdge +CPACSTrailingEdgeDevices CCPACSTrailingEdgeDevices +CPACSTrailingEdgeDevice CCPACSTrailingEdgeDevice +CPACSControlSurfaceOuterShapeTrailingEdge CCPACSControlSurfaceOuterShapeTrailingEdge +CPACSControlSurfaceWingCutOut CCPACSControlSurfaceWingCutOut + +// Pylons +CPACSEnginePylon CCPACSEnginePylon +CPACSEnginePylons CCPACSEnginePylons + +// Engines +CPACSEnginePositions CCPACSEnginePositions +CPACSEnginePosition CCPACSEnginePosition +CPACSEngines CCPACSEngines +CPACSNacelleCowl CCPACSNacelleCowl +CPACSNacelleSections CCPACSNacelleSections +CPACSNacelleSection CCPACSNacelleSection +CPACSProfileGeometry2D CCPACSNacelleProfile +CPACSNacelleGuideCurves CCPACSNacelleGuideCurves +CPACSRotationCurve CCPACSRotationCurve +CPACSNacelleCenterCowl CCPACSNacelleCenterCowl + +// Ducts +CPACSDuct CCPACSDuct +CPACSDuctStructure CCPACSDuctStructure +CPACSDuctAssembly CCPACSDuctAssembly +CPACSDucts CCPACSDucts + +// Tanks +CPACSHull CCPACSHull +CPACSHulls CCPACSHulls +CPACSFuelTank CCPACSFuelTank +CPACSFuelTanks CCPACSFuelTanks CPACSHullStructure CCPACSHullStructure \ No newline at end of file diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index ff27509526..0532288efc 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -1,34549 +1,34550 @@ - - - - - - - - - - - - CPACS root element - - - - - Version - - V3.3 - - Date - - 2020-06-03 - - - - 1. Overview - - The Common Parametric Aircraft Configuration Scheme (CPACS) is an XML-based data format for describing aircraft configurations and their corresponding data. - This XML-Schema document (XSD) serves two purposes: (1) it defines the CPACS - data structure used in the XML file (e.g., aircraft.xml) and - (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., Tixi or - XML tools in Eclipse) parses the XSD and XML files and validates whether the data set defined by the user (or tool) conforms to the given structure defined by the schema. - - - - This documentation explains the elements defined in CPACS and its corresponding data types. - Data types can either be simple types (string, double, boolean, etc.) or - complex types (definition of attributes and sub-elements to build a hierarchical - structure). In addition, the sequence of the elements and their occurrence is documented. - To link the XML file to the XSD file, the header of the XML file should specify the path of the schema file. - An example could look like this: - <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - - CPACS is an open source project published by the German Aerospace Center (DLR e.V.). For further information please visit www.cpacs.de. - - - - - 2. Data hierarchy - - CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. - For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. - - - - - - - 3. Coordinate Systems - - Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. - The CPACS coordinate system is the coordinate system identified by TIGL, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. - Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. - The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. - The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. - - - - Axis - - - Direction - - - Description - - - - x - tailwards - from nose to tail - - - y - spanwise - from symmetry plane to the right wingtip - - - z - upwards - from landing gear to tip of vertical tailplane - - - The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. - - - - The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. - - - - The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. - - - - The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. - - - - Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. - - - - 4. Units - - There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: - - - [m] - Position, Distance - - - [m^2] - Area - - - [m^3] - Volume - - - [kg] - Mass - - - [s] - Time - - - [K] - Temperature - - - or in derived units, e.g.: - - - [N] - Force - - - [Nm] - Moment - - - [W] - Power - - - [J] - Energy - - - The only non SI unit used throughout CPACS is the angle in degrees [°]. - For the sake of an intuitive use the angles are given in degrees rather than in radian [rad]. - - - [°] - Angle - - - - - - 5. Splitting up a CPACS dataset into several files - - To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <externaldata> - <path>file:://airfoils</path> - <filename>NACA0010.xml</filename> - <filename>NACA2412.xml</filename> - </externaldata> - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> - Such an external file would look like: - <?xml version="1.0" encoding="utf-8"?> -<airfoil uID="NACA0010"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> -</airfoil> - The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), then it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). - For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given: - - Absolute local path: "file:///tmp" or "file:///c:/windows/tmp" - Relative local direcotry: "file://relativeDirectory" or "file://../anotherRelativeDirectory" - Remote net ressource: "http://www.someurl.de" - - A CPACS dataset with external files, being loaded by a special library like the TIVA XML Interface TIXI, shall collect all its external datafiles and build up a single tree from them. A validation against this schema is only possible for such a single tree file; the <externaldata>nodes are not recognized by it. To preserve the information, necessary to split the file up into external files again later, externaldata information is maintained within three attributes of the former external top node: - - externalFileName - Name of the file where the external data shall be saved - externalDataDirectory - Directory of the external data file. Its content is analogous to the <externaldata>'s <path>node described above. - externalDataNodePath - XPATH of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPATH in the outer external file. If, e.g., in the example above the <pointList>node would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. - - The single tree for the example above would look like: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> - </airfoil> - ... - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> - - - - 6. UIDs and references - - The CPACS-dataset often uses references between nodes. Typically, these - references define connections between elements which are located somewhere else in the hierarchical dataset (e.g. a wing is connected to a - fuselage; a specific engine is connected to a pylon; etc.). These connections are defined by - unique identifiers (uID) which are specified as attributes. Thus, there are elements which can be referenced via a uID attribute, e.g. a fuselage: - <fuselage uID="ATTAS_fuselage">... - - as well as elements which refer to the former, e.g. a wing pointing to its geometrical parent: - <wing uID="e382bf5j"> - <name>ATTAS main wing</name> - <parentUID isLink="True">ATTAS_fuselage</parentUID> - ... - Such referencing elements must carry the isLink="True" attribute. - - Since uIDs are only used to link nodes within the XML file, no naming convention is required. UIDs, however, must be unique! - Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), - uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element - to convey human-readable meanings. - - - - 7. Symmetry - - Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). Hence, some parts offer the option to set a symmetry attribute for them, like: - <wing symmetry="x-z-plane">... - This attribute explains that the whole part with all its subnodes is symmetric to the given plane. Possible planes are: - x-y-plane - x-z-plane - y-z-plane - none - inherit - - By default, the symmetry of a component is inherited from its parent. If e.g. a wing is symmetrically defined, a pylon will also have a symmetry by default. - This symmetry inheritance can be broken, by explicitly deleting the symmetry with symmetry="none". - - - - - UIDs, references and symmetry - - All nodes, e.g. parentUID, in CPACS that refer to a component that holds symmetry attribute, e.g. wing, have to carry the symmetry attribute as well. - The symmetry attribute may take three values: symm, def, full: - - - def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. - - symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) - - full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) - - - <wing uID="ATTAS_main_wing" symmetry="x-z-plane"> - ... - <segments> - <segment uID="ATTAS_main_wing_innersegment"> - ... - In the example above, to refer to the "other" side of the wing on must use the definition as such: - <loadcase> - ... - <segments> - <segment> - <segmentUID isLink="True" symmetry="symm">ATTAS_main_wing_inner_segment</segmentUID> - <strip>... - - - - 8. Vectors and arrays - - For large data sets (e.g. increments of aerodynamic coefficients due to control surface deflections) it is advantageous - to map them via vectors and arrays instead of using a sequence of nodes for each data value. Therefore vectors and arrays are defined as semicolon-separated lists in CPACS. Via the documentation (derived from the XSD) of the corresponding nodes it has to be checked whether it is a vector or an array. - - Vector - The vector is meant as a one-dimensional-array. In such a node, the values are given in a semicolon separated list: - <angleOfAttack>0.;1.5;3.;4.5;6;7.5;9.</angleOfAttack> - - Array - - As for vectors, multi-dimensional arrays provide values in a semicolon separated list. An array is always preceded by a sequence of vectors, containing the dimensions and index values. Which vectors of an array are dimensioning is specified in the respective documentation of the array. - - <altitude>1000.;2000.;3000.</altitude> <!-- vector element --> - <incrementMaps> - <incrementMap uID="incMap_b3ac2"> - <controlSurfaceUID>InnerWingFlap</controlSurfaceUID> - <controlParameters>-1;-0.5;0;1</controlParameters> <!-- vector element --> - <!-- array of dimension length(altitude) x length(controlParameters): --> - <dcl>11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34.</dcl> - - - - Values for cl increments: - - - - Control parameter = -1 - Control parameter = -0.5 - Control parameter = 0 - Control parameter = 1 - - - Altitude = 1000m - 11. - 12. - 13. - 14. - - - Altitude = 2000m - 21. - 22. - 23. - 24. - - - Altitude = 3000m - 31. - 32. - 33. - 34. - - - - - - - - - - 9. Control Parameters - - Control parameters are abstract parameters, linking a generic floating point value to a certain status of a control device - (e.g. control surface, landing gear, suction system, brake parachute, ...). For control surfaces, such a data pair (control parameter - and control surface deflection status) is called a <step> and the ordered list of all steps for a control surface forms its deflection - <path>. - The control parameter values for each step are arbitrary floating point values. However, it is strongly recommended to use - values between -1. and +1., or between 0. And +1. (depending on the type of control surface). The smallest and the largest value implicitly - define the maximum deflection limits. It is mandatory, that the value “0.” is within the specified range, as this value is treated as - undeflected and used to specify a “clean” aircraft configuration (e.g. used in the clean aero performance map). It is recommended, but not - mandatory to specify a <step> with a <controlParameter> of 0. Consequently, no <controlParameter> must be used twice within - a single <path> definition. Deflection values between two specified steps are handled by linear interpolation. - The following example shows the usage of control parameters within a control surface deflection path definition: - <controlSurfaces> - <trailingEdgeDevices> - <trailingEdgeDevice uID="InnerWingFlap"> - ... - <path> - ... - <steps> - <step> - <controlParameter>-1</controlParameter> - <hingeLineRotation>-20.</hingeLineRotation> - </step> - <step> - <controlParameter>-0.5</controlParameter> - <hingeLineRotation>-10.</hingeLineRotation> - </step> - <step> - <controlParameter>0</controlParameter> - <hingeLineRotation>0.</hingeLineRotation> - </step> - <step> - <controlParameter>1</controlParameter> - <hingeLineRotation>5.</hingeLineRotation> - </step> - </steps> - ... - - - - - 10. Atmosphere - - At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). - Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) - It covers temperature, pressure, density, speed of sound, dynamic viscosity and kinematic viscosity with respect to altitude. - In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. - For details, see ISA manual, section 2.3, page E-viii f. - ISA covers a range from -5000 m to 80000 m. - Temperature offsets are introduced on top of the definitions in the ISA manual (which does not cover such variations). The offset model - is based upon the idea that the pressure at a fixed geopotential altitude is independent from temperature offset (pressure altitude). - The temperature offset changes only the density (following rho = p / Gas Constant / T) (and viscosity, of course) - - - - CPACS 3.3 - - Release in June 2021 - - Revision of the mission definition including parameter lapses within segments (compatibility break) - Revision of the point performance definition (compatibility break) - Revision of performance requirements (compatibility break) - Revision of landing gears (compatibility break) - Revision of control surface tracks definition (compatibility break) - Load analysis: Revision of flightLoadCasesType (compatibility break) - Load analysis: Revision of aeroCasesType (compatibility break) - Load analysis: loadEnvelopesType relocated and envelope simplified to a single uID-Sequence (compatibility break) - Load analysis: Replaced dynamicAircraftModel elements by loadApplicationPointSets (compatibility break) - Flight dynamics: Group flightPerformance, flyingQualities and trim under flightDynamics parent node (compatibility break) - Introduced a configuration node to describe aircraft and payload configurations - Fuselage profiles: Introduced rectangle and super ellipse as standard profiles - Fuselage profiles: Added vector to specify curve parameters for profiles with kinks - Internal structure: Added standard profiles to profile based structural elements - Internal structure: Added ribPosts element to wingRibCrossSectionType - Internal structure: Upper and lowerCap now optional in sparCellType - Internal structure: Stringers and frames can reference sections - MassBreakdown: Set mass inertia Jxy, Jxz and Jyz optional - MassBreakdown: Added mMiscellaneous element - MassBreakdown: Added fuselage walls - Added flight envelope to aircraft global element - Added new base types: doubleVectorBaseType, posIntVectorBaseType, doubleArrayBaseType - Added 'none' and 'inherit' to list of symmetry flags - Set mapType attribute of vector and array elements to optional (requires TiXI>=3.1) - AeroMaps: Defined angleOfSideslip as input and added distinction between minimum and maximum angleOfAttack in aeroLimitMaps (compatibility break) - AeroMaps: Added missing singular incrementMap element to incrementMaps in aeroLimitsMap (compatibility break) - AeroMaps: Adopted the camelCase style for damping derivatives (compatibility break) - Introduced common nomenclature for speeds and altitudes (compatibility break) - Control distributors are set to optional - Added instructions for superposition of control surface deflections - Further elaboration of development standards - General improvements of the documentation - - - - - CPACS 3.2 - - Release in February 2020 - - Replaced tool-specific elements with xsd:any element and strict schema request for validation - UIDs adapted to type xsd:ID and xsd:IDREF - UIDs optional for transformationType and pointTypes - Replaced xsd:sequence elements with xsd:all elements where possible - CpacsVersion element set to optional - GuideCurves are now optional for nacelleCowlType - Documentation adaptions - - - - - CPACS 3.1 - - Release in August 2019 - - Redefinition of aeroPerformanceMaps - Added nodes for detailed engine pylons and nacelles - Added nodes to model generic walls - Extension of material definition - Added fuselage compartment definition - Added fuselage fuel tank definition - Explicit wing stringer definition integrated into wing stringer definition - RelativeDeflections renamed to control parameters - Control distributors modified to only have a single command input vector - "cpacsVersion" restricted to current schema version - Code cleanup - Cpacs_schema.xml removed - Documentation adaptions - - - - - CPACS 3.0 - - Release in Jul 2018 - - New component segment definition; this is affecting all structural components of wings - Renamed angleOfYaw into angleOfSideslip - Fixes in documentation - Made all uID attributes required - Minor fixes in choices and typos - Added nodes for the geometry of generic system components - Added performance requirements for aircraft models - Redefined the whole mission definition including point performances - Made link to missionUID in trajectory optional - Added new parameters to enginePerformanceMap - Relocated mFixedLeadingEdge and mFixedTrailingEdge within the massBReakdown structure - Changed aeroPerformanceMap to use altitude and standard atmosphere instead of reynolds number - Added an optional local direction for guide curves and an illustration image - Announced toolspecifics definitions as deprecated; will be removed from CPACS in next release and should be managed in separate namespace by tool maintainers - Added an option for aerodynamic performance maps of elastic aircraft - Enabled the definition of multiple aeroPerformanceMaps - Enabled the use of spar points for rib placement and rib points for spar placement - Added explicit stringer definitions for wing cells - All issues for this release can be found online - https://github.com/DLR-LY/CPACS/issues - - - - - CPACS 2.3.1 - - Release in Jul 2016 - - CPACS 2.3.1 is a beta release, all parameters may be subject to change. - Added a branch for the definition of design studies. - Added thermal properties for materials. - Revised the definition of flights/flightplans. - Added an airline definition. - Added structure for skid gear components. - Changed the units for material density to SI units. - Revised the top level fleets node and put it into the new airline node. - All issues for this release can be found online - https://github.com/DLR-LY/CPACS/issues - - - - - CPACS 2.3 - - Release in Nov 2015 - CPACS 2.3 is the fourth public release of CPACS. Major changes include: - - Included vector notation for weight and balance. - Included flight system and flight dynamic information. - Included top level aircraft requirements. - Included a prototype for detailed nacelle geometries. - Included structural mounts. - Extended aero data set for loads. - Extended the mass breakdown. - Updated the symmetry definition, please take a look at the documentation point 5 and 6. - All issues for this release can be found online - https://github.com/DLR-LY/CPACS/issues - - - - - CPACS 2.2.1 - - Release in Feb 2015 - - CPACS 2.2.1 is a beta release, all parameters may be subject to change. - Included preliminary definition of guidecurves. - Included additional means to describe the wing structure. - Included preliminary fuselage fuel tanks. - Included preliminary load envelope. - Included preliminary flight performance and flight qualities. (flight dynamics will follow) - Updated toolspecifics - Updated uncertainty definition - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.2 - - Release in May 2014 - - CPACS 2.2 is the third public release of CPACS. Major changes include - Additions and changes to the loadCaseType. - Included additional genericGeometricEntities for bellyfairings etc. - The mass breakdown is extended for a more detailed fuselage strucuture. - Steadiness information on the geometry is excluded from CPACS 2.2. CPACS 2.3 will include optional guidelines for smoother surfaces. - Uncertainties can now be specified (CPACS 2.2alpha doubleBaseType, CPACS 2.2 also in vector notations) - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.1 - - Release in May 2013 - - CPACS 2.1 is the second public release of CPACS. Most of the implementation was already included in CPACS 2.01 - included fuselage structure and cabin definition - all data is defined according to the CPACS coordinate system. That is the initial coordinate system in which geometries are defined. Therefore, it can but must not meet your body axis. - the mass breakdown is extended for a more detailed wing strucuture - profiles can now be included based on a two-dimensional class shape transformation. The old parametrization will still be available. TIGL will learn CST asap. - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.01 - - Release in Nov 2012 - - CPACS 2.01 is an internal release for the VAMP project. It is the testbed for CPACS 2.1 - included fuselage structure - additions to the load case definition - all issues can be found online - http://code.google.com/p/cpacs/issues/list - - - - - CPACS 2.0 - - Release in Mar 2012 - - CPACS 2.0 is the first public release - large impacts on the documentation - all issues can be found online - http://code.google.com/p/cpacs/issues/list - compatible with TIGL 2.0 - excluded fuselage structure, reintegration in CPACS 2.1 - - - - - CPACS 1.6 - - Release in Jul 2011 - - Thanks for the input on the documentation to Felix Dorbath, Till Pfeiffer, Alexander Koch, Falk Heinecke and Tom Otten - preliminary added enginePylons - deleted seatAssemblyPositionType - updated toolspecific blocks from handbook aero and cpacs mass updater - added weight and balance definition - added loads reference axis and dynamic aircraft model - added wing documentation - added weights documentation - added fleet documentation - added paramam toolspecific documentation - added wing tank definition - changed some names in the massBreakdown - deleted old loadCaseDefinitions - no more plural element for loadAnalyses - shifted groundforces to groundloadcases, this will need an update - added noseLandingGear - mainLandingGear can now have plural SideStruts - - - - - CPACS 1.5 - - Release in Feb 2011 - - uID for transformation - extended stringUIDBaseType with optional attribute isLink - all elements xxxUID are now of Type stringUIDBaseType - added new material definition from FA to distinguish between diffent material types - changed fuselage structure definition due to input from BK - changed rib definition in cells in component segments - cleaned up material definition in component segments - added cpacsVersion information to the header and updates types - added area and length to the loadCase reference on wing strips - added wingFuselageAttachment - - - - - CPACS 1.4 - - Release in Nov 2010 - - Geometry definition for engine and nacelle added - Trailing Edge Devices, Leading Edge Devices and Spoilers added - Rotorcraft added, similar to aircraft - Splitted up multiple Point Types - sparCell added uID - new inline Documentation introduced in CPACS type - - - - - CPACS 1.3 - - Release in Aug 2010 - - Fuel definition added - Introduced component segments for the wing structure - Mission definition was updated - VSAero toolspecific data updated - - - - - CPACS 1.2 - - Release in May 2010 - - Fuselage Structure Elements are updated following the input from BK - - stringers>arbitrary additional parameters: yBezugAtStartX, zBezugAtStartX, yBezugAtEndX, zBezugAtEndX - paxCrossBeams additional parameters: startX, endX - cargoCrossBeams additional parameters: startX, endX - paxCrossBeamStruts additional parameters: startX, endX - cargoCrossBeamStruts additional parameters: startX, endX - structure>pressureBulkhead: positionX instead of positionZ - reinforcementNumberVertical: number of vertical reinforcements - reinforcementNumberHorizontal: number of horizontal reinforcements - maxFlectionDepth: max camber of pressure bulkhead - reinforcementNumber: number of reinforcements rear pressure bulkhead - sheetProperties: definition of sheet properties - innerRadius: inner radius of the pressure bulkhead - - Dummy Wingbox element is included. This definition needs further enhancements - - cpacs>vehicles>aircraft>model>fuselage>fuselage>structure - Wingbox: - xStart: start of the wingbox area - xEnd: end of the wingbox area - zStart: upper limit of the wingbox area - - Damping Derivaties are added in the form of dcfxdp, dcfxdq, dcfxdr, dcfydp, etc. The data will be stored in the model/global/aeroperformaneMap under a new dampingDerivatives element. Unit is deg/sec. - StructureProfiles are defined in the profiles element. They are referenced in structuralElements for several entities such as stringer, frame etc. Currently they are referenced via 'structuralProfileUID' for name consistency it should be either only 'structure' or only 'structural' - Control Commmands. The chain between pilot inputs and controlsurface deflections is now closed. - - Parameters located at cpacs\vehicles\aircraft\model\systems - cockpitControl: links from pilotInput to commandCase - commandCase: links from commandCase to controlDistributor or controlFunction - controlDistributor links to the controlSurface - controlLaws includes controlModes automatic and manual - controlModes contain controlFunctions - - TraFuMo toolspecific data added - - - - - CPACS 1.1 - - Release in Feb 2010 - - Fleets model added. The fleets modeling from CATS is introduced to CPACS 1.1 - Reference changed. The reference type in wingSegmentStripCoefficientsType was changed from referenceType to pointType - - - - - - - - - - - - - - - - - - - - - - - - - CPACS header - - - Header type, containing CPACS dataset description - - - - - - - - - - - Name of CPACS dataset - - - - - Description of CPACS dataset - - - - - - Version of initial CPACS dataset according to the Semantic Versioning 2.0.0 standard. - - - - - - DEPRECATED: Should only be set to allow TiGL to open the file until TiGL is adopted accordingly. - Will be replaced by the cpacsVersion element in versionInfos. - - - - - - - - - - - - - - - updatesType - - - Updates type, containing update data for the CPACS - dataset - - - - - - - - - - - - - - - - - - - - - complexBaseType - - - Base type for complex nodes (including external data - attributes) - - - - - - - - - - - - - - - stringBaseType - - - Base type for string nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - stringUIDBaseType - - - This is the base type that links to other components. It should always contain a UID. - This node has an additional attribute isLink that will be used if a stringBaseType refers to a uID. TIXI can then - perform automatic validation for the existence of the referenced uID. - Furthermore this node contains an additional attribute symmetry. The symmetry attribute may take three values: symm, def, full - def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. - symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) - full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) - - - - - - - - - - - - - - - - - - - - - - - - - - stringVectorBaseType - - - - Base type for string vector nodes - The vector base type can include optional uncertainty - information. The description of uncertainties is placed in - addtional attributes. First, it is described by an attribute that - describes the type of uncertainty function called functionName. - The functionName attribute includes the tag name of the - distribution function which is listened in the table shown below. - Each uncertainty function is further describes by a set of - parameters that are described in the table below. - If the uncertainty values change for the elements of - the vector than the attribute may be written as a list of values - separated by semicolons - DEPRECATED: As of CPACS - version 3.3, the mapType - attribute is set to optional to ensure the compatibility of older data sets. - However, since the type is uniquely defined via the XSD, the attribute is superfluous - and will therefore be completely omitted in the next major release (Note: requires - TiXI >= 3.3). Please contact the CPACS team - if for any reason you see a long-term need for the mapType - attribute. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vector with semicolon separated values of type double - - - - Any entries of type double separated by semicolons are permitted, e.g.: - -<doubleVectorTest>123.456;+123.456;-1.234e56;-.45E-6;NaN</doubleVectorTest> - - -<doubleVectorTest>123.456</doubleVectorTest> - - -<doubleVectorTest>123.456,+1234.456</doubleVectorTest> - - -<doubleVectorTest>123.456;mainWingUID</doubleVectorTest> - - -<doubleVectorTest>123.456;1234.4E 56;-1.234e5.6</doubleVectorTest> - - - - - - - - - - - - - - - - - - - doubleVectorConstraintBaseType - - - - Base type for double vectors including a relational operator attribute indicating valid constraint region. - The doubleVectorConstraintBaseType extends the doubleVectorBaseType and thus inherits all its attributes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vector with semicolon separated positive integer values - - - - Any positive integer values separated by semicolons are permitted, e.g.: - -<intVectorTest>0;1;2;3;4;5</intVectorTest> - - -<intVectorTest>1</intVectorTest> - - -<intVectorTest>0,1,2,3,4,5</intVectorTest> - - -<intVectorTest>0.;1.;2.</intVectorTest> - - -<intVectorTest>-1;0;1</intVectorTest> - - - - - - - - - - - - - - - - - - - stringArrayBaseType - - - Base type for string array nodes (including maptype - array attribute) - DEPRECATED: As of CPACCS version 3.3, the mapType attribute is set to optional to ensure the compatibility of older data records. However, since the type is uniquely defined via the XSD, the attribute is superfluous and will therefore be completely omitted in future versions. - - - - - - - - - - - - - - - - - Array with semicolon separated values of type double - - - - In CPACS arrays are used to exchange values - in full-factorial parameter spaces, for example to describe the aerodynamic coefficients depending - on Mach number and altitude. - - Thus, the dimensions of the array are spanned by the input vectors. See the following - example where two input vectors are defined. For clarification the entries of the array result from - the multiplication of the index values of the corresponding input vectors: - -<inputVector1>1;2;3</inputVector1> -<inputVector2>4;5;6;7</inputVector2> - - -<array>4;5;6;7;8;10;12;14;12;15;18;21</array> - - Any entries of type double separated by semicolons are valid, e.g.: - -<doubleArrayTest>123.456;+123.456;-1.234e56;-.45E-6;NaN;0</doubleArrayTest> - - -<doubleArrayTest>123.456</doubleArrayTest> - - -<doubleArrayTest>123.456,+1234.456</doubleArrayTest> - - -<doubleArrayTest>123.456;mainWingUID</doubleArrayTest> - - -<doubleArrayTest>1234.4E 56;-1.234e5.6</doubleArrayTest> - - - Please note that the syntax of arrays in the current CPACS - version correspond exactly to the syntax of vectors. There is no special character indicating - the dimensions. Thus, the input vectors have to be determined from the documentation of the - corresponding elements and splitting of the one-dimensional vector has to be done manually. - - - - - - - - - - - - - - - - - - - doubleBaseType - - - - Base type for double nodes (including external data - attributes) - The double base type can include optional uncertainty - information. The description of uncertainties is placed in - addtional attributes. First, it is described by an attribute - that describes the type of uncertainty function called - functionName. The functionName attribute includes the tag name - of the distribution function which is listened in the table - shown below. Each uncertainty function is further describes by a - set of parameters that are described in the table below. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - doubleConstraintBaseType - - - - Base type for double nodes including a relational operator attribute indicating valid constraint region - The doubleConstraintBaseType extends the doubleBaseType and thus inherits all its attributes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - timeConstraintBaseType - - - - Base type for time nodes including a relational operator attribute indicating valid constraint region - The timeConstraintBaseType extends the timeBaseType and thus inherits all its attributes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - integerBaseType - - - Base type for integer nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - booleanBaseType - - - Base type for boolean nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - dateTimeBaseType - - - Base type for dateTime nodes (including external data - attributes) - - - - - - - - - - - - - - - - - - - timeBaseType - - - Base type for time nodes (including external data attributes) - This time type is based on the xsd:time definition. - "To specify a time zone, you can either enter a time in UTC time by adding a "Z" behind the time - like this: 09:30:10Z - or you can specify an offset from the UTC time by adding a positive or negative time behind the time - like this: - 09:30:10-06:00 - or - 09:30:10+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) - - - - - - - - - - - - - - - - - - - dateBaseType - - - Base type for date nodes (including external data attributes). - This date type is based on the xsd:date definition. - "To specify a time zone, you can either enter a date in UTC time by adding a "Z" behind the date - like this: 2002-09-24Z - or you can specify an offset from the UTC time by adding a positive or negative time behind the date - like this: - 2002-09-24-06:00 - or - 2002-09-24+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) - - - - - - - - - - - - - - - - - - - - - - Positionings of the wing. - - - Positionings type, containing all the positionings of - the wing sections. - - - - - - - - - - - - - - - - - - - Positioning of the wing section - - - - The positionings describe an additional translation of - sections. Basically, the positioning is a vector having the - length 'length' and an orientation that is described by the - parameters 'sweepAngle' and 'dihedralAngle'. If the 'sweepAngle' - and the 'dihedralAngle' are set to zero (or left blank) the - positioning vector equals the positive y-axis of the coordinate - system (in case of a positive 'length'). - If the parameter 'fromSectionUID' is set, the - positioning describes the translation between the 'from' towards - the 'to' section. If the parameter 'fromSectionUID' is left - blank the orgin of the positioning vector is the origin of the - parent coordinate syste. - The orgin of the section coordinate system is the - position which is described by the positioning vector PLUS the - translation which is described in the section. - Please note: If the orgin of the positioning vector is - defined by using another section, i.e. fromSection is defined, - the orgin of this vector equals the end of the positioning - vector of the previous section. This means that the section - translation of the from-section has no influence on the - positioning of the to-section. Therefore the total translation, - which is described by positionings, is the sum of the current - positioning and all positionings that are defined 'before'. - - An example for this is given at positioning 3 and 4 at - the picture below. Please note, that any other combination of - positionings would be possible. - Application of the sweepangle does not lead to a - rotation of the section. Application of the dihedral does not - lead to a rotation of the section. - - - - - - - - - - - - - - Name of the positioning. - - - - - Description of the positioning. - - - - - - Distance between inner and outer section - (length of the positioning vector). - - - - - Sweepangle between inner and outer section. - This angle equals a positive rotation of the positioing vector - around the z-axis of the wing coordinate system. - - - - - - Dihedralangle between inner and outer section. - This angle equals a positive rotation of the positioing vector - around the x-axis of the wing coordinate system - - - - - - Reference to starting section of the - positioning vector. If missing, the positioning is made from the - orgin of the wing coordinate system. - - - - - Reference to ending section (section to be - positioned) of the positioning vector. - - - - - - - - - - - - - - Transformation - - - Transformation type, containing a set of - transformations. The order of the transformations is scaling - -> rotation -> translation, and they are executed in this - order. Any of them can be omitted; it will be replaced by its - defaults. - Transformations are always executed relative to the - child not the parent. I.e. a scaling does not have an influence - on the parent item. For example in the outer geometry of a wing - the element scaling does not influence the section. Scaling does - also not effect rotation and translation. - - - - - - - - - - Scaling data default: 1,1,1. Those parameters - describe the scaling of the x-, y-, and z-axis. - - - - - - Rotation data default: 0,0,0. The rotation - angles are the three Euler angles to describe the orientation of - the coordinate system. The order is allways xyz in CPACS. - Therefore the first rotation is around the x-axis, the second - rotation is around the rotated y-axis (y') and the third - rotation is around the two times rotated z-axis (z''). - - - - - - Translation data default: 0,0,0. Translations - can either be made absolute in the global coordinate system - (absGlobal), absolute in the local Coordinate system (absLocal) - or relative (relative), normalized with the maximum dimensions - of the parent. - - - - - - - - - - - - - - 2D transformation - - - - - - - - - - - - - Scaling of the structural profile - - - - - - rotation around z-axis of profile definition - - - - - - translation of profile definition - - - - - - - - - - - - - - - Point: x,y,z - - - Point type, containing an xyz data triplet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - Point: x - - - Point type, containing a x data. - - - - - - - - - - X-Component - - - - - - - - - - - - - - Point: y - - - Point type, containing a y data. - - - - - - - - - - Y-Component - - - - - - - - - - - - - - Point: z - - - Point type, containing a z data. - - - - - - - - - - Z-Component - - - - - - - - - - - - - - Point: x,y - - - Point type, containing an xy data doublet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - - - - - - - - - - Point: x, z - - - Point type, containing an xz data doublet. - - - - - - - - - - X-Component - - - - - Z-Component - - - - - - - - - - - - - - Point: y, z - - - Point type, containing an yz data doublet. - - - - - - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - Point: x,y,z - - - Point type, containing an obligatory xyz data triplet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - Point with global/local reference - - - PointAbsRel type, containing an xyz data triplet. Each - of the components is optional. The refType attribute defines, - whether coordinates are absolute in the global ccordinate system - [absGlobal], absolute in the parent element's local coordinate - system [absLocal]. If the object does not have a - parent, only [absGlobal] is permitted. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - - - - - - - - - - Point with constraints - - - Point constraint type, containing an xyz data triplet. - - - - - - - - - - X-Component - - - - - Y-Component - - - - - Z-Component - - - - - - - - - - - - - List of 3D points, kept in three relative coordinate - vecors (rX, rY, rZ) - - - - This set of vectors contains an ordered list of points - for rX, rY, and rZ coordinates in the form of stringBased - Vectors. The x, y and z vector elements with the same index - specify a 3D point relative to a geometric segment. - - - - - - - - - - - - - - - - - - - - Vector of rX coordinates. Relative - circumferential coordinate on wing / fuselage profile - - - - - - Vector of rY coordinates. Relative span - coordinate along a segment - - - - - Vector of rZ coordinates. Relative coordinate - normal to the linear strake (normalised with chordlength / - diameter c*) - - - - - - - - - - - - - List of points - - - PointList type, containing an ordered list of points - - - - - - - - - - - Data point - - - - - - - - - - - - - List of points in x,y - - - PointList type, containing an ordered list of points - - - - - - - - - - - Data points in x-y-space. - - - - - - - - - - - - - List of 3D points, kept in three coordinate vecors (x, - y, z) - - - - This set of vectors contains an ordered list of points - for x, y and z coordinates in the form of stringBased Vectors. - The x, y and z vector elements with the same index specify a 3D - point. - - - - - - - - - - - Vector of x coordinates - - - - - Vector of y coordinates - - - - - Vector of z coordinates - - - - - - - - - - - - - Maps points (actually the index in the point list) to a curve parameter. - - - - Which parameters are allowed depends on the context. - For exampple in a wing profile, values between -1 and 1 are valid. - - - - - - - - - - - List of indices of points to be mapped. Each index must be in the range [1, npoints]. - - - - - List of parameters on the curve, that is mapped to the points defined by their index. - - - - - - - - - - - - - A curve that interpolates a list of points. - - - - The curve interpolates the list of points, typically with a b-spline. - In theory, the interpolation is somewhat ambiguous as it is not defined at which - curve parameter a point will be interpolated. - - To solve is ambiguity, an optional parameter map can be defined - that maps point indices with curve parameters. - - Kinks can also be modeled by populating the "kinks" array with the - indices of points that should be on a kink. As an example, look at the following image: - - - - - In this example, the kinks array will be "3;7". - Optionally, the parameters of the kinks can be set in the parameter map. - The whole profile looks as follows: - - -<pointList> - <x>...</x> - <y>...</y> - <z>...</z> - <kinks>3;7</kinks> - <parameterMap> - <pointIndex>3;5;7</pointIndex> - <paramOnCurve>0.2;0.5;0.8</paramOnCurve> - </parameterMap> -</pointList> - - - - - - - - - - - - Indices of points at which the curve has a kink. Each index is in the range [1, npoints]. - - - - - - Map between point index and curve parameter. - - - - - - - - - - - - - List of 2D points, kept in two coordinate vecors (x, y) - - - - This set of vectors contains an ordered list of points - for x and y coordinates in the form of stringBased Vectors. - The x and y vector elements with the same index specify a 2D - point. The coordinates of the x vector of [0, 1]. - - - - - - - - - - - Vector of x coordinates - - - - - Vector of y coordinates - - - - - - - - - - - - - Point in eta and xsi coordinates - - - Point described by eta-xsi coordinates. - Can be either segment or component segment coordinates. - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta-xsi values are considered to be in segment - eta-xsi coordinates; if it points to a componentSegment, - then componentSegment eta-xsi coordinates are used. - - - - - - - - - - - - - Relative height at eta, xsi position - - - Point described by eta-xsi and a relative height coordinate. - Can be either segment or component segment coordinates. - If relHeight is not given, the point has no offset from the eta-xsi plane - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative height position. - relHeight is relative to the local airfoil thickness. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta-xsi values are considered to be in segment - eta-xsi coordinates; if it points to a componentSegment, - then componentSegment eta-xsi coordinates are used. - - - - - - - - - - - - - Positive double values larger than 0 - - - - - - - - - - - - - - - - - List of uIDs - - - - - - - - - - - Reference to a uID - - - - - - - - - - - - - - - - UIDGroupDefinitionType - - - - - - - - - - - - - - - - - - - - - - - - - - - UIDGroupDefinitionsType - - - - - - - - - - - - - - - - - - - - - - - Actuator attachment - - - - - - - - - - - - - Relative spanwise position of the actuator. - Eta refers to the dimensions of the control surface. - - - - - - - - - - - - - - - - - Definition of the position and material properties of - the control surface actuator attachment. - - - - Definition of the position and material properties of - the control surface actuator attachment. - Please refer to the picture below for the definition - of the parameters: - - - - - - - - - - - - - - Definition of the relative chordwise position - of the parent actuator attachment. Xsi refers to the parents - dimensions. - - - - - Definition of the relative height position of - the parent actuator attachment. relHeight refers to the parents - dimensions. - - - - - Definition of the material properties of the - actuator attachment at the parent. - - - - - - - - - - - - - actuatorFuselageWingAttachmentType - - - - - - - - - - - - - - - - - - - - - - - actuatorFuselageWingType - - - - - - - - - - - - - Reference to the actuator. - - - - - Definition of the actuator to fuselage - attachment. - - - - - Definition of the actuator to wing attachment. - - - - - - - - - - - - - - - Definition of the position and material properties of - the parent actuator attachment. - - - - Definition of the position and material properties of - the parent actuator attachment. - Please refer to the picture below for the definition - of the parameters: - - - - - - - - - - - - - - Definition of the relative chordwise position - of the parent actuator attachment. Xsi refers to the parents - dimensions. - - - - - Definition of the relative height position of - the parent actuator attachment. relHeight refers to the parents - dimensions. - - - - - Definition of the material properties of the - actuator attachment at the parent. - - - - - - - - - - - - - actuatorsFuselageWingType - - - - - - - - - - - - - Definition of one actuator (e.g. trim actuator - of an HTP) of the attachment. - - - - - - - - - - - - - aeroPerformanceMapRCType - - - AeroPerformanceMapRC type, containing a perfomance map - with aerodynamic data. Array order is: angleOfAttack min->max - then angleOfSideslip then altitude then machNumber - - - - - - - - - - Atmospheric model and temperature offset - - - - - Mach number - - - - - Altitude - - - - - Sideslip angle - - - - - Angle of attack - - - - - Name and version of the tool used to compute - the aerodynamic performance - - - - - Modeling level of the methods used to compute - the aerodynamic performance. The higher the analysisLevel, the - higher the quality of the results. Possible use of - analysisLevel: 0- 9 = Statistical models, 10-19 = Analytic - models, 20-29 = Lifting line method, 30-39 = Panel method, 40-49 - = Panel-BL-coupled method, 50-59 = Full potential method, 60-69 - = Full potential-BL coupled method, 70-79 = CFD euler method, - 80-89 = CFD euler-bl coupled method, 99-99 = CFD RANS method, - >=100 = Experimental data. - - - - - - - - - - - - - - - - - - - - aeroPerformanceMapsRCType - - - aeroPerformanceMapsRC type, containing multiple - aeroPerformanceMapRC nodes for different cases - - - - - - - - - - - - - - - - - - - aeroPerformanceType - - - aeroPerformance type, containing perfomance maps with - aerodynamic data of an airfoil. - - - - - - - - - - Aerodynamic performance map of the full - configuration - - - - - Aerodynamic performance maps of isolated - fuselages - - - - - Aerodynamic performance maps of isolated wings - - - - - - Aerodynamic performance maps of control - surfaces - - - - - Aerodynamic performance maps of isolated - airfoils - - - - - - - - - - - - - aeroelasticDivergenceType - - - AeroelasticDivergence type, containing the results from - aeroelastic analysis - - - - - - - - - - - - - - - - - - - aeroelasticStaticMaxDisplacementType - - - AeroelasticStaticMaxDisplacement type, containing the - Maximum static displacement from aeroelastic analysis - - - - - - - - - - Maximum translation - - - - - Maximum rotation - - - - - - - - - - - - - Aeroelasticity - - - Aeroelastics type, containing the results from - aeroelastic analysis - - - - - - - - - - - - - - - - - - - - Results from several analysis - modules connected to CPACS - - - AircraftAnalyses type, containing detailed analysis - data of the aircraft - Within this element results from analysis modules are - stored that rely to the overall definition of the aircraft. These - include e.g. aerodynamic data or loadCases - For further documentation please refer to the - respective elements. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Global data - - - AircraftGlobal type, containing global data of the - aircraft - - - - - - - - - - - designRange equals the full payload max - range, i.e. point B in payload range - diagramm - - - - - - - - - - - - - - - - - - - Aircraft model - - - - The aircraftModelType contains the geometric aircraft - model and associated data. - Elements specifying the geometry of the aircraft are fuselages, - wings, - engines (referenced via uID), - enginePylons, landingGear, - systems (to some extend) and genericGeometryComponents. - - Other elements are dedicated to additional data associated to this aircraft model. Brief and concise analysis results are stored - in the global node. The analysis node contains - extensive results from multidisciplinary analysis modules. - In the current CPACS version requirements only refer to the aircraft performance and are therefore specified in the - performanceRequirements node. - - - - - - - - - - - - Name of the aircraft model - - - - - - Description of the aircraft model - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aircraft - - - - The aircraftType contains a list of aircraft models. - - - Note: Since there is no distinction between plural and singular in English, aircraft - refers to plural form, while a single aircraft itself is referened as model. - - - - - - - - - - - - - - - - - - - - - airfoilAeroPerformanceType - - - airfoilAeroPerformance type, containing perfomance maps - with aerodynamic data of an airfoil. - - - - - - - - - - Reference to the uID of the analysed airfoil - - - - - - References used for the calculation of the - force and moment coefficients of the airfoil (in the airfoil - axis system!) - - - - - Calculated aerodynamic performance maps of the - airfoil - - - - - - - - - - - - - airfoilsAeroPerformanceType - - - airfoilsAeroPerformance type, containing - airfoilsAeroPerformance - - - - - - - - - - - - - - - - - - - airframeMaintenanceCostType - - - - - - - - - - - - - - - - - - - - - - - airlineType - - - Describes a specific airline and their fleet - - - - - - - - - - Name of the airline - - - - - Description of the airline - - - - - - - - - - - - - - - - Airlines - - - Contains a list of different airlines - - - - - - - - - - - - - - - - - - - airportCompatabilityGlobalType - - - - - - - - - - - - - - - - - - - - - - - - - - airportType - - - Airport type, containing data of an airport - - - - - - - - - - Name of airport - - - - - Description of airport - - - - - IATA 3-letter-code - - - - - ICAO 4-letter-code - - - - - Position in degrees north - - - - - Position in degrees east - - - - - Airport elevation - - - - - - - - - - - - - - - Airports - - - Airports type, containing data of the airports - - - - - - - - - - - - - - - - - - - - alignmentCrossBeamType - - - - - - - - - - - - - Offset in direction of extrusion, first side - (absolute value) - - - - - Offset in direction of extrusion, second side - (absolute value) - - - - - Rotation around local x axis (extrusion axis) - - - - - - Translation along local y axis (perpendicular - to extrusion axis) - - - - - Translation along local z axis (perpendicular - to x ynd y axes) - - - - - - - - - - - - - - alignmentFloorPanelType - - - - - - - - - - - - - Offset from seat rail 1 reference Position in - local y direction (in plane of panel, absolute value) - - - - - - Offset from seat rail 2 refernce position in - local y direction (in plane of panel, absolute value) - - - - - - Offset from seat rail 1 refernce position in - local z direction (in plane of panel, absolute value)) - - - - - - - - - - - - - - - alignmentStringFrameType - - - - - - - - - - - - - Rotation around local x axis (extrusion axis) - - - - - - Translation along local y axis (perpendicular - to extrusion axis) - - - - - Translation along local z axis (perpendicular - to x ynd y axes) - - - - - - - - - - - - - - alignmentStructMemberType - - - - - - - - - - - - - Offset in direction of extrusion (absolute - value) - - - - - Rotation around local x axis (extrusion axis) - - - - - - Translation along local y axis (perpendicular - to extrusion axis) - - - - - Translation along local z axis (perpendicular - to x ynd y axes) - - - - - - - - - - - - - - atmosphericModelType - - - Defines the the athmospheric model which should be used. - Currently there is only a single option which is ISA for ICAO Standard - atmosphere (ISA) from 1993. For more details on atmospheric - models, please refer to documentation of the <CPACS> root - element. - - - - - - - - - - Atmospheric model (e.g. ISA for ICAO Standard - atmosphere (ISA) from 1993). - - - - - - - - - - - - Offset from temperature of the atmospheric model [K]. - For more details on atmospheric models, please refer to documentation - of the <CPACS> root element. - - - - - - - - - - - - - Attachment pin of the wing-fuselage-attachment. - - - - Attachment pin of the wing-fuselage-attachment. - - - - - - - - - - - - - Definition which translation degrees of - freedom are blocked. Default x=0 (free); y=1 (blocked); z=1 - (blocked). - - - - - - - - - - - - - - - - Definition of attachment pins for the wing-fuselage - attachment. - - - Definition of attachment pins for the wing-fuselage - attachment. - - - - - - - - - - - - - - - - - - - Axle - - - Geometric description and material properties of the - landing gear axle - - - - - - - - - - Length of the axle. For a single wheel, the length is equal to the distance between the center of the piston and the center of the wheel. For two wheels, the length is equal to the distance between the centers of the wheels with the axis being centered w.r.t. to the Piston. - - - - - Axle shaft properties - - - - - Number of wheels attached to this axle - - - - - Defines the side of the first wheel (inboard or outboard; inboard corresponds to the negative y-direction or in flight direction left) for odd number of wheels on this axis. Each additional wheel is the added on the opposite site of the previous wheel. - - - - - - - - - - - - Properties of the wheel(s) attached to this axle. If more than one wheel is attached, all wheels on a single axis have the same properties. - - - - - - - - - - - - - - Definition of the landing gear wheel. - - - The center plane of the wheel is located on the end point of the axle. - - - - - - - - - - Wheel radius - - - - - With of the wheel - - - - - Brake: false = - not braked; true = braked. - - - - - - - - - - - - - - beamCrossSectionType - - - beamCrossSectionType, containing the beam geometrical - properties - - - - - - - - - - - - - - - - - - - - - - - - beamStiffnessType - - - globalBeamStiffnessType, containing the beam - stiffnesses such as EA, EI - - - - - - - - - - - - - - - - - - - - - - - - - - blockedDOFType - - - - - - - - - - - - - - - - - - - - - - - Bogie - - - Geometric description and material properties of the - landing gear axle bogie (including the axle configuration) - - - - - - - - - - Length of the bogie - - - - - Tilt angle of the bogie in airborne conditions - - - - - - - - - - - - - - - - Bogie axle assembly - - - Description of an axle installed on the bogie and its - relative position to it - - - - - - - - - - - Relative position of the axle to the bogie (if more than one axle is defined; 0 = forward end of bogie; 1 = rear end of bogie) - - - - - - - - - - - - - - - - - - - Bogie axle assemblies - - - - A list of axles that are attached to the bogie - and their relative position to it - - - - - - - - - - - - - - - - - - - - cabGeometryType - - - cabGeometry provides the geometry of the cabin in terms - of constant height contour lines. The lines all share a common - x-vector. The vectors yZ[N] provide the lateral contour at - Z-coordinate provided in the vector z. The number of contour - lines can differ and is given by the length of the vector z - - - - - - - - - - - - - x-coordinates for all contour lines, relative - to cabin origin. - - - - - z-coordinate of contour lines. Contour lines - are constant z, so each entry in this vector belongs to a single - contour line. - - - - - - - - - - - - - - - cabinAisleType - - - aisles has as many entries as there are aisles in the - cabin. In a normal single aisle there are two aisles: the cabin - aisle and the aisle leading to the cockpit. - - - - - - - - - - - - Provides the longitudinal coordinates. The - number of coordinates can be chosen as appropriate, the minimum - number is two. The coordinates are relative to the cabin origin. - - - - - - Provides the center points of the aisle. The - y-vector has to have same length as the x-vector. The aisle - stretches equally left and right of the provided y-coordinate. - - - - - - the width of the aisle at floor level at each - y-coordinate. - - - - - - - - - - - - - - cabinAislesType - - - - - - - - - - - - - - - - - - - - - - cabinDoorType - - - doors describe all doors of the cabin. They are linked - to a structural door description. The cabin door is usually equal - in size to the door, but does not need to be. The structural door - might describe a wider cut-out, while the cabin door is primarily - intended for evacuation modeling and cabin layout. In order to - obtain a 3-dimensional door representation, the local cabin - geometry shall be used. - - - - - - - - - - - - - Number of passengers this door adds to the - overall exit capacity limit of the aircraft. - - - - - This is the forward x-coordinate of the door - relative to the cabin origin. - - - - - the door sill height relative to cabin origin. - - - - - - The width of the door in x-direction. - - - - - - the effective height of the door. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cabinDoorsType - - - - - - - - - - - - - - - - - - - - - - cabinFloorElementType - - - floorElement describes objects like monuments or other - installations inside the cabin. - - - - - - - - - - - - - - - - - - - - - - - forward center coordinate of object relative - to cabin origin. - - - - - center y-coordinate relative to cabin origin. - - - - - - length of the object - - - - - length of the object - - - - - length of the object - - - - - - - - - - - - - - - cabinFloorElementsType - - - - - - - - - - - - - - - - - - - - - - cabinSeatElementType - - - seats describe all seats inside the aircraft. They are - – strictly speaking – also objects mounted on the floor, hence - floor objects. But the specific characteristics of seats justify - a differentiation between seats and other objects on the floor. - Seats are seat group, for example a triple seat. Therefore they - have multiple seats. - - - - - - - - - - - - Number of seats - - - - - - - - - - - - - - - - x-coordinate relative to cabin origin. - - - - - - y-coordinate relative to cabin origin. - - - - - - delta-y-coordinate of the individual seat - center points from the y-coordinate of the seat object. This is - important to locate passengers. It is assumed that seats have no - angle. - - - - - length of the seat group. - - - - - width of the seat group. - - - - - height of the seat group. - - - - - - - - - - - - - - - - - cabinSeatElementsType - - - - - - - - - - - - - - - - - - - - - - cabinSpaceType - - - spaces describe areas in the cabin that need to be - clear for use as emergency area. Depending on the type of area, - it can have a height limit. The spaces are required for - downstream cabin design, for example to describe an empty cabin. - - - - - - - - - - - - - x-coordinates. These describe an area, so they - are not monotonous ascending. - - - - - y-coordinates at given x-coordinates. Warning: - x-y do not represent a function as single x-positions can have - multiple y-coordinates. Hence, no interpolation is possible. - - - - - - the height above the floor that is required to - be empty of any objects. - - - - - - - - - - - - - - cabinSpacesType - - - - - - - - - - - - - - - - - - - - - - Cap - - - - SparCap type, containing the cross section area of the - spar cap and the material properties. - Pleas find below a picture where all spar cross - section parameters as well as the orientation refereneces for - the material definition can be found: - - - - - - - - - - - - - - Area of the cap - - - - - - - - - - - - - - cargoCrossBeamStrutsAssemblyType - - - CargoCrossBeamStrutsAssembly type, containing cargo - crossBeam strut assemblys - - - - - - - - - - - - - - - - - - - cargoCrossBeamsAssemblyType - - - CargoCrossBeamsAssembly type, containing cargo - crossBeam assemblys - - - - - - - - - - - - - - - - - - - cargoDoorsAssemblyType - - - CargoDoorsAssembly type, containing cargo door - assemblys - - - - - - - - - - - - - - - - - - - Chordwise positioning of wing cells. - - - CellPositioningChordwise defines the chordwise direction of a wing cell either in two xsi - (xsi1 at innerBorder and xsi2 at outerBorder) coordinates, via referencing a spar-uID or via a - contour coordinate in chordwise direction. - - - - - - - - - - - Relative chordwise position of the inner - end. - - - - - Relative chordwise position of the outer - end. - - - - - - Reference to a spar as chordwise border. - - - - - - Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. - - - - - - - - - - - - - Spanwise positioning of wing cells. - - - CellPositioningSpanwise defines the chordwise direction of a wing cell either in two eta - (eta1 at leadingEdge and eta2 at trailingEdge) coordinates, via referencing a rib-uID or via a contour - coordinate in chordwise direction. - - - - - - - - - - - Relative spanwise position of the forward - end. - - - - - Relative spanwise position of the rear end. - - - - - - - - RibNumber is the reference to the rib number - of the rib set which is referenced by 'ribDefinitionUID'. - - - - - - Reference to a ribDefinition set. The single - rib of this ribDefinition set is defined by using 'ribNumber'. - - - - - - - Spanwise contour coordinate as spanwise border. 0 equals root, 1 equals tip. - - - - - - - - - - - - - centerFuselageAssemblyType - - - CenterFuselageAssembly type, containing wing box - assemblys - - - - - - - - - Choise between diffent center fuselage - modelling options - - - - Simplified center fuselage definition (rigid - body) - - - - UID of first frame in rigid center fuselage - area - - - - - UID of last frame in rigid center fuselage - area - - - - - UID of start stringer to define center - fuselage area - - - - - UID of end stringer to define center fuselage - area - - - - - - Detailled low wing center fuselage definition - (draft definition) - - - - - - Detailled high wing center fuselage definition - (draft definition) - - - - - - - - - - - - - - - centerFuselageAreasAssemblyType - - - centerFuselageAreasAssembly type, containing center - fuselage area assembly - - - - - - - - - - - - - - - - - - - centerFuselageHighWingConfiguration - - - - - - - - - - - - - - - - - - - - - - centerFuselageKeelbeamType - - - CenterFuselage / Keelbeam definition between mainframe1 - und mainframe3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageLateralPanelsType - - - CenterFuselage / lateral Panel definition between - mainframe2 und mainframe3 - - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageLongFloorBeamConnectionType - - - CenterFuselage / Long. floor beam connection - - - - - - - - - - - - - - - - - - - - - centerFuselageLowWingConfiguration - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageMainFramesType - - - CenterFuselage / main frame definition, containing - mainframe and pressure Bulkhead definitions - - - - - - - - - - - - - - - - - - - - - - - - centerFuselagePressureFloorType - - - CenterFuselage / pressure floor definition between - mainframe2 und mainframe3 - - - - - - - - - - - - - - - - - - - - - - - - centerFuselagePressureFloorType - - - CenterFuselage / side box definition between mainframe2 - und mainframe3 - - - - - - - - - - - - - - - - - - - - - certificationCasesType - - - - - - - - - - - - - - - - - - - - - - chargesCostType - - - - - - - - - - - - - - - - - - - - - - - - - - cockpitControlType - - - single cockpitControl is defined by a pilotInput and a - commandOutput. The commandOutput is linked to the commandCase - - - - - - - - - - - - - - - - - - - - - - - - - cockpitControlsType - - - Cockpit controls type, containing the cockpit controls - - Some controls are mandatory, others can be added via - cockpitControl elements - - - - - - - - - - - - - - - - - - - - - - commandCaseCommandType - - - single commandCaseCommand can either hold a - controlFunction or a controlDistributor - - - - - - - - - - - - - - - - - - - - - - - commandCaseType - - - single commandCase Containing several - commandCaseCommands - - - - - - - - - - - - - - - - - - - - - - commandCasesType - - - plural Element for commandCase, some fixed dp, dq, dr - and dx, dy, dz - - - - - - - - - - - - - - - - - - - - - - - - - componentCostType - - - - - - - - - - - - - - - - - - - - - - Load envelope - - - List of load cases defining a load envelope - - - - - - - - - - - Name - - - - - Description - - - - - UID of the corresponding point set - - - - - - List of uIDs defining the loads envelope - - - - - - - - - - - - - componentSegmentPathType - - - - - - - - - - - - - Definition of hingePoint of the - componentSegment. The hingePoint is used as reference point for - the deflection definition. - - - - - Definition of the orientation of the hinge - line with three Euler-rotation angles. The hinge line is - oriented along the global y-axis if all rotations are 0. - - - - - - Definition of all steps of the deflection - path. - - - - - - - - - - - - - componentSegmentStepType - - - - - - - - - - - - - The control parameter is used to reference the - state of a control device, e.g. in the load - case description. Can have any value and is NOT limited to the - range of -1 to 1. - - - - - Translation along the x-, y- and z-Coordinate - of the rotated hinge coordinate system. - - - - - Rotation around the hinge line. - - - - - - - - - - - - - - componentSegmentStepsType - - - - - - - - - - - - - Definition of one step of the deflection path. - - - - - - - - - - - - - - ComponentSegment of the wing. - - - - Within componentSegments the wing structure, the - control surfaces, the wing fuel tanks and the - wingFuselageAttachment is defined by using relative coordinates. - - A componentSegment is defined in the same way as - segments: from one cross section (sections->elements) to - another. Compared to segments one componentSegment can can start - and end at elements that are not consecutive. Therefore that one - componentSegment can be the combination of several segments. - Each wing has at least one componentSegment (from root to tip). - The maximal number of componentSegments equals the number of - segments (each segment is defined as one componentSegment). - This also implies that each segment can only be part of one componentSegment. - - In principal a componentSegment can combine any number - of segments. But if in one section two elements are defined, the - componentSegment has to start/end there as no well-defined - relative coordinats can be defined if steps in the wing occure. - - An example for wing componentSegments can be found in - the picture below: - - - - Within componentSegments a relative spanwise - coordinate (eta) and a relative chordwise coordinate (xsi) is - defined. Those coordinates are used for the definition of e.g. - wing structures and control surfaces. there are two types of eta xsi coordinates. - Segment (eta, xsi) coordinates define the relative local coordinate system for a segment ranging from (0,0) to (1,1). - - - - - - The eta xsi coordinates for a component segment are based on the segment eta xsi planes. - As a reference length for the component segment eta coordinate the - mid chord lines of all the segments are used. - The beginning of this line at from-element equals eta = 0, while the end of this line - at the to-element equals eta = 1. All wing positions that lie on the same - element (segment border) have the same eta coordinate. The points inbetween - two elements are defined by the iso xsi lines of the segment eta xsi space. - An example for the definition of the relative axes can - be found in the picture below: - - - - - In order to calculate the global coordinates of a component segment eta xsi point - one first has to calculate the eta point on the xsi iso line of (xsi=0.5), - and then walk along the iso eta lineof the segment. - - An example for determining the a component - eta xsi point can be found in the picture below: - - - - - - - - - - - - - - - - - - - - - - - - Name of the wing componentSegment. - - - - - - - Description of the componentSegment. - - - - - - - Reference to the element from which the - componentSegment shall start. - - - - - - - Reference to the element from which the - componentSegment shall end. - - - - - - - - - Description of deflection path of - componentSegments (e.g. used for - trimmable HTPs). - - - - - - - - - - - - - - - - - - - ComponentSegments of the wing. - - - ComponentSegments type, containing all the - componentSegments of the wing. - - - - - - - - - - - - - - - - - - - compositeLayerType - - - CompositeLayer type, conatining data of a composite - layer - - - - This type defines single composite layers by - giving a ply thickness, ply reference angle and a materialUID. - - - - - - - - Name of layer - - - - - Description of layer - - - - - Thickness of layer - - - - - Angle of layer in degree - - - - - Material UID of the layer - - - - - - - - - - - - - compositeType - - - Composite type, conatining data of a composite - - - - - Within this type individual stackings of - composites can be introduced by defining an offset and a set of - composite layers. The order of the composite layers defines the - stacking order. - - - - - - - Name of composite - - - - - Description of composite - - - - - offset of the laminate. The reference plane of - the laminate is the arithmetic mean of the laminate thickness. - - - - - - - - - - - - - - - - compositesType - - - - - - - - - - - - - - - - - - - - - - connectivitiesType - - - - - - - - - - - - - - - - - - - - - - connectivityType - - - - - - - - - - - - - - - - - - - - - - - - - - Constraints - - - - Constraint settings for the point performance definition - - - - - - - - - - - Calibrated airspeed [m/s] - - - - - - - Mach number [-] - - - - - - - Climb angle [deg] - - - - - - - Rate of climb [m/s] - - - - - - - Rate of turn [deg/s] - - - - - - Thrust setting for derated engine as fraction of max. thrust (e.g.: for powered descents, deceleration not at IDLE, manoevres) - - - - - - - Rate of velocity [m/s^2] - - - - - - - Duration [s] - - - - - - - Angle of attack [deg] - - - - - - - Constant altitude [m] - - - - - - - - - - - - - - Constraint - - - - - Specification of performance constraints. - - Constraints allow vectors of double values to define parameter lapses within a mission segment. The example below illustrates this by means of an exemplary climb profile of a conventional airliner, in which multiple physical and regulatory speed constraints are simultaneously specified over several altitudes (e.g., to account for the crossover altitude): - <endCondition> - <positionGeo> - <altitude relationalOperator="ge" uID="altClimb">10058.4</altitude> <!-- FL330 --> - </positionGeo> -</endCondition> -<constraint> - <referenceEndConditionUID>altClimb</referenceEndConditionUID> - <endConditionRatio>0.0;0.303</endConditionRatio> <!-- FL0, FL100 --> - <continuitySetting>discrete</continuitySetting> - <CAS relationalOperator="le">128.61;154.33</CAS> <!-- 250 [kt], 300 [kt]--> - <machNumber relationalOperator="le">0.78;0.78</machNumber> - <prioritySetting>velocity</prioritySetting> -</constraint> - - - From FL0 until FL100, the vehicle should fly at a velocity less than or equal to CAS = 250 kt or M = 0.78. In this first segment at low altitudes, the constraint on CAS is triggered. - - - From FL100 until FL330, the vehicle should fly at a velocity less than or equal to CAS = 300 kt or M = 0.78. In this second segment, the vehicle starts by increasing velocity until 300 kt, the constraint on maximum machNumber triggers from the crossover altitude onwards - - - - - - - - - - - - - Reference to the uID of the segment end condition variable - - - - - - - Vector indicating the ratios of the constraintSettings profile with respect to the provided referenceEndCondition, ranging from 0 to 1. If this vector is defined, the provided constraintSettings are expected to be vectors with the same length providing ratio-value pairs. Example: for referenceEndCondition <range><z> (i.e.: flown distance in z direction of the segment), a vector of <CAS> and <machNumber> is provided to define a climb profile. - - - - - - Defines how to interpret the parameter lapses within the segment: discrete steps (C0 continuity) or linear interpolation (C1 continuity) - - - - - - - - - - - - - - - Calibrated airspeed within the - segment - - - - - - - Mach number within the segment - - - - - - - Climb angle within the segment - - - - - - - Climb angle within the segment - - - - - - - Specific excess power within the segment - (e.g.: for defining minimum SEP to - remain after step climbs have been - performed). - - - - - - - Altitude difference of each step climb - - - - - - - - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] - - - - - - - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] - - - - - - - - Rate of turn within the segment - - - - - - - Thrust setting for derated engine as - fraction of max. Thrust (e.g.: for - powered descents, deceleration not at - IDLE, manoevres). - - - - - - - Rate of velocity within the segment - - - - - - - Load factor experienced during segment - - - - - - - Constant altitude for the segment. - - - - - - - priority setting indicating which - constraint is preferred within the - segment - - - - - - - - - - - - - - - - - - - - - - Airfoil definition of an control surface at the - inner/outer border. - - - - Optional definition of the exact airfoil shape at the - inner/outer border of the control surface. - The airfoil shape is defined via referencing to the - airfoilUID. As the leading and trailing edge point is fix due to - the outer shape definition of the control surface the airfoil - can only be rotated around the x-axis (axis going from leading - to trailing edge of the inner/outer border of the control - surface). Scaling in x-direction is also defined by the outer - shape, wherefore only scaling in y and z direction is allowed. - - - - - - - - - - - - Reference to the airfoil uID. - - - - - - Rotation around an axis, going from the - leading edge point to the trailing edge point of the inner/outer - border of the control surface. Defaults to 90°, which is - equivalent to perpendicular on the control surface middle plane. - - - - - - Scaling of the airfoil in spanwise direction - (not used for 2D airfoils). - - - - - Scaling in thickness direction of the airfoil. - - - - - - - - - - - - - - controlDistributorType - - - - single controlDistributor bundling several - controlElements - Within some analyses, it might occur that overlapping control element settings are specified. In this case, - it is assumed that a cumulative setting is built by summing up the individual settings. As the behavior of these settings - is not necessarily linear, a certain order of summation has to be followed: - - (1) The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. - (2) With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. - (3) All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. - (4) With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. - (5) During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. - - - - - - - - - - - - - - Vector of command inputs. The minimum and maximum value is given by the lowest and highest entry of the vector, respectively. - - - - - - - - - - - - - - - controlDistributorsType - - - plural Element for controlDistributor - - - - - - - - - - - - - - - - - - - controlElementType - - - Single controlElement linking the inputs of a controlDistributor via a gain - table to a contol device by using its uID. Controls can be ControlSurfaces and in the - future thrust. - - - - - - - - - - UID of the control device, e.g. a control surface. It is not allowed to reference another control distributor. - - - - - Vector of control device states resulting from the input commands. It must be of the same length as the inputCommands element. - The minimum and maximum values are defined according to the minimum and maximum values of the input commands. - - - - - - - - - - - - - controlElementsType - - - plural Element for controlElement - - - - - - - - - - - - - - - - - - - controlFunctionType - - - single controlFunction containing the controller's - parameters - - - - - - - - - - - - - - - - - - - - - - - - - - controlFunctionsType - - - plural Element for controlFuntion - - - - - - - - - - - - - - - - - - - controlLawModeType - - - Control Laws type, containing the aircraft's control - law mode - - - - - - - - - - - - - - - - - - - controlLawModesType - - - Control Laws type, containing the aircraft's control - law modes - - - - - - - - - - - - - - - - - - - controlLawsType - - - Control Laws type, containing the aircraft's control - laws - - - - - - - - - - - - - - - - - - - - Definition of an actuator of the control surface, that - is not placed within a track. - - - Definition of an actuator of the control surface, that - is not placed within a track. - - - - - - - - - - Reference to the actuator (actuator definition - currently not available in CPCAS, status 1.6). - - - - - - - - - - - - - - - - Definition of actuators of the control surface, that - are not placed within a track. - - - Definition of actuators of the control surface, that - are not placed within a track. - - - - - - - - - - - - - - - - - - - Airfoil definition of an control surface between inner - and outer border. - - - - Optional definition of the exact airfoil shape between - the inner and outer border of the control surface. - The airfoil shape is defined via referencing to the - airfoilUID. As the leading and trailing edge point is fix due to - the outer shape definition of the control surface the airfoil - can be rotated around the x-axis (axis going from leading to - trailing edge of the control surface) and around the z-axis - (normal axis on the control surface middle plane). Scaling in - x-direction is also defined by the outer shape, wherefore only - scaling in y and z direction is allowed. - - - - - - - - - - - Relative spanwise coordinate (eta) of the - control surface, where the leading edge of the airfoil is - placed. - - - - - Reference to the airfoil uID. - - - - - - Rotation around an axis, going from the - leading edge point to the trailing edge point of the control - surface. Defaults to 90°, which is equivalent to perpendicular - on the control surface middle plane. - - - - - Rotation of the airfoil around the control - surface middle plane normal direciotn. Reference point is the - most forward point of the airfoil. Defaults to 90°, which is - equivalent to the airfoilplacement in flight direction (along - wings-x axis). - - - - - Scaling of the airfoil in spanwise direction - (not used for 2D airfoils). - - - - - Scaling in thickness direction of the airfoil. - - - - - - - - - - - - - - Inner/outer border of the control surface. - - - - Definition of the inner/outer border of the control - surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - In addition, optionally, the airfoil shape of the - control surface can be defined closer. For the leading edge - devices 'hollow'. If an exact control surface airfoil definition - should be used, outerShape->airfoils can be used. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - Relative spanwise inner/outer position of the - leading edge of the control surface. - - - - - Relative spanwise inner/outer position of the - trailing edge of the control surface. Defaults to 'etaLE'. - - - - - - Relative chordwise inner/outer position of - the trailing edge of the control surface. Reference is eta/xsi - from the parent. - - - - - - - - - - - - - - - - - - - - - - - Inner/outer border of the control surface. - - - - Definition of the inner/outer border of the control - surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - In addition, optionally, the airfoil shape of the - control surface can be defined closer. For the - spoiler'relHeightLE' is used. If an exact control surface - airfoil definition should be used, outerShape->airfoils can - be used. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - Relative spanwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - Relative spanwise inner/outer position of the - trailing edge of the control surface. Reference is eta/xsi from - the parent. Defaults to 'etaLE'. - - - - - Relative chordwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - Relative chordwise inner/outer position of the - trailing edge of the control surface. Reference is eta/xsi from - the parent. - - - - - - Defines the relative high of lowest point of - the spoiler leading edge, relative to the airfoil height of the - parent at this position. See picture below. - - - - - - - - - - - - - - - - Inner/outer border of the control surface. - - - - Definition of the inner/outer border of the control - surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - In addition, optionally, the airfoil shape of the - control surface can be defined closer. For the trailing edge - device this is done at 'leadingEdgeShape', for the spoiler - 'relHeightLE' is used and for the leading edge devices 'hollow'. - If an exact control surface airfoil definition should be used, - outerShape->airfoils can be used. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - Relative spanwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - Relative spanwise inner/outer position of the - trailing edge of the control surface. Reference is eta/xsi from - the parent. Defaults to 'etaLE'. - - - - - Relative chordwise inner/outer position of the - leading edge of the control surface. Reference is eta/xsi from - the parent. - - - - - - - - - - - - - - - - Optional definition of the exact airfoil shape of the - control surface. - - - - - - - - - - - - - - - - - - - - - - This type contains a vector of deflection values for a - single control surface - - - - - 0. General overview - - In this type, a vector of deflections of a single - control surface is specified. - - - - 1. - <controlSurfaceUID> - (mandatory) - - - A reference to a control surface from the aircraft - model - - - - 2. - <controlParameters> - (mandatory) - - - A vector of controlParameters of the selected - control surface (with respect to the defined deflection path). - - - - - - - - - - - - - - Reference to a control surface - - - - - - Control parameters of the control surface - - - - - - - - - - - - - - This type contains a list of control surfaces and their - deflection vectors - - - - - 0. General overview - - In this type, a list of control surfaces is defined. - - - - - 1. - <controlSurface> - (mandatory) - - - One of these nodes per deflected control surface is - required here. - - - - - - - - - - - - - - - - - - - - - - controlSurfaceHingeMomentMapType - - - controlSurfaceHingeMomentMap type, containing a moment - map with aerodynamic data for a control surface. Array order is: - controlParameters min->max then angleOfAttack then angleOfSideslip - then reynoldsNumber then machNumber. AngleOfAttack, angleOfSideslip, - reynoldsNumber and machNumber are taken from the basic - performance map one level above. - - - - - - - - - - Reference to the control surface - - - - - - Control parameters of the control surface - - - - - - - - - - - - - - - - - - - - controlSurfaceHingeMomentMapsType - - - controlSurfaceHingeMomentMapsType type, containing the - aerodynamic moment maps for one or more control surfaces. - - - - - - - - - - - - - - - - - - - - controlSurfaceHingePointType - - - - The deflection path of a control surface is described - with respect to two hinge points - one at the inner border of - the control surface and one at the outer border of the control - surface. Those two points are defined using the xsi and relative - height coordinates of the parent. Therefore those points can also - lay outbound of the control surface. Those two points defined - the hinge line, which is a straight line between the two points. - - An example can be found below: - - - - - - - - - - - - - - Relative chordwise coordinate (xsi) of the - hinge line point. Reference is the parent chord. - - - - - - Relative height of the hinge line point. - Reference is the parent airfoil height. - - - - - Optional absolute translation of the hinge point. - This can be used to move the hinge points outside of the wing shape. - - - - - - - - - - - - - Outer shape definition of the control surface. - - - - - Definition of the outer shape of the leading edge - control surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - - - - - - - - - Outer shape definition of the spoiler control surface. - - - - - Definition of the outer shape of the control surface. - - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - - - - - - - - - Outer shape definition of the control surface. - - - - - Definition of the outer shape of the trailing Edge - control surface. - The position on the planform of the control surface is - defined by defining the eta/xsi coordinates of the inner/outer - and forward/rear border. The eta/xsi coordinates refer to the - parent. - Please find below an example for the definition of the - planform of a trailing edge device. Other controlsurfaces are - similar. - - - - - - - - - - - - - - - - - - - - - - - - - Definition of the deflection path of the control - surface. - - - - The deflection path of a control surface is described - with respect to two hinge points - one at the inner border of - the control surface and one at the outer border of the control - surface. Those two points are defined using the xsi and relative - height coordinates of the parent. Therefore those points can also - lay outbound of the control surface. Those two points defined - the hinge line, which is a straight line between the two points. - - The deflection path of the control surface is defined - within the hinge line coordinat system. This is defined as - follows: The x-hinge coordinate equals the wing x-axis. The - y-hinge coordinate equals the hinge line axis (see above; - positive from inner to outer hinge point). The z-hinge line is - perpendicular on the x-hinge and y-hinge coordinate according to - the right hand rule. The rotation of the control surface is - defined as rotation around the positive y-hinge line. - - The deflection of the is defined in any number of - steps. The deflection of the control surface is done as follows: - First the x-deflection at the inner and outer border; afterwards - the z-deflection of the inner and outer border; last the - y-deflection of the inner border. The y-deflection is only - defined at the inner border, as it is identical to the outer - border. If no values for the outer border deflection are given, - they default to the values of the inner border. - An example can be found below: - - - - - - - - - - - - - - - - - - - - - - - - - controlSurfacePerformanceMapType - - - ControlSurfacePerformanceMap type, containing a delta - performance map with aerodynamic data for a control surface. Array - order is: relativeDeflection min->max then angleOfAttack then - angleOfSideslip then altitude then machNumber. AngleOfAttack, - angleOfSideslip, altitude and machNumber are taken from the - basic performance map one level above. - - - - - - - - - - Reference to the control surface - - - - - - Relative deflection of the control surface - - - - - - - - - - - - - - - - - - - - controlSurfacePerformanceMaps - - - controlSurfacePerformanceMaps type, containing the - aerodynamic delta performance maps for one or more control - surfaces. - - - - - - - - - - - - - - - - - - - Border type for the inner and outer border of a wing - cut out - - - - Maybe applied to specifiy inner and outer border of - the cutout either via eta or rib references - - - - - - - - - - - - - - - Link to a rib definition - - - - - - Rib number in the corresponding - ribDefinitionUID - - - - - - - Spanwise location of the border at the - leading edge of the cut out - - - - - Spanwise location of the border at the - trailing edge of the cut out - - - - - - - - - - - - - - Cut out of the parents upper/lower skin due to a - control surface. - - - - Optional. Definition of the skin cut out due to a - control surface. The cut out of the skin can either be defined - by referencing to a spar uID or by defining the relative chord - values (xsi) of the cut at the inner and outer border of the - control surface. The xsi value is based on the parents chord. - For leading edge devices additional parameters can be defined. - - An example for wing cut outs can be found in the - picture below: - - - - - - - - - - - - - - - Xsi value of the inner border, where the cut - out begins. - - - - - Xsi value of the outer border, where the cut - out begins. - - - - - - Reference to a spar, defining the skin cut - out. - - - - - - - - - - - - - controlSurfaceStepType - - - - The deflection path of the control surface is defined - within the hinge line coordinat system. This is defined as - follows: The x-hinge coordinate equals the wing x-axis. The - y-hinge coordinate equals the hinge line axis (see above; - positive from inner to outer hinge point). The z-hinge line is - perpendicular on the x-hinge and y-hinge coordinate according to - the right hand rule. The rotation of the control surface is - defined as rotation around the positive y-hinge line. - - The deflection of the is defined in any number of - steps. The deflection of the control surface is done as follows: - First the x-deflection at the inner and outer border; afterwards - the z-deflection of the inner and outer border; last the - y-deflection of the inner border. The y-deflection is only - defined at the inner border, as it is identical to the outer - border. If no values for the outer border deflection are given, - they default to the values of the inner border. - An example can be found below: - - - - - - - - - - - - - - The control parameter links a generic floating point value to - a certain status of a control device (e.g. control surface, landing gear, suction - system, brake parachute, ...). See the documentation of the global CPACS-Element for - further information. - - - - - - Translation of the inner hinge line point - within the hinge line coordinate system. Defaults to zero. Not - allowed for spoilers! - - - - - Translation of the outer hinge line point - within the hinge line coordinate system. Defaults to the values - of the inner hinge line point. Not allowed for spoilers! - - - - - - Positve rotation around the hinge line, - heading from the inner to the outer border. Defaults to zero. - - - - - - - - - - - - - - Definition of the steps of the control surface - deflection path. - - - - List of steps. - - - - - - - - - - - - - - - - - - - - Control surface tracks (mechnaical link between control - surface and parent). - - - - A track generally describes the structural connection between a control surface and a wing (or parent element). For example, a track can be a flap track, a revolute joint connecting an aileron or spoiler, or the kinematics of slats on a wing. - The spanwise position of the track is defined by - etaPosition, which refers to the control surface dimensions. - - The structural properties of the track (e.g. - materials) are defined in trackStructure. - If an actuator is included into the the track, a - reference is given in actuator. - The principal kinematic of the track is defined by - setting the trackType and trackSubType. Please refer to the - tables below for setting the trackType and trackSubType - parameter. Note, those tables are not final - they are extended - continuously. - - - - Trailing edge track types - - - trackType - picture - description - trackSubType - picture - description - - - 1 - - - - - - Revolute joint; no actuators; the revolute joint is on TED hinge line. - 1 - - - - - - Revolute attached at the wings rear spar and the TEDs front spar respectively the load - carrying ribs of the TED. - - - 2 - - - - - - Revolute joint; dropped hinge; linear or rotary actuator (subtype-dependent) included. - The drive strut (if any) is defined as strut1. - 1 - - - - - - Box beam design as wing attachment; rotary drive attached at wing rear spar. - - - - - - 2 - - - - - - Wing attachment at wing rear spar; rotary drive attached at wing rear spar - - - - - - 3 - - Track mounted inside the fuselage at wing root. - - - 3 - - - - - - Upside-down, forward link in conjunction with a straight track on a fixed structure - as aft. support; including rotary drive. - 1 - - - - - - Wing attachment using a box beam design where track is mounted; rotary actuator mounted - at the wing rear spar. - - - - - - 2 - - Track mounted inside the fuselage at wing root. - - - 4 - - - - - - Straight and sloped track on a fixed structure as forward support and an upright link as - aft. support; linear or rotary actuator (subtype-dependent) included. - 1 - - - - - - Wing attachment using a box beam design where the track is mounted; rotary actuator at - the wing rear spar. - - - - - - 2 - - - - - - Wing attachment using a box beam design where track is mounted; rotary actuator mounted - on the track. - - - - - - 3 - - Track mounted inside the fuselage at wing root. - - - - - - - - - - - - - - Relative chordwise position of the track. Eta - refers to the control surface. - - - - - Type of the track. Please refer to the remarks - of the controlSrufaceTrackTypeType for details. - - - - - - - - - - - - - - - - Type of the track. Please refer to the remarks - of the controlSrufaceTrackTypeType for details. - - - - - - - - - - - - - - - - - - - - - - - - - - Control surface tracks (mechnaical link between control - surface and parent). - - - - - - - - - - - - - - - - - - - - - - Cut out of the parents structure due to a control - surface. - - - - Optional. Definition of the parents structure cut out - due to a control surface. The cut out is split into three parts: - cut out of the upper and lower skin and the definition of an - profile conecting the cut out of the upper and lower skin. - - An example for wing cut outs can be found in the - picture below: - - - - In the default configuration the cut out is as wide as - the control surface. If additional spacing is necessary inner - and outer border may be set. - - - - - - - - - - - - - - - - - - - - - - - - - controlSurfacesType - - - Definition of the outer shape, structure and deflection - of all control surfaces (flaps, slats, soiler, ailerons...) of - the wing. - - - - - - - - - - - - - - - - - - - - - costAirConditioningSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costAutomaticFlightSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costAuxilaryPowerUnitsType - - - - - - - - - - - - - - - - - - - - - - - - - costBleedAirSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costCommunicationSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costComponentsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costDeIcingSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costElectricalSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costEnginePylonsType - - - - - - - - - - - - - - - - - - - - - - - - - costEquippedEnginesType - - - - - - - - - - - - - - - - - - - - - - - - - costFireProtectionSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costFixedEmergencyOxygenSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - - costFlightControlSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costFuelSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costFurnishingElementsType - - - - - - - - - - - - - - - - - - - - - - - - - - - costFurnishingsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costFuselagesType - - - - - - - - - - - - - - - - - - - - - - - - - costHydraulicSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costInstrumentSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costLandingGearType - - - - - - - - - - - - - - - - - - - - - - - - - costLightingSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costNacellesType - - - - - - - - - - - - - - - - - - - - - - - - - costNavigationSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costPowerUnitsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - costWaterInstallationSystemsType - - - - - - - - - - - - - - - - - - - - - - - - - costWingsType - - - - - - - - - - - - - - - - - - - - - - - - - - - crashLoadCasesType - - - - - - - - - - - - - - - - - - - - - - crashLoadcaseType - - - CrashLoadcase type, containing a crash loadcase - - - - - - - - - - - - - Optional start of crash section: Default: - first frame of model - - - - - Optional end of crash section: Default: last - frame of model - - - - - Initial velocities - - - - - Initial rotations around axes, roll, pitch, - yaw - - - - - Initial rotational velocities aroud axes - - - - - - Definition of reference point to consider - rotation - - - - - AccelerationFields, usually gravity in z - - - - - - Definition of impact Surface for crash - simulation - - - - - - - - - - - - - - - - - - - - - - - crewCostType - - - - - - - - - - - - - - - - - - - - - - - - crossBeamAssemblyPositionType - - - CrossBeamAssemblyPosition type, containing the position - of a crossBeam assembly - - - - - - - - - - UID of profile based structural element to be - used as crossbeam - - - - - UID of the frame to which the crossbeam is - attached - - - - - Referenze z position of the crossbeam - - - - - - - - - - - - - - - - crossBeamStrutAssemblyPositionType - - - CrossBeamStrutAssemblyPosition type, containing a - crossBeam strut assembly position - - - - - - - - - - UID of profile based structural element to be - used as crossbeam strut - - - - - UID of the frame to which the crossbeam strut - is attached - - - - - UID of the crossbeam to which the crossbeam - strut is attached - - - - - Referenze y position of the strut at the - crossbeam intersection - - - - - angle of the strut in global yz plane - - - - - - - - - - - - - - - - cruiseRollerType - - - - - - - - - - - - - Definition of the position of the mid point of - the roll of the cruise roller. - - - - - Definition of the attachment of the cruise - roller to the parent of the flap. This is the track on which the - roll rolls during retracted flap position - - - - - Definition of the attachment of the cruise - roller to the flap. - - - - - Degree of freedom that is blocked by the - cruise roller if the flap is in retracted position. Positive = - cruise roller blockes bending in the direction of the upper skin - of the parent. Negative = cruise roller blockes bending in the - direction of the lower skin of the parent. - - - - - - - - - - - - - - cruiseRollersType - - - - - - - - - - - - - Definition of one cruise rollers/mid-span - stops. - - - - - - - - - - - - - cst2DType - - - - - - - - - - - A 2D impelmentation for Class shape - transformations. For more details look at AIAA Journal of Aircraft - Vol.45 No.1 2008 - - - - - The psi vector for definition of the class and - shape function, i.e. the points at which the CST functions will - be evaluated - - - - - N1 for the class function for the upper side - of the profile - - - - - N2 for the class function for the upper side - of the profile - - - - - B Coefficients for the Bernstein polynominal - on the upper side - - - - - N1 for the class function for the lower side - of the profile - - - - - N2 for the class function for the lower side - of the profile - - - - - B Coefficients for the Bernstein polynominal - on the lower side - - - - - Optionally, the trailingEdgeThickness of the - profile - - - - - - - - - - - - - - - - - - - - - - - curvePointType - - - Point on a curve in normalized curve coordinates. - The referenceUID must reference a one-dimensional curve such as spars. - - - - - - - - - - Relative position on the referenced line/curve. - - - - - This reference uID determines the reference curve. - If it points to a spar, then the eta value is considered to be a spar coordinate - between start (eta=0) and end (eta=1) of the spar. - - - - - - - - - - - - - cutLoadIntegrationPointsType - - - cutLoadIntegrationPoints are defined in a vector - notation, due to the high amounts of data. Usually they well be - defined inbetween the ribs. Each point must have an id. - Optionally it is possible to rotate the orientation within a - cutloadIntegrationPoint to obtain meaningful results. The - orientation is optional and relative to the CPACS coordinate - system - - - - - - - - - - - - - - - - - - - - - - - - - Additional definition of the leading edge cut out. - - - - - Optional. Definition of additional parameters, - describing the shape of the parents leading edge of the cut out - due to leading edge devices. - The parameters are described in the picture below: - - - - - - - - - - - - - - - Relative height of the most forward position of - the parents leading edge, relative to the airfoil height without - cut out. - - - - - Relative chordwise position of the most - forward position of the parents leading edge, relative to the - parents chord without cut out. - - - - - - - - - - - - - cutOutControlPointsType - - - - - - - - - - - - - - - - - - - - - - - Definition of cut out profiles. - - - - Optional, the exact shape between the upper and lower - skin cut out can be given by using cutOutProfiles. In general - cut out profiles are open profiles and not closed profiles as - e.g. wing airfoils. The placement, scaling and (partly) rotation - of the cut out profiles is fixed as the beginning and ending - point of the profile is fixed as can be seen in the two pictures - below. - - - - - - - - - - - - - - - - - Reference to the profile uID. Profiles should - be linked in profiles/structuralProfiles - - - - - Relative spanwise position of the cut out - profile. The eta coordinate refers to the control surface and - desribes the cut out profile at the leading edge of the control - surface. - - - - - Rotation of the airfoil around the control - surface middle plane normal direciotn. Reference point is the - most forward point of the airfoil. Defaults to 90°, which is - equivalent to the airfoilplacement in flight direction (along - wings-x axis). - - - - - - - - - - - - - Definition of cut out profiles. - - - - - - - - - - - - - - - - - - - - - - - - cutOutType - - - CutOut type, containing cut-outs - - - - - - - - - - Name of the cut out element - - - - - - Description of the cut out element - - - - - - Width of the cut element (absolute value) - - - - - - Height of the cut element (absolute value) - - - - - - Fillet radius of the cut element (absolute - value) - - - - - UID of a structural element that reinforces - the cut out - - - - - - - - - - - - - - Damping derivatives for positive and negative rotation - rates - - - - - 0. General overview - - This type contains the damping derivatives. They are - split up into those derivatives for positive rotation rates, - and those for negative rotation rates. - - - - 1. <positiveRates> (optional) - - Damping derivatives, calculated by positive rotation - rates. - - - - 2. <negativeRates> (optional) - - Damping derivatives, calculated by negative rotation - rates. - - - - - - - - - - - - - - - - - - - - - - - - deckType - - - Deck type, containing the data of a deck - - - - - - - - - - Name of the deck - - - - - Description of the deck - - - - - - The starting point of the deck/cabin. In a - conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object - defined by “parentUID”, which should be the fuselage. - - - - - - The starting point of the deck/cabin. In a - conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object - defined by “parentUID”, which should be the fuselage. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - decksType - - - Decks type, containing the decks of the fuselage - - - - - - - - - - - - - - - - - - - - deltaTemperatureType - - - - - - - - - - - - - - - - - - - - - - - - - - - - Design masses - - - The design mases are requerments wich can com form the - TLARs - - - - - - - - - - Take off mass - - - - - Zero Fuel mass - - - - - Maximum landing mass - - - - - Maximum ramp mass (the maximum weight - authorised for the ground handling) - - - - - - - - - - - - - Design parameter definition - - - Contains a the values of a parameter and its uid as reference. - - - - - - - - - - - - - - - - - - - - - - Design parameters list - - - Contains a list of all design parameters. - - - - - - - - - - - - - - - - - - - - Design space definition - - - Contains the definition of the design space. - - - - - - - - - - - - - - - - - - - - - - - Design study definitions - - - Contains the data of design studies definitions. - - - - - - - - - - - - - - - - - - - - directOperatingCostType - - - - - - - - - - - - - - - - - - - - - - - - - - - - divergenceCaseType - - - DivergenceCase type, containing a case for aeroelastic - divergence analysis - - - - - - - - - - Mach number of divergence case - - - - - - Divergence stagnation pressure - - - - - - - - - - - - - - divergenceCasesType - - - DivergenceCases type, containing the cases for - aeroelastic divergence analysis - - - - - - - - - - - - - - - - - - - doorAssemblyPositionType - - - DoorAssemblyPosition type, containing the position of a door - assembly - - - - - - - - - - - - optional definition of door type (restricted to pax, - service, emergency, cargo) - - - - - - - - - - - - - - - UID of the door element - description - - - - - UID of the forward door frame - - - - - UID of the backward door frame - - - - - UID of the stringer at the upper door - edge - - - - - UID of the stringer at the lower door - edge - - - - - Lower height of the door with respect to the floor. - (Information necessary for boarding and evacuation analysis not - necessarily linked to structures) - - - - - Minimum widh of the door element. (Information - necessary for boarding and evacuation analysis not necessarily - linked to structures) - - - - - Minimum height of the door element. (Information - necessary for boarding and evacuation analysis not necessarily - linked to structures) - - - - - Door on right side of the fuselage = 1; on the left = - -1. (Information necessary for boarding and evacuation analysis not - necessarily linked to structures) - - - - - - - - - - - - - - doorCutOutType - - - CutOut type, containing cut-outs - - - - - - - - - - Name of door cutout element - - - - - Description of door cutout - element - - - - - Fillet radius of door cutout - element - - - - - Reference UID to the description of a DSS (door - surround structure) - - - - - - - - - - - - - - doorSurroundStructurePositionType - - - DoorSurroundStructurePosition type, containing the position of a - door surround structure - - - - - - - - - - - - number of bays effected by DSS in front of - door - - - - - number of bays effected by DSS in behind of - door - - - - - number of bays effected by DSS - - - - - number of bays effected by DSS - - - - - - - - - - - - - - doorSurroundStructuresAssemblyType - - - doorSurroundStructuresAssembly type, containing - dorrSurroundStructure definitions - - - - - - - - - - - - - - - - - - - doorsType - - - Doors type, containing doors - - - - - - - - - - - - - - - - - - - driveSystemType - - - DriveSystem Type, defining a drive system (combination - of transmissions/gearboxes and shafts and their links to engines - and rotors) of a rotorcraft model. - - - - - - - - - - - - - - - - - - - - - driveSystemsType - - - DriveSystems Type, containing all the drive systems - (combination of transmissions/gearboxes and shafts and their - links to engines and rotors) of a rotorcraft model. - - - - - - - - - - - - - - - - - - - dynamicAircraftModelAnalysisType - - - - - - - - - - - - - - - - - - - - - - dynamicAircraftModelCoordinatesType - - - - - - - - - - - - - - - - - - - - - - - - - Emissivity map, containing the diffuse emissivity of a material at different spectral lengths. - - - The emissivity of a material can vary with the spectral wave length. - The vectors diffuseEmissivity and waveLength must have the same size to be valid. - The data should be linearly interpolated. - - - - - - - - - - - Wave length in [m] - - - - - Diffuse emissivity of the material - - - - - - - - - - - - - engineAnalysisType - - - - - - - - - - - - - Thrust at takeoff - - - - - Fan pressure ratio at takeoff - - - - - - Bypass ratio at takeoff - - - - - overall pressure ratio at takeoff - - - - - - Maximum rotations per second, shaft 1 - - - - - - Maximum rotations per second, shaft 2 - - - - - - Design tip relative mach number (FAN) - - - - - - DryMass of engine - - - - - - - - - - - - - - Definition of global geometry parameters of the engine - fan. - - - - - - - - - - - - - Inner radius of the fan. - - - - - Outer radius of the fan. - - - - - - - - - - - - - Definition of the global engine geometry. - - - - All engine geometry definitions refer to the engine - coordinate system. The engine coordinate system has its orgine - in the middle of the fan plan. The positive x-axis is heading to - the rear, the positive z-axis to the top and the y-axis - according to the right hand rule. - - - - - - - - - - - length of engine - - - - - diameter of engine - - - - - dProp - - - - - Chordlength of a fan blade - - - - - - - - - - - - - - - - - engineGlobalType - - - EngineGlobal type, containing global engine data - - - - - - - - - - - Concept of engine - - - - - - - - - - - - - - - Year of first certification - - - - - - Rotation direction of the engine if looking at - it from the front, i.e. from propeller/fan to exhaust - - - - - - - - - - - - - - Hub to tip ratio - - - - - Number of rotor blades of fan - - - - - - Number of outlet guiding vanes - - - - - - Rotor stator spacing (relative to chordlength) - - - - - - - - - - - - - - Definition of one engine mount. - - - - - - - - - - - - - Name of the engine mount. - - - - - Description of the engine mount. - - - - - - position of the engine mount refering to the - engine coordinate system. - - - - - - UID of the engine mount. - - - - - - - - - - - - List of all engine mounts. - - - - - - - - - - - - - - - - - - - - - - Definition of the engine nacelle type. - - - - The engine nacelle is currently located together with - the engine. It gives a simple description of the outer shell of - the engine. All values are defined according to the base area, - center point of the fan(i.e. negative values can occur in the - definition) In most cases there will be a bypass engine. For - non-bypass or mixed engines ignore the bypass nozzle. For further - information on the geometric setup, please refer to the picture - below. - - - - - - - - - - - - - - - - - - - - - - - - - - - - enginePerformanceMapType - - - EnginePerformanceMap type, containing a perfomance map - with engine data - - - - - - - - - - - - - - Flight Level - - - - - Mach number - - - - - Absolute thrust [N] - - - - - Fuel mass flow - - - - - Speed at core engine nozzle - - - - - - Total temperature at core engine nozzle - - - - - - Mass flow through core engine nozzle - - - - - - Speed at bypass nozzle - - - - - Total temperature at bypass nozzle - - - - - - Mass flow through bypass nozzle - - - - - - Percent of n1Max, shaft 1 - - - - - Percent of n2Max, shaft 2 - - - - - Fan pressure ratio - - - - - Fan efficiency - - - - - Turbine entry total temperature - - - - - - Emission index Carbon Monoxide - - - - - - Emission index Nitrogen Oxide - - - - - - Emission index Sulfur Oxide - - - - - - Emission index Soot - - - - - Emission index unburned hydrocarbon - - - - - - air density at core outlet 8 - - - - - - air density at bypass outlet 18 - - - - - - area at core outlet - - - - - area at bypass outlet - - - - - - - - - - - - - - enginePerformanceMapsType - - - - - - - - - - - - - - - - - - - - - - enginePositionType - - - EnginePosition type, containing data for a single - engine - - - - - - - - - - Name of the engine - - - - - Description of the engine - - - - - Reference to the used engine - - - - - - Component, to which the engine is mounted - - - - - - - - - - - - - - - - - - - - - - - - - - - Engine references - - - EnginePositions type, containing a reference to the - used engines and their positions at the configuration - - - - - - - - - - - - - - - - - - - Definition of one engine pylon. - - - - - - - - - - - - - Name of the engine pylon. - - - - - Description of the engine pylon. - - - - - - UID of the parent (normaly wing or fuselage). - - - - - - - - - - - - UID of the engine pylon. - - - - - - - - - - - - - - - - - - - - - - - Engine pylons - - - - - - - - - - - - - - - - - - - - - - Definition of the engine spinner geometry. - - - - - - - - - - - - - Most forward x-position of the spinner. - - - - - - X-position of the spinner base. - - - - - - Radius of the spinner at the base position. - - - - - - - - - - - - - - engineType - - - Engine type, containing engine data. - - - - - - - - - - Name of engine - - - - - Description of engine - - - - - Scaling of engine take-off thrust - - - - - - - - - - - - - - - - - - - Engines - - - Engines type, containing complete engine configurations - - - - - - - - - - - - - - - - - - - - etaIsoLineType - - - Iso line described by point of the same eta coordinate. - Can be either segment or component segment coordinates. - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta value is considered to be in segment - eta coordinate; if it points to a componentSegment, - then componentSegment eta coordinate is used. - - - - - - - - - - - - - fleetType - - - Each fleet can be divided into sub fleet groups - - - - - - - - - - Name of fleet - - - - - Description of the fleet - - - - - Description of sub-fleets. - - - - - - - - - - - - - - flightAnalysisType - - - - - - - - - - - - - - - - - - - - - - - Flight dynamics - - - - - - - - - - - - - - - - - - - - - - - - Linear model parameters - - - - - - - - - - - - - - - - - - - - - - - - - - Trim result - - - - - - - - - - - Mach number - - - - - - - True airspeed - - - - - - - Angle of attack - - - - - - - Altitude - - - - - - - - - - - - - - Load case - - - This node defines the load case - - - - - - - - - - - Name of the load case - - - - - - - Description of the load case - - - - - - - - - - - - - - - - - Load case specification - - - Input values defining a load case - - - - - - - - - - - Environment - - - - - - - Altitude above sea level - - - - - - - Mach number - - - - - - - UID of the aerodynamic loads (aeroCase) - - - - - - - - Controller description. Note: Since there is no controller description in CPACS yet, the expected content of this string element has to be defined individually for each project. - - - - - - - - - - - UID referencing the mass state of aircraft for this load case - - - - - - - - - - - - - - Flight load cases - - - - - - - - - - - - - - - - - - - - - - Flight loads - - - Loads resulting from the load case analysis - - - - - - - - - - - - - - - - - - - - - Load conditions - - - Inertia load conditions acting on the aircraft - - - - - - - - - - - Description - - - - - - - Safety factor applied on the loads - - - - - - - - Rotational rates around centre of gravity - - - - - - - Enumeration flag stating the typ of the load - case (i.e. limit or ultimate loads) - - - - - - - - - - - - - Angle of sideslip [deg] - - - - - - - Angle of attack [deg] - - - - - - - - - - - - - - - - Flight point definition for load case analysis - - - Description of the aircraft's flight state for - this load case. - - - - - - - - - - - - Environmental conditions - - - - - - - Altitude above sea level - - - - - - - Mach number - - - - - - - - - - - - - - Accelerations - - - Translational or rotational accelerations acting - on the aircraft - - - - - - - - - - - Rotational accelerations acting around aircraft centre of gravity [deg/s^2] - - - - - - - - - - - - - Load factors - - - - - - - - - - - - - - Load factor in x-direction - - - - - - - Load factor in y-direction - - - - - - - Load factor in z-direction - - - - - - - - - - - - - - Load case superposition - - - List of uIDs referencing load cases that are superimposed to the current load case - - - - - - - - - - - - UID reference to another load case to be superimposed - - - - - - - - - - - - - - Gust definition - - - The coordinate system of the gust corresponds to the CPACS coordinate system. - - - - - - - - - - Parameters describing the shape of the gust - - - - - - - - - - - - - - - - - Angle between gust and vehicle [deg] (e.g., 0deg: from right to left; 90 deg: downwards; 180deg: from left to right; 270/-90deg: upwards) - - - - - - - Gust length: length of ramp or gradient distance of 1-cos gust - - - - - - - Gust velocity - - - - - - - - - - - - - - Flight path - - - Definition of a flight path by points of longitude, latitude and a descriptive waypoint code. - - - - - - - - - - Vector of waypoint codes. If waypoint codes are not available put empty items into the waypoint string - - - - - Vector of waypoint latitude values in [deg] - - - - - Vector of waypoint longitude values in [deg] - - - - - Indicates the type of the way point. - - - - - - - - - - - - - - - - - - - - Performance case - - - - - - - - - - - - - - Name - - - - - - - Description - - - - - - - UID of flight performance requirement - - - - - - - - - - - - - - - - - - - - - - - Performance cases - - - List of performance cases - - - - - - - - - - - - - - - - - - - - Results of the landing analysis - - - - - - - - - - - - - Determined landing distance. - - - - - - Determined ground phase distance. - - - - - - - - - - - - - - Results of the take-off analysis - - - - - - - - - - - - - Main element containing the results for - take-off calculations optimized for min-imum liftoff speed - VLOFmin. - - - - - Main element containing the results for - take-off calculations optimized for min-imum safety speed V2min. - - - - - - - - - - - - - - flightPointType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Flight systems - - - - - - - - - - - - - - - - - - - - - - flightType - - - Flight type, containing data of a scheduled flight - - - - - - - - - - MissionUID for the flights mission definition - - - - - ModelUID of the aircraft appointed to perform the flight - - - - - Departure day of the flight - - - - - Time of departure - the time is defined as SOBT (Scheduled Off-Block Time) / STD (Scheduled Time of Departure) - - - - - Arrival day of the flight - - - - - Time of arrival - the time is defined as SIBT (Scheduled In-Block Time) / STA (Scheduled Time of Arrival) - - - - - Reference to the operating airline of a flight - - - - - - - - - - - - - - - Flights - - - Flighs type, containing all flight definitions - - - - - - - - - - - - - - - - - - - - floorPanelAssemblyPositionType - - - FloorPanelAssemblyPosition type, containing a floor - panel assembly position - - - - - - - - - - x coordinate of the begin of the floor panel - (absolute value) - - - - - x coordinate of the end of the floor panel - (absolute value) - - - - - UID of the first long. floor beam to be - connected to the floor panel - - - - - UID of the second long. floor beam to be - connected to the floor panel - - - - - UID of structural sheet element used for the - floor panel - - - - - - - - - - - - - - - floorPanelsType - - - FloorPanels type, containing floor panel definitions - - - - - - - - - - - - - - - - - - - - Flying qualities - - - Provides a list of flying qualities cases - - - - - - - - - - - - - - - - - - - - - Flying qualities case - - - - - - - - - - - - - Name - - - - - Description - - - - - Aircraft Class; Class 1 small light aircraft; - Class 2 medium weight aircraft, low to medium maneuverability; - Class 3 large, heavy aircraft, low to medium maneuverability; - Class 4 high maneuverability aircraft - - - - - Flight Phase Category; Category A Non-terminal - flight phases requiring maneuvering, precision tracking, or - precise flight-path control (e.g. air-to-air combat, terrain - following). Category B Non-terminal Flight Phases with gradual - maneuvers and without precision tracking, although accurate - flight-path control may be required (e.g. climb, cruise). - Category C Terminal Flight Phases are normally accomplished - using gradual maneuvers and usually require accurate flight-path - control (takeoff, approach and landing). - - - - - main element containing longitudinal transfer - functions - - - - - main element containing lateral directional - transfer functions - - - - - main element containing characteristic - parameters of the handling qualities criteria - - - - - - main element containing handling qualities - ratings - - - - - - - - - - - - - - fqCharParametersType - - - - - - - - - - - - - static margin [-] - - - - - main element containing characteristic - parameter of phugoid damping - - - - - main element containing characteristic - parameters of short period mode criteria - - - - - main element containing characteristic - parameters of roll oscillation criterion - - - - - coupling of roll and spiral mode: normal = no - coupling of roll and spiral mode coupled = coupling of roll and - spiral mode - - - - - main element containing characteristic - parameters of lateral eigenvalues - - - - - main element containing characteristic - parameters of effective roll time constant criterion - - - - - - main element containing characteristic - parameters of roll performance criterion - - - - - - - - - - - - - fqEiglatType - - - - - - - - - - - - - natural frequency of dutch roll mode [rad/s] - - - - - - damping of dutch roll mode [-] - - - - - - roll time constant [s] - - - - - time to double of spiral mode [s] - - - - - - ratio of bank to sideslip angle [-] - - - - - - natural frequency of coupled rollspiral motion - [rad/s] - - - - - damping ratio of coupled roll-spiral motion - - - - - - product of roll-spiral damping and natural - frequency [rad/s] - - - - - handling qualities level of roll time constant - - - - - - handling qualities level of roll spiral mode - - - - - - - - - - - - - - fqLateralType - - - - - - - - - - - - - numerator of transfer function roll control - surface deflection to bank angle - - - - - numerator of transfer function roll control - surface deflection to yaw rate - - - - - numerator of transfer function roll control - surface deflection to sideslip angle - - - - - numerator of transfer function roll control - surface deflection to bank angle of reduced 4th order system - - - - - - numerator of transfer function roll control - surface deflection to sideslip angle of reduced 4th order system - - - - - - numerator of transfer function yaw control - surface deflection to yaw rate - - - - - numerator of transfer function yaw control - surface deflection to sideslip angle - - - - - numerator of transfer function roll stick - input to roll rate - - - - - numerator of transfer function roll stick - input to yaw rate - - - - - numerator of transfer function roll stick - input to bank angle - - - - - numerator of transfer function roll stick - input to sideslip angle - - - - - numerator of transfer function pedal input to - roll rate - - - - - numerator of transfer function pedal input to - yaw rate - - - - - numerator of transfer function pedal input to - bank angle - - - - - numerator of transfer function pedal input to - sideslip angle - - - - - denominator of lateral motion - - - - - - denominator of lateral motion of reduced 4th - order system - - - - - - - - - - - - - fqLongitudinalType - - - - - - - - - - - - - numerator of transfer function pitch stick - input to pitch rate - - - - - numerator of transfer function pitch control - surface deflection to pitch angle - - - - - numerator of transfer function pitch stick - input to pitch angle - - - - - numerator of transfer function pitch stick - input to angle of attack - - - - - numerator of transfer function pitch stick - input to vertical load factor - - - - - denominator of longitudinal motion - - - - - - - - - - - - - - fqPhugoidType - - - - - - - - - - - - - damping ratio of phugoid mode [-] - - - - - - time to double amplitude of unstable phugoid - mode [s] - - - - - - - - - - - - - fqRatingsType - - - - - - - - - - - - - handling qualities level of phugoid damping - - - - - - handling qualities level of C* criterion - - - - - - main element containing handling qualities - levels of short period mode - - - - - main element containing handling qualities - levels of roll oscillation criterion - - - - - main element containing handling qualities - levels of lateral eigenvalues - - - - - handling qualities level of effective roll - time constant - - - - - handling qualities level of roll performance - - - - - - - - - - - - - - fqRollPerfType - - - - - - - - - - - - - time to reach critical bank angle [s] - - - - - - critical bank angle that has to be reached - [deg] - - - - - - - - - - - - - fqRoloscType - - - - - - - - - - - - - ratio of oscillatory component of the roll - rate to the average roll rate [-] - - - - - phase angle of dutch roll oscillation in - sideslip [deg] - - - - - phase angle between roll rate and sideslip in - dutch roll mode [deg] - - - - - ratio of first minimum roll rate to first - maximum [-] - - - - - handling qualities level of ratio of - oscillatory component of roll rate to average roll rate - - - - - - - - - - - - - - fqShortPeriodType - - - - - - - - - - - - - steady state normal acceleration change with - angle of attack [g/rad] - - - - - short period natural frequency of reduced - order system [rad/s] - - - - - short period damping ratio of reduced order - system [-] - - - - - equivalent pitch time delay of reduced order - system [s] - - - - - handling qualities level of CAP criterion - - - - - - - - - - - - - - fqTreffType - - - - - - - - - - - - - effective roll time constant [s] - - - - - - time where tangent of bank angle step response - is placed [s] - - - - - - - - - - - - - frameType - - - frame type, containing frame definition (V1.5+) - - - - - - - - - - - - - - - - - - - - - framesAssemblyType - - - FramesAssembly type, containing frames assembly - - - - - - - - - - - - - - - - - - - - freePathType - - - - - - - - - - - - - - - - - - - - - - - mass - - - - - - - - - - - - - - - - - - - - - - Fuels - - - fuelType containing data for fuels - Can be used as a catalog for different (liquid) fuel - types - - - - - - - - - - - - - at 15deg C - - - - - - - - - - - - - - - - - - - - Fuels - - - fuelType containing data for fuels - - - - - - - - - - - - - - - - - - - fuselageAeroPerformanceType - - - fuselageAeroPerformance type, containing perfomance - maps with aerodynamic data of a fuselage. - - - - - - - - - - Reference to the uID of the analysed fuselage - - - - - - References used for the calculation of the - force and moment coefficients of the fuselage (in the fuselage - axis system!) - - - - - Calculated aerodynamic performance maps of the - fuselage - - - - - - - - - - - - - fuselageCutOutType - - - fuselageCutOut type, containing a fuselage cutout - definition - - - - - - - - - - Name of the cutout - - - - - Description of the cutout - - - - - X position of the cutout center point - - - - - - Y offset of the cutout reference point - - - - - - Z offset of the cutout reference point - - - - - - Angle in degrees of the vector pointing from - the cutout reference point to the cutout center point, measured - relative to the direction of the fuselage z axis. - - - - - - Coordinates of the unit vector defining the - direction of extrusion - - - - - Coordinates of the unit vector defining the - y-axis of the local cutout coordinate system. Must be normal to - the orientationVector. - - - - - This value is used to define the width of the - cutout - - - - - This value is used to define the height of the - cutout - - - - - This value is used to define the width of the - cutout - - - - - This value is used to define the height of the - cutout - - - - - Fillet radius of the cut element (absolute - value) - - - - - Cutout type. Determines the type of the cutout - and how it is treated by the tools. Possible values: - ("window"|"door"|"ramp") - - - - - - - - - - - - - - - - - - - - - - - - - - fuselageCutOutsType - - - fuselageCutOuts type, containing fuselage cutouts - - - - - - - - - - - - - - - - - - - - fuselageElementType - - - FuselageElement type, containing fuselage element data - - - - - - - - - - - Name of fuselage element - - - - - Description of fuselage element - - - - - - Reference to a fuselage profile - - - - - - - - - - - - - - - - fuselageElementsType - - - FuselageElements type, containing the elements of a - fuselage section - - - - - - - - - - - - - - - - - - - Definition of one fuselage fuel tank. - - - The definition of fuselage tanks is still preliminary. - Currently, there is no link to any structural elements - - - - - - - - - - - Name of the fuselage fuel tank. - - - - - - Description of the fuselage fuel tank. - - - - - - Link to the tank geometry defined by a compartment. - - - - - - - - - - - - - - - - - - - List of fuselage fuel tanks. - - - - - - - - - - - - - The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. -The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - - - fuselageProfilesType - - - FuselageProfiles type, containing fuselage profile - geometries. See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - - - fuselageSectionType - - - FuselageSection type, containing fusleage section and - element data - - - - - - - - - - Name of fuselage section - - - - - Description of fuselage section - - - - - - - - - - - - - - - - - fuselageSectionsType - - - FuselageSections type, containing fuselage sections - - - - - - - - - - - - - - - - - - - - fuselageSegmentType - - - FuselageSegment type, containing data of a fuselage - segment - - - - - - - - - - Name of fuselage segment - - - - - Description of fuselage segment - - - - - - Reference to element from which the segment - shall start - - - - - Reference to element at which the segment - shall end - - - - - Optional and additional guidecurves to shape - the outer geometry. - - - - - - - - - - - - - - fuselageSegmentsType - - - FuselageSegments type, containing fuselage segment - definitions (from sections and elements) - - - - - - - - - - - - - - - - - - - fuselageStructureType - - - FuselageStructure type, containing data of the fuselage's - structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fuselageType - - - - Fuselage type, containing all data related to a - fuselage - - - - - - - - - - - - - - - Name of fuselage - - - - - - - Description of fuselage - - - - - - - UID of part to which the fuselage is - mounted (if any) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fuselagesAeroPerformanceType - - - fuselagesAeroPerformance type, containing - fuselagesAeroPerformance - - - - - - - - - - - - - - - - - - - Fuselages - - - Fuselages type, containing the fuselages of the - configuration - - - - - - - - - - - - - - - - - - - This type contains a vector of deflection values for a - single gear - - - - - 0. General overview - - In this type, a vector of deflections of a single - gear is specified. - - - - 1. - <gearUID> - (mandatory) - - - A reference to a gear from the aircraft model - - - - - 2. - <controlParameters> - (mandatory) - - - A vector of control parameters of the selected - gear - - - - - - - - - - - - - Reference to a gear - - - - - Control parameters of the gear - - - - - - - - - - - - - - This type contains a list of gears and their deflection - vectors - - - - - 0. General overview - - In this type, a list of gears is defined. - - - - - 1. - <gear> - (mandatory) - - - One of these nodes per deflected gear is required - here. - - - - - - - - - - - - - - - - - - - - - - stringerFramePositionType - - - stringerFramePosition type, containing individual - stringer / frame postion definition (CPACS V2.1+) - - - - - - - - - - - - - - - - - - - - - Continuity definition for profile extrusion: - 0= C0 (allows sharp edges, default), 2= C2 (defines curvature - continuity) - - - - - - - - - - - - - Definition of interpolation between different - profiles: 0= no interpolation 1= interpolation of strcutural - profile - - - - - - - - - - - - - - - - - - - - - - generalStructuralMemberType - - - - - - - - - - - - - - - - - - - - - - - - generalStructuralMembersAssemblyType - - - generalStructuralMembersAssembly type, containing - structural member assemblys - - - - - - - - - - - - - - - - - - - genericCostType - - - - - - - - - - - - - - - - - - - - - - - - genericGeometricComponentType - - - - In some cases additional geometric components need to - be linked to a CPACS, but these components are not yet handled by - CPACS explicitly. For example, a belly fairing and/or external - tanks. - A generic geometric component may be applied to include - such a geometry from an external file (preferably STEP) in the - context of the overall aircraft. - - - - - - - - - - - - - - Name of genericGeometricComponent - - - - - - Description of genericGeometricComponent - - - - - - UID of part to which the component is mounted - (if any) - - - - - - - - - - - - - - - - - - - - - - - - - - - Generic geometric components - - - - - - - - - - - - - - - - - - - - - - mass - - - genericMassType, describing mass, inertia and CoG data. - - - - - - - - - - - name - - - - - description - - - - - parentUID - - - - - mass value - - - - - mass loaction values (x,y,z) - - - - - - mass orientation values - - - - - - - - - - - - - - - genericSystemsType - - - Node for geometrical layout of system components - based on simple geometric shapes - - - - - - - - - - - - - - - - - - - Generic system type containing describing the basic dimensions of a system component using simple geometric shapes - - - - The generic base types must be one of the following cone|sphere|cube|cylinder. The origin of the shapes is at the center of volume for cube, sphere and cylinder. Since the cone is constructued from a cylindric shape, its origin is at the same location as the origin of the basic cylinder, although not any longer the center of volume due to scaling of one side. While cube and sphere are symmetrical in all three axis, cylinder and cone are standing upright in the direction of cpacs z-axis. The tip of the cone is located in direction of the positive z-axis. The figure below illustrates the default position and orientation of the different shapes. Note that the cube, cylinder and sphere were moved along the x-axis for demonstration by 2, 4 and 6 meters respectively. - For spheres the default diameter is 1m. Cubes have a length of 1m in all three dimensions. Cylinders have a length of 1m and a diameter of 1m for the circular cross section. The cone is a cylinder with the top face scaled down to zero. - - - - - - - - - - - - - - - Name of the system component. - - - - - Description of the system component. - - - - - Enum for selecting the basic shape of the - component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - geographicPointConstraintType - - - Geographic point constraint, containing a longitude, latitude, altitude data triplet. - - - - - - - - - - Longitude coordinate 0-360 - - - - - Latitude coordinate 0-360 - - - - - Altitude in meters - - - - - - - - - - - - - geographicPointType - - - Geographic point type, containing a longitude, latitude, altitude data triplet. - - - - - - - - - - Longitude coordinate 0-360 - - - - - Latitude coordinate 0-360 - - - - - Altitude in meters - - - - - - - - - - - - - - airfoilAeroPerformanceType - - - airfoilAeroPerformance type, containing perfomance maps - with aerodynamic data of an airfoil. - - - - - - - - - - References used for the calculation of the - force and moment coefficients - - - - - Calculated aerodynamic performance maps of the - full configuration - - - - - - - - - - - - - globalBeamPropertiesType - - - globalBeamPropertiesType, containing the global beam - properties such as EA, EI, mass - - - - - - - - - - - - - - - - - - - - - - - - - - - Ground load Cases - - - - - - - - - - - - - - - - - - - - - - guideCurveProfileGeometryType - - - - A guide curve profile is defined by a profile name, an - optional description and a 3-dimensional relative pointlist with - all three coordinates mandatory. For typical profiles, one of - the coordinate vectors contains only "0" entries. All point - coordinates are transferred to the global coordinate system. - First and last point may, but need not to, be identical. - - The points have to be ordered in a mathematical - positive sense. - A profile can be symmetric. In that case the profile - is interpreted as being not closed and will be closed by - mirroring it on the symmetry plane. - Curves have to go continuously over the whole wing or - fuselage - Connection of guide curves from segment to segment - - - - - - - - Please note, currently it is not possible to apply any - means of class based transformation in the description. However, - this may be an addition for the future. - - - - - - - - - - - Name of profile - - - - - Description of profile - - - - - - - - - - - - - - - - - - - - - - - - - - guideCurveProfilesType - - - Guide Curve Profiles type. This type is used to - describe guide curves that enable designers to create a geometry - that deviates from a standard loft. - - - - - - - - - - - - - - - - - - - - Guide Curve Type - - - - A guide curve may be used to alter the shape of the - outer geometry and "guide" the loft. - The guide curve profiles are defined in the guideCurveProfileGeometryType. - Their use on wing and fuselage components is illustrated in the image below. - - - - - - - - - - - - - - - Name of guide curve - - - - - Description of guide curve - - - - - Reference to a guide curve profile - - - - - - For the first segment fromGuideCurveUID is not - a valid entry! For the first guideCurve - fromRelativeCircumference must be applied! fromGuideCurveUID is - exclusive. - - - - - - Reference to the previous guide curve from - which this guide curve shall start. - - - - - - Continuity definition for geometry - generation. Possible options: C0, C1 from previous, C2 from - previous, C1 to previous, C2 to previous - - - - - - - - - - - - - - - - - - - Reference to the relative circumference - position from which the guide curve shall start. Valid values - are in the interval -1.0...1.0. - - - - - - Tangent at first point - - - - - - - - The relative circumference - position at which the guide curve shall end. Valid values - are in the interval -1.0...1.0. - - - - - - Tangent at last point - - - - - - Local direction along which the relative x-coordinates of - the guide curve points are defined. For the wing the default is - the wing's local x-axis, for the fuselage its the fuselage's local z-axis. - - - - - - - - - - - - - - - Guide Curves Type - - - Guide Curve type. This type is used to describe guide - curves that enable designers to create a geometry that deviates - from a standard loft. - - - - - - - - - - - - - - - - - - - hingeMomentsMapType - - - hingeMomentsMap type, containing a hinge moments map - with aerodynamic data. Array order is: angleOfAttack min->max - then angleOfSideslip then reynoldsNumber then machNumber. - All coefficients in the aeroperformanceMap relate to - the CPACS coordinate system. See documentation of the - CPACS-Element for further information. - - - - - - - - - - Name of the AeroPerformanceMap. - - - - - - Description of the AeroPerformanceMap. - - - - - - Mach number - - - - - Reynolds Number - - - - - Sideslip angle - - - - - Angle of attack - - - - - - - - - - - - - - htpFwdInterfaceDefType - - - Definition of the interface of forward HTP attachment - - - - - - - - - - Definition of the forward HTP attachment - interface - - - - relative width of reinforcement at fwd HTP - attachment, between 0.0 and 1.0 - - - - - relative width of plate at fwd HTP attachment - (only applicable for Type1 model), between 0.0 and 1.0, smaller - than htpPlateWidth - - - - - UID of panel element at HTP forward attachment - in x-direction (shell elements) - - - - - UID of panel element at HTP forward attachment - in z-direction (shell elements) - - - - - UID of reinforcements for panel element at HTP - forward attachment in z-direction (beam elements) - - - - - - UID of the element to fix HTP to fuselage - (beam elements) - - - - - - - - - - - - - - htpInterfaceDefType - - - Definition of the interface of HTP - - - - - - - - - Definition of the HTP interface - - - - - UID of the fuselage frame at the forward HTP - attchment - - - - - - UID of the fuselage frame at the backward HTP - attchment - - - - - - maximum HTP deflection (nose up in - degrees) - - - - - - maximum HTP deflection (nose down in - degrees) - - - - - - angle of the reinforcements at backward HTP - attchment - (in degrees) - - - - - - Defines area (absolute) in x-direction around - htpFrame2UID where the HTP attachmentpoint has correct position - ==> check and potentially warning message - - - - - Defines area (absolute) in y-direction around - the - outer edge of htpFrame2UID where the HTP attachmentpoint has correct - y-position ==> check and potentially warning - message - - - - - - Defines allowed z-position for rear HTP - attachment - relativ to total frame height ==> check and potentially warning - message ==> check and potentially warning - message - - - - - - Definition of HTP structural - elements - - - - - - Definition of HTP forward attachment to - structure - - - - - - - - - - - - - - - htpStructElemDefType - - - definition of structural elements in HTP attachment - - - - - - - - - - Definition of tailplane attachment area - (Standard Configuration) - - - - UID of structural element for HTP front - crossbeams - - - - - UID of structural element for HTP rear - crossbeams - - - - - UID of structural element for HTP diagonal - beams - - - - - UID of structural element for HTP side beams - - - - - - UID of structural element for upper HTP cutout - reinforcement beams, also used for lower cutout reinforcement, - when not explicitely defined - - - - - UID of structural element for lower HTP cutout - reinforcement beams (optional) - - - - - - - - - - - - - - indirectOperatingCostType - - - - - - - - - - - - - - - - - - - - - - interConnectionStrutAttachmentType - - - - - - - - - - - - - Definition of the position of the attachment - joint in relative coordinates. - - - - - Material settings of the attachment. - - - - - - - - - - - - - - interconnectionStrutType - - - - - - - - - - - - - uID of control surface where this flap is - attached to by the interconnection strut. - - - - - Material settings of the strut (if strut is - moddeled as a simple strut). - - - - - Definition of the attachment on this control - surface. - - - - - Definition of the attachment on the other - control surface - - - - - Free path in positive (tensil) and negative - (compression) direction before interconnection strut blocks. - - - - - - - - - - - - - - - interconnectionStrutsType - - - - - - - - - - - - - Definition of one interconnection strut. - - - - - - - - - - - - - - intercostalPositionType - - - intercostalPosition type, containing the position of intercostals - in DSS - - - - - - - - - - - - UID of the frame at which intercostal - starts - - - - - UID of the forward door frame - - - - - UID of the door - - - - - non-dimensional value ranging between 0 and 1 - - - - - - UID of profileBasedStructuralElement used for - intercostal - - - - - - - - - - - - - - IntercostalsAssemblyType - - - IntercostalsAssembly type, containing intercostal - definitions - - - - - - - - - - - - - - - - - - - structuralElementsConnectionsType - - - StructuralElementsConnections type, containing - connections between structural elements - - - - - - - - - - Flag for automatic generation of interface - definitions (draft version) - - - - - - - - - - - - - - - landingGearInterfaceDefinitionsType - - - CenterFuselage landing gear interface definitions - - - - - - - - - - - - - - - - - - - - - - - - - - keelbeamType - - - HighWingCenterFuselage / Keelbeam definition between - mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lateralPanelsType - - - HighWingCenterFuselage / lateral Panel definition - between mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - - - - - longFloorBeamConnectionType - - - HighWingCenterFuselage / Long. floor beam connection - - - - - - - - - - - - - - - - - - - - - centerFuselageMainFramesType - - - High wing main frame definition, containing mainframe - UIDs - - - - - - - - - - - - - - - - - - - - - - - pressureFloorType - - - High Wing Center Fuselage / pressure floor definition - between mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - - sideboxType - - - HighWingCenterFuselage / side box definition between - mainframe1 und mainframe2 - - - - - - - - - - - - - - - - - - - - - - Landing gear position safety margins - - - LandingGearPositionSafetyMargins type, containing the - safety margins of the gear due to its position - - - - - - - - - - Safety margin for landing gear x position - regarding tail clearance at takeoff pitch angle - - - - - - Safety margin for landing gear x position to - avoid tail dropping down during touchDown and ground maneuvering - - - - - - Safety margin for landing gear y position to - avoid wing tip dropping down during ground maneuvering - - - - - - Safety margin for landing gear y position - regarding wingtip or engine nacelle clearance at a certein roll - angle - - - - - - - - - - - - - Landing gears - - - Contains a list of landing gears. - - - - - - - - - - - - - - - - - - - Landing gears - - - LandingGear type, containing the definition of nose, - main and skid gears. - - - - - - - - - - - - - - - - - - - - - Trailing edge device of the wing. - - - A leadingEdgeDevice (LED) is defined via its outerShape - relative to the componentSegment. The WingCutOut defines the area - of the skin that is removed by the LED. Structure is similar to - the wing structure. The mechanical links between the LED and the - parrent are defined in tracks. The deflection path is described - in path. Additional actuators, that are not included into a - track, can be defined in actuators. - Leading and trailing edge are defined by the outer - shape of the wing segments, i.e. the trailing edge of a - trailingEdgeDevice is the trailing edge of the wing. This is also - valid for kinks that are present in the wing but not explicitly - modeled in the control surface. - The edges of the control surface within the wing are a - straight line in absolute coordinates! Hence, there needs to be a - straight connection between the eta-wise outer and inner points - of the edge that is within the wing in absolute coordinates. - - - - - - - - - - - Name of the leading edge device. - - - - - - Description of the leading edge device. - - - - - - UID of the parent of the LED. The parent is - the componentSegment, where it is attached to. - - - - - - - - - - - - - - - - - - - - - Definition of the wings leading edge devices. - - - - Definition of the wings leading edge devices. - - - - - - - - - - - - - - - - - - - - Optional definition of the airfoil inner shape of - leading edge devices (LED). - - - - All parameters are optional. For the definition of the - parameters, please refer to the picture below. Parameters from - the outer border default to the parameters of the inner border. - - - - - - - - - - - - - - - Relative height of the most forward point of - the LED's rear part, based on the airfoil height of the parent - at this position. Optional. - - - - - Relative chordwise position of the most - forward point of the LED's rear part, based on the chord of the - parent at this position. Optional. - - - - - - - - - - - - - Optional definition of the leading edge shape of - trailing edge devices (TED). - - - - All parameters are optional. For the definition of the - parameters, please refer to the picture below. Parameters from - the outer border default to the parameters of the inner border. - - - - - - - - - - - - - - - Relative height of the leading edge of the TED, - based on the airfoil height of the parent at this position. - Optional. - - - - - Relative chordwise upper skin position, of the - border, where the airfoil of the TED is equivalent of the - airfoil from the parent. Measured from the rear to the front (0 - = TED trailing edge; 1 = TED leading edge). Values form the - outer border default to the value of the inner border. Optional. - - - - - - Relative chordwise lower skin position, of the - border, where the airfoil of the TED is equivalent of the - airfoil from the parent. Measured from the rear to the front (0 - = TED trailing edge; 1 = TED leading edge). Values form the - outer border default to the value of the inner border. Optional. - - - - - - - - - - - - - - linerType - - - Liner type, containing liner data - - - - - - - - - - Type of liner - - - - - - - - - - - - - % of fan diameter - - - - - % of fan diameter - - - - - - - - - - - - - linkToFile - - - Please provide a link to the additional file that shall - be loaded by the TIGL library. Furthermore it is necessary to - provide the format attribute so that the file type can be - identified. Several CAD formats provide multiple endings, and - hence, this measure seems necessary. - - - - - - - - - - - - - - - - - - - - - - - - - Load analysis - - - - - - - - - - - - - - - - - - - - - - - loadBreakdownType - - - - - - - - - - - - - - - - - - - - - - - - - - Load cases - - - - - - - - - - - - - - - - - - - - - - - - - loadReferenceAxisPointType - - - - - - - - - - - - - - - - - - - Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - Relative height position. - relHeight is relative to the local airfoil thickness. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta-xsi values are considered to be in segment - eta-xsi coordinates; if it points to a componentSegment, - then componentSegment eta-xsi coordinates are used. - - - - - - - - - - - - - - loadReferenceAxisPointsType - - - - - - - - - - - - - - - - - - - - - - Load envelopes - - - The loads envelope is the results of the loadsAnalysis - and lists those loadcases that are limiting for the design - - - - - - - - - - - - - - - - - - - - - logFloorBeamPositionType - - - longFloorBeamPosition type, containing individual - position definition - - - - - - - - - - UID of structural element - - - - - UID of crossbeam to which the long. beam is - attached - - - - - y position of long. beam - - - - - - Continuity definition for profile extrusion: - 0= C0 (allows sharp edges, default), 2= C2 (defines curvature - continuity) - - - - - - - - - - - - - Definition of interpolation between different - profiles: 0= no interpolation 1= interpolation of strcutural - profile - - - - - - - - - - - - - - - - - - - - - - longFloorBeamType - - - longFloorBeam type, containing a long. floor beam - definition - - - - - - - - - - - - - - - - - - - - longFloorBeamsAssemblyType - - - longFloorBeamsAssembly type, containing long. floor - beam assemblys - - - - - - - - - - - - - - - - - - - mAirConditioningType - - - - - - - - - - - - - Air conditioning mass description - - - - - - - - - - - - - - mAutomaticFlightSystemType - - - - - - - - - - - - - Automatic flight system mass description - - - - - - - - - - - - - - mAuxillaryPowerUnitType - - - - - - - - - - - - - Auxillary power unit masse description - - - - - - - - - - - - - - mBellyFairingsType - - - - - - - - - - - - - - - - - - - - - - - mBleedAirSystemType - - - - - - - - - - - - - Bleed air system mass description - - - - - - - - - - - - - - mBulkCargoType - - - - - - - - - - - - - - - - - - - - - - mBulkCargosType - - - - - - - - - - - - - - - - - - - - - - - mBulkheadsType - - - - - - - - - - - - - - - - - - - - - - - mCabinFloorsType - - - - - - - - - - - - - - - - - - - - - - - mCabinLightingsType - - - - - - - - - - - - - - - - - - - - - - - mCargoFloorsType - - - - - - - - - - - - - - - - - - - - - - - mCargoLiningsType - - - - - - - - - - - - - - - - - - - - - - - mCargoLoadingsType - - - - - - - - - - - - - - - - - - - - - - - Cargo masses - - - - - - - - - - - - - Cargo masses description - - - - - Cargo mass description - - - - - - - - - - - - - - - - mCarriagesType - - - - - - - - - - - - - - - - - - - - - - - mCarryOnType - - - - - - - - - - - - - - - - - - - - - - mCarryOnsType - - - - - - - - - - - - - - - - - - - - - - - mCateringsType - - - - - - - - - - - - - - - - - - - - - - - mCellsType - - - - - - - - - - - - - - - - - - - - - - - mCockpitLightingsType - - - - - - - - - - - - - - - - - - - - - - - mCommunicationType - - - - - - - - - - - - - Communication mass description - - - - - - - - - - - - - - mComponentSegmentType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mComponentSegmentsType - - - - - - - - - - - - - - - - - - - - - - - mControlSurfaceSupportType - - - - - - - - - - - - - - - - - - - - - - - - - mControlSurfaceSupportsType - - - - - - - - - - - - - - - - - - - - - - - mCrewMembersType - - - - - - - - - - - - - - - - - - - - - - - mCrewSeatsType - - - - - - - - - - - - - - - - - - - - - - - mDeIcingType - - - - - - - - - - - - - De-icing mass description - - - - - - - - - - - - - mDocumentsToolsType - - - - - - - - - - - - - - - - - - - - - - - mDoorsType - - - - - - - - - - - - - - - - - - - - - - - mElectricalDistributionType - - - - - - - - - - - - - Electrical distribution mass description - - - - - - - - - - - - - - mElectricalGenerationType - - - - - - - - - - - - - Electrical generation mass description - - - - - - - - - - - - - - mEmergencyEquipmentsType - - - - - - - - - - - - - - - - - - - - - - - mEmergencyOxygenSystemsType - - - - - - - - - - - - - - - - - - - - - - - mEmptyULDType - - - - - - - - - - - - - - - - - - - - - - mEmptyULDsType - - - - - - - - - - - - - - - - - - - - - - - mEngineControlType - - - - - - - - - - - - - Engine control mass description - - - - - - - - - - - - - - mEquippedEnginesType - - - - - - - - - - - - - - Equipped engines mass description - - - - - - - - - - - - - - - mExtLightingsType - - - - - - - - - - - - - - - - - - - - - - - mFireProtectionType - - - - - - - - - - - - - Fire protection mass description - - - - - - - - - - - - - - mFixedGalleysType - - - - - - - - - - - - - - - - - - - - - - - mFixedLeadingEdgeType - - - - - - - - - - - - - - - - - - - - - - mFixedLeadingEdgesType - - - - - - - - - - - - - - - - - - - - - - - - mFixedTrailingEdgeType - - - - - - - - - - - - - - - - - - - - - - - - mFixedTrailingEdgesType - - - - - - - - - - - - - - - - - - - - - - - mFlightControlsType - - - - - - - - - - - - - Flight controls mass description - - - - - - - - - - - - - - mFloorCoveringsType - - - - - - - - - - - - - - - - - - - - - - - mFramesType - - - - - - - - - - - - - - - - - - - - - - - - - mFreshWaterSystemsType - - - - - - - - - - - - - - - - - - - - - - - mFuelSystemType - - - - - - - - - - - - - Fuel system mass description - - - - - - - - - - - - - - Fuel mass - - - - - - - - - - - - - Fuel mass description - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Furnishing mass description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mFuselageStructureType - - - - - - - - - - - - - Fuselage structure mass description - - - - - - - - - - - - - - - - - - - - - - - - - - mWallsType - - - - - - - - - - - - - - - - - - - - - - - mFuselagesStructureType - - - - - - - - - - - - - Fuselages structure mass description - - - - - - - - - - - - - - - mHydraulicDistributionType - - - - - - - - - - - - - Hydraulic distribution mass description - - - - - - - - - - - - - - mHydraulicGenerationType - - - - - - - - - - - - - Hydraulic generation mass description - - - - - - - - - - - - - - mIFESystemsType - - - - - - - - - - - - - - - - - - - - - - - mInstrumentPanelType - - - - - - - - - - - - - Instrument panel mass description - - - - - - - - - - - - - - mInsulationsType - - - - - - - - - - - - - - - - - - - - - - - mIntegratedModularAvionicsType - - - - - - - - - - - - - Integrated modular avionics mass description - - - - - - - - - - - - - - mInterGasSystemType - - - - - - - - - - - - - Inter gas system mass description - - - - - - - - - - - - - - mLandingGearSupportsType - - - - - - - - - - - - - - - - - - - - - - - mLandingGearsType - - - - - - - - - - - - - - Landing Gears mass description - - - - - - - - - - - - - - - - mLavatoriesType - - - - - - - - - - - - - - - - - - - - - - - mLiningsType - - - - - - - - - - - - - - - - - - - - - - - mMainGearsType - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Manufacturer empty mass description - - - - - - - - - - - - - - - - - - mMillitarySystemsType - - - - - - - - - - - - - Millitary systems mass description - - - - - - - - - - - - - - mMiscellaneousType - - - Miscellaneous masses must only specify componenent masses for which NO DEDICATED ELEMENT EXISTS in the mass breakdown list! - - - - - - - - - - - - - - - - - - - mMoveableLeadingEdgeType - - - - - - - - - - - - - - - - - - - - - - - - mMoveableLeadingEdgesType - - - - - - - - - - - - - - - - - - - - - - - mMoveableTrailingEdgeType - - - - - - - - - - - - - - - - - - - - - - - - mMoveablesType - - - - - - - - - - - - - - - - - - - - - - - - mNavigationType - - - - - - - - - - - - - Navigation mass description - - - - - - - - - - - - - - mNoseGearsType - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Operator items mass description - - - - - - - - - - - - - - - - - - - - - mOverheadBinsType - - - - - - - - - - - - - - - - - - - - - - - mPartStowDoorsType - - - - - - - - - - - - - - - - - - - - - - - mPassengerType - - - - - - - - - - - - - - - - - - - - - - mPassengersType - - - - - - - - - - - - - - - - - - - - - - - Passengers masses - - - - - - - - - - - - - Passanger masses Description - - - - - - Passanger mass Description - - - - - - - - - - - - - - Payload mass - - - - - - - - - - - - - Payload mass description - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Power units mass description - - - - - - - - - - - - - - - - - - - - mPylonAttachmentsType - - - - - - - - - - - - - - - - - - - - - - - mPylonsType - - - - - - - - - - - - - - Pylons mass description - - - - - - - - - - - - - - - mRibType - - - - - - - - - - - - - - - - - - - - - - mRibsType - - - - - - - - - - - - - - - - - - - - - - - mSeatsType - - - - - - - - - - - - - - - - - - - - - - - mShellType - - - - - - - - - - - - - - - - - - - - - - - - - mShellsType - - - - - - - - - - - - - - - - - - - - - - - - mSkinPanelsType - - - - - - - - - - - - - - - - - - - - - - - mSkinsType - - - - - - - - - - - - - - - - - - - - - - - mSparsType - - - - - - - - - - - - - - - - - - - - - - - mSpecialStructuresType - - - - - - - - - - - - - - - - - - - - - - - mSpoilersType - - - - - - - - - - - - - - - - - - - - - - - mStringersType - - - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Structure mass description - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Systems mass description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mTrailingEdgeDeviceType - - - - - - - - - - - - - - - - - - - - - - - - mTrailingEdgeDevicesType - - - - - - - - - - - - - - - - - - - - - - - mULDContentType - - - - - - - - - - - - - - - - - - - - - - mULDContentsType - - - - - - - - - - - - - - - - - - - - - - - mVacuumWasteSystemsType - - - - - - - - - - - - - - - - - - - - - - - mWasteWaterSystemsType - - - - - - - - - - - - - - - - - - - - - - - mWindowsType - - - - - - - - - - - - - - - - - - - - - - - mWingBoxType - - - - - - - - - - - - - - - - - - - - - - - - - mWingStructureType - - - - - - - - - - - - - Wing structure mass description - - - - - - - - - - - - - - - mWingsStructureType - - - - - - - - - - - - - Wings structure mass description - - - - - - - - - - - - - - - Main actuator - - - - Definition of the landing gear main actuator. - - - - - - - - - - - Reference to the main actuator uID of the - landing gear - - - - - - - - - - - - - - Main landing gear - - - List of main gears - - - - - - - - - - - - - - - - - - - mainStrutInterfaceDefinitionsType - - - HighWingCenterFuselage main strut interface definitions - - - - - - - - - - - - - - - - - - - - - - mainStrutFuselageAttachmentType - - - HighWingCenterFuselage / main strut attachment to - fuselage frame and stringer - - - - - - - - - - - - - reference to the structural element that comprises this connection. - - - - - - - - - - - - - - maintenanceCostType - - - - - - - - - - - - - - - - - - - - - - - - Mass breakdown - - - - - 1. General - - - The - massBreakeDown - is subdivided in - designMasses - , - fuel - , - payload - and - mOME - (operating empty mass). - - - designMass - - The design masses contain the overall values for - mTOM and so forth. These should be listed as specified by the - TLAR or found from initial sizing. - - fuel - and - payload - - The fuel and payload nodes should contain maximum - values, i.e. full fuel tanks, all passengers on board and full - cargo holding. These values may exceed the maximum allowable - take-off mass as the actual loading of the aircraft should be - specified in the weight and balance section of the aircraft. - - - mOEM - - - The operation empty mass structure is based on the Airbus Mass - Standard brake down [AIRBUS MASS STANDARD 2008]. The - operator’s mass empty (OME) is defined by the sum of the - following component masses: - - operator’s items - manufacturer’s mass empty (MME) - - - - - - - 2. massDescription - - - Each sub component has the following - massDescription - which include a: - - Name - Description - parentUID - Mass value - Mass location - Mass orientation - Mass Inertia. - - - - The - massdescription - can be found at the - designMasses - direct under each item. At the - fuel - , - payload - and - mOME - under massDescription in each item and sub item. - - Concerning symmetry please note that any item - referenced by its UID, e.g. wingUID, accounts for the complete - component, e.g. right and left side. Hence for these items - their complete mass needs to be specified. If the mass of - geometricallly symmetrical components is different, please use - the symmetry modifyers for UIDs: _symm and _mirror. See also - the overall CPACS definition section on symmetry - - - - - - - - - - - - - - - - - - - - - - - - - Fuel Mass Fraction - - - Describing the mass fraction considered for a mission segment sequence - - - - - - - - - - Reference to the segment from which the fuel fraction should be considered - - - - - Reference to the segment to which the fuel fraction should be considered - - - - - Float value of the mass fraction defined as - fraction = m_end / m_start - - - - - - - - - - - - - massInertiaType - - - massInertiaType - - - - - - - - - - - - - - - - - - - - - - - - massInertiaVectorType - - - - - - - - - - - - - - - - - - - - - - - - - - - materialDefinitionForProfileBasedPointType - - - MaterialDefinitionForProfileBased type, containing a - material definition (Reference to material and thickness) for - profile based objects, addition point reinforcements - - - - - - - - - - uID of the profile point to which the - additional stiffness shall be applied. - - - - - uID of a material definition. - - - - - - cross sectional area of additional long. - stiffener at strctural element point - - - - - optional auxiliary parameter for special use - (no physical meaning) - - - - - optional auxiliary parameter for special use - (no physical meaning) - - - - - - - - - - - - - Definition of the properties of the structural - profile sheet - - - MaterialDefinitionForProfileBased type, containing a - material definition (Reference to material and thickness) for - profile based objects. - - - - - - - - - - - UID of the sheet to which the material - properties shall be applied - - - - - - Predefined ID of the sheet of a standard profile - - - - - - - - - - - - - - - - - - Length of the sheet of a standard profile [m] - - - - - - - - - uID of a composite definition. - - - - - - Orthoropy direction of the composite. - - - - - - Scaling factor of the composite thickness. - - - - - - - - uID of a material definition. - - - - - - Absolute thickness of the material [m] - - - - - - - - - - - - - - - - Material Definition - - - MaterialDefinition type, containing a material - definition (Reference to material and thickness) - - - - - - - - - choice between composite / isotropic material - definition - - - - - uID of a composite definition. - - - - - - Orthotropy direction of the composite. - - - - - - Scaling factor of the composite thickness. - Absolute thicknesses are defined in each composite material - seperatly - - - - - - - uID of a material definition. - - - - - - Absolute thickness of the material. - - - - - - - - - - - - - - - Material - - - - Definition of the material properties for one of the following - material types: - - isotropic materials - anisotropic 2D and 3D materials - orthotropic 2D and 3D materials - - The nonemclature is adopted from [1] to define the material properties in an orthotogonal 1-2-3 - coordinate system. This may be illustrated by the stresses of a three-dimensional cube: - - - - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - - - - - - - - - - - - Name of the material - - - - - Description of the material - - - - - Material density [kg/m^3] - - - - - - - - - - - - - - - - - Reference temperature for thermal expansion - coefficient [K] - - - - - - - - - - - - - - - - - Isotropic material properties - - - - Defines the material properties for an isotropic material. Note that the shear modulus G - is defined in terms of the elastic modulus E and the Poisson's ratio nu as: - - - - Specifying a value for all three properties E, G and nu therefore results in an overdetermined material definition and must be avoided. - - - - - - - - - - - - Young's modulus [N/m^2] - - - - - - - Shear modulus [N/m^2] - - - - - - - Poisson's ratio - - - - - - - Thermal expansion coefficient [1/K] - - - - - - - Thermal conductivity of the material in - [W/(m*K)] - - - - - - - Allowable stress for tension [N/m^2] - - - - - - - Allowable stress for compression [N/m^2] - - - - - - - Allowable stress for shear [N/m^2] - - - - - - - Allowable strain for tension - - - - - - - Allowable strain for compression - - - - - - - Allowable strain for shear - - - - - - - Yield strength, tension [N/m^2] - - - - - - - Yield strength, compression [N/m^2] - - - - - - - Plastification curves for isotropic - materials incl. element elimination - - - - - - - Optional knockdown factor for fatiuqe - (defaults to 1) - - - - - - - Fatigue behaviour of the material - - - - - - - Damage tolerance behaviour of the - material - - - - - - - - - - - - - - - Anisotropic material properties for 2D materials - - - - - Defines the material properties for a linear anisotropic material in the plane stress state (i.e., shell). The stress-strain relationship is defined as: - - - - The terminology of this complex type refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. - - - - - - - - - - - - Coefficient 11 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 12 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 13 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 22 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 23 of reduced stiffness matrix [N/m^2] - - - - - Coefficient 33 of reduced stiffness matrix [N/m^2] - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal expansion coefficient in material direction - 12 [1/K] - - - - - Thermal conductivity of the material in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 2 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 3 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 [N/m^2] - - - - - - Allowable stress for compression in material direction 1 [N/m^2] - - - - - - Allowable stress for tension in material direction 2 [N/m^2] - - - - - - Allowable stress for compression in material direction 2 [N/m^2] - - - - - - Allowable stress for shear [N/m^2] - - - - - - Allowable strain for tension in material direction 1 - - - - - Allowable strain for compression in material direction 1 - - - - - - Allowable strain for tension in material direction 2 - - - - - Allowable strain for compression in material direction 2 - - - - - - Allowable strain for shear - - - - - - - - - - - - - - Orthotropic material properties for 2D materials - - - - - Defines the material properties for an orthotropic material in the plane stress state (i.e., shell). The strain-stress relationship is defined as: - - - - Inverting the strain-stress relation and introducing thermal expansion yields: - - - - with: - - - - The terminology refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - - - - - - - - - - - - Young's modulus in material direction 1 [N/m^2] - - - - - Young's modulus in material direction 2 [N/m^2] - - - - - Shear modulus in material in 2-3 plane [N/m^2] - - - - - Shear modulus in material in 3-1 plane [N/m^2] - - - - - Shear modulus in material in 1-2 plane [N/m^2] - - - - - Poisson's ratio - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal conductivity of the material in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 2 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 - [N/m^2] - - - - - Allowable stress for compression in material - direction 1 [N/m^2] - - - - - Allowable stress for tension in material direction 2 - [N/m^2] - - - - - Allowable stress for compression in material - direction 2 [N/m^2] - - - - - Allowable stress for shear [N/m^2] - - - - - - Allowable strain for tension in material direction 1 - - - - - - Allowable strain for compression in material - direction 1 - - - - - Allowable strain for tension in material direction 2 - - - - - - Allowable strain for compression in material - direction 2 - - - - - Allowable strain for shear - - - - - - - - - - - - - - Anisotropic material properties for 3D materials - - - - - Defines the material properties for a linear anisotropic material in three spatial directions (i.e., solid). The stress-strain relationship is defined as: - - - - The terminology of this complex type refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. - - - - - - - - - - - - Coefficient 11 of stiffness matrix [N/m^2] - - - - - Coefficient 12 of stiffness matrix [N/m^2] - - - - - Coefficient 13 of stiffness matrix [N/m^2] - - - - - Coefficient 14 of stiffness matrix [N/m^2] - - - - - Coefficient 15 of stiffness matrix [N/m^2] - - - - - Coefficient 16 of stiffness matrix [N/m^2] - - - - - Coefficient 22 of stiffness matrix [N/m^2] - - - - - Coefficient 23 of stiffness matrix [N/m^2] - - - - - Coefficient 24 of stiffness matrix [N/m^2] - - - - - Coefficient 25 of stiffness matrix [N/m^2] - - - - - Coefficient 26 of stiffness matrix [N/m^2] - - - - - Coefficient 33 of stiffness matrix [N/m^2] - - - - - Coefficient 34 of stiffness matrix [N/m^2] - - - - - Coefficient 35 of stiffness matrix [N/m^2] - - - - - Coefficient 36 of stiffness matrix [N/m^2]2] - - - - - Coefficient 44 of stiffness matrix [N/m^2]] - - - - - Coefficient 45 of stiffness matrix [N/m^2] - - - - - Coefficient 46 of stiffness matrix [N/m^2] - - - - - Coefficient 55 of stiffness matrix [N/m^2] - - - - - Coefficient 56 of stiffness matrix [N/m^2] - - - - - Coefficient 66 of stiffness matrix [N/m^2] - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal expansion coefficient in material direction - 3 [1/K] - - - - - Thermal expansion coefficient affecting strain in material direction - 23 [1/K] - - - - - Thermal expansion coefficient affecting strain in material direction - 31 [1/K] - - - - - Thermal expansion coefficient affecting strain in material direction - 12 [1/K] - - - - - Thermal conductivity of the material in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 2 [W/(m*K)] - - - - - - Thermal conductivity of the material in material direction 3 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 - [N/m^2] - - - - - Allowable stress for compression in material - direction 1 [N/m^2] - - - - - Allowable stress for tension in material direction 2 - [N/m^2] - - - - - Allowable stress for compression in material - direction 2 [N/m^2] - - - - - Allowable stress for tension in material direction 3 - [N/m^2] - - - - - Allowable stress for compression in material - direction 3 [N/m^2] - - - - - Allowable stress for shear in 2-3 plane [N/m^2] - - - - - Allowable stress for shear in 3-1 plane [N/m^2] - - - - - - Allowable stress for shear in 1-2 plane [N/m^2] - - - - - Allowable strain for tension in material direction 1 - - - - - - Allowable strain for compression in material - direction 1 - - - - - Allowable strain for tension in material direction 2 - - - - - - Allowable strain for compression in material - direction 2 - - - - - Allowable strain for tension in material direction 3 - - - - - - Allowable strain for compression in material - direction 3 - - - - - Allowable strain for shear in 2-3 plane - - - - - - Allowable strain for shear in 3-1 plane - - - - - - Allowable strain for shear in 1-2 plane - - - - - - - - - - - - - - - Orthotropic material properties for 3D materials - - - - - Defines the material properties for an elastic orthotropic material in three spatial directions (i.e., solid). The strain-stress relationship is defined as: - - - - Note that nuij is related to nuji by: - - - - The terminology refers to the following literature: - - [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. - - - - - - - - - - - - Young's modulus in material direction 1 [N/m^2] - - - - - Young's modulus in material direction 2 [N/m^2] - - - - - Young's modulus in material direction 3 [N/m^2] - - - - - Shear modulus in the 2-3 plane [N/m^2] - - - - - Shear modulus in the 3-1 plane [N/m^2] - - - - - - Shear modulus in the 1-2 plane [N/m^2] - - - - - Poisson's ratio in in 2-3 plane - - - - - Poisson's ratio in in 3-1 plane - - - - - Poisson's ratio in in 1-2 plane - - - - - Thermal expansion coefficient in material direction - 1 [1/K] - - - - - Thermal expansion coefficient in material direction - 2 [1/K] - - - - - Thermal expansion coefficient in material direction - 3 [1/K] - - - - - Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] - - - - - Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] - - - - - - Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] - - - - - - Allowable stress for tension in material direction 1 - [N/m^2] - - - - - Allowable stress for compression in material - direction 1 [N/m^2] - - - - - Allowable stress for tension in material direction 2 - [N/m^2] - - - - - Allowable stress for compression in material - direction 2 [N/m^2] - - - - - Allowable stress for tension in material direction 3 - [N/m^2] - - - - - Allowable stress for compression in material - direction 3 [N/m^2] - - - - - Allowable stress for shear in 2-3 plane [N/m^2] - - - - - - Allowable stress for shear in 3-1 plane [N/m^2] - - - - - Allowable stress for shear in 1-2 plane [N/m^2] - - - - - - Allowable strain for tension in material direction 1 - - - - - - Allowable strain for compression in material - direction 1 - - - - - Allowable strain for tension in material direction 2 - - - - - - Allowable strain for compression in material - direction 2 - - - - - Allowable strain for tension in material direction 3 - - - - - - Allowable strain for compression in material - direction 3 - - - - - Allowable strain for shear in 1-3 plane - - - - - - Allowable strain for shear in 1-3 plane - - - - - - Allowable strain for shear in 1-2 plane - - - - - - - - - - - - - - Materials - - - Materials type, containing material and composite data. - A material describes the properties of a certain material. - Several materials can be combined within one composite. - - - - - - - - - - - - - - - - - - - - - Mission definitions - - - - Specifies missions for performance evaluation of aircraft. - As the topmost element of the hierarchical mission definition, individual missions are grouped together - in the missions node. Here, segmentBlocks - are referenced. These again link to a list of segments. - - - - - - - - - - - - - - - - - - - - - - Setting default and specific performance maps to be used for a model - - - - - - - - - - Default performance map which is used if no other performance map - is assigned through the specificPerformanceMap node - - - - - List of specific performance maps used on dedicated mission segments - - - - - - - - - - - - - - End condition - - - - - Specifies the end conditions for a segment or segment block (e.g.: an altitude or velocity). If a phase has no endCondition, it will base its endCondition on the segmentBlock settings (e.g.: it is the cruise segment, retrieving its total length based on the length of the segmentBlock minus all other segment lengths avaible within the segmentBlock). - - - - - - - - - - - - - - Calibrated airspeed [m/s] - - - - - - - - - - - - - - Mach number - - - - - - - - - - - - - - - - Global coordinate in xyz coordinates - - - - - - - - - - - - - - Global coordinate in geographic - coordinates (longitude, latitude, - altitude) - - - - - - - - - - - - - - Runway - - - - - - - - - - - - - - - - MassFraction ending the segment - - - - - - - - - - - - - - Fuel mass fraction ending the - segment, as remaining fuel mass with - respect to initial segment fuel mass - - - - - - - - - - - - - - Remaining absolute fuel ending the - segment - - - - - - - - - - - - - - Consumed fuel mass ending the - segment - - - - - - - - - - - - - - - - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] - - - - - - - - - - - - - - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] - - - - - - - - - - - - - - - Flown distance in the segment (x, y, z) - - - - - - - - - - - - - - - Duration of the segment [hh:mm:ss] - - - - - - - - - - - - - - UTC time at end of mission - - - - - - - - - - - - - - - Specific excess power at the end of the - segment - - - - - - - - - - - - - - Rate of climb ending the segment - - - - - - - - - - - - - - Achieved flightPathAngle ending the segment - - - - - - - - - - - - - - - - - - - - - Mission block constraints - - - Definition of constraints for the mission segment block - - - - - - - - - - - - - - - - - - - - Segment block - - - A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). - - - - - - - - - - Name - - - - - Description - - - - - - Segment direction. Either 'outbound' or 'inbound'. Only needed for radiusOfAction kind of missions. - - - - - - - - - - - - - - - - Specifies to which type of mass the segment fuel mass - should be added (blockFuel = designFuel + additionalFuel; Total fuel requirement - = blockFuel + reserveFuel; designFuel = the fuel of the segmentBlock is part of the design mission) - - - - - - - - - - - - - - - - Number of repetitions of this segment block, e.g. to perform repeated holding patterns - - - - - - - - - - - - - - - Segment blocks - - - A list of segment blocks. A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). - - - - - - - - - - - - - - - - - - - Segment - - - Definition of a mission segment which can be used to define missions. - - - - - - - - - - Name - - - - - Description - - - - - Type of the mission segment (takeOff, clime, cruse, ...) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Indication whether the distance flown during the segment is to be taken into account in the segmentBlock's distance calculation. - - - - - - Environmental conditions. If the environmentalCondition is not provided at segment level, the conditions of the - previous segment are inherited (this inhertance can continue until the startCondition, where the initial - environmentalConditions are provided). - - - - - - - Fuel mass - - - - - - - - - - - - - - - - - - - - Mission segment constraints - - - Contains a set of constraints for the segment - - - - - - - - - - - - - - - - - - - Mission segments - - - A collection of mission segments which can be reused to define missions. - - - - - - - - - - - - - - - - - - - Start conditions - - - Conditions which define the start of a mission - - - - - - - - - - - Calibrated airspeed at the start of the mission [m/s] - - - - - Mach number at the start of the mission - - - - - - - Global coordinate at the start of the mission in xyz coordinates - - - - - Global coordinate at the start of the mission in geographic coordinates (longitude, latitude, altitude) - - - - - - UID of the runway at which the - mission starts - - - - - - - - Flight heading at the start of the mission, in compassAngle with reference to true North - - - - - - UTC time at start of mission - - - - - - - - - - - - - - Mission - - - Contains a list of segmentBlock uID's forming the mission along with additional mission information. - - - - - - - - - - Name - - - - - Description - - - - - - - List of segmentBlock uID's forming the mission. Segments must first be grouped in segmentBlocks to be assigned to a mission. - - - - - - - - - - - - - - - Missions - - - A list of missions. - - - - - - - - - - - - - - - - - - - Monetary values - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - nacelleProfilesType - - - Nacelle profiles type, containing nacelle profile geometries. - See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - nacelleSectionType - - - - - - - - - - - - - - - - - - - - - - - - - - nacelleSectionsType - - - - - - - - - - - - - - - - - - - - - - Noise - - - - - - - - - - - - - FAR approach noise level - - - - - FAR sideline noise level - - - - - FAR take-off noise level - - - - - - - - - - - - - Nose landing gears - - - List of nose gears - - - - - - - - - - - - - - - - - - - Operating empty mass - - - - - - - - - - - - - Operating empty mass description - - - - - - - - - - - - - - - - operationalCaseType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - operationalCasesType - - - - - - - - - - - - - - - - - - - - - - outerCutOutProfileType - - - - - - - - - - - - - - - - - - - - - - - Parameter definition for design studies. - - - Contains a name for the design parameter to give semantic meaning to parameters used in design studies. - - - - - - - - - - - Name of parameter - - - - - - - - - - - - - - Container for parameter definitions - - - Contains a of the design parameter definitions. - - - - - - - - - - - - - - - - - - - - paxCrossBeamStrutsAssemblyType - - - PaxCrossBeamStrutsAssembly type, containing pax - crossBeam strut assemblys - - - - - - - - - - - - - - - - - - - paxCrossBeamsAssemblyType - - - PaxCrossBeamsAssembly type, containing pax crossBeam - assemblys - - - - - - - - - - - - - - - - - - - paxDoorsAssemblyType - - - PaxDoorsAssembly type, containing pax door assemblys - - - - - - - - - - - - - - - - - - - - payloadGlobalType - - - - - - - - - - - - - - - - - - - - - - - Flight performance requirements - - - Contains a list of flight performance requirements - - - - - - - - - - - - - - - - - - - - Flight performance requirement - - - - - - - - - - - - - Name of the performance case - - - - - Description of the performance case - - - - - Requirement classification based on the MoSCoW method (must, should, could or wont) - - - - - - - - - - - - - - - Reference to the considered weightAndBalance case - - - - - The UID of the mission to be flown - - - - - List of point performance uIDs constraining the mission - - - - - - - - - - - - - - - - Selection of performance maps - - - - - - - - - - Engine performance map selection - - - - - Aerodynamic performance map selection - - - - - - - - - - - - - Performance requirements - - - - - - - - - - - - - - - - - - - - - - - - - - performanceTargetsGlobalType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Piston - - - - Geometric description and material properties of the - landing gear piston. The figure below shows the condition of the - uncompressed piston, where the length of the exposed part is the - sum of the maxSpringDeflection - and the compressedExternalLength: - - - - - - - - - - - - - - - Length of the piston - - - - - - Maximum spring deflection of the piston (difference between minimum and maximum deflection) - - - - - Length of the piston that remains outside of the main strut in fully compressed state - - - - - - - - - - - - - - plasticityCurvePointType - - - - - - - - - - - - - Tangent modulus [N/m^2] - - - - - True stress [N/m^2] - - - - - - - - - - - - - Points on plasticity curve of material - (min. 1 point) - - - - - - - - - - - - pointPerformanceType - - - Specific performance settings for the point performance calculation (e.g.: a cruise Mach number) - - - - - - - - - - Name - - - - - Description - - - - - - - Defines at which part of the mission - the point performance should be - considered - after indicated segment - of the mission as defined in - performanceCase - - - - - - - Defines at which part of the mission - the point performance should be - considered - at the defined - massFraction within the mission as - defined in performanceCase - (mCurrent/mTO) - - - - - - - Defines at which part of the mission - the point performance should be - considered - at the defined - fuelFraction within the mission as - defined in performanceCase - (mFuelCurrent/mFuelTO) - - - - - - - - Indicates the type of point performance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Point performance definitions - - - List of point performance definitions - - - - - - - - - - - - - - - - - - - pressureBulkheadAssemblyPositionType - - - PressureBulkheadAssemblyPosition type, containing a - pressure bulkhead assembly position - - - - - - - - - - Frame to which bulkhead is attached to - - - - - - UID of bulkhead element desription - - - - - - - - - - - - - - - pressureBulkheadAssemblyType - - - PressureBulkheadAssembly type, containing pressure - bulkhead assemblys - - - - - - - - - - - - - - - - - - - pressureBulkheadType - - - PressureBulkhead type, containing data of a pressure - bulkhead - - - - - - - - - - Name of the pressure bulkhead structural - element - - - - - Description of the pressure bulkhead - structural element - - - - - UID of structural sheet element used for the - bulkhead - - - - - Choice between flat and curved bulkhead types - - - - - additional data for flat (forward) pressure - bulkhead - - - - Number of vertical reinforcements on flat - bulhhead - - - - - UID of structural elements used as vertical - reinforcements - - - - - Number of horizontal reinforcements on flat - bulhhead - - - - - UID of structural elements used as - horizontal reinforcements - - - - - - additional data for curved (rear) pressure - bulkhead - - - - Radius of bulkhead calotte in the plane of - the adjacent frame - - - - - maximum flection of the pressure bulkhaed - calotte - - - - - Number of radial reinforcements (equally - distributed) on curved bulhhead - - - - - UID of structural elements used as radial - reinforcements on curved bulkheads - - - - - - - - - - - - - - - - pressureBulkheadsType - - - PressureBulkheads type, conteining pressure bulkheads - - - - - - - - - - - - - - - - - - - - Structural elements based on profiles - - - - - Short description - - The ProfileBasedStructuralElement type containins the - data of a structural element, that are based on 2-dimensional profiles. - There are three approaches to model profile based structural elements: - - by specifying global beam properties - by referencing a structuralProfile2D element - by choosing one of the prescribed standard profiles - - - - - - 1. Global beam properties - - In the section globalBeamProperties the properties - of the structural profile in an equivalent beam representation - are defined. - - - - 2. Structural 2D profile - - The structuralProfileUID element refers to the uID of the structuralProfile2D element. - As described in the corresponding documentation, this profile is defined by several points in the x-y-space. - Two points always form a sheet. - The properties of each sheet are defined in the sheetProperties element. - The orthotropy direction of composite materials equals the sheets' x-axis. - The orthotropy direction angle equals a positive rotation around the sheets' z-axis as indicated in the picture below (part 3), which shows an example of a wing stringer.: - - - - - - - 3. Standard structural 2D profile - - Instead of referencing a structuralProfile2D element, it is also possible to select a predefined standard profile. - These profiles are listed in the figure below. - Under sheetProperties, only the standardProfileSheetID (equals S1, S2, ...) must now be specified along with a corresponding length. - - - - - - - - - - - - - - - - Name of the profile based structural element - - - - - - Description of the profile based structural - element - - - - - Choice between global beam properties and sheet properties - - - - - - Choice between general profile element - description (referencing a structuralProfile) and predefined - standard profiles - - - - Definition based on structuralProfile - definition - - - - Reference to the structural profile profile - uID - - - - - - Reference point in structural profile - definition for structural element definition - - - - - - - Standard Profile Type, see picture below for - further information. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - structuralElementType - - - profileBasedStructuralElements type, containing a list - of profile based structural elements - - - - - - - - - - - - - - - - - - - profileGeometryType - - - - A profile is defined by a profile name, an optional - description and a 3-dimensional pointlist with all three - coordinates mandatory. For typical profiles, one of the - coordinate vectors contains only "0" entries. All point - coordinates are transferred to the global coordinate system. The - points have to be ordered in a mathematical positive sense. - Normalized coordinates are not required. First and last point - may, but need not to, be identical. Hence, it is possible to - include "open" profiles. However, the trailing edge position of - the upper and lower point need to be identical. No crooked - trailing edges are possible. - Example 1: For a conventional wing, the airfoil - coordinates are defined in x and z with all the y-coordinates - set to "0". The points have to be ordered from the trailing edge - along the lower side to the leading edge and then along the - upper side back to the trailing edge. - Example 2: For a fuselage, the coordinates are - typically given in y and z with x set to "0". Starting point of - the profile sould be the lowest point (typically in the symmetry - plane), then upwards on the positive y-side up to the highest - point (again, typically in the symmetry plane). Depending on, - whether the fuselage shall be specified with symmetry condition - or not, the profile either ends there, or continues on the - negative y-side back down to the lowest point. - Alternatively, it is possible to specify the - coordinates of a profile via the CST (class function /shape - function transformation technique) notation. Please see the - cst2DType for further information. - A profile can be symmetric. In that case the profile - is interpreted as being not closed and will be closed by - mirroring it on the symmetry plane. - - - - - - - - - - - Name of profile - - - - - Description of profile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - profileGeometry2DType - - - - A profile is defined by a profile name, an optional - description and a 2-dimensional pointlist with both - coordinates mandatory. All point coordinates are transferred - to the global coordinate system depending on the context they - are used in. The points have to be ordered in a mathematical - positive sense. The x-coordinates of the profile has to be - normalized between 0 and 1. First and last point - may, but need not to, be identical. Hence, it is possible to - include "open" profiles. However, the trailing edge position of - the upper and lower point need to be identical. No crooked - trailing edges are possible. - Example 1: For a conventional nacelle profile, the airfoil - coordinates are defined in x and y. The points have to be ordered - from the trailing edge along the lower side to the leading - edge and then along the upper side back to the trailing edge. - When used for a nacelle the profile axis align - with the global axes as follows: - +x_profile -> +x_global; - +y-profile -> -z_global - Example 2: For a fuselage, the coordinates are - also given in x and z with x as the normalized fuselage height. - Starting point of the profile sould be the lowest point - (typically in the symmetry plane), then upwards on the positive x-side up to the highest - point (again, typically in the symmetry plane). Depending on, - whether the fuselage shall be specified with symmetry condition - or not, the profile either ends there, or continues on the - negative x-side back down to the lowest point. - Alternatively, it is possible to specify the - coordinates of a profile via the CST (class function /shape - function transformation technique) notation. Please see the - cst2DType for further information. - A profile can be symmetric. In that case the profile - is interpreted as being not closed and will be closed by - mirroring it on the symmetry plane. - - - - - - - - - - - Name of profile - - - - - Description of profile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Profiles - - - Profiles type, containing profile geometries - - - - - - - - - - - - - - - - - - - - - - - - - - Attachment of the pylon to the parent. - - - - - - - - - - - - - Material properties of the attachment. - - - - - - Link to the structural profile of the - attachment. - - - - - - UID of the attachment. - - - - - - - - - - - - Attachments of the pylon to the parent. - - - - - - - - - - - - - - - - - - - - - - - Structural properties of the pylon box (ribs, upper, - lower and side panels). - - - - - - - - - - - - - - - - - - - UID of the pylon box. - - - - - - - - - - - - Definition of one pylon pin. - - - - - - - - - - - - - First element (parentAttachmentUID, engineUID - or uID of a pylon structure. - - - - - Second element (parentAttachmentUID, engineUID - or uID of a pylon structure. - - - - - Position of the pylon pin related to the pylon - coordinate system. - - - - - - Blocked DOFs. Referes to the rotated - coordinate system that is defined in 'orientation'. - - - - - - - - UID of the pin. - - - - - - - - - - - - Definition of pylon pins. - - - - - - - - - - - - - - - - - - - - - - Definition of a rib set. - - - - RibDefinitionType, containing the definition for ribs. - Ribs are defined in sets of one or more ribs. The positions of - the rib, as well as the orientation of the ribs are defined in - 'ribPositioing'. The cross section properties, as e.g. - materials, are defined in 'ribCrossSection'. - - - - - - - - - - - Name of the rib set. - - - - - Description of the rib set. - - - - - - - - - - - - - - - - - Structural properties of all tibs of the engine pylon - box. - - - - - - - - - - - - - - - - - - - - - - pylonRibsPositioningType - - - - Within the ribsPositioning type the position and the - orientation of the ribs of the rib set are defined. - The forward and the rear beginning of the rib set is - defined using relDepthStart and relDepthEnd. The orientation of - the ribs is defined in ribRotaton. The number of ribs of the - current rib set is either defined by ribNumber or by spacing. - - - - - - - - - - - - relDepthStart defines the forward location of - the beginning of the rib set. 0 equals the forward end of the - pylon box, while 1 equals the rear end of the pylon box. - - - - - - relDepthEnd defines the rear end. 0 equals the - forward end of the pylon box, while 1 equals the rear end of the - pylon box. - - - - - Ribs can be rotated in the side view. The - defaults to 90°, which equals an orientation along the pylons - z-axis. The angle is meassured around the positive y-direction - of the pylon. - - - - - - The spacing of the ribs defines the distance - between two ribs, measured along the pylons x-axis. First rib - is placed at relDepthStart. - - - - - RibNumber defines the number of ribs in this - ribSet. First rib is at relDepthStart along the pylons x-axis, - last rib is at relDepthEnd. The spacing is constant. - - - - - - - - RibCrossingBehaviour can either be "cross" or - "end". If it is end then ribs will end it they intersect - another rib. It it is cross ribs are placed uncut. - - - - - - - - - - - - - - - - - - - - - Structural properties of a pylon shackle. - - - - - - - - - - - - - Material properties of the shackle. - - - - - - Link to the structural profile of the shackle. - - - - - - - UID of the shackle. - - - - - - - - - - - - Structural properties of pylon shackles (for pylon to - parent attachment), if existing. - - - - - - - - - - - - - - - - - - - - - - - Structural properties of the pylon shells. - - - - - - - - - - - - - - UID of the structural profile. - - - - - - Material settings. - - - - - - UID of the structure. - - - - - - - - - - - - Definition of the load carrying structure of the engine - pylon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - Structural properties of struts (drag struts, upper - links and tangent links), if existing. - - - - - - - - - - - - - - - - - - - - - - - - radiativeForcingType - - - - - - - - - - - - - - - - - - - - - - - - - - - - recurringCostType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Reference values - - - Reference type, containing the reference values of the - aircraft model - - - - - - - - - - Reference area (typically planform area) - - - - - - Reference length (typically Mean Aerodynamic - Chord MAC). In CPACS, only one reference length exists (and is - used, e.g. for all three moment coefficients. Coordinates given - relative to MAC shall always use this length as MAC. - - - - - - Moment reference point (in global coordinate - system). The x-coordinate is typically chosen same as of the - leading edge of the wing in the spanwise section having a - chordlength identical to MAC. Coordinates given as %MAC shall - always use this x-coordinate and length (e.g. 0%MAC = x, 100%MAC - = x + length). The y coordinate is typically 0. The z coordinate - is often chosen either as 0., or as z of fueselage nose or as z - of middle of center fuselage part. - - - - - - - - - - - - - requirementType - - - - - - - - - - - - - - - - - - - - - - - RibIdentificationType, defining one rib. - - - - - - - - - - - - - UID of the rib definition set. - - - - - - Number of the rib of the rib definition set. - - - - - - - - - - - - - - Definition of the rib rotation - - - The rotation around z describes the rotation around the - wings midplane normal axis. The defaults to 90°. The reference - for the 'zero-angle' of the z-rotation is defined in - ribRotationReference. - - - - - - - - - - RotationReference defines the reference for - the z-rotation it is either sparUID, „LeadingEdge“, - „TrailingEdge“, "globalX", "globalY" or "globalZ". - If it is not defined the rotation reference is - the eta-axis (=leading edge, that is projected on the wings - y-z-plane). A z-rotation angle of 90 degrees means, that the rib - is perpendicular on the ribRotationReference (e.g. spar, leading - edge...). The rib itself is always straight, and the rotation - is defined with respect of the intersection point of the rib - with the ribRotationReference. - - - - - The rotation around z describes the rotation - around the wings midplane normal axis. The defaults to 90°. The - reference for the 'zero-angle' of the z-rotation is defined in - ribRotationReference. - - - - - - - - - - - - - rivetJointAreaAssemblyPositionType - - - RivetJointAreaAssemblyPosition type, containing a rivet - joint area assembly position - - - - - - - - - - - - - - - - - - - - - rivetJointAreasAssemblyType - - - RivetJointAreasAssembly type, containing rivet joint - area assemblys - - - - - - - - - - - - - - - - - - - rivetType - - - Rivet type, containing a rivet - - - - - - - - - - Name of the rivet type - - - - - Description of the rivet type - - - - - - Tensile Strength of the rivet type - - - - - - Shear Strength of the rivet type - - - - - - - - - - - - - - - rivetsType - - - Rivets type, containing rivets - - - - - - - - - - - - - - - - - - - rotorAirfoilsType - - - RotorAirfoils type, containing rotor airfoil - geometries. See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - - rotorBladeAttachmentType - - - RotorBladeAttachment type, defining the elements used - to attach one or more rotor blades to the rotor head. - - - - - - - - - - Name of the blade attachment. - - - - - - Description of the blade attachment. - - - - - - - The azimuthAngles element is used to specify - a list of discrete azimuth angles (in deg) at which instances - of attached blades are to be created. The number of blades will - equal to the number of elements of the vector. E.g. - <azimuthAngles>0;90;180;270</azimuthAngles> for a - four blade rotor with equal equiangularly distributed blades. - The transformation of the respective rotor blade corresponds to - a rotation by azimuthAngle around the z axis of the rotor - coordinate system in mathematically positive sense of rotation. - - - - - - If only the number of blades is specified, - the attached blades will be distributed equiangularly and the - first blade will be attached at azimuth angle 0. (Formula: - azimuthAngle[i] = i*360deg/numberOfBlades, - i=0..numberOfBlades-1) - - - - - - Definition of all hinges used to attach the - rotor blade. - - - - - UID of the rotorBlade which should be attached - to the rotor hub. - - - - - - - - - - - - - - rotorBladeAttachmentsType - - - RotorBladeAttachments type, containing all hinges and - blade UIDs attached to the current rotor hub. - - - - - - - - - - - - - - - - - - - rotorBladesType - - - - RotorBlades type, containing all the rotor blade - gometry definitions of an rotorcraft model. - Rotor blade geometries are defined using the same data - structure as wings (wingType). But in order to be compatible - with the other rotor blade related types (e.g. rotorType, - rotorHubType, rotorHubHingeType) there are some additional - conventions/requirements regarding the definition and - orientation of rotorBlade geometries: - - Rotor blades should be positioned relative to the - global z-axis the way they will be positioned to the rotor - shaft (when blade azimuth=0deg). - The global x-axis should be used as radial axis - (usually the quarter chord line of the rotor blade coincides to - a great extent with the x-axis of the rotor blade coordinate - system). - All sections should be positioned in the positive - x halfspace. - Segments should connect sections with ascending x - coordinates. - Airfoils defined in the rotorAirfoils node should - be used instead airfoils from the wingAirfoils node. - - - - - - - - - - - - - - - - Rotor blade geometries are defined using the - same data structure as wings (wingType). But in order to be - compatible with the other rotor blade related types (e.g. - rotorType, rotorHubType, rotorHubHingeType) there are some - additional conventions/requirements regarding the definition and - orientation of rotorBlade geometries: see remarks. - - - - - - - - - - - - - - rotorHubHinge type, containing a rotor hub hinge - (flap/leadLag/pitch). - - - - RotorHubHinge type, containing a rotor hub hinge - (flap/leadLag/pitch) of a rotorcraft model. - - - - - - - - - - - Name of the hinge. - - - - - Description of the hinge. - - - - - - Hinge type. Possible values: "flap", "pitch" - "leadLag". This is used to define the rotation axis of the hinge - (flap = y-axis in blade cs, pitch = x-axis in blade cs, lead-lag - = z-axis in blade cs). - - - - - - - - - - - - The angle (in deg) at which the hinge is in - neutral position. This element is normally used to define - precone or prelag angles of the attached blade. Defaults to 0. - - - - - - Static stiffness of the hinge in (N/m) for - linear hinges and (N.m/deg) for angular hinges. Default value: - +inf (statically rigid hinge) - - - - - Dynamic stiffness of the hinge in (N/m) for - linear hinges and (N.m/deg) for angular hinges. Default value: - +inf (statically rigid hinge) - - - - - Damping of the hinge in (N/(m/s)) for linear - hinges and (N.m/(deg/s)) for angular hinges. Default value: +inf - - - - - - - - - - - - - - - rotorHubHingesType - - - RotorHubHinges type, defining hinges used to attach a - rotor blade to the rotor head. - - - - - - - - - - Definition of a flap, lead-lag or pitch hinge. - - - - - - - - - - - - - - rotorHubType - - - RotorHub type, containing definitions for the rotor hub - and attached hinges and blades. - - - - - - - - - - Name of the rotor hub. - - - - - Description of the rotor hub. - - - - - - Rotor head type. Possible values: "semiRigid", - "rigid", "articulated", "hingeless" - - - - - - - - - - - - - Rotor blade attachments are used to define how - many rotor blades are attached at which azimuth positions of the - rotor hub and the used hinges. - - - - - - - - - - - - - - Rotor type, containing a rotor (main rotor, tail rotor, - fenestron, propeller,...) of an rotorcraft model. - - - - Rotor type, containing a rotor (e.g. main rotor, tail - rotor, fenestron, propeller,...) definition of a rotorcraft - model. - The position and attitude of the rotor is defined - using the transformation element. The following image shows the - CPACS conventions for the orientation of rotors and rotor axis - systems: - - - - - The origin coincides with the center of rotation. - - The z-axis corresponds to the axis of rotation - and thus coincides with the rotor shaft centerline. It Points - in the main thrust direction of the rotor (usually upwards for - a main rotor, forwards for a propeller). - The x-axis points from nose to tail (usually - rearwards for main and tail rotors, upwards for a propeller). - - The y-axis completes the right-handed orthogonal - coordinate system. - - Rotor hub attributes, hinges and references to - attached rotor blades are defined in the rotorHub element. - - - Note that rotor blade geometries are only referenced and not - defined in the child nodes of the rotor element. Refer to the - documentation of rotorBladesType ( - Empty#T/rotorBladesType - ) and wingType ( - Empty#T/wingType - ) for information on the definition of rotor blade geometries. - - The following figure shows the transformations to be - applied to rotorBlade geometries to visualize them in the rotor - frames for a given state (each rotor: rotorAzimuth given, each - hinge: hingeDeflection given): - - - - - - - - - - - - - - Name of the rotor. - - - - - Description of the rotor. - - - - - UID of the part to which the rotor is mounted - (if any). The parent of the rotor can e.g. be the fuselage. In - each rotorcraft model, there is exactly one part without a - parent part (The root of the connection hierarchy). - - - - - - Rotor type. Possible values: "mainRotor" - (default), "tailRotor", "fenestron" or "propeller".. - - - - - - - - - - - - - - Nominal value of the angular rotation speed in - rotations per minute (rpm). - - - - - Transformation (scaling, rotation, - translation). This element is used to define the position and - attitude of the rotor relative to the global or the parent - component's axis system. Note that an anisotropical scaling - transformation should not be applied to the rotor. - - - - - - The rotorHub element contains the definition - of the rotor hub type and number and azimuth angles of the - attached blades and their hinges. The rotor hub position and - attitude coincides with the rotor axis system's origin and z - axis. - - - - - - - - - - - - - - - - - - - - - - - - - rotorcraftAnalysesType, results from several analysis - modules connected to CPACS - - - RotorcraftAnalyses type, containing detailed analysis - data of the rotorcraft - Within this element results from analysis modules are - stored that rely to the overall definition of the rotorcraft. - These include e.g. aerodynamic data or loadCases - For further documentation please refer to the - respective elements. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rotorcraftGlobalType - - - RotorcraftGlobalType type, containing global data of - the rotorcraft - - - - - - - - - - Number of passenger seats - - - - - Cargo transport capacity [kg] - - - - - - Cruise Mach Number - - - - - Configuration of the rotorcraft: - standard(single main rotor, single tail rotor) / tandem / - coaxial/intermeshing / sideBySide/tiltRotor/tiltWing - - - - - - - - - - - - - - massBreakdownType - - - - - 1. General - - - The - massBreakeDown - is subdivided in - designMasses - , - fuel - , - payload - and - mOME - (operating empty mass). - - - designMass - - The design mass is a description from TLARs and can - be understand as design criteria. - - fuel - and - payload - - The fuel and payload mass are the maximum masses - which can be achieved. Full fuel tanks, all passengers on - board and full cargo holding. - - mOEM - - - The operation empty mass structure is based on the Airbus Mass - Standard brake down [AIRBUS MASS STANDARD 2008]. The - operator’s mass empty (OME) is defined by the sum of the - following component masses: - - operator’s items - manufacturer’s mass empty (MME) - - - - - - - 2. massDescription - - - Each sub component has the following - massDescription - which include a: - - Name - Description - parentUID - Mass value - Mass location - Mass orientation - Mass Inertia. - - - - That - massdescription - can be found at the - designMasses - direct under each item. At the - fuel - , - payload - and - mOME - under massDescription in each item and sub item. - - - - For the clean up the - mOME - there is consisting a script witch is programmed in Matlab but - also as standalone vision available. Setting for that tool can - be done under - toolspesifics/cmu - . - - - - - - - - - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Manufacturer empty mass description - - - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Group mass of hierarchy level 1 - - - - - - - - - - - - - - - Mass - - - - - - - - - - - - - Group mass of hierarchy level 2 - - - - - - - - - - - - - - - Operating empty mass - - - - - - - - - - - - - Operating empty mass description - - - - - - - - - - - - - - - - rotorcraftModelType - - - RotorCraftModel type, containing a complete rotorcraft - model (Geometry and all specific data). The rotorcraftModelType - is basically a copy of the aircraftModelType with the following - additional elements: rotors, rotorBlades, driveSystems. - Furthermore the folowing elements have been adapted for - rotorcraft: global and analyses (aeroPerformance and - massBreakdown). - - - - - - - - - - Name of rotorcraft model - - - - - Description of rotorcraft model - - - - - - - - - - - - - - - - - - - - - - - - - - Rotorcraft - - - Rotorcraft type, containing all the rotorcraft models. - - Most of the extensions used in the rotorcraft type have - been defined as part of the work in the DLR project RIDE - (Rotorcraft Integrated Design and Evaluation, 2009-2012). - Therefore some of the definitions and conventions are tightly - coupled to the RIDE toolchain and tools. Further generalization - and assimilation of these parts to the definitions for fixed-wing - aircraft is planned for the near future. - - - - - - - - - - - - - - - - - - - rotorsType - - - Rotors type, containing all the rotors (mainRotors, - tailRotors, fenestrons, propellers, ...) of an rotorcraft model. - - - - - - - - - - - - - - - - - - - - runwayILSType - - - RunwayILS type, containing ILS data of a runway - - - - - - - - - - - Position of the localizer antenna - - - - - - - Position of the glide slope antenna - - - - - - Angle of the glide path - - - - - - - - - - - - - - runwayType - - - Runway type, containing data of a runway - - - - - - - - - - Name of runway - - - - - Description of runway - - - - - Position in degrees north - - - - - Position in degrees east - - - - - Threshold elevation - - - - - Runway heading - - - - - Takeoff run available - - - - - Landing distance available - - - - - Conditions of the runway - - - - - - - - - - - - - - - runwaysType - - - Runways type, containing data of the airport's runways - - - - - - - - - - - - - - - - - - - - seatModuleType - - - SeatModule type, containing data of a seat module - - - - - - - - - - - Name of the seat module - - - - - Description of the seat module - - - - - - Number of seats in the seat module, e.g 1, 2 - or 3 - - - - - Total width of the seat module - - - - - - seat module mass (optional, use of data to be - clarified) - - - - - seat module mass CoG (optional, use of data to - be clarified) - - - - - - - - - - - - - - seatModulesType - - - SeatModules type, containing seat modules - - - - - - - - - - - - - - - - - - - shaftLinkedComponentsType - - - ShaftLinkedComponents type, containing UIDs of engines, - transmissions and rotors linked by a shaft. - - - - - - - - - - - UID of a linked engine. - - - - - UID of a linked transmission shaft input. - - - - - - UID of a linked transmission shaft output. - - - - - - UID of a linked rotor. - - - - - - - - - - - - - - shaftType - - - Shaft type defining a shaft used as a link between - drive system components. - - - - - - - - - - - - - - - - - - - - - - shaftsType - - - Shafts type, containing all the shafts of a drive - system. - - - - - - - - - - - - - - - - - - - sheet3DType - - - - - - - - - - - - - - - - - - - - - - - - - - sheetBasedStructuralElementType - - - sheetBasedStructuralElementType type, sheet definition - for use in fuselage/structure - - - - - - - - - - Material definition of the skin segment - (Material, thickness, (lay-up)) - - - - - - - - - - - - - - sheetBasedStrcuturalElementsType - - - sheetBasedStrcuturalElementsType, containing sheet - based structural element definitions - - - - - - - - - - - - - - - - - - - sheetList3DType - - - - - - - - - - - - - - - - - - - - - - List of sheets, connecting 2-dimensional profile - points. - - - SheetList type, containing a list of sheets. Each sheet - combines two points to one sheet. - - - - - - - - - - - - - - - - - - - sheetPointsType - - - - - - - - - - - - - - - - - - - - - - sheetType - - - Sheet type, containing connection data of a sheet - - - - - - - - - - - Name of sheet within the profile definition - - - - - - Description of sheet within the profile - definition - - - - - Point from which the sheet definition starts - start - - - - - Continuity definition for profile geometry - generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines - tangential continuity), 2= C2 (defines curvature continuity) - 2=all - - - - - - - - - - - - - - Definition of an orientation vector at P1 - - - - - - Point at which the sheet definition ends - - - - - - Continuity definition for profile geometry - generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines - tangential continuity), 2= C2 (defines curvature continuity) - 2=all - - - - - - - - - - - - - - Definition of an orientation vector at P2 - - - - - - - - - - - - - - - singleGenericMassType - - - - - - - - - - - - - - - - - - - - - - Skid landing gears - - - List of skid gears - - - - - - - - - - - - - - - - - - - fuselagePanelType - - - FuselagePanel type, panel of the fuselage between - stringers/ frames (new in V1.5) - - - - - - - - - - UID of sheetBasedStructuralElement used for - the panel - - - - - UID of frame at start of the skin segment - - - - - - UID of frame at end of the skin segment - - - - - - UID of stringer at start of the skin segment - - - - - - UID of stringer at end of the skin segment - - - - - - - - - - - - - - - fuselageSkinSegmentType - - - FuselageSkinSegment type, containing material on skin - over circumference - - - - - - - - - - - - - - - - - - - skinType - - - Containing data defining the skin - - - - - - - - - - Default UID of sheetBasedStructuralElement - used for the fuselage skin not covered by individual panels - - - - - - - - - - - - - - - Spar cell of the spar. - - - - Within spar cells a special area of the spar is - defined where different cross section and material properties - shall be defined. - The area of the spar is defined by using the - parameters 'fromEta' and 'toEta'. The definition of the caps, - webs and rotation is equivalent to the cross section definition - of the complete spar. - - - - - - - - - - - Beginning (= inner border) of the spar cell. - - - - - - Ending (= outer border) of the spar cell. - - - - - - Upper Cap - - - - - - Lower Cap - - - - - - Web 1 - - - - - - Web 2 - - - - - - The angle between the wing middle plane and - web 1 [deg]. Default is 90 degrees. Positive rotation is around the - spar axis heading along with the positive eta-axis. - - - - - - - - - - - - - - - SparCells of current spar. - - - sparCells are an optional Element. They are defined via - the etaCoordinates and define a region of special cross section - and material properties. - - - - - - - - - - - - - - - - - - - Definition of the spar cross section. - - - - Spar type, containing the cross section definition of - a spar. The spar middle point is defined by the intersection of - the wing middle plane and web1. This equals the coordinate - defined within the sparPosition. - Please find below a picture where all spar cross - section parameters as well as the orientation refereneces for - the material definition can be found: - - - - - - - - - - - - - - - - - - - The angle between the wing middle plane and - web1. Default is 90 degrees. Positive rotation is around the - intersection axis of the spar and the wing middle plane. The - positive heading of this axis is inline with the positive - heading of the componentSegment eta-axis. - - - - - - - - - - - - - Spar position on the wing - - - - sparPositionType, a sparPostion defines a location - within the componentSegment where a spar in mounted. Eta and xsi - are relative to the componentSegment. - Please find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - As an alternative to the relative eta coordinate it is - possible to specify an elementUID so that the spar position is - relative to the outer geometry, e.g. kink, of the wing. - - - - - - - - - - - - Defines a spar position on an existing rib using a relative xsi coordinate - to determine the chord wise position on that rib - - - - - Defines a spar position using relative eta/xsi coordinates - - - - - - - - - - - - - - sparPositionUIDs of the spar. - - - - sparPositionType, a sparPostion defines a location - within the componentSegment where a spar in mounted. Those - positions are combined to spars by using a list of spar position - uIDs. The order of the sparPositionUIDs must be the same as the - order of the points on the real spar (from root to tip or from - tip to root). - Pleas note: orientation of a spar must be allways - outbound or allways inbound. A zigzag spar orientation where - e.g. the spar starts at the root, goes to the tip and goes back - to another point at the root is not allowed. - Pleas find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - - - - - - - - - - - List of spar position uIDs. - - - - - - - - - - - - - - Spar definition points on the wing. - - - - sparPositionType, a sparPostion defines a location - within the componentSegment where a spar in mounted. Eta and xsi - are relative to the componentSegment. - Please find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - - - - - - - - - - - - - - - - - - - - SparSegments (=spars) of the wing. - - - SparSegmentType, each spar is defined by multiple - sparPositions that are referenced via their uID. The spar cross - section is defined in 'sparCrossSection'. - - - - - - - - - - Name of the spar segment (=spar). - - - - - - Description of the spar segment (spar). - - - - - - - - - - - - - - - - - Spar segments of the wing. - - - sparSegmentsType, containing multiple sparSegment - (=spars) of the wing. - - - - - - - - - - - - - - - - - - - Specific heat map, containing the specific heat capacity of a material at different temperatures. - - - The specific heat of a material can vary with the temperature. The vectors specificHeat and temperature - must have the same size to be valid. The data should be linearly interpolated. - - - - - - - - - - - Temperature in [K] - - - - - Specific heat capacity of the material in [J/(kg*K)] - - - - - - - - - - - - - Specific performance map - - - - Applying a specific performance map to selected mission segments. In addition to the obligatory defaultPerformanceMapUID at least a segmentUID or pointPerformanceUID must be given. - - - - - - - - - - - UID of performance map to be used for mission segments - - - - - - - List of all mission segment UIDs to which the performance map is to be applied - - - - - List of point performance UIDs to which the performance map is to be applied - - - - - - List of point performance UIDs to which the performance map is to be applied - - - - - - - - - - - - - - specificPerformanceMapsType - - - Collection of all assignments of specific performance maps to selected mission segments - - - - - - - - - - - - - - - - - - - Spoilers of the wing. - - - A spoiler is defined via its outerShape relative to the - componentSegment. The WingCutOut defines the area of the upper - skin that is removed by the spoiler. Structure is similar to the - wing structure. The mechanical links between the spoiler and the - parrent are defined in tracks. The deflection path is described - in path. Additional actuators, that are not included into a - track, can be defined in actuators. - - - - - - - - - - Name of the spoiler. - - - - - Description of the spoiler. - - - - - - UID of the parent of the spoiler. The parent - is the componentSegment, where the spoiler is attached. - - - - - - - - - - - - - - - - - - - - - Definition of the wings spoilers. - - - Definition of the wings spoilers. - - - - - - - - - - - - - - - - - - - State parameter definition - - - Contains the values of a parameter and its uid as reference. - - - - - - - - - - - - - - - - - - - - - - - - State parameters list - - - Contains a list of all state parameters. - - - - - - - - - - - - - - - - - - - - stiffnessType - - - - - - - - - - - - - - - - - - - - - - - - - - - stringerFramePositionType - - - - Description of individual stringer / frame postions - - - - - - - - - - - - - - UID of profile based structural element - - - - - - - x position in absolute value - - - - - - UID reference to a fuselageSectionElement - - - - - - - y coordinate of reference system - - - - - - z coordinate of reference system - - - - - - angle definition to calculate intersection - with loft - - - - - - Continuity definition for profile extrusion: - 0= C0 (allows sharp edges, default), 2= C2 (defines curvature - continuity) - - - - - - - - - - - - - Definition of interpolation between different - profiles: 0= no interpolation 1= interpolation of strcutural - profile - - - - - - - - - - - - - - - - - - - - - - arbitraryStringerType - - - ArbitraryStringer type, containing stringer definition - (CPACS V1.5+) - - - - - - - - - - - - - - - - - - - - stringersAssemblyType - - - StringersAssembly type, containing an assembly of - stringers (new V1.5) - - - - - - - - - - - - - - - - - - - Structural elements - - - structuralElements Type, containing the different structural - elements - - - - - - - - - - - - - - - - - - - - - - - - - - - structuralMountType - - - - - - - - - - - - - - If this value is set to true then only the end points of the intersection shall be included as nodes in the model. - - - - - - The UID for the first connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. - - - - - - Optional counter to specify numbered items, e.g. ribs in a ribSet. - - - - - - The UID for the second connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. - - - - - - Optional counter to specify numbered items, e.g. ribs in a ribSet. - - - - - - - - - - - - - - - structuralProfile3DType - - - - - - - - - - - - - - - - - - - - - - - - - - 2-dimensional cross sections of structural profiles. - - - - - StructureProfile type, containing data of a structure - profile cross sections. The cross section profile is defined by - several points (->pointList) in the x-y-space. Two points are - combined to one sheet (->sheetList) by using the pointUIDs. - - This profile is defined by several points in the - x-y-space. Allways two points are combined to one sheet. The - properties of each sheet are defined in the 'sheetProperties' - section by referencing on the sheetUID and the material - properties. The orthotropy direction of composite materials equals - the x-sheet axis. The orthotropy direction angle equals a positive - rotation around the z-sheet axis as indicated in the picture below - (part 3.), where a wing stringer is defined as an example: - - - - - - - - - - - - - - - Name of the structure profile. - - - - - - Description of the structure profile. - - - - - - List of structural profile points, only x and - y. - - - - - - - - - - - - - - - Definition cross sections of structural profiles. - - - - Structuralprofiles type, containing cross section - information of structural profiles. - - - - - - - - - - - - - - - - - - - - Geometric description and material properties of a strut - - - - - - - - - - Length of the strut - - - - - - - - - - - - - - Design study parameters and results - - - - Contains optimization data such as definitions of design parameters and design studies. - - - - - - - - - - - - - - - - - - - - - - - - - subFleetType - - - Each fleet can be divided into sub fleet groups - - - - - - - - - - Name of fleet - - - - - Description of the fleet - - - - - A ; separated list of all tailsign strings - - - - - - - - - - - - - - subFleetsType - - - Contains a list of different sub fleets - - - - - - - - - - - - - - - - - - - subLoadType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Systems - - - - Systems type, containing the aircraft's control system - data - Please see the attached picture for further - documentation - - - - - - - - - - - - - - Node for geometrical layout of system components - based on simple geometric shapes - - - - - - Cockpit controls, e.g. stickRoll, pedals - - - - - - Different commandCases that are commanded, - e.g. roll, accelerate - - - - - Control Distributors, deliver inputs to the - control actuators. E.g. different angles of different ailerons. - - - - - - Control laws, for regulated actuation - - - - - - - - - - - - - - tailplaneAttachmentAreaType - - - tailplaneAttachmentArea type, containing dat on - fuselage - structure to attach tailplaine - - - - - - - - - - Definition of tailplane attachment area - (Standard - Configuration) - - - - - type of tailplane attachment: Currently - restricted to - 'Type1' and 'Type2' (see documentation) - - - - - - - - - - - - - - Definitions of VTP interface - - - - - - Definitions of VTP interface - - - - - - - - - - - - - - - takeoffPerformanceParametersType - - - - - - - - - - - - - Take-off distance at liftoff speed VLOF. - - - - - - Take-off distance at safety speed V2. - - - - - - Optimal speed Velev at point of initiating - take-off rotation by elevator deflection for a minimum take-off - distance. - - - - - Optimal rotation speed VR for a mini-mum - take-off distance - - - - - Liftoff speed VLOF. - - - - - Safety speed V2. - - - - - Take-off decision speed V1 - - - - - Minimum control speed ground VMCG. - - - - - - Flight path angle being achieved at V2 with - one engine failure in 400 ft height above ground. This is the - result of a post trim calculation using the deter-mined V2. If - the trim calculation fails the entry is set to -90. - - - - - - - - - - - - - - Structural properties of the tangent links, if - existing. The tangent links do connect the engine pylon with the - engine to carry the thrust forces. - - - - - - - - - - - - - - - - - - - - - - simpleConnectionType - - - SimpleConnection type, containing a simple connection - - - - - - - - - - - Can be each structural member (skinSegment, - stringer, frame, paxCrossBeam, cargoCrossBeam, - paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, - floorPanel, seatModule) - - - - - Can be each structural member (skinSegment, - stringer, frame, paxCrossBeam, cargoCrossBeam, - paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, - floorPanel, seatModule) - - - - - - - - - - - - - - - simpleConnectionsType - - - SimpleConnections type, containing simple connections - - - - - - - - - - - - - - - - - - - - topologyEntriesType - - - - - - - - - - - - - - - - - - - - - - topologyEntryType - - - A topology entry is used to combine the dynamic aicraft - models of several components, e.g. wing and fuselage. By default - these will be stiff. If desired stiffness and rotation with - respect to the CPACS coordinate system may be specified. - - - - - - - - - - - - - - - - - - - - - - - totalOperatingCostType - - - - - - - - - - - - - - - - - - - - - - - - trackActuatorType - - - - - - - - - - - - - Reference to the uID of the actuator of the - track. - - - - - Definition of the material properties of the - actuator to track attachment. - - - - - - - - - - - - - - wingSparsType - - - Spars type, a spar is defined by sparSegments that - stretch between multiple sparPositions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Definition of the struts of a control surface track. - - - - Definition of the struts of a control surface track. - - - - - - - - - - - - - - - - - - - - Definition of a strut of a control surface track. - - - - Definition of a strut of a control surface track. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Specification of joint coordinates. - - - - Specification of joint coordinates. - - - - - - - - - - - - - - - - - - - - Set of joint coordinates - - - - Definition of a set of joint coordinates. - - - - - - - - - - - Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - - - - - - - - Joint coordinates - - - - Definition of a joint coordinates. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Trailing edge device of the wing. - - - A trailingEdgeDevice (TED) is defined via its - outerShape relative to the componentSegment. The WingCutOut - defines the area of the skin that is removed by the TED. - Structure is similar to the wing structure. The mechanical links - between the TED and the parrent are defined in tracks. The - deflection path is described in path. Additional actuators, that - are not included into a track, can be defined in actuators. - - Leading and trailing edge are defined by the outer - shape of the wing segments, i.e. the trailing edge of a - trailingEdgeDevice is the trailing edge of the wing. This is also - valid for kinks that are present in the wing but not explicitly - modeled in the control surface. - The edges of the control surface within the wing are a - straight line in absolute coordinates! Hence, there needs to be a - straight connection between the eta-wise outer and inner points - of the edge that is within the wing in absolute coordinates. - - - - - - - - - - - Name of the trailing edge device. - - - - - - Description of the trailing edge device. - - - - - - UID of the parent of the TED. The parent can - either be the uID of the componentSegment of the wing, or the - uID of another TED. In the second case this TED is placed within - the other TED (double slotted flap). In this way n-slotted TEDs - can be created. - - - - - - - - - - - Definition of cruise rollers/mid-span stops. - Those features are small rolls at the leading edge of a flap - that keep the flap within the bending wing at cruise - configuration. - - - - - Definition of interconnection struts. Those - struts connect two neighbouring flaps and are load carrying in - case of an actuator of flap track failour. - - - - - Definiton of z-couplings. Those elements - couple two neighbouring flaps in z-direction. - - - - - - - - - - - - - - - Definition of the wings trailing edge devices. - - - - Definition of the wings trailing edge devices. - - - - - - - - - - - - - - - - - - - - Trajectories - - - - - - - - - - - - - - - - - - - - - - trajectoryGlobalType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - trajectoryType - - - - - - - - - - - - - - - - - - - - - - - - - - - transmissionGearRatioType - - - TransmissionGearRatio type, defining the ratio of - output rotation velocity to input rotation velocity. - - - - - - - - - - - - - - - - - - - - transmissionShaftInputType - - - TransmissionShaftInput type, defining a shaft input for - a transmission. - - - - - - - - - - - - - - - - - - - - transmissionShaftInputsType - - - TransmissionShaftInputs type, defining the shaft inputs - of a transmission. - - - - - - - - - - - - - - - - - - - transmissionShaftOutputType - - - TransmissionShaftOutput type, defining a shaft output - for a transmission. - - - - - - - - - - - - - - - - - - - - - transmissionShaftOutputsType - - - TransmissionShaftOutputs type, defining the shaft - outputs of a transmission. - - - - - - - - - - - - - - - - - - - transmissionType - - - Transmission type, defining a transmission/gearbox. - - - - - - - - - - - - - - - - - - - - - - - - - transmissionsType - - - Transmissions type, containing all the - transmissions/gearboxes of a rotorcraft model. - - - - - - - - - - - - - - - - - - - - - - - - - - - updateType - - - Update type, containing a datablock for each update of - the CPACS dataset - - - - - - - - - - Description of Modification of CPACS data - - - - - - Creator of CPACS modification - - - - - - Timestamp of CPACS modification - - - - - - New version number of CPACS dataset after - modification - - - - - CPACS version that the dataset is valid to - - - - - - - - - - - - - - Structural properties of the upper links, if existing. - The upper links do connect the upper forward part of the pylon - box with the forward wing attachment. - - - - - - - - - - - - - - - - - - - - - - variableSegmentType - - - - Containing the definition of variable segments for a segment block - - - - - - - - - - - defines uID of the segment having variable conditions - - - - - defines which condition(s) are variable within the segment (must be one of the defined - endConditions for the segmentBlock) - - - - - - - - - - - - - - - - - - - - List of segments that are allowed to be varied within a mission optimization. - - - - Provides a list of segments having variable conditions within the segmentBlock. - Example: a segmentBlock containing takeOff, climb, cruise, decent, landing segments has a cruise segment for which the range is variable. - The range of this segment is then to be calculated using the range defined for the segmentBlock while concerning the known ranges of all - other segments within the segmentBlock. - This concept needs to be practically tested. Does it suffice to mention (a list of) segments that are free to change to fit the overall block constraints? What happens if a segment is variable, though it has some constraints? When to define a segment as variable (climb until endPosition z, then endPosition x should be left free. Is the segment then variable? Probably not.). Somehow the 'free' segment should be in between fully defined segments (i.e.: a cruise+descent in between endPosition z == ICA and endPosition z == 0 for landing to define max range. How to define this exactly?) - - - - - - - - - - - - - - - - - - - Vehicles - - - - The vehiclesType contains all vehicle-specific - data. - This includes the vehicle itself (i.e. aircraft - and rotorcraft). Furhtermore, components - (e.g. engines, structuralElements, etc.) - as well as physical properties of materials and - fuels can be predefined for easy and consistent reuse via - uID-references. - - - - - - - - - - - - - - - - - - - - - - - - - - - - vtpFrameDefType - - - Definition of the individual VTP attachments - - - - - - - - - - Definition of tailplane attachment area - (Standard Configuration) - - - - UID of the fuselage frame at this VTP - attchment - - - - - Flag for option for VTP attachment between - defined FrameUID and the next one - - - - - UID of panel element at VTP attachment (shell - elements) - - - - - UID of structural element at VTP attachment - (base, beams) - - - - - UID of structural element at VTP attachment - (horizontal, beams) - - - - - UID of structural element at VTP attachment - (radial, beams) - - - - - - - - - - - - - - vtpInterfaceDefType - - - Definition of the interface of the VTP - - - - - - - - - Definition of the VTP interface - - - - - Definition of the VTP attachment frames and - their - reinforcement - - - - - - Defines area for valid x-position of VTP (just - used - if attachmentpoint is directly based on frame) ==> check and - potentially warning message - - - - - - Definition of the max. distance between - fuselage and - the defined VTP pins ==> check and potentially warning - message - - - - - - Definition of reinforcement area at VTP frame - positions (relative coordinate, smaller than - 1.0) - - - - - - Definition of vertical reinforcements at VTP - frame - positions (relative coordinate, smaller than - 1.0) - - - - - - value to change from horizontal to radial - reinforcements for VTP frame plates - - - - - - UID of elements to connect VTP pins with - fuselage - (beam elements) - - - - - - - - - - - - - - - webType - - - - SparWeb type, containing the cross section area of the - spar web and the material properties. - Pleas find below a picture where all spar cross - section parameters as well as the orientation refereneces for - the material definition can be found: - - - - - - - - - - - - - - Material definition of the spar web. - - - - - - relPos ranges from 0 to 1 It defines the - position of the web relative to the caps (see picture below).. - - - - - - - - - - - - - - weightAndBalanceCaseType - - - WeightAndBalanceCase type, containing weight and - balance data for one case - - - - - - - - - - - - - - - - - - - - - - - - weightAndBalanceFuelInTankType - - - - - - - - - - - - - - - - - - Ranges from 0 for empty tank to 1 - - - - - - - - - - - - - - weightAndBalanceFuelInTanksType - - - - - - - - - - - - - - - - - - - - - - weightAndBalanceFuelType - - - - - - - - - - - - - - - - - - - - - - - - - weightAndBalancePayloadType - - - - - - - - - - - - - - - - - - - - - - - - - - Weight and balance - - - WeightAndBalance type, containing weight and balance - datasets - - - - - - - - - - - - - - - - - - - - weightAndBalancemCargosType - - - For a higher ganularity it is possible to add more - information on the actual Cargo that are included in the - operational case. Please note that the information needs to be - identical with the massBreakdown. Hence, only links via uIDs can - be specified. - - - - - - - - - - - - - - - - - - - - - - weightAndBalancemPaxxType - - - For a higher ganularity it is possible to add more - information on the actual Pax that are included in the - operational case. Please note that the information needs to be - identical with the massBreakdown. Hence, only links via uIDs can - be specified. - - - - - - - - - - - - - - - - - - - - - - windowAssemblyPositionType - - - WindowAssembly type, containing an the position of a - windows assembly - - - - - - - - - - UID of the window element to be used - - - - - - x position of window elemment on global x axis - - - - - - z position of window elemment refernce point - - - - - - angle around global x axis to define window - position with respect to positionX and postionZ - - - - - - - - - - - - - - - windowsAssemblyType - - - WindowsAssembly type, containing an assembly of windows - - - - - - - - - - - - - - - - - - - - windowsType - - - Windows type, containing windows - - - - - - - - - - - - - - - - - - - - wingAeroPerformanceType - - - wingAeroPerformance type, containing perfomance maps - with aerodynamic data of a wing. - - - - - - - - - - Reference to the uID of the analysed wing - - - - - - References used for the calculation of the - force and moment coefficients of the wing (in the wing axis - system!) - - - - - Calculated aerodynamic performance maps of the - wing - - - - - - - - - - - - - wingAirfoilsType - - - WingAirfoils type, containing wing airfoil geometries. - See profileGeometryType for further documentation - - - - - - - - - - - - - - - - - - - Cell of the wing - - - - A cell defines a special region of the wing. Within - this region skin and stringer properties can be defined that - differer from the properties of the rest of the wing. In general - a cell is defined by defining four borders – the cell leading - and trailing edge and the inner border and the outer border. - Those borders can either be defined by using eta/xsi coordinates - or by referencing to spars and ribs. Mixed definitions (e.g. - forward border is defined due to a spar, side borders due to eta - coordinates) is allowed. In general a cell is quadrilateral. But - if e.g. the spar, which is used for the definition of the - trailing edge, has a kink, the cell can have more than four - corners. - The cell leading and trailing edge (= forward and rear - border) can either be defined by referencing to a spar - (->sparUID) or by the defining the xsi (=relative chord) - coordinates of the border (xsi1 = inner end; xsi2 = outer end). - - The cell inner and outer border can either be defined - by referencing to a rib (->ribDefinitionUID and ribNumber) or - by the defining the eta (=relative spanwise) coordinates of the - border (eta1 = forward end; eta2 = rear end). - Some examples for wing cells can be found in the - picture below: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cells of the wing. - - - WingCells type, containing all the cells of the wing. - - - - - - - - - - - - - - - - - - - - Structure of the wing - - - wingComponentSegmentStructure type, containing the - whole structue (skins, ribs, spars...) of the wing. - - - - - - - - - - - - - - - - - - - - - - - Element of the section. - - - - Within elements the airfoils of the wing are defined. - Each section can have one or more elements. Within each element - one airfoil have to be defined. If e.g. the wing should have a - step at this section, two elements can be defined for the two - airfoils. - Mathematically spoken a element is a coordinate system - that is translated, rotated and scaled relative to the section - coordinate system. This transformation parameters are defined - withing the transformation section. The wirfoil, which is linked - by using the parameter airfoilUID is directly 'copied' in the - element coordinate system. If e.g. the airfoil is defined from 0 - to 1 in x-direction and the total scaling of the elements x-axis - equals 3.5 the wing chord is 3.5 m long. - An example for wing element can be found in the - picture below: - - - - - - - - - - - - - - Name of the wing element. - - - - - Description of the wing element. - - - - - - Reference to a wing airfoil. - - - - - - - - - - - - - - - - Elements of the wing. - - - WingElements type, containing the elements of a wing - section. - - - - - - - - - - - - - - - - - - - Border of the fuel tank (either rib or spar). - - - - - - - - - - - - - - Spar uID of the bordering spar. - - - - - - - UID of the rib set of the bordering rib. - - - - - - RibNumber of the rib set of the bordering - rib. - - - - - - - - - - - - - - Definition of the geometry of the wing fuel tank by - defining a continouse list of borders. - - - - - - - - - - - - - - - - - - - - - - Definition of one wing fuel tank. - - - - - - - - - - - - - Name of the wing fuel tank. - - - - - - Description of the wing fuel tank. - - - - - - - - - - - - - - - - - Definition of different volumes of the fuel tank. - - - - - - - - - - - - - - Theoretical volume if material thicknesses - (ribs, spars, skins, stringers) and systems (fuel pumps, - pipes...) are neglected. - - - - - - - Usable fuel volume aircraft operations. - - - - - - Total real fuel tank volume. - - - - - - - - Factor between the usalbe fuel volume and - the real fuel volume. - - - - - Factor between the real fuel volume and the - theoretical optimum fuel volume. - - - - - - - - - - - - - - - List of wing fuel tanks. - - - - - - - - - - - - - - - - - - - - - - Definition of the wing-fuselage attachment - - - - Definition of the wing-fuselage attachment. The area - of the fuselage attachment (resp. center wing box, CWB) is - defined by defining one resp. two ribs from the rib definition. - If one rib is defined (rib1) the CWB goes from the closer end of - the componentSegment (e.g. wing symetry plane) to the defined - rib. If two ribs are defined (rib1 and rib2), the CWB is between - both ribs. - Additionally attachment pins can be defined. At those - positions the wing is attached to the fuselage. This can be e.g. - used for defining the wing-attachment of high wing - configurations, HTPs or VTPs. - - - - - - - - - - - Definition of first (=inner) rib of the - fuselage attachment. - - - - - Definition of the second (=outer) rib of the - fuselage attachment. Optional. Only to be used if attachment is - defined over two ribs. - - - - - Definition of position, orientation, materials - and blocked DOFs of attachment pins. - - - - - Definition of actuators (e.g. trim actuator of - an HTP) of the attachment. - - - - - - - - - - - - - Definition of the wing-fuselage attachment. - - - Definition of the wing-fuselage attachment - - - - - - - - - - - - - - - - - - - wingInterfaceDefinitionsType - - - CenterFuselage high wing interface definitions - - - - - - - - - - - - - - - - - - - - - - - - - centerFuselageMainFramesType - - - High wing main frame definition, containing mainframe - UIDs - - - - - - - - - - - - - - - - - - - - - wingInterfaceSupportStrutType - - - wingInterfaceSupportStrut type, containing support - strut definition - - - - - - - - - - Name of support strut. - - - - - Type description: lateral or longitudinal - support strut. - - - - - - - - - - - - - - - - - - wingInterfaceSupportStrutsAssemblyType - - - wingInterfaceSupportStrutsAssembly type, containing - support struts assembly - - - - - - - - - - - - - - - - - - - - Definition of the cell of the intermediateStructure - - - - - IntermediateStructure: - It defines the filling materials between the upper and - lower shell (e.g. honeycombe structures in a smeared - representation). IntermediateStructure is optional.The position - of the intermediateStructure is defined in so called cells (= - special areas on the wing). Default is no intermediateStructure. - - Material Definition of intermediateStructure: - - The material of the intermediateStructure is reference - by 'material'. The material orientation is defined by 'rotX' and - 'rotZ'. 'rotZ' is defined equivalent to the stringer angle resp. - the skin orthotropyDirection. 'rotX' equals a positive rotation - around the wings x-axis, while a rotation of zero is equivalent - to the wing middle plane. - A picture to clarify the reference direction of rotZ - (equivalent to orthothropy direction of the wing) can be found - in the picture below: - - - - Position definition by using cells: - A cell defines a special region of the wing. Within - this region the cell properties are defined. In general a cell - is defined by defining four borders – the cell leading and - trailing edge and the inner border and the outer border. Those - borders can either be defined by using eta/xsi coordinates or by - referencing to spars and ribs. Mixed definitions (e.g. forward - border is defined due to a spar, side borders due to eta - coordinates) is allowed. In general a cell is quadrilateral. But - if e.g. the spar, which is used for the definition of the - trailing edge, has a kink, the cell can have more than four - corners. - The cell leading and trailing edge (= forward and rear - border) can either be defined by referencing to a spar - (->sparUID) or by the defining the xsi (=relative chord) - coordinates of the border (xsi1 = inner end; xsi2 = outer end). - - The cell inner and outer border can either be defined - by referencing to a rib (->ribDefinitionUID and ribNumber) or - by the defining the eta (=relative spanwise) coordinates of the - border (eta1 = forward end; eta2 = rear end). - Some examples for wing cells can be found in the - picture below: - - - - - - - - - - - - - - - - - - Reference to the material of the intermediate - structure. - - - - - 'rotX' equals a positive rotation around the - wings x-axis, while a rotation of zero is equivalent to the wing - middle plane direction. - - - - - 'rotZ' is defined equivalent to the stringer - angle resp. the skin orthotropyDirection. - - - - - - - - - - - - - - IntermediateStructure cells - - - Definition of the intermediateStructure of the - componentSegment of the wing. - - - - - - - - - - - - - - - - - - - Definition of a ribCell - - - RibCells are optional elements. They are defined via a - fromRib and a toRib. The enumeration is within the ribSet. - RibNumber 1 starts at etaStart. - - - - - - - - - - Defines the beginning of the ribCell. The - enumeration is within the ribSet. - - - - - Defines the ending of the ribCell. The - enumeration is within the ribSet. - - - - - WING: The Rotation along the x describes a - rotation around a line, that is defined by the intersection of - the rib with the wing middle plane (orientated from leading to - trailing edge). This angle defaults to 90° which means, that the - rib is perpendicular on the wings middle plane. PYLON: The - Rotation along the z describes a rotation around the pylons - z-axis (= rotation in top view). This angle defaults to 90° - which means, that the rib is perpendicular to the pylons x-axis. - - - - - - The orthotropyDirection is defined as rotation - around the ribs z-axis. The rib coordinate system is defined as - follows: x-axis is from leading to trailingeEdge of the - componentSegment in the direction of the rib elongation. z-axis - is normal to the rib in the direction of positive eta. y is - defined by right hand rule. Rotation is around the z-axis. Zero - degrees are at the x-axis positive direction. - - - - - - - - - - - - - - - - - Cross section properties of a wing rib - - - wingRibCrossSectionType, containing the definition of - ribsCrossSection - - - - - - - - - - The orthotropyDirection is defined as rotation - around the ribs z-axis. The rib coordinate system is defined as - follows: x-axis is from leading to trailingeEdge of the - componentSegment in the direction of the rib elongation. z-axis - is normal to the rib in the direction of positive eta. y is - defined by right hand rule. Rotation is around the z-axis. Zero - degrees are at the x-axis positive direction. - - - - - - WING: The Rotation along the x describes a - rotation around a line, that is defined by the intersection of - the rib with the wing middle plane (orientated from leading to - trailing edge). This angle defaults to 90° which means, that the - rib is perpendicular on the wings middle plane. The rotation - angle is defined at the intersection point of the rib with the - ribReference line. The rib itself is allways straight and not - twisted. PYLON: The Rotation along the z describes a rotation - around the pylons z-axis (= rotation in top view). This angle - defaults to 90° which means, that the rib is perpendicular to - the pylons x-axis. - - - - - - - - Post element definition applied to all vertical intersections with spars - - - - - - - - - - - - - Explicit positioning of a wing rib - - - - Use this type for an explicit positioning of a rib. As opposed to - ribsPositioning, this defines a single rib connecting a specified start - and end point. - - - - - - - - - - - - - Defines the start of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the start of the rib defined by a point on a reference curve - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the beginning of the rib using a specific sparPosition. - - - - - - - - - Defines the end of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the end of the rib given by a point on a reference curve - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the end of the rib using a specific sparPosition. - - - - - - - - Defines the forward beginning of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - RibEnd defines the backward ending of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - - - - - - - - wingRibPointType - - - - The wingRibPointType is used to define reference points on ribs. - It can be used for rib set definitions (wingRibsPositioningType) as - well as explicit rib definitions (wingRibExplicitPositioningType). - - - - - - - - - - - - The UID of the rib definition. Can be a reference to nodes - of either wingRibsPositioningType or wingRibExplicitPositioningType. - - - - - - - For references of type wingRibsPositioningType this node indicates the rib number of the rib set. - If not given it defaults to 1. - - - - - - - Normalized xsi coordinate of the rib point which is measured along the rib - from the start point [0] towards the end point [1]. - - - - - - - - - - - - - - Definition of a set of ribs - - - - RibDefinitionType, containing the definition for ribs. - Ribs are defined in sets of one or more ribs. The positions of - the rib, as well as the orientation of the ribs are defined in - 'ribPositioing'. The cross section properties, as e.g. - materials, are defined in 'ribCrossSection'. - - - - - - - - - - - Name of the rib set - - - - - Description of the rib set - - - - - - - - - - - - - - - - - - - - Wing ribs - - - RibDefinitions type, containing the definition of all - ribs of the wing. - - - - - - - - - - - - - - - - - - - Positioning of a set of wing ribs - - - - The ribsPositioning type allows the definition of a set - of ribs which is distributed over a specified spanwise area. - The positions of the ribs are defined by placing the - ribs on a reference line on the wing (ribReference). The inner - and the outer beginning of the rib set is defined using etaStart - and etaEnd. The position of the forward and rear end of the ribs - is defined by ribStart and ribEnd. The orientation of the ribs - is defined in ribRotation. The number of ribs of the current rib - set is either defined by ribNumber or by spacing. - Three examples how ribs can be placed on the wing are - illustrated in the picture below. For more detailed information, - please refer to the description of each parameter. - - - - - - - - - - - - - - - - Defines the start of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the start of the rib by a point on a reference curve, - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the beginning of the rib using a specific sparPosition - - - - - - - - - Defines the end of the rib defined in eta-xsi coordinates of a reference plane - - - - - - - Defines the end of the rib defined by a point on a reference curve - such as a spar, but not an explicit sparPosition - - - - - - - Defines the location of the end of the rib using a specific sparPosition - - - - - - - - Defines the forward beginning of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - Defines the backward ending of the ribs. It can either be a - sparUID or "trailingEdge" or "leadingEdge". - - - - - - - - The spacing of the ribs defines the distance between two ribs, - measured on the - ribReferenceLine. First rib is placed at etaStart. - - - - - - - Defines the number of ribs in this ribSet. First rib is at - etaStart on the - referenceLine, last rib is at etaEnd. The spacing is constant on the - ribReferenceLine. - - - - - - - - The ribReference is the reference line for the computation of the rib set spacing. - It can either be a sparUID or "trailingEdge" or "leadingEdge" - - - - - - - - RibCrossingBehaviour can either be 'cross' or 'end'. If it is set to'end' the ribs - of this rib set will end at the intersection with another rib. - If it is set to - 'cross' the ribs of this rib set will continue at the intersection - with another rib. - - - - - - - - - - - - - - - - - - - - - - Section of the wing. - - - - WingSection type, containing a wing section. The - sections contains elements, where the airfoils are defined. For - the definition of a wing at least two sections (root and tip) - have to be defined, but any number greater than 2 is also - possible. - Mathematically spoken a section is a coordinate system - that is translated, rotated and scaled relative to the wing - coordinate system. This transformation parameters are defined - withing the transformation section. - In addition to the translation, which is defined in - the transformation part, the section can be translated by using - the positionings vectors (wing->positiongs). Translation of - the positionings vectors is added to the translation of the - section. - An example for wing sections can be found in the - picture below: - - - - - - - - - - - - - - Name of wing the wing section. - - - - - - Description of the wing section. - - - - - - - - - - - - - - - - - Sections of the wing. - - - WingSections type, containing all the sections of the - wing. - - - - - - - - - - - - - - - - - - - Segment of the wing. - - - - A segment defines which two wing elements (=cross - sections) are linked to one wing segment. - An example for wing segments can be found in the - picture below: - - - - - - - - - - - - - - Name of wing the wing segment. - - - - - - Description of the wing segment. - - - - - - Reference to the element from which the - segment shall start. - - - - - Reference to the element at which the segment - shall end. - - - - - Optional and additional guidecurves to shape - the outer geometry. - - - - - - - - - - - - - - Segments of the wing. - - - WingSegments type, containing all the segments of the - wing. - - - - - - - - - - - - - - - - - - - Shells of the wing - - - Within the wingShellType the upper and lower skin of a - and the skin stringers are defined. At 'skin' and 'stringer' the - skin and stringer properties of the complete componentSegment are - defined. If different skin or stringer properties should be - defined in a special region of the wing this can be done within - 'cells'. - If the stringer should not be defined explicite, they - can be defined implizite by defining an equivalent material layer - and using a composite as material. - - - - - - - - - - - - - - - - - - - - - - Material properties of the wing skin. - - - - The wingSkinType describes the material properties of - the wing. - For composites materials: the positive z-direction is - from the outer side to the inner side. - For composites materials: the reference axis for the - orthotropyDirection is defined by the two leading edge points of - the 'from'- and the 'to'-element of the componentSegment - definition. The angle between the reference axis and the - orthotropyDirection equals the rotation around the z-reference - axis. For details, please refer to the picture below: - - - - - - - - - - - - - - - Material properties of the wing skin. - - - - - - - - - - - - - - Wing spars - - - - Spars type, a spar is defined by sparSegments that - stretch between multiple sparPositions. The spar definition is - very flexible in CPACS. Spars can start and end at any position - of the wing, spars can have kinks at any position of the wing - and spars can cross each other or merge. - At first the spar points (->sparPositions) have to - be defined. Spar points are defined using the relative - coordinates eta and xsi. Spar points do lay on wing middle - plane. - Two or more spar points are connected to on spar - segment (->sparSegments). Each spar segment can be seen as - one spar. The spar geometry between two spar points is defined - as a direct/straight connection in global coordinate system - and not in eta xsi coordinates of the component segment. - One spar point can be used by more than one spar, if - e.g. two spars are merging. The detailed cross section of the - spar is also defined with sparSegments. - Pleas find below a picture for an example definition - of 3 spars in one wing, by using spar position points and spar - segments: - - - - - - - - - - - - - - - - - - - - - - - - Definition of the wing stringers. - - - - Within the wingStringerType wing stringers are - defined. The stringer are defined by referencing on the - stringerStructureUID, where the shape and material settings of - one single stringer is defined. In addition the orientaion and - the stringer pitch have to be defined: - One stringer intersects the point at the given xsi and - eta position. - - - - Alternatively, an exlicit stringer definition can be - applied if the stringers shall be tapered. - - - - - - - - - - - - - This is the simple and default stringer - definition - - - - The pitch describes the distance between to - adjacent stringers in the plane rectangular to the stringer - elongation direction. - - - - - - Stringer angle: the reference axis for the - stringer angle is defined by the two leading edge points of - the 'from'- and the 'to'-element of the componentSegment - definition. The angle between the reference axis and the - stringers equals the rotation around the z-reference axis. For - details, please refer to the picture below. - - - - - - If the reference of the stringer angle shall - be different from the default implementation then this - parameter may be set. Allowed values include: leadingEdge, - trailingEdge and globalY. Furthremore, it is possible to - provide the UID of a spar. - - - - - - This is the explicit stringer definition. - Please note that for a consistent definition two out of the - possible three elements innerBorder (xsiLE, xsiTE), outerBorder - (xsiLE, xsiTE) and stringer angle (and angle reference) must be - defined. Any combination of two of the three is valid - - - - - The number of stringers; default is 0 - - - - - - Stringer angle: the reference axis for the - stringer angle is defined by the two leading edge points of - the 'from'- and the 'to'-element of the componentSegment - definition. The angle between the reference axis and the - stringers equals the rotation around the z-reference axis. For - details, please refer to the picture below. - - - - - - If the reference of the stringer angle shall - be different from the default implementation then this - parameter may be set. Allowed values include: leadingEdge, - trailingEdge and globalY. Furthremore, it is possible to - provide the UID of a spar. - - - - - Inner border xsi coordinate at the leading - edge of the stringer definition - - - - - Outer border xsi coordinate at the leading - edge of the stringer definition - - - - - Inner border xsi coordinate at the trailing - edge of the stringer definition - - - - - Outer border xsi coordinate at the trailing - edge of the stringer definition - - - - - - - - - - - - - - - wingStructuralMountsType - - - - - - - - - - - - - - - - - - - - - - Wing type, containing all a lifting surface (wing, HTP, - VTP, canard...) of an aircraft model. - - - - Wing type, containing all a lifting surface (wing, - HTP, VTP, canard...) of an aircraft model. - Position of the wing: The position of the wing is - defined using the transformation parameters. Using those - parameters, the wing coordinate system is translated, rotated - and scaled. - Definition of the wings outer shape: The outer shape - of the wing is defined by airfoils that are placed within the 3D - space. Two airfoils are combined to one wing segment within the - segments. For the definition of the positions of the airfoils, - differnt sections are defined. Within each section one or more - elements are defined. The airfoil shape is defined within the - elements. If the wings outer shape should e.g. have a step it is - possible to define two different airfoils in one section by - using two elements. In most cases each section will only include - one element. Positionings are vectors that are used for an - additional translation of the sections by using 'user friendly - paramaters' as e.g. sweep and dihedral. Please note, the first - positioning may be non-zero. Often it will be zero just to - locate the wing at the position stated by the translation, but - this is not necessary. Finally the wing segments are defined by - combining two consecutive elements. A more detailed description - is given within the different parameters. - Definition of control surfaces, wing structures, wing - fuel tank and wing fuselage attachment: those parts are defined - within componentSegments. Please refer to the documentation - there. - - - - - - - - - - - - - - Name of the wing. - - - - - Description of the wing. - - - - - UID of part to which the wing is mounted (if - any). The parent of the wing can e.g. be the fuselage. In each - aircraft model, there is exactly one part without a parent part - (The root of the connection hierarchy). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The two elements that where the structural connection - is placed. - - - - - - - - - - - - - Element uID of the element of the CURRENT - componentSegment where the structural connection is placed. - - - - - - Element uID of the element of the second - componentSegment where the structural connection is placed. - - - - - - - - - - - - - - Two spars that are structurally connected. - - - - - - - - - - - - - Spar uID of the CURRENT componentSegment. - - - - - - Spar uID of the second componentSegment. - - - - - - - - - - - - - - wingWingAttachmentType - - - Definition of the structural connection between two - wings resp. two componentSegments. Note: All structural - connections between two wings/componetSegments have to be defined - using wingWingAttachments. The wingWingAttachment has only be - defined in one of the two componentSegments, that are connected. - - - - - - - - - - - UID of the componentSegment, that is connected - with the current one. - - - - - - - Defines if the upper shell of the current - componentSegment is structurally connected to the upper or lower - shell of the second componentSegment. Can have the values - 'upperShell' or 'lowerShell'. - - - - - Defines if the lower shell of the current - componentSegment is structurally connected to the upper or lower - shell of the second componentSegment. Can have the values - 'upperShell' or 'lowerShell'. - - - - - - - - - - - - - wingWingAttachmentsSparsType - - - - - - - - - - - - - - - - - - - - - - List of wingWingAttachments. - - - - - - - - - - - - - - - - - - - - - - wingsAeroPerformanceType - - - wingsAeroPerformance type, containing - wingsAeroPerformance - - - - - - - - - - - - - - - - - - - Wings - - - Wings type, containing all the lifting surfaces (wings, - HTPs, VTPs, canards...) of an aircraft model. - - - - - - - - - - - - - - - - - - - xsiIsoLineType - - - Iso line described by point of same xsi coordinate. - Can be either segment or component segment coordinates. - - - - - - - - - - Relative spanwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. - - - - - This reference uID determines the reference coordinate system. - If it points to a segment, then the eta value is considered to be in segment - eta coordinate; if it points to a componentSegment, - then componentSegment eta coordinate is used. - - - - - - - - - - - - - zCouplingType - - - - - - - - - - - - - Reference to the control surface that is - connected to this controll surface by the z-coupling.. - - - - - - Material of the movable part of the - z-coupling. - - - - - Definition of the attachment of the z-coupling - to this control surface. - - - - - Definition of the attachment of the z-coupling - to the other control surface. - - - - - - - - - - - - - - zCouplingsType - - - - - - - - - - - - - Definiton of one z-coupling. - - - - - - - - - - - - - - damTolBehaviourType - - - - - - - - - - - - - Damage tolerance law, Walker approach - - - - - Damage tolerance law, Forman approach - - - - - - - - - - - - - fatigueStressBasedBrownMillerType - - - - - - - - - - - - - Parameter sigma_f [N/m^2] - - - - - Parameter b [-] - - - - - Parameter epsilon_f [-] - - - - - Parameter c [-] - - - - - - - - - - - - - damTolWalkerType - - - - - - - - - - - - - Fracture toughness KIc [Pa m^0.5] - - - - - Parameter C0 [m/cycle] - - - - - Parameter m [-] - - - - - Parameter gamma [-] - - - - - - - - - - - - - damTolFormanType - - - - - - - - - - - - - Parameter Kc [Pa m^0.5] - - - - - Parameter C2 [m/cycle] - - - - - Parameter m2 [-] - - - - - - - - - - - - - - - - - The compartment defines an enclosed volume within the fuselage. It is defined by a set of border geometries. This could be pressureBulkheads, walls or floors and they are referred by their uIDs. The volume is closed with the fuselage skin. The geometry tool has to check, if the compartment definition gives a closed geometry. - - - - - - - - - - - The compartment defines an enclosed volume in the - fuselage. It is defined by a set of border geometries. - This could be pressureBulkheads, walls or floors and - they are referenced by their uIDs. The volume is closed - with the fuselage skin. The geometry tool has to check, - if the compartment definition gives a closed geometry. - - - - - - - - - Compartment geometry uIDs list. - - - - - - - Name of the compartment. - - - - - - - Description of the compartment. - - - - - - - Ideal design volume of the compartment. - - - - - - - - - - - - - - - - - - - - - - - UIDs of 2d structural fuselage elements - (e.g., pressure bulkheads, walls or - floors). The compartment will be - enclosed with the fuselage skin - - - - - - - - - - - - - - fatigueBehaviourType - - - - - - - - - - - - - Fatigue law, stress based Brown Miller approach [N/m^2] - - - - - - - - - - - - - plasticityCurvesType - - - - - - - Plastification curve incl. element elimination (isotropic - materials). The data may be used to describe the plastic behavior of isotropic - materials in non-linear analysis, such as crash simulations. The input is defined - according to the needs of Material 103 (single stress strain option) in the - PAM-CRASH explicit Finite Element code, but can also be used for equivalent material - laws in alternative simulation environment (see PAM-CRASH Solver Reference Manual., - Material 103). - - - - - - - - - - - - - - - - This type describes the plasticity curve of isotropic - materials - - - - ... - - Plastification curve incl. element elimination - (isotropic materials) - - Plastification curve incl. element elimination (isotropic - materials) The data may be used to describe the plastic behavior of - isotropic materials in non-linear analysis, such as crash - simulations. The input is defined according to the needs of Material - 103 (single stress strain option) in the PAM-CRASH explicit Finite - Element code, but can also be used for equivalent material laws in - alternative simulation environment (see PAM-CRASH Solver Reference - Manual., Material 103) - Source: PAM-CRASH V2010 - Notes Manual - - - - - - - - - - - - Name of the post failure definition - - - - - - - Description of the post failure - definition - - - - - - - Strain rate for following plastcity - curve [1/s] - - - - - - - - - - plasticEliminationStrain [-]; Plastic - strain for element elimination during - the non-linear analysis - - - - - - - - - - - - - - - - Definition of wall positions to place - walls inside fuselage. - - - - - - - List of wall segments. - - - - - - - - - - - - Definition of wall positions to place walls inside fuselage. - - - - - - - Wall position definition specifying a point in the fuselage to be connected to a wall segment. - - - - - - - - - - - - - - Wall segment definition. - - - - - - - - - - Definition of a wall position to place walls inside fuselage. - - - - - - - UID of a bulkhead determining the - x-coordinate of the position with the given - y- and z-coordinates. - - - - - - - UID of a wall segment determining the - x-coordinate of the position with the given - y- and z-coordinates. - - - - - - - UID of a fuselage section determining the - x-coordinate of the position with the given - y- and z-coordinates. - - - - - - - UID of a tank hull section determining the - x-coordinate of the position with the given - y- and z-coordinates. - - - - - - Absolute x-coordinate of wall position in fuselage coordinate system. - - - - - - Absolute y-coordinate of wall position in fuselage coordinate system. - - - - - Absolute z-coordinate of wall position in fuselage coordinate system. - - - - - - - - - - - - Defines extrusion direction. Rotation angle - around fuselage x-axis of extrusion direction. A - value of 0deg means fuselage z-axis as extrusion - direction. Default: 0.0deg. - - - - - - - - - - - - - - By default, the wall is only extruded in positive direction. If doubleSidedExtrusion is true, the wall is additionaly extruded in negative direction as well. Default: false. - - - - - Rotates the first edge of the wall segment so that it is adjacent with the structural element defined in the first wall position (bulkhead, fuselage section or another plane wall). Default: false. - - - - - Rotates the last edge of the wall segment so that it is adjacent with the structural element defined in the last wall position (bulkhead, fuselage section or another plane wall). Default: false. - - - - - - A list of uIDs referencing other - structural/geometric elements that shall serve - as a boundary of the wall element. Possible - references are floor, wall or - genericGeometryComponent. A major requirement is - that the referenced element has an intersection - with the wall for at least the distance between - two wall positions. So that a full geometric - face of the wall is bounded by it. Neighbouring - wall faces that are not completely bounded by - the reference element are not affected. - - - - - - - Reference to the structural property definition - of this wall segment. - - - - - - - List of wall position uIDs that are used for - this wall segment. At least two positions must - be defined (for start and end position of wall). - If more than two positions are referenced here, - the wall is constructed out of several planar - faces that connect two consecutive positions - (Note: Order of position uIDs defines - connectivity). - - - - - - - - - - - A list of uIDs referencing other structural/geometric - elements that shall serve as a boundary of the wall - element. Possible references are floor, wall or - genericGeometryComponent. A major requirement is that - the referenced element has an intersection with the wall - for at least the distance between two wall positions. So - that a full geometric face of the wall is bounded by it. - Neighbouring wall faces that are not completely bounded - by the reference element are not affected. - - - - - - - - - UID referencing another - structural/geometric element that shall - serve as a boundary of the wall element. - Possible references are floor, wall or - genericGeometryComponent. - - - - - - - - - - - - - - - Structural wall reinforcement definition specifying physical properties of a fuselage wall segment. - - - - - - - - - - - - - - Reference to a sheet element definition specifying the physical properties of the wall's shell. - - - - - Reinforcements running along the position polygon of the wall positions. - - - - - Reinforcements running in lateral/radial direction in the wall segment plane. - - - - - Reinforcement at inner side of wall. This is either, depending on the extrusion direction flag, the edge of the wall that connects the positions ("positiveDirection") or the edge of the wall where the wall intersects with the fuselage skin in the opposite direction of the extrusion direction. - - - - - - Reinforcement at outer side of wall. The outer side of the wall is defined as the edge of the wall at the intersection of the wall with the fuselage skin running along the main direction of the wall. - - - - - - - Lateral caps are the reinforcements of - the wall at the edges lateral to the - main direction of the wall. These caps - can be either defined at start, end, - start and end or at all wall positions - according to the placement flag. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Reference to wall position uID. - - - - - - - - - - - - nacelleCowlType - - - - Describes the cowl geometry for nacelles - using sections positioned around the - rotational center of the engine. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - nacelleCenterCowlType - - - - Describes the curve for defining rotational center of the engine. - - - - - - - - - - - - - - - - - - - - - - Aerodynamic performance - - - - The aerodynamic coefficients and derivatives are stored in aerodynamic maps. Individual maps can be used to - gather the aerodynamic characteristics for specific boundary conditions. - - - - - - - - - - - - - - - - - - - - - Aerodynamic map - - - - - The aeroMap contains aerodynamic coefficients and derivatives for a specific set of aerodynamic - and configurative boundary conditions. - - The aeroMap allows for the simultaneous specification of multiple - controlDevice settings. - In this case, it is assumed that a cumulative setting is built by summing up the individual settings. The correct - sequence of this summation is described in the controlDistributorType documentation. - - - - - - - - - - - - Name - - - - - Description - - - - - - - - - - - - - - - - - - - - Boundary conditions - - - Specification of boundary conditions. - - - - - - - - - - - - - - Offset from temperature of the - atmospheric model [K]. For more details - on atmospheric models, please refer to - documentation of the <CPACS> root - element. - - - - - - - Configuration settings - - - - - - - - - - - - - - Control elements - - - Specification of control element settings. Control elements can be controlDistributors - or individual control devices, such as control surfaces or landing gears. - - - - - - - - - - - - - - - - - - - - Control element - - - Specification of an control element setting. A control element can be a controlDistributor - or an individual control device, such as a control surface or a landing gear. - - - - - - - - - - - Reference to the uID of a control device, e.g. a control surface or a landing gear - - - - - Control parameter of the control device - - - - - - - Reference to a control distributor uID - - - - - Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - - - - - - - - Aerodynamic coefficients and derivatives - - - - - Description - - The aeroPerformanceMap contains a map - with aerodynamic data of the complete aircraft in the form of - nondimensional coefficients. The force coefficients in - i-direction (ci) - are nondimensionalized by dynamic pressure and reference area, - the moment coefficients (cmi) by dynamic pressure, reference - area and reference length. - - All coefficients in the aeroPerformanceMap relate to - the aerodynamic coordinate system which is deducted from the CPACS coordinate system by - the transformations of angle of attack and angle of yaw. See the documentation of the - CPACS element for further details. - - The dependend parameters of the aeroPerformanceMap are altitude, - machNumber, angleOfSideslip and - angleOfAttack. These elements are vectors of equal length, where values - with identical indices belong together. The solution vectors ci and - cmi have the same length as the input vectors. Shown below is an example where - with 10 values per vector: - - <altitude mapType="vector">12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02</altitude> -<machNumber mapType="vector">0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2</machNumber> -<angleOfSideslip mapType="vector">0;0;0;0;0;2;2;2;2;2</angleOfSideslip> -<angleOfAttack mapType="vector">-2;0;2;4;6;-2;0;2;4;6</angleOfAttack> -<cd mapType="vector">0.056;0.094;0.132;0.17;0.208;0.072;0.11;0.148;0.186;0.224</cd> -<cs mapType="vector">0.;0.;0.;0.;0.;0.01;0.015;0.02;0.025;0.03</cs> -<cl mapType="vector">-0.1;0.04;0.18;0.32;0.46;-0.08;0.03;0.14;0.25;0.36</cl> - - The aerodynamic coefficients for altitude=1200m, machNumber=0.2, - angleOfSideslip=0° and angleOfAttack=6° can be found at the 5th index: - cd=0.208, cs=0 and cl=0.46. - - - - - - - - - - - - - - - Altitude [m] - - - - - - - Mach number - - - - - - - Sideslip angle [deg] - - - - - - - Angle of attack [deg] - - - - - - - Drag coefficient in aerodynamic - coordinates - - - - - - - Coefficient of the side force vector in - aerodynamic coordinates (perpendicular - to lift and drag) - - - - - - - Lift coefficient in aerodynamic - coordinates - - - - - - - - - - - - - - - - - - - Increment maps for aerodynamic coefficients - - - - - - - - - - - - - - - - - - - Increment map from aerodynamic coefficients - - - The increment map is composed of two-dimensional arrays. The first dimension is given by the - length of the input vectors of the baseline aeroPerformanceMap and the second dimension by the vector of relative - deflections (or command inputs) of control surfaces (or control distributors). An example is described in the <CPACS> - root element. - - - - - - - - - - - - Reference to the uID of a control device, e.g. a control surface or a landing gear - - - - - Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - Reference to a control distributor uID - - - - - Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - Increment of drag coefficient in aerodynamic coordinates - - - - - Increment of coefficient of the side force vector in aerodynamic coordinates (perpendicular to lift and drag) - - - - - Increment of lift coefficient in aerodynamic coordinates - - - - - Increment of cmd - - - - - Increment of cms - - - - - Increment of cml - - - - - - - - - - - - - - Aerodynamic limitations - - - - This map explicitly specifies limitations of a vehicle in terms of angles of attack and sideslip angles. - All vectors, i.e. altitude, machNumber, - angleOfSideslip and angleOfAttack, must have the - same length. To avoid redundancy with the aeroPerformanceMap, this type does not contain - any aerodynamic coefficients. - Since angleOfSideslip and angleOfAttack - are closely interdependent for a given machNumber and altitude - combination, a positive and negative maximum angleOfAttack is defined for a given combination of - machNumber, altitude and - angleOfSideslip. The limits of angleOfSideslip - can be determined by evaluating the nominal decrease of angleOfAttack values or by - agreeint with the data supplier that the minimum and maximum value of the angleOfSideslip - vector corresponds with physical limits. - In order to avoid data redundancy, the operational limits should not reflect the extrema of aerodynamic - coefficients as these can be extracted from the performanceMap via interpolation. - Note: In future CPACS versions, a revision of the aeroLimitsMap - will be targeted, since operational limits are not a purely aerodynamic issue. - - - - - - - - - - - - Altitude [m] - - - - - - - Mach number - - - - - - - Angle of sideslip - - - - - - - - - - - - - - - - Increment maps for limitation values due to movable device deflections - - - Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control - surfaces or landing gears). - - - - - - - - - - - - - - - - - - - Increment maps for limitation values due to movable device deflections - - - Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control - surfaces or landing gears). - - - - - - - - - - - - Reference to the uID of a control device, e.g. a control surface or a landing gear - - - - - Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - - Reference to a control distributor uID - - - - - Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. - - - - - - Reference to an increment map of the aeroPerformanceMap - - - - - - Increments of the vehicle operation limits - - - - - - - - - - - - - - Damping derivatives for positive and negative rotation rates - - - - - 0. General overview - - This type contains the damping derivatives. They are - split up into those derivatives for positive rotation rates, - and those for negative rotation rates. - - - - 1. <positiveRates> (optional) - - Damping derivatives, calculated by positive rotation - rates. - - - - 2. <negativeRates> (optional) - - Damping derivatives, calculated by negative rotation - rates. - - - - - - - - - - - - - - - - - - - - - - - Damping derivatives - - - This type contains aerodynamic performance maps with - the damping derivatives. The derivatives are calculated using - rotational rates [rad/s], normalized by: - Rate*ReferenceLength/flow speed. The rotations are performed - around the global axis directions with the aircraft model's - global reference point as origin. The damping derivative - performance maps are vectors of the same length as the input - vectors of the baseline aerodynamic performance maps, consisting of - semicolon separated values. - - - - - - - - - - - Change of cd by normalized roll rate - - - - - Change of cd by normalized pitch rate - - - - - Change of cd by normalized yaw rate - - - - - Change of cs by normalized roll rate - - - - - Change of cs by normalized pitch rate - - - - - Change of cs by normalized yaw rate - - - - - Change of cl by normalized roll rate - - - - - Change of cl by normalized pitch rate - - - - - Change of cl by normalized yaw rate - - - - - Change of cmd by normalized roll rate - - - - - Change of cmd by normalized pitch rate - - - - - Change of cmd by normalized yaw rate - - - - - Change of cms by normalized roll rate - - - - - Change of cms by normalized pitch rate - - - - - Change of cms by normalized yaw rate - - - - - Change of cml by normalized roll rate - - - - - Change of cml by normalized pitch rate - - - - - Change of cml by normalized yaw rate - - - - - - - - - - - - - Vehicle operation limit - - - Vehicle operation limit defined by sets of minimum and maximum angleOfSideslip - and minimum and maximum angleOfAttack for a given altitude and Mach number. - This might be, e.g., a safety margin to the angle of attack at maximum lift or the flight - attitude a fighter aircraft is capable to fly in stalled conditions. The corresponding aerodynamic coefficients must - be extracted from the aeroPerformanceMap. - - - - - - - - - - Minimum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] - - - - - Maximum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] - - - - - - - - - - - - - Operation Limit Increments - - - Changes of the deltas of operation limit angles with respect to the corresponding increment aeroPerformanceMaps. - Values are specified as an array with same indices like the corresponding increment map. - - - - - - - - - - Minimum delta angle of attack [deg] - - - - - Maximum delta angle of attack [deg] - - - - - - - - - - - - - Toolspecific data - - - - This type contains a list of tools each specifying some basic tool information as well as the actual toolspecific part. - - The toolspecific elements must be defined in a separate namespace which can be specified and linked with the corresponding XSD file - in the CPACS header: - <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd" - xsi:schemaLocation="http://www.cpacs.de/myTool pathToToolspecificSchemaFile/toolspecific_myTool.xsd"> - - A simple example could look like this: - <toolspecific> - <tool> - <name>myToolName</name> - <version>1.2.3</version> - <myTool xmlns="http://www.cpacs.de/myTool" schemaVersion="1.0"> - <parentElement> - <childElement1>stringValue</childElement1> - <childElement2>1.0</childElement2> - </parentElement> - </myTool> - </tool> -</toolspecific> - - - - - - - - - - - - - - - - - - - - Tool identification - - - - Tool information as described in the toolspecificType. - - - - - - - - - - - - Name of the tool - - - - - - - Version of the tool - - - - - - - Wildcard for the root element of a toolspecific namespace - - - - - - - - - - - - - - Global analysis information - - - - - - - - - - - - - - - - - - - - - - - Load application points - - - - Multiple sets of scattered load application points can be defined. However, no specific information about the corresponding loads (e.g. whether aerodynamic or structural loads are involved) or mesh topologies are specified here, as such assumptions are tool-specific. - - - - - - - - - - - - - - - - - - - - - Load application point set - - - - - A point set contains discrete spatial points at which loads are applied (e.g., aerodynamic or structural loads). A typical procedure in CPACS is as follows: - - - - Reference a wing, fuselage or control surface by its uID using the componentUID node. - Define a reference axis through the above component with the loadReferenceLine element to specify where a load distribution shall be applied. - Compute the intersections with (e.g.) ribs of the referenced component (wing, fuselage or control surface) and write the results into loadApplicationPoints. This procedure results from common practice where the forces in structural analyses are typically introduced at structural elements such as ribs and spars. With respect to preliminary aircraft design a two-dimensional load distribution is preferred. However, an arbitrary distribution of the load application points is possible (without the intersection of structural elements with a reference axis in the previous step), for example to define discrete load distributions on the wing surface in streamwise and spanwise direction. - Specify the location and orientation of cut loads in the cutLoadIntegrationPoints element and the corresponding connectivity information in the connectivities node. - - - - - - - - - - - - - - - - - UID of a wing, fuselage or control surface - - - - - - - Reference axis (line) for load distribution - - - - - - - List of points at which load vectors are - applied to - - - - - - - List of points at which cut loads are applied to - - - - - - - Specification of connectivity properties between points - - - - - - - - - - - - - - - Vehicle configurations - - - - List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) - - - - - - - - - - - - - - - - - - - - - Vehicle configurations - - - - List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) - - - - - - - - - - - - Name - - - - - - - Description - - - - - - - - - Deck configurations - - - - - - - - - - - - - - - Internal pressure of a deck - - - - - - - - - - - Internal pressure of a fuselage, deck or compartment - - - - - - - - - - - - - - Cabin pressure - - - - Internal pressure of a fuselage, deck or compartment - - - - - - - - - - - - UID of a fuselage, deck or compartment - - - - - - - Internal pressure [Pa] - - - - - - - - - - - - - - Load set - - - A set of forces and moments - - - - - - - - - - - Description - - - - - - - UID of load application point set (analysis/global/loadApplicationPoints) - - - - - - - Force in x-direction [N] - - - - - - - Force in y-direction [N] - - - - - - - Force in z-direction [N] - - - - - - - Moment around x-axis [Nm] - - - - - - - Moment around y-axis [Nm] - - - - - - - Moment around z-axis [Nm] - - - - - - - Nodal displacement in x-direction [m] - - - - - - - Nodal displacement in y-direction [m] - - - - - - - Nodal displacement in z-direction [m] - - - - - - - Nodal rotation around x-axis [deg] - - - - - - - Nodal rotation around y-axis [deg] - - - - - - - Nodal rotation around z-axis [deg] - - - - - - - Load brake-down - - - - - - - - - - - - - - - Load sets - - - - A list of load sets - - - - - - - - - - - - - - - - - - - - - Aerodynamic load cases - - - - Combines a set of aerodynamic load cases - - - - - - - - - - - - - - - - - - - - Aerodynamic load case - - - - Specification of an aerodynamic load case - - - - - - - - - - - - Name - - - - - - - Description - - - - - - - - - - - - - - - - - - Specification - - - - Specification of the vehicle properties and dynamics - - - - - - - - - - - Altitude - - - - - - - Mach number - - - - - - - Angle of sideslip [deg] - - - - - - - - Angle of attack [deg] - - - - - - - Target lift coefficient - - - - - - - - Normalized roll rate [rad/sec]. It is specified around the global x-axis - with the aircraft model's global reference point as origin and - nondimensionalized by: pStar = p * reference length / flow speed. - - - - - - - Normalized pitch rate [rad/sec]. It is specified around the global y-axis - with the aircraft model's global reference point as origin and - nondimensionalized by: qStar = q * reference length / flow speed. - - - - - - - Normalized yaw rate [rad/sec]. It is specified around the global z-axis - with the aircraft model's global reference point as origin and - nondimensionalized by: rStar = r * reference length / flow speed. - - - - - - - - Reference to a weight and balance description - - - - - - - - - - - - Aerodynamic loads - - - - Description of the aerodynamic loads - - - - - - - - - - - - Angle of attack [deg] - - - - - - - Angle of sideslip [deg] - - - - - - - - - - - - - - - - Aerodynamic loads of components - - - - Specification of the aerodynamic loads of components - - - - - - - - - - - - - - - - - - - - Aerodynamic data of components - - - - Aerodynamic data of individual components of the aircraft (e.g. control surface loads and hinge moments) - - - - - - - - - - - - Reference to a component uID - - - - - - - - - - - - - - - Aerodynamic loads of the vehicle - - - - Description of the aerodynamic loads of the vehicle - - - - - - - - - - - - - - - - - - - - - Aerodynamic coefficients - - - - A set of aerodynamic coefficients in the aerodynamic coordinate system - - - - - - - - - - - - Drag coefficient in aerodynamic - coordinates - - - - - - - Coefficient of the side force vector in - aerodynamic coordinates (perpendicular - to lift and drag) - - - - - - - Lift coefficient in aerodynamic - coordinates - - - - - - - Aerodynamic moment around d-axis of the aerodynamic coordinate system - - - - - - - Aerodynamic moment around s-axis of the aerodynamic coordinate system - - - - - - - Aerodynamic moment around l-axis of the aerodynamic coordinate system - - - - - - - - - - - - - - - Drag contributions - - - - The drag contributions relate to different physical mechanisms. The sum of the contributions does not have to be equal to the total drag. - - - - - - - - - - - - Drag contributions due to the displacement of the flow around a component. Zero for irrotational two-dimensional flows. - - - - - - - Drag contributions due to shear forces on surfaces - - - - - - - Drag contributions due to friction - - - - - - - Drag contributions due to energy loss through vortex structures caused by the pressure difference between the upper and lower sides of three-dimensional lifting surfaces. - - - - - - - Drag contributions due to mixing of streamlines between airframe components (e.g., interaction between wing and fuselage or pylon and wing). - - - - - - - Drag contributions due to energy dissipation in shock waves - - - - - - - Drag contributions due to trimmed aircraft configuration - - - - - - - - - - - - - - Aerodynamic coefficients breakdown - - - - - Breakdown of the total aerodynamic coefficients into contributions - from the various vehicle componenents. A detailed breakdown is only specified - for the wing. Other components, such as the fuselage, are more generically - referred to as otherComponents. Since - the sum of the contributions within a breakdown must equal the total - coefficients, the remaining contributions must be listed in - remainingContributions. - - - The remainingContributions cannot be defined alone. Either the - definition of a wing, otherComponents - or both together is valid and can be combined with remainingContributions. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of the wings - - - - Contains a list of wings for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a wing - - - - - Describes the contributions of a specific wing to the total aerodynamic coefficients of a vehicle - - - It is obligatory to reference a wing via its uID and to provide its - coefficients. The breakdown of the coefficients comprises the segments - and remainingContributions. The latter must only be specified if segments - is given. - - - - - - - - - - - - - Reference to a wing uID - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of wing segments - - - - Contains a list of wing segments for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a wing segment - - - - - Describes the contributions of a specific wing segment to the total aerodynamic coefficients of a wing - - - It is obligatory to reference a segment via its uID and to provide its - coefficients. The breakdown of the coefficients comprises the strips - and remainingContributions. The latter must only be specified if strips - is given. - - - - - - - - - - - - - Reference to a wing segment uID - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of strips within a wing segment - - - - Contains a list of strips within a wing segment for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a strip within a wing segment - - - - - Describes the contributions of a specific strip within a wing segment to the total aerodynamic coefficients of a wing segment - - - The strip extends spatially between two eta coordinates (i.e., from an inner border to an outer border). - In order to avoid redundancy, the inner border (denoted as from) is always identical to the outer border of the previous strip (denoted by to). - Accordingly, only the to-border can be specified explicitly, while the from-border equals implicitly either to 0 - (for the first strip) or the toSegmentEta value of the previous element. The toSegmentEta of the last strip - must be equal to 1! - - - It is obligatory to provide the coefficients of the strip. The breakdown comprises the chordwiseParts - and remainingContributions. The latter must only be specified if the breakdown into chordwiseParts - is given. This breakdown is optional. If it is specified, but the sum of all chordwiseParts does not match the strip coefficients, one or more remainingContributions may be applied - to ensure consistency (sum of all chordwiseParts + sum of all remainingContributions must be equal to total strip coefficients). - - - - - - - - - - - - - Spanwise coordinate eta in the segment coordinate system to define the end of the strip - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a chrordwise part within a wing segment strip - - - - Contains a list of chordwise parts within a wing segment strip for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a chordwise part within a within a wing segment strip - - - - - Describes the contributions of a specific par within a wing segment to the total aerodynamic coefficients of a wing segment strip - - - A chordwisePart aescribes the contributions of a specific chordwise part within a wing strip - to the total aerodynamic coefficients of this strip. It extends spatially between the two eta - positions of the parent strip (see strip documentation) and four xsi positions in the segment coordinate system. - As with the parent stips, only the trailing border (..ToSegmentXsi) of a chordwisePart is defined, while the leading border always equals the trailing border of the preceding chordwisePart (or 0 for the first part). - To account for oblique trailing borders (e.g., to match the aileron on a tapered wing) two different toSegmentXsi positions can be defined, one at the inner border (innerBorderToSegmentXsi) and one at the outer border (innerBorderToSegmentXsi) of the parent strip. - The innerBorderToSegmentXsi and outerBorderToSegmentXsi of the last chordwisePart must be equal to 1. - - - - - - - - - - - - - Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the inner eta border - - - - - - - Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the outer eta border - - - - - - - - - - - - - - - - Remaining contributions to aerodynamic coefficients - - - - This node lists the remaining contributions which were not specified so that the sum of the coefficients are equal to the total coefficients. - - - - - - - - - - - - - - - - - - - - Remaining contribution to aerodynamic coefficients - - - - This node lists a remaining contribution which was not specified so that the sum of the coefficients are equal to the total coefficients. - - - - - - - - - - - - Name - - - - - - - Description - - - - - - Type (numerical/unspecified): "numerical", for example, describes rounding errors to clearly - separate them from other effects currently labeld as "unspecified". - The latter usually summarizes physical effects such as viscosity and should be further described via "description". - The approach is currently being tested in practice in order to derive a robust definition of categories in the future. - - - - - - - - - - - - - - - - - - - - - - - - Reference values for aerodynamic coefficients - - - - Specification of reference values for aerodynamic coefficients. - - - - - - - - - - - - Reference area - - - - - - - Reference lengt - - - - - - - Reference point - - - - - - - Reference translation - - - - - - - Reference rotation - - - - - - - - - - - - - - Aerodynamic contributions of the components - - - - Contains a list of components for which aerodynamic coefficients are specified - - - - - - - - - - - - - - - - - - - - Aerodynamic contributions of a component - - - - Describes the contributions of a specific component to the total aerodynamic coefficients - - - - - - - - - - - - Reference to a component - - - - - - - - - - - - - - - Atmospheric model - - - Available options: ISA. See documentation of <CPACS> root element for further details. - - - - - - - - - - - - - - - - - - Flight Envelopes - - - - Specification of flight envelopes - - - - - - - - - - - - - - - - - - - - - Flight Envelope - - - - Specification of a flight envelope - - - - - - - - - - - - Offset from temperature of the atmospheric model [K] - - - - - - - - - - - - - - - Flight envelope speed - - - - Specification of the V-speed - - - - - - - - - - - - - Vector with altitudes - - - - - - - Vector with True Airspeeds - - - - - - - - - - - - - - Speed designators - - - - Provides an enumerated list of V-speeds as defined by regulations. - - - - - - - - - - - Design maneuvering speed - - - - - - - Design speed for maximum gust intensity - - - - - - - Design cruise speed, used to show compliance with gust intensity loading - - - - - - - Design diving speed, the highest speed planned to be achieved in testing - - - - - - - Designed flap speed - - - - - - - Stall speed or minimum steady flight speed for which the aircraft is still controllable - - - - - - - Stall speed or minimum flight speed in landing configuration - - - - - - - Stall speed or minimum steady flight speed for which the aircraft is still controllable in a specific configuration - - - - - - - Minimum control speed - - - - - - - Never exceed speed - - - - - - - Maximum operating limit speed - - - - - - - - - - - - - Landing gear base - - - - Base type for landing gears (i.e. nose gear, main gear and skid gear). - An example of a nose and main gear is shown below: - - - - - - - - - - - - - - Name - - - - - Description - - - - - UID of the parent component. If set, the position of the main strut is defined relative to the parent coordinate system. - - - - - - - - - Total length of landing gear, equals the distance from the middle of the bogie/axles to the axis of rotation of the pintle strut. Distance is measured while landing gear is fully extended and in airborne condition (i.e., if a spring is present, the totalLength includes the springDeflectionLength) - - - - - Static suspension travel means the positive distance between the total length in airborne condition and the reduced length due to compression on the ground. - - - - - Compressed suspension travel means the positive distance between the total length in airborne condition and the maximum reduced length due to maximum compression on the ground (e.g., landing shock). - - - - - - - Transformation with respect to the uppermost point of the main strut. From this point the landing gear is oriented in negative z-direction by default. - - - - - - - - - - - - - - - - - - - - - - - - - Landing gear control parameters - - - - Parameters of a landing gear control such as extraction or steering. - - - - - - - - - - - - Retraction angle of the main landing - gear. Equals a rotation around the - global z-axis in degrees. 0 = retraction - to the front; 90 = retraction to the - left; 180 = retraction to the rear; 270 - = retraction to the right. - - - - - - - - Distance of the center of rotation to the top of the main strut - for retracting and extending the landing gear. I.e., a value of - 0 means that the landing gear will rotate around the upper end - of the main strut during retraction. If this value is greater - than 0, the center of rotation is shifted by this value above - the main strut end point (translation along the main strut axis). - - - - - - - - - - - - - - Landing gear control functions - - - - - A list of functions which can be addressed by the controlDistributor. - - - - - - - - - - Extension path - - - - - Steering path - - - - - Braking state - - - - - - - - - - - Braking function - - - - - Describes the braking state of the landing gear. - - - - - - - - - - Control parameter indicating that the brake is set - - - - - Control parameter indicating that the brake is released - - - - - - - - - - - - Steering path - - - - - Describes the steering path of the landing gears via a list of steps. - - - - - - - - - - Step within the steering path - - - - - - - - - - - - Steering step - - - - - Describes a step with the steering path of the landing gear. - - - - - - - - - - Step type (centered, fullBackboard or fullStarboard) - - - - - - - - - - - - Control parameter - - - - - Steering angle [deg] - - - - - - - - - - - Extension path - - - - - Describes the extension path of the landing gears via a list of steps. - - - - - - - - - - Step within the extension path - - - - - - - - - - - - Extension step - - - - - Describes a step with the extension path of the landing gear. Make sure to provide a least one step with stepType=extracted! - - - - - - - - - - Step type (retracted or extracted) - - - - - - - - - - - - Control parameter - - - - - Extension angle of the main strut [deg] - - - - - - - - - - - Assembly of landing gear components - - - - - Describes an assembly of the various landing gear components - - - - - - - - - - - - Main strut - - - - - - - - - - Drag strut (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) - - - - - - - - - - - Pintle strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) - - - - - Pintle strut (one or two pintle struts are supported) - - - - - - - - Side strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) - - - - - - - - - - - - Strut assembly - - - Geometric description, spatial placement and specification of material parameters - - - - - - - - - - Strut properties - - - - - The starting point of the support strut must connect to the main strut. This element specifies the relative position on the main strut (0 -> top end, 1 -> bottom end). - - - - - - - - - - - - End position in absolute coordinates. Coordinates are relative to parent if it has a parentUID reference (otherwise global). - - - - - End position in eta/xsi/relHeight coordinates - - - - - End position as a relative position on another strut of this landing gear - - - - - - Attachment to an aircraft wing or fuselage component - - - - - Reference to an actuator uID - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Strut properties - - - - - Geometric description and material properties - of a strut - - - - - - - - - - - - - (Outer) radius of the strut - - - - - - Material of the strut - - - - - Inner radius of the strut - - - - - - - - Reference to structural element for a more - detailed cross section definition - - - - - - - - - - - - - - - - Definition of the wing attachment - - - - - Definition of the wing attachment, if - attached to the wing. The definition - includes the position of the landing gear as - well as the information to which spars resp. - supportBeam the gear is attached. - - - - - - - - - - - - UID of the second spar, where the landing gear is attached to. Only used, if the landing gear is attached between two spars. - - - - - - UID of a set of ribs (ribDefinition) - - - - - Number of the rib in the rib set (ribDefinition) - - - - - - - - UID of the structural mount - - - - - - - - - - - - - - - Main landing gear support beam - - - - Definition of the main landing gear support beam, if a - support beam is used for the attachment. The defintion includes - cross section properties as well as the position of the support - beam. - - - - - - - - - - - - - - - - - - - - - framePositionUIDs of the frame - - - - - A framePostion defines a location where a frame in mounted. - - - - - - - - - - - framePositionUID of the frame, where the landing gear - is attached to. - - - - - - - - - - - - - Position of the landing gear on a wing - - - - Definition of the position of the landing gear - (intersection point of main strut and pintle sturt) on a wing, - using relative componentSegment coordinates - - - - - - - - - - Relative height of spar or rib at which landing gear is attached. - - - - - - Relative spanwise position (eta) of spar at which landing gear is attached. - - - - - Relative chordwise position (xsi) of the rib at which landing gear is attached. - - - - - - - - - - - - - Definition of the main landing gear support beam - position - - - Definition of the main landing gear support beam - position - - - - - - - - - - Relative chordwise coordinate (xsi) of the - inner end of the support beam. The eta - position of the inner end is defined by the eta position of the - wing root (=wing-fuselage attachment). - - - - - Relative spanwise coordinate (eta) of the - outer end of the support beam. The xsi - coordinate of the outer end is defined by the spar position - (first spar), where the support beam is attached to. - - - - - - - - - - - - - - Configuration - - - - Contains references to control control devices and (or) the global aircraft configuration node. - - - - - - - - - - - - - Reference to the aircraft configuration node (aircraft/model/configurations/configuration) - - - - - - - State description of the control elements - - - - - - - - - - - - - - Standard profile - - - - - - - - - - - - - - - - - - - - - - - Rectangle - - - - The width of the profile is always 1, since scaling is performed after referencing it (e.g., in the fuselage). - The resulting profile is defined by the following equation: - - - - with c = cornerRadius and r = heightToWidthRatio. - Example: Rectangle with cornerRadius=0.125 and heightToWidthRatio=0.5 - - - - - - - - - - - - - - - - - - Corner radius - - - - - - - - - - - - - - - - - - Height-to-width ratio - - - - - - - - - - - - - - - - Superellipse - - - - A profile based on superellipses is composed of an upper and a lower semi-ellipse, which may differ from each other in their parameterization. The total width and height of the profile is always 1, since scaling is performed after referencing (e.g., in the fuselage). - This lowerHeightFraction describes the portion of the lower semi-ellipse on the total height. - The resulting profile is defined by the following set of equations: - - - - - - - with - - - - The following examples indicate the various possibilities of parametric profiles: - Example 1: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (0.5; 2; 5; 3; 0.25) - - - - Example 2: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (2; 2; 2; 2; 0.5) = a circle - - - - Example 3: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (1; 1; 1; 1; 0.5) = a square / diamond - - - - Note: For exponents that are infinitely large, the superellipse converges to a rectangle. However, the value Inf is not a valid entry at this point. Use the square element instead. - - - - - - - - - - - Exponent m for upper semi-ellipse - - - - - Exponent n for upper semi-ellipse - - - - - Exponent m for lower semi-ellipse - - - - - Exponent n for lower semi-ellipse - - - - - - Fraction of height of the lower semi-ellipse relative to the total height - - - - - - - - - - - - - - - - - - - - Performance Cases - - - - Definition of missions and point performance events to evaluate the performance of a vehicle. - The definition of performance cases is independent from a specific vehicle. - - - - - - - - - - - - - - - - - - - - - - - - UID of the runway - - - - - - - Offset from runway threshold in cartesian coordinates in the runway coordinate system - - - - - - - - - - - - - - - - UID of the runway - - - - - - - Offset from runway threshold in cartesian coordinates in the runway coordinate system - - - - - - - - - - - - - - - Requirements - - - - Requirement settings for the point performance definition - - - - - - - - - - - Sustained load factor to be achieved - - - - - - - Instantaneous load factor to be achieved - - - - - - - Specific excess power to be achieved [m/s] - - - - - - - Roll rate to be achieved [deg/s] - - - - - - - Roll acceleration to be achieved upon control onset [deg/s^2] - - - - - - - Roll acceleration to be achieved upon control stop [deg/s^2] - - - - - - - - - - - - - - Controllability requirements - - - Contains a list of controllability requirements - - - - - - - - - - - - - - - - - - - - Trim requirements - - - Contains a list of trim requirements - - - - - - - - - - - - - - - - - - - - - Controllability requirement - - - - - - - - - - Name - - - - - Description - - - - - UID of point performance definition - - - - - UID of weight and balance description - - - - - - - - - - - - - - - - - Trim requirement - - - - - - - - Name - - - - - Description - - - - - UID of a predefined flight point - - - - - UID of weight and balance description - - - - - - - - - - - - - - - Trim - - - - Provides a list of trim cases - - - - - - - - - - - - - - - - - - - - - - Trim case - - - - - - - - - - - - - - Name - - - - - Description - - - - - UID of trim requirement - - - - - - - Description of the linear model - - - - - - - - - - - - - - Turn - - - - - - - - - - - - - ... - - - - - ... - - - - - - - - - - - - - - Level flight - - - - - - - - - - - - - - Specific excess power - - - - - - - - - - - - - - Climb - - - - - - - - - - - - - - - - - - - - Descent - - - - - - - - - - - - - - - - - - - - Environmental conditions - - - - Specification of environmental conditions - - - - - - - - - - - - Delta temperature - - - - - - - - - - - - - - Flight Cases - - - - - - - - - - - - - - - - - - - - - - - - Flight point - - - - - - - - - - - - - - - - - - - - Mach number - - - - - - - Calibrated air speed - - - - - - - True air speed - - - - - - - - - - - - - - - - - Configurations which apply for this performance requirement - - - - - - - - - - - - - - - - Default configuration uID - - - - - - - - - - - - - - - Specific configuration uIDs - - - - - - - - - - - - - - - - - - - - - - - - Connection between segments, pointPerformances and a configurationUID - - - - - - - - - - - - - - - - Configuration uID - - - - - - - - List of pointPerformanceUIDs - - - - - - - - - - - - - - Segments - - - - - - - - - - - - - - - - - - - - - - - - Specification of a segment uID and index of the parameter lapses - - - - - - - - - - - - - - - - - Vector with semicolon separated indices of the parameters within a segment. If not given then the complete segment is applied. - - - - - - - - - - - - - - Released stores - - - - - - - - - - - - - - - - - - - - - - - - Released store - - - - - - - - - - - - - - - - UID of the released store. - - - - - - - Quantity of the released store. - - - - - - - - - - - - - - Runway start position - - - - - Description of the vehicle on the runway relative to the runway threshold. - - - - - - - - - - - - - - X-position in cartesian coordinates in the runway coordinate system - - - - - - - Y-position in cartesian coordinates in the runway coordinate system - - - - - - - Z-position in cartesian coordinates in the runway coordinate system - - - - - - - - - Lengthwise distance along the runway centerline from the runway threshold - - - - - - - Lateral offset from the runway centerline. Positive values on the starboard side. - - - - - - - - - - - - - - - Ducts - - - - - - - - - - - - - - - - - - - - Duct assembly - - - - - - - - - - - Name - - - - - - - Description - - - - - - - UID of part to which the duct is - mounted (if any) - - - - - - - - - - - - - - - - - - Duct - - - - - - - - - - - Name - - - - - - - Description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Duct structure - - - - - - - - - - - - - - - - - - - - - Version Informations - - - - - - - - - - - - - - - - - - - Version Information - - - - - - - - - - CPACS version of the dataset - - - - - - Description of CPACS dataset - - - - - - Timestamp of initial CPACS dataset creation - - - - - - Creator of initial CPACS dataset - - - - - - - - - - - - - - - - Change log - - - - - - - - - - - - - - - - - - - Log entry - - - - - - - - - - Description of CPACS dataset - - - - - - Timestamp - - - - - - Creator (tool, person, etc.) - - - - - - - - - - - - - - Fuel tanks - - - - - - - - - - - - - - - - - - - - - - Fuel tank - - - - - - - - - - Name - - - - - - Description - - - - - - Parent component - - - - - - - - Volume - - - - - Burst pressure - - - - - - - - - - - - - - - - - - - - - - - - - Hulls - - - - - - - - - - - - - - - - - - - Hulls - - - - - - - - - - Name - - - - - - Description - - - - - - - - - - - - - Inner radius of the cylinder - - - - - Inner length of the cylinder - - - - - - - - - - - - - - - - - - - Dome Type - - - - - - - - - - - - - - - - - - - - - - - - Ellipsoid dome - - - - - - - - - - Half axis fraction - - - - - - - - - - - - - Torispherical dome - - - - - - - - - - R1: dish radius - - - - - R2: knuckle radius - - - - - - - - - - - - - Isotensoid dome - - - - - - - - - - Radius of the fitting/smaller polar opening - - - - - - - - - - - - - Structure - - - - - - - - - - - - - - - - - - - - - - - - - Skin Layers - - - - - - - - - - - - - - - - - + + + + + + + + + + + + CPACS root element + + + + + Version + + V3.3 + + Date + + 2020-06-03 + + + + 1. Overview + + The Common Parametric Aircraft Configuration Scheme (CPACS) is an XML-based data format for describing aircraft configurations and their corresponding data. + This XML-Schema document (XSD) serves two purposes: (1) it defines the CPACS + data structure used in the XML file (e.g., aircraft.xml) and + (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., Tixi or + XML tools in Eclipse) parses the XSD and XML files and validates whether the data set defined by the user (or tool) conforms to the given structure defined by the schema. + + + + This documentation explains the elements defined in CPACS and its corresponding data types. + Data types can either be simple types (string, double, boolean, etc.) or + complex types (definition of attributes and sub-elements to build a hierarchical + structure). In addition, the sequence of the elements and their occurrence is documented. + To link the XML file to the XSD file, the header of the XML file should specify the path of the schema file. + An example could look like this: + <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + + CPACS is an open source project published by the German Aerospace Center (DLR e.V.). For further information please visit www.cpacs.de. + + + + + 2. Data hierarchy + + CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. + For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. + + + + + + + 3. Coordinate Systems + + Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. + The CPACS coordinate system is the coordinate system identified by TIGL, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. + Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. + The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. + The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. + + + + Axis + + + Direction + + + Description + + + + x + tailwards + from nose to tail + + + y + spanwise + from symmetry plane to the right wingtip + + + z + upwards + from landing gear to tip of vertical tailplane + + + The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. + + + + The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + + + + The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. + + + + The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. + + + + Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + + + + 4. Units + + There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: + + + [m] + Position, Distance + + + [m^2] + Area + + + [m^3] + Volume + + + [kg] + Mass + + + [s] + Time + + + [K] + Temperature + + + or in derived units, e.g.: + + + [N] + Force + + + [Nm] + Moment + + + [W] + Power + + + [J] + Energy + + + The only non SI unit used throughout CPACS is the angle in degrees [°]. + For the sake of an intuitive use the angles are given in degrees rather than in radian [rad]. + + + [°] + Angle + + + + + + 5. Splitting up a CPACS dataset into several files + + To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: + <?xml version="1.0" encoding="utf-8"?> +<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + <vehicles> + <profiles> + <wingAirfoils> + <externaldata> + <path>file:://airfoils</path> + <filename>NACA0010.xml</filename> + <filename>NACA2412.xml</filename> + </externaldata> + <airfoil uID="NACA0012"> + <name>NACA 0012 Airfoil</name> + <pointList>...</pointList> + </airfoil> + </wingAirfoils> + </profiles> + </vehicles> +<cpacs> + Such an external file would look like: + <?xml version="1.0" encoding="utf-8"?> +<airfoil uID="NACA0010"> + <name>NACA 0010 Airfoil</name> + <pointList>...</pointList> +</airfoil> + The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), then it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). + For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given: + + Absolute local path: "file:///tmp" or "file:///c:/windows/tmp" + Relative local direcotry: "file://relativeDirectory" or "file://../anotherRelativeDirectory" + Remote net ressource: "http://www.someurl.de" + + A CPACS dataset with external files, being loaded by a special library like the TIVA XML Interface TIXI, shall collect all its external datafiles and build up a single tree from them. A validation against this schema is only possible for such a single tree file; the <externaldata>nodes are not recognized by it. To preserve the information, necessary to split the file up into external files again later, externaldata information is maintained within three attributes of the former external top node: + + externalFileName - Name of the file where the external data shall be saved + externalDataDirectory - Directory of the external data file. Its content is analogous to the <externaldata>'s <path>node described above. + externalDataNodePath - XPATH of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPATH in the outer external file. If, e.g., in the example above the <pointList>node would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. + + The single tree for the example above would look like: + <?xml version="1.0" encoding="utf-8"?> +<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + <vehicles> + <profiles> + <wingAirfoils> + <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils"> + <name>NACA 0010 Airfoil</name> + <pointList>...</pointList> + </airfoil> + ... + <airfoil uID="NACA0012"> + <name>NACA 0012 Airfoil</name> + <pointList>...</pointList> + </airfoil> + </wingAirfoils> + </profiles> + </vehicles> +<cpacs> + + + + 6. UIDs and references + + The CPACS-dataset often uses references between nodes. Typically, these + references define connections between elements which are located somewhere else in the hierarchical dataset (e.g. a wing is connected to a + fuselage; a specific engine is connected to a pylon; etc.). These connections are defined by + unique identifiers (uID) which are specified as attributes. Thus, there are elements which can be referenced via a uID attribute, e.g. a fuselage: + <fuselage uID="ATTAS_fuselage">... + + as well as elements which refer to the former, e.g. a wing pointing to its geometrical parent: + <wing uID="e382bf5j"> + <name>ATTAS main wing</name> + <parentUID isLink="True">ATTAS_fuselage</parentUID> + ... + Such referencing elements must carry the isLink="True" attribute. + + Since uIDs are only used to link nodes within the XML file, no naming convention is required. UIDs, however, must be unique! + Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), + uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element + to convey human-readable meanings. + + + + 7. Symmetry + + Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). Hence, some parts offer the option to set a symmetry attribute for them, like: + <wing symmetry="x-z-plane">... + This attribute explains that the whole part with all its subnodes is symmetric to the given plane. Possible planes are: + x-y-plane + x-z-plane + y-z-plane + none + inherit + + By default, the symmetry of a component is inherited from its parent. If e.g. a wing is symmetrically defined, a pylon will also have a symmetry by default. + This symmetry inheritance can be broken, by explicitly deleting the symmetry with symmetry="none". + + + + + UIDs, references and symmetry + + All nodes, e.g. parentUID, in CPACS that refer to a component that holds symmetry attribute, e.g. wing, have to carry the symmetry attribute as well. + The symmetry attribute may take three values: symm, def, full: + + + def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. + + symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) + + full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + + + <wing uID="ATTAS_main_wing" symmetry="x-z-plane"> + ... + <segments> + <segment uID="ATTAS_main_wing_innersegment"> + ... + In the example above, to refer to the "other" side of the wing on must use the definition as such: + <loadcase> + ... + <segments> + <segment> + <segmentUID isLink="True" symmetry="symm">ATTAS_main_wing_inner_segment</segmentUID> + <strip>... + + + + 8. Vectors and arrays + + For large data sets (e.g. increments of aerodynamic coefficients due to control surface deflections) it is advantageous + to map them via vectors and arrays instead of using a sequence of nodes for each data value. Therefore vectors and arrays are defined as semicolon-separated lists in CPACS. Via the documentation (derived from the XSD) of the corresponding nodes it has to be checked whether it is a vector or an array. + + Vector + The vector is meant as a one-dimensional-array. In such a node, the values are given in a semicolon separated list: + <angleOfAttack>0.;1.5;3.;4.5;6;7.5;9.</angleOfAttack> + + Array + + As for vectors, multi-dimensional arrays provide values in a semicolon separated list. An array is always preceded by a sequence of vectors, containing the dimensions and index values. Which vectors of an array are dimensioning is specified in the respective documentation of the array. + + <altitude>1000.;2000.;3000.</altitude> <!-- vector element --> + <incrementMaps> + <incrementMap uID="incMap_b3ac2"> + <controlSurfaceUID>InnerWingFlap</controlSurfaceUID> + <controlParameters>-1;-0.5;0;1</controlParameters> <!-- vector element --> + <!-- array of dimension length(altitude) x length(controlParameters): --> + <dcl>11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34.</dcl> + + + + Values for cl increments: + + + + Control parameter = -1 + Control parameter = -0.5 + Control parameter = 0 + Control parameter = 1 + + + Altitude = 1000m + 11. + 12. + 13. + 14. + + + Altitude = 2000m + 21. + 22. + 23. + 24. + + + Altitude = 3000m + 31. + 32. + 33. + 34. + + + + + + + + + + 9. Control Parameters + + Control parameters are abstract parameters, linking a generic floating point value to a certain status of a control device + (e.g. control surface, landing gear, suction system, brake parachute, ...). For control surfaces, such a data pair (control parameter + and control surface deflection status) is called a <step> and the ordered list of all steps for a control surface forms its deflection + <path>. + The control parameter values for each step are arbitrary floating point values. However, it is strongly recommended to use + values between -1. and +1., or between 0. And +1. (depending on the type of control surface). The smallest and the largest value implicitly + define the maximum deflection limits. It is mandatory, that the value “0.” is within the specified range, as this value is treated as + undeflected and used to specify a “clean” aircraft configuration (e.g. used in the clean aero performance map). It is recommended, but not + mandatory to specify a <step> with a <controlParameter> of 0. Consequently, no <controlParameter> must be used twice within + a single <path> definition. Deflection values between two specified steps are handled by linear interpolation. + The following example shows the usage of control parameters within a control surface deflection path definition: + <controlSurfaces> + <trailingEdgeDevices> + <trailingEdgeDevice uID="InnerWingFlap"> + ... + <path> + ... + <steps> + <step> + <controlParameter>-1</controlParameter> + <hingeLineRotation>-20.</hingeLineRotation> + </step> + <step> + <controlParameter>-0.5</controlParameter> + <hingeLineRotation>-10.</hingeLineRotation> + </step> + <step> + <controlParameter>0</controlParameter> + <hingeLineRotation>0.</hingeLineRotation> + </step> + <step> + <controlParameter>1</controlParameter> + <hingeLineRotation>5.</hingeLineRotation> + </step> + </steps> + ... + + + + + 10. Atmosphere + + At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). + Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) + It covers temperature, pressure, density, speed of sound, dynamic viscosity and kinematic viscosity with respect to altitude. + In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. + For details, see ISA manual, section 2.3, page E-viii f. + ISA covers a range from -5000 m to 80000 m. + Temperature offsets are introduced on top of the definitions in the ISA manual (which does not cover such variations). The offset model + is based upon the idea that the pressure at a fixed geopotential altitude is independent from temperature offset (pressure altitude). + The temperature offset changes only the density (following rho = p / Gas Constant / T) (and viscosity, of course) + + + + CPACS 3.3 + + Release in June 2021 + + Revision of the mission definition including parameter lapses within segments (compatibility break) + Revision of the point performance definition (compatibility break) + Revision of performance requirements (compatibility break) + Revision of landing gears (compatibility break) + Revision of control surface tracks definition (compatibility break) + Load analysis: Revision of flightLoadCasesType (compatibility break) + Load analysis: Revision of aeroCasesType (compatibility break) + Load analysis: loadEnvelopesType relocated and envelope simplified to a single uID-Sequence (compatibility break) + Load analysis: Replaced dynamicAircraftModel elements by loadApplicationPointSets (compatibility break) + Flight dynamics: Group flightPerformance, flyingQualities and trim under flightDynamics parent node (compatibility break) + Introduced a configuration node to describe aircraft and payload configurations + Fuselage profiles: Introduced rectangle and super ellipse as standard profiles + Fuselage profiles: Added vector to specify curve parameters for profiles with kinks + Internal structure: Added standard profiles to profile based structural elements + Internal structure: Added ribPosts element to wingRibCrossSectionType + Internal structure: Upper and lowerCap now optional in sparCellType + Internal structure: Stringers and frames can reference sections + MassBreakdown: Set mass inertia Jxy, Jxz and Jyz optional + MassBreakdown: Added mMiscellaneous element + MassBreakdown: Added fuselage walls + Added flight envelope to aircraft global element + Added new base types: doubleVectorBaseType, posIntVectorBaseType, doubleArrayBaseType + Added 'none' and 'inherit' to list of symmetry flags + Set mapType attribute of vector and array elements to optional (requires TiXI>=3.1) + AeroMaps: Defined angleOfSideslip as input and added distinction between minimum and maximum angleOfAttack in aeroLimitMaps (compatibility break) + AeroMaps: Added missing singular incrementMap element to incrementMaps in aeroLimitsMap (compatibility break) + AeroMaps: Adopted the camelCase style for damping derivatives (compatibility break) + Introduced common nomenclature for speeds and altitudes (compatibility break) + Control distributors are set to optional + Added instructions for superposition of control surface deflections + Further elaboration of development standards + General improvements of the documentation + + + + + CPACS 3.2 + + Release in February 2020 + + Replaced tool-specific elements with xsd:any element and strict schema request for validation + UIDs adapted to type xsd:ID and xsd:IDREF + UIDs optional for transformationType and pointTypes + Replaced xsd:sequence elements with xsd:all elements where possible + CpacsVersion element set to optional + GuideCurves are now optional for nacelleCowlType + Documentation adaptions + + + + + CPACS 3.1 + + Release in August 2019 + + Redefinition of aeroPerformanceMaps + Added nodes for detailed engine pylons and nacelles + Added nodes to model generic walls + Extension of material definition + Added fuselage compartment definition + Added fuselage fuel tank definition + Explicit wing stringer definition integrated into wing stringer definition + RelativeDeflections renamed to control parameters + Control distributors modified to only have a single command input vector + "cpacsVersion" restricted to current schema version + Code cleanup + Cpacs_schema.xml removed + Documentation adaptions + + + + + CPACS 3.0 + + Release in Jul 2018 + + New component segment definition; this is affecting all structural components of wings + Renamed angleOfYaw into angleOfSideslip + Fixes in documentation + Made all uID attributes required + Minor fixes in choices and typos + Added nodes for the geometry of generic system components + Added performance requirements for aircraft models + Redefined the whole mission definition including point performances + Made link to missionUID in trajectory optional + Added new parameters to enginePerformanceMap + Relocated mFixedLeadingEdge and mFixedTrailingEdge within the massBReakdown structure + Changed aeroPerformanceMap to use altitude and standard atmosphere instead of reynolds number + Added an optional local direction for guide curves and an illustration image + Announced toolspecifics definitions as deprecated; will be removed from CPACS in next release and should be managed in separate namespace by tool maintainers + Added an option for aerodynamic performance maps of elastic aircraft + Enabled the definition of multiple aeroPerformanceMaps + Enabled the use of spar points for rib placement and rib points for spar placement + Added explicit stringer definitions for wing cells + All issues for this release can be found online + https://github.com/DLR-LY/CPACS/issues + + + + + CPACS 2.3.1 + + Release in Jul 2016 + + CPACS 2.3.1 is a beta release, all parameters may be subject to change. + Added a branch for the definition of design studies. + Added thermal properties for materials. + Revised the definition of flights/flightplans. + Added an airline definition. + Added structure for skid gear components. + Changed the units for material density to SI units. + Revised the top level fleets node and put it into the new airline node. + All issues for this release can be found online + https://github.com/DLR-LY/CPACS/issues + + + + + CPACS 2.3 + + Release in Nov 2015 + CPACS 2.3 is the fourth public release of CPACS. Major changes include: + + Included vector notation for weight and balance. + Included flight system and flight dynamic information. + Included top level aircraft requirements. + Included a prototype for detailed nacelle geometries. + Included structural mounts. + Extended aero data set for loads. + Extended the mass breakdown. + Updated the symmetry definition, please take a look at the documentation point 5 and 6. + All issues for this release can be found online + https://github.com/DLR-LY/CPACS/issues + + + + + CPACS 2.2.1 + + Release in Feb 2015 + + CPACS 2.2.1 is a beta release, all parameters may be subject to change. + Included preliminary definition of guidecurves. + Included additional means to describe the wing structure. + Included preliminary fuselage fuel tanks. + Included preliminary load envelope. + Included preliminary flight performance and flight qualities. (flight dynamics will follow) + Updated toolspecifics + Updated uncertainty definition + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.2 + + Release in May 2014 + + CPACS 2.2 is the third public release of CPACS. Major changes include + Additions and changes to the loadCaseType. + Included additional genericGeometricEntities for bellyfairings etc. + The mass breakdown is extended for a more detailed fuselage strucuture. + Steadiness information on the geometry is excluded from CPACS 2.2. CPACS 2.3 will include optional guidelines for smoother surfaces. + Uncertainties can now be specified (CPACS 2.2alpha doubleBaseType, CPACS 2.2 also in vector notations) + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.1 + + Release in May 2013 + + CPACS 2.1 is the second public release of CPACS. Most of the implementation was already included in CPACS 2.01 + included fuselage structure and cabin definition + all data is defined according to the CPACS coordinate system. That is the initial coordinate system in which geometries are defined. Therefore, it can but must not meet your body axis. + the mass breakdown is extended for a more detailed wing strucuture + profiles can now be included based on a two-dimensional class shape transformation. The old parametrization will still be available. TIGL will learn CST asap. + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.01 + + Release in Nov 2012 + + CPACS 2.01 is an internal release for the VAMP project. It is the testbed for CPACS 2.1 + included fuselage structure + additions to the load case definition + all issues can be found online + http://code.google.com/p/cpacs/issues/list + + + + + CPACS 2.0 + + Release in Mar 2012 + + CPACS 2.0 is the first public release + large impacts on the documentation + all issues can be found online + http://code.google.com/p/cpacs/issues/list + compatible with TIGL 2.0 + excluded fuselage structure, reintegration in CPACS 2.1 + + + + + CPACS 1.6 + + Release in Jul 2011 + + Thanks for the input on the documentation to Felix Dorbath, Till Pfeiffer, Alexander Koch, Falk Heinecke and Tom Otten + preliminary added enginePylons + deleted seatAssemblyPositionType + updated toolspecific blocks from handbook aero and cpacs mass updater + added weight and balance definition + added loads reference axis and dynamic aircraft model + added wing documentation + added weights documentation + added fleet documentation + added paramam toolspecific documentation + added wing tank definition + changed some names in the massBreakdown + deleted old loadCaseDefinitions + no more plural element for loadAnalyses + shifted groundforces to groundloadcases, this will need an update + added noseLandingGear + mainLandingGear can now have plural SideStruts + + + + + CPACS 1.5 + + Release in Feb 2011 + + uID for transformation + extended stringUIDBaseType with optional attribute isLink + all elements xxxUID are now of Type stringUIDBaseType + added new material definition from FA to distinguish between diffent material types + changed fuselage structure definition due to input from BK + changed rib definition in cells in component segments + cleaned up material definition in component segments + added cpacsVersion information to the header and updates types + added area and length to the loadCase reference on wing strips + added wingFuselageAttachment + + + + + CPACS 1.4 + + Release in Nov 2010 + + Geometry definition for engine and nacelle added + Trailing Edge Devices, Leading Edge Devices and Spoilers added + Rotorcraft added, similar to aircraft + Splitted up multiple Point Types + sparCell added uID + new inline Documentation introduced in CPACS type + + + + + CPACS 1.3 + + Release in Aug 2010 + + Fuel definition added + Introduced component segments for the wing structure + Mission definition was updated + VSAero toolspecific data updated + + + + + CPACS 1.2 + + Release in May 2010 + + Fuselage Structure Elements are updated following the input from BK + + stringers>arbitrary additional parameters: yBezugAtStartX, zBezugAtStartX, yBezugAtEndX, zBezugAtEndX + paxCrossBeams additional parameters: startX, endX + cargoCrossBeams additional parameters: startX, endX + paxCrossBeamStruts additional parameters: startX, endX + cargoCrossBeamStruts additional parameters: startX, endX + structure>pressureBulkhead: positionX instead of positionZ + reinforcementNumberVertical: number of vertical reinforcements + reinforcementNumberHorizontal: number of horizontal reinforcements + maxFlectionDepth: max camber of pressure bulkhead + reinforcementNumber: number of reinforcements rear pressure bulkhead + sheetProperties: definition of sheet properties + innerRadius: inner radius of the pressure bulkhead + + Dummy Wingbox element is included. This definition needs further enhancements + + cpacs>vehicles>aircraft>model>fuselage>fuselage>structure + Wingbox: + xStart: start of the wingbox area + xEnd: end of the wingbox area + zStart: upper limit of the wingbox area + + Damping Derivaties are added in the form of dcfxdp, dcfxdq, dcfxdr, dcfydp, etc. The data will be stored in the model/global/aeroperformaneMap under a new dampingDerivatives element. Unit is deg/sec. + StructureProfiles are defined in the profiles element. They are referenced in structuralElements for several entities such as stringer, frame etc. Currently they are referenced via 'structuralProfileUID' for name consistency it should be either only 'structure' or only 'structural' + Control Commmands. The chain between pilot inputs and controlsurface deflections is now closed. + + Parameters located at cpacs\vehicles\aircraft\model\systems + cockpitControl: links from pilotInput to commandCase + commandCase: links from commandCase to controlDistributor or controlFunction + controlDistributor links to the controlSurface + controlLaws includes controlModes automatic and manual + controlModes contain controlFunctions + + TraFuMo toolspecific data added + + + + + CPACS 1.1 + + Release in Feb 2010 + + Fleets model added. The fleets modeling from CATS is introduced to CPACS 1.1 + Reference changed. The reference type in wingSegmentStripCoefficientsType was changed from referenceType to pointType + + + + + + + + + + + + + + + + + + + + + + + + + CPACS header + + + Header type, containing CPACS dataset description + + + + + + + + + + + Name of CPACS dataset + + + + + Description of CPACS dataset + + + + + + Version of initial CPACS dataset according to the Semantic Versioning 2.0.0 standard. + + + + + + DEPRECATED: Should only be set to allow TiGL to open the file until TiGL is adopted accordingly. + Will be replaced by the cpacsVersion element in versionInfos. + + + + + + + + + + + + + + + updatesType + + + Updates type, containing update data for the CPACS + dataset + + + + + + + + + + + + + + + + + + + + + complexBaseType + + + Base type for complex nodes (including external data + attributes) + + + + + + + + + + + + + + + stringBaseType + + + Base type for string nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + stringUIDBaseType + + + This is the base type that links to other components. It should always contain a UID. + This node has an additional attribute isLink that will be used if a stringBaseType refers to a uID. TIXI can then + perform automatic validation for the existence of the referenced uID. + Furthermore this node contains an additional attribute symmetry. The symmetry attribute may take three values: symm, def, full + def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. + symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) + full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + + + + + + + + + + + + + + + + + + + + + + + + + + stringVectorBaseType + + + + Base type for string vector nodes + The vector base type can include optional uncertainty + information. The description of uncertainties is placed in + addtional attributes. First, it is described by an attribute that + describes the type of uncertainty function called functionName. + The functionName attribute includes the tag name of the + distribution function which is listened in the table shown below. + Each uncertainty function is further describes by a set of + parameters that are described in the table below. + If the uncertainty values change for the elements of + the vector than the attribute may be written as a list of values + separated by semicolons + DEPRECATED: As of CPACS + version 3.3, the mapType + attribute is set to optional to ensure the compatibility of older data sets. + However, since the type is uniquely defined via the XSD, the attribute is superfluous + and will therefore be completely omitted in the next major release (Note: requires + TiXI >= 3.3). Please contact the CPACS team + if for any reason you see a long-term need for the mapType + attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vector with semicolon separated values of type double + + + + Any entries of type double separated by semicolons are permitted, e.g.: + +<doubleVectorTest>123.456;+123.456;-1.234e56;-.45E-6;NaN</doubleVectorTest> + + +<doubleVectorTest>123.456</doubleVectorTest> + + +<doubleVectorTest>123.456,+1234.456</doubleVectorTest> + + +<doubleVectorTest>123.456;mainWingUID</doubleVectorTest> + + +<doubleVectorTest>123.456;1234.4E 56;-1.234e5.6</doubleVectorTest> + + + + + + + + + + + + + + + + + + + doubleVectorConstraintBaseType + + + + Base type for double vectors including a relational operator attribute indicating valid constraint region. + The doubleVectorConstraintBaseType extends the doubleVectorBaseType and thus inherits all its attributes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vector with semicolon separated positive integer values + + + + Any positive integer values separated by semicolons are permitted, e.g.: + +<intVectorTest>0;1;2;3;4;5</intVectorTest> + + +<intVectorTest>1</intVectorTest> + + +<intVectorTest>0,1,2,3,4,5</intVectorTest> + + +<intVectorTest>0.;1.;2.</intVectorTest> + + +<intVectorTest>-1;0;1</intVectorTest> + + + + + + + + + + + + + + + + + + + stringArrayBaseType + + + Base type for string array nodes (including maptype + array attribute) + DEPRECATED: As of CPACCS version 3.3, the mapType attribute is set to optional to ensure the compatibility of older data records. However, since the type is uniquely defined via the XSD, the attribute is superfluous and will therefore be completely omitted in future versions. + + + + + + + + + + + + + + + + + Array with semicolon separated values of type double + + + + In CPACS arrays are used to exchange values + in full-factorial parameter spaces, for example to describe the aerodynamic coefficients depending + on Mach number and altitude. + + Thus, the dimensions of the array are spanned by the input vectors. See the following + example where two input vectors are defined. For clarification the entries of the array result from + the multiplication of the index values of the corresponding input vectors: + +<inputVector1>1;2;3</inputVector1> +<inputVector2>4;5;6;7</inputVector2> + + +<array>4;5;6;7;8;10;12;14;12;15;18;21</array> + + Any entries of type double separated by semicolons are valid, e.g.: + +<doubleArrayTest>123.456;+123.456;-1.234e56;-.45E-6;NaN;0</doubleArrayTest> + + +<doubleArrayTest>123.456</doubleArrayTest> + + +<doubleArrayTest>123.456,+1234.456</doubleArrayTest> + + +<doubleArrayTest>123.456;mainWingUID</doubleArrayTest> + + +<doubleArrayTest>1234.4E 56;-1.234e5.6</doubleArrayTest> + + + Please note that the syntax of arrays in the current CPACS + version correspond exactly to the syntax of vectors. There is no special character indicating + the dimensions. Thus, the input vectors have to be determined from the documentation of the + corresponding elements and splitting of the one-dimensional vector has to be done manually. + + + + + + + + + + + + + + + + + + + doubleBaseType + + + + Base type for double nodes (including external data + attributes) + The double base type can include optional uncertainty + information. The description of uncertainties is placed in + addtional attributes. First, it is described by an attribute + that describes the type of uncertainty function called + functionName. The functionName attribute includes the tag name + of the distribution function which is listened in the table + shown below. Each uncertainty function is further describes by a + set of parameters that are described in the table below. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + doubleConstraintBaseType + + + + Base type for double nodes including a relational operator attribute indicating valid constraint region + The doubleConstraintBaseType extends the doubleBaseType and thus inherits all its attributes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + timeConstraintBaseType + + + + Base type for time nodes including a relational operator attribute indicating valid constraint region + The timeConstraintBaseType extends the timeBaseType and thus inherits all its attributes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + integerBaseType + + + Base type for integer nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + booleanBaseType + + + Base type for boolean nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + dateTimeBaseType + + + Base type for dateTime nodes (including external data + attributes) + + + + + + + + + + + + + + + + + + + timeBaseType + + + Base type for time nodes (including external data attributes) + This time type is based on the xsd:time definition. + "To specify a time zone, you can either enter a time in UTC time by adding a "Z" behind the time - like this: 09:30:10Z + or you can specify an offset from the UTC time by adding a positive or negative time behind the time - like this: + 09:30:10-06:00 + or + 09:30:10+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) + + + + + + + + + + + + + + + + + + + dateBaseType + + + Base type for date nodes (including external data attributes). + This date type is based on the xsd:date definition. + "To specify a time zone, you can either enter a date in UTC time by adding a "Z" behind the date - like this: 2002-09-24Z + or you can specify an offset from the UTC time by adding a positive or negative time behind the date - like this: + 2002-09-24-06:00 + or + 2002-09-24+06:00" (description taken from http://www.w3schools.com/xml/schema_dtypes_date.asp) + + + + + + + + + + + + + + + + + + + + + + Positionings of the wing. + + + Positionings type, containing all the positionings of + the wing sections. + + + + + + + + + + + + + + + + + + + Positioning of the wing section + + + + The positionings describe an additional translation of + sections. Basically, the positioning is a vector having the + length 'length' and an orientation that is described by the + parameters 'sweepAngle' and 'dihedralAngle'. If the 'sweepAngle' + and the 'dihedralAngle' are set to zero (or left blank) the + positioning vector equals the positive y-axis of the coordinate + system (in case of a positive 'length'). + If the parameter 'fromSectionUID' is set, the + positioning describes the translation between the 'from' towards + the 'to' section. If the parameter 'fromSectionUID' is left + blank the orgin of the positioning vector is the origin of the + parent coordinate syste. + The orgin of the section coordinate system is the + position which is described by the positioning vector PLUS the + translation which is described in the section. + Please note: If the orgin of the positioning vector is + defined by using another section, i.e. fromSection is defined, + the orgin of this vector equals the end of the positioning + vector of the previous section. This means that the section + translation of the from-section has no influence on the + positioning of the to-section. Therefore the total translation, + which is described by positionings, is the sum of the current + positioning and all positionings that are defined 'before'. + + An example for this is given at positioning 3 and 4 at + the picture below. Please note, that any other combination of + positionings would be possible. + Application of the sweepangle does not lead to a + rotation of the section. Application of the dihedral does not + lead to a rotation of the section. + + + + + + + + + + + + + + Name of the positioning. + + + + + Description of the positioning. + + + + + + Distance between inner and outer section + (length of the positioning vector). + + + + + Sweepangle between inner and outer section. + This angle equals a positive rotation of the positioing vector + around the z-axis of the wing coordinate system. + + + + + + Dihedralangle between inner and outer section. + This angle equals a positive rotation of the positioing vector + around the x-axis of the wing coordinate system + + + + + + Reference to starting section of the + positioning vector. If missing, the positioning is made from the + orgin of the wing coordinate system. + + + + + Reference to ending section (section to be + positioned) of the positioning vector. + + + + + + + + + + + + + + Transformation + + + Transformation type, containing a set of + transformations. The order of the transformations is scaling + -> rotation -> translation, and they are executed in this + order. Any of them can be omitted; it will be replaced by its + defaults. + Transformations are always executed relative to the + child not the parent. I.e. a scaling does not have an influence + on the parent item. For example in the outer geometry of a wing + the element scaling does not influence the section. Scaling does + also not effect rotation and translation. + + + + + + + + + + Scaling data default: 1,1,1. Those parameters + describe the scaling of the x-, y-, and z-axis. + + + + + + Rotation data default: 0,0,0. The rotation + angles are the three Euler angles to describe the orientation of + the coordinate system. The order is allways xyz in CPACS. + Therefore the first rotation is around the x-axis, the second + rotation is around the rotated y-axis (y') and the third + rotation is around the two times rotated z-axis (z''). + + + + + + Translation data default: 0,0,0. Translations + can either be made absolute in the global coordinate system + (absGlobal), absolute in the local Coordinate system (absLocal) + or relative (relative), normalized with the maximum dimensions + of the parent. + + + + + + + + + + + + + + 2D transformation + + + + + + + + + + + + + Scaling of the structural profile + + + + + + rotation around z-axis of profile definition + + + + + + translation of profile definition + + + + + + + + + + + + + + + Point: x,y,z + + + Point type, containing an xyz data triplet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + Point: x + + + Point type, containing a x data. + + + + + + + + + + X-Component + + + + + + + + + + + + + + Point: y + + + Point type, containing a y data. + + + + + + + + + + Y-Component + + + + + + + + + + + + + + Point: z + + + Point type, containing a z data. + + + + + + + + + + Z-Component + + + + + + + + + + + + + + Point: x,y + + + Point type, containing an xy data doublet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + + + + + + + + + + Point: x, z + + + Point type, containing an xz data doublet. + + + + + + + + + + X-Component + + + + + Z-Component + + + + + + + + + + + + + + Point: y, z + + + Point type, containing an yz data doublet. + + + + + + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + Point: x,y,z + + + Point type, containing an obligatory xyz data triplet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + Point with global/local reference + + + PointAbsRel type, containing an xyz data triplet. Each + of the components is optional. The refType attribute defines, + whether coordinates are absolute in the global ccordinate system + [absGlobal], absolute in the parent element's local coordinate + system [absLocal]. If the object does not have a + parent, only [absGlobal] is permitted. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + + + + + + + + + + Point with constraints + + + Point constraint type, containing an xyz data triplet. + + + + + + + + + + X-Component + + + + + Y-Component + + + + + Z-Component + + + + + + + + + + + + + List of 3D points, kept in three relative coordinate + vecors (rX, rY, rZ) + + + + This set of vectors contains an ordered list of points + for rX, rY, and rZ coordinates in the form of stringBased + Vectors. The x, y and z vector elements with the same index + specify a 3D point relative to a geometric segment. + + + + + + + + + + + + + + + + + + + + Vector of rX coordinates. Relative + circumferential coordinate on wing / fuselage profile + + + + + + Vector of rY coordinates. Relative span + coordinate along a segment + + + + + Vector of rZ coordinates. Relative coordinate + normal to the linear strake (normalised with chordlength / + diameter c*) + + + + + + + + + + + + + List of points + + + PointList type, containing an ordered list of points + + + + + + + + + + + Data point + + + + + + + + + + + + + List of points in x,y + + + PointList type, containing an ordered list of points + + + + + + + + + + + Data points in x-y-space. + + + + + + + + + + + + + List of 3D points, kept in three coordinate vecors (x, + y, z) + + + + This set of vectors contains an ordered list of points + for x, y and z coordinates in the form of stringBased Vectors. + The x, y and z vector elements with the same index specify a 3D + point. + + + + + + + + + + + Vector of x coordinates + + + + + Vector of y coordinates + + + + + Vector of z coordinates + + + + + + + + + + + + + Maps points (actually the index in the point list) to a curve parameter. + + + + Which parameters are allowed depends on the context. + For exampple in a wing profile, values between -1 and 1 are valid. + + + + + + + + + + + List of indices of points to be mapped. Each index must be in the range [1, npoints]. + + + + + List of parameters on the curve, that is mapped to the points defined by their index. + + + + + + + + + + + + + A curve that interpolates a list of points. + + + + The curve interpolates the list of points, typically with a b-spline. + In theory, the interpolation is somewhat ambiguous as it is not defined at which + curve parameter a point will be interpolated. + + To solve is ambiguity, an optional parameter map can be defined + that maps point indices with curve parameters. + + Kinks can also be modeled by populating the "kinks" array with the + indices of points that should be on a kink. As an example, look at the following image: + + + + + In this example, the kinks array will be "3;7". + Optionally, the parameters of the kinks can be set in the parameter map. + The whole profile looks as follows: + + +<pointList> + <x>...</x> + <y>...</y> + <z>...</z> + <kinks>3;7</kinks> + <parameterMap> + <pointIndex>3;5;7</pointIndex> + <paramOnCurve>0.2;0.5;0.8</paramOnCurve> + </parameterMap> +</pointList> + + + + + + + + + + + + Indices of points at which the curve has a kink. Each index is in the range [1, npoints]. + + + + + + Map between point index and curve parameter. + + + + + + + + + + + + + List of 2D points, kept in two coordinate vecors (x, y) + + + + This set of vectors contains an ordered list of points + for x and y coordinates in the form of stringBased Vectors. + The x and y vector elements with the same index specify a 2D + point. The coordinates of the x vector of [0, 1]. + + + + + + + + + + + Vector of x coordinates + + + + + Vector of y coordinates + + + + + + + + + + + + + Point in eta and xsi coordinates + + + Point described by eta-xsi coordinates. + Can be either segment or component segment coordinates. + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta-xsi values are considered to be in segment + eta-xsi coordinates; if it points to a componentSegment, + then componentSegment eta-xsi coordinates are used. + + + + + + + + + + + + + Relative height at eta, xsi position + + + Point described by eta-xsi and a relative height coordinate. + Can be either segment or component segment coordinates. + If relHeight is not given, the point has no offset from the eta-xsi plane + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative height position. + relHeight is relative to the local airfoil thickness. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta-xsi values are considered to be in segment + eta-xsi coordinates; if it points to a componentSegment, + then componentSegment eta-xsi coordinates are used. + + + + + + + + + + + + + Positive double values larger than 0 + + + + + + + + + + + + + + + + + List of uIDs + + + + + + + + + + + Reference to a uID + + + + + + + + + + + + + + + + UIDGroupDefinitionType + + + + + + + + + + + + + + + + + + + + + + + + + + + UIDGroupDefinitionsType + + + + + + + + + + + + + + + + + + + + + + + Actuator attachment + + + + + + + + + + + + + Relative spanwise position of the actuator. + Eta refers to the dimensions of the control surface. + + + + + + + + + + + + + + + + + Definition of the position and material properties of + the control surface actuator attachment. + + + + Definition of the position and material properties of + the control surface actuator attachment. + Please refer to the picture below for the definition + of the parameters: + + + + + + + + + + + + + + Definition of the relative chordwise position + of the parent actuator attachment. Xsi refers to the parents + dimensions. + + + + + Definition of the relative height position of + the parent actuator attachment. relHeight refers to the parents + dimensions. + + + + + Definition of the material properties of the + actuator attachment at the parent. + + + + + + + + + + + + + actuatorFuselageWingAttachmentType + + + + + + + + + + + + + + + + + + + + + + + actuatorFuselageWingType + + + + + + + + + + + + + Reference to the actuator. + + + + + Definition of the actuator to fuselage + attachment. + + + + + Definition of the actuator to wing attachment. + + + + + + + + + + + + + + + Definition of the position and material properties of + the parent actuator attachment. + + + + Definition of the position and material properties of + the parent actuator attachment. + Please refer to the picture below for the definition + of the parameters: + + + + + + + + + + + + + + Definition of the relative chordwise position + of the parent actuator attachment. Xsi refers to the parents + dimensions. + + + + + Definition of the relative height position of + the parent actuator attachment. relHeight refers to the parents + dimensions. + + + + + Definition of the material properties of the + actuator attachment at the parent. + + + + + + + + + + + + + actuatorsFuselageWingType + + + + + + + + + + + + + Definition of one actuator (e.g. trim actuator + of an HTP) of the attachment. + + + + + + + + + + + + + aeroPerformanceMapRCType + + + AeroPerformanceMapRC type, containing a perfomance map + with aerodynamic data. Array order is: angleOfAttack min->max + then angleOfSideslip then altitude then machNumber + + + + + + + + + + Atmospheric model and temperature offset + + + + + Mach number + + + + + Altitude + + + + + Sideslip angle + + + + + Angle of attack + + + + + Name and version of the tool used to compute + the aerodynamic performance + + + + + Modeling level of the methods used to compute + the aerodynamic performance. The higher the analysisLevel, the + higher the quality of the results. Possible use of + analysisLevel: 0- 9 = Statistical models, 10-19 = Analytic + models, 20-29 = Lifting line method, 30-39 = Panel method, 40-49 + = Panel-BL-coupled method, 50-59 = Full potential method, 60-69 + = Full potential-BL coupled method, 70-79 = CFD euler method, + 80-89 = CFD euler-bl coupled method, 99-99 = CFD RANS method, + >=100 = Experimental data. + + + + + + + + + + + + + + + + + + + + aeroPerformanceMapsRCType + + + aeroPerformanceMapsRC type, containing multiple + aeroPerformanceMapRC nodes for different cases + + + + + + + + + + + + + + + + + + + aeroPerformanceType + + + aeroPerformance type, containing perfomance maps with + aerodynamic data of an airfoil. + + + + + + + + + + Aerodynamic performance map of the full + configuration + + + + + Aerodynamic performance maps of isolated + fuselages + + + + + Aerodynamic performance maps of isolated wings + + + + + + Aerodynamic performance maps of control + surfaces + + + + + Aerodynamic performance maps of isolated + airfoils + + + + + + + + + + + + + aeroelasticDivergenceType + + + AeroelasticDivergence type, containing the results from + aeroelastic analysis + + + + + + + + + + + + + + + + + + + aeroelasticStaticMaxDisplacementType + + + AeroelasticStaticMaxDisplacement type, containing the + Maximum static displacement from aeroelastic analysis + + + + + + + + + + Maximum translation + + + + + Maximum rotation + + + + + + + + + + + + + Aeroelasticity + + + Aeroelastics type, containing the results from + aeroelastic analysis + + + + + + + + + + + + + + + + + + + + Results from several analysis + modules connected to CPACS + + + AircraftAnalyses type, containing detailed analysis + data of the aircraft + Within this element results from analysis modules are + stored that rely to the overall definition of the aircraft. These + include e.g. aerodynamic data or loadCases + For further documentation please refer to the + respective elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Global data + + + AircraftGlobal type, containing global data of the + aircraft + + + + + + + + + + + designRange equals the full payload max + range, i.e. point B in payload range + diagramm + + + + + + + + + + + + + + + + + + + Aircraft model + + + + The aircraftModelType contains the geometric aircraft + model and associated data. + Elements specifying the geometry of the aircraft are fuselages, + wings, + engines (referenced via uID), + enginePylons, landingGear, + systems (to some extend) and genericGeometryComponents. + + Other elements are dedicated to additional data associated to this aircraft model. Brief and concise analysis results are stored + in the global node. The analysis node contains + extensive results from multidisciplinary analysis modules. + In the current CPACS version requirements only refer to the aircraft performance and are therefore specified in the + performanceRequirements node. + + + + + + + + + + + + Name of the aircraft model + + + + + + Description of the aircraft model + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aircraft + + + + The aircraftType contains a list of aircraft models. + + + Note: Since there is no distinction between plural and singular in English, aircraft + refers to plural form, while a single aircraft itself is referened as model. + + + + + + + + + + + + + + + + + + + + + airfoilAeroPerformanceType + + + airfoilAeroPerformance type, containing perfomance maps + with aerodynamic data of an airfoil. + + + + + + + + + + Reference to the uID of the analysed airfoil + + + + + + References used for the calculation of the + force and moment coefficients of the airfoil (in the airfoil + axis system!) + + + + + Calculated aerodynamic performance maps of the + airfoil + + + + + + + + + + + + + airfoilsAeroPerformanceType + + + airfoilsAeroPerformance type, containing + airfoilsAeroPerformance + + + + + + + + + + + + + + + + + + + airframeMaintenanceCostType + + + + + + + + + + + + + + + + + + + + + + + airlineType + + + Describes a specific airline and their fleet + + + + + + + + + + Name of the airline + + + + + Description of the airline + + + + + + + + + + + + + + + + Airlines + + + Contains a list of different airlines + + + + + + + + + + + + + + + + + + + airportCompatabilityGlobalType + + + + + + + + + + + + + + + + + + + + + + + + + + airportType + + + Airport type, containing data of an airport + + + + + + + + + + Name of airport + + + + + Description of airport + + + + + IATA 3-letter-code + + + + + ICAO 4-letter-code + + + + + Position in degrees north + + + + + Position in degrees east + + + + + Airport elevation + + + + + + + + + + + + + + + Airports + + + Airports type, containing data of the airports + + + + + + + + + + + + + + + + + + + + alignmentCrossBeamType + + + + + + + + + + + + + Offset in direction of extrusion, first side + (absolute value) + + + + + Offset in direction of extrusion, second side + (absolute value) + + + + + Rotation around local x axis (extrusion axis) + + + + + + Translation along local y axis (perpendicular + to extrusion axis) + + + + + Translation along local z axis (perpendicular + to x ynd y axes) + + + + + + + + + + + + + + alignmentFloorPanelType + + + + + + + + + + + + + Offset from seat rail 1 reference Position in + local y direction (in plane of panel, absolute value) + + + + + + Offset from seat rail 2 refernce position in + local y direction (in plane of panel, absolute value) + + + + + + Offset from seat rail 1 refernce position in + local z direction (in plane of panel, absolute value)) + + + + + + + + + + + + + + + alignmentStringFrameType + + + + + + + + + + + + + Rotation around local x axis (extrusion axis) + + + + + + Translation along local y axis (perpendicular + to extrusion axis) + + + + + Translation along local z axis (perpendicular + to x ynd y axes) + + + + + + + + + + + + + + alignmentStructMemberType + + + + + + + + + + + + + Offset in direction of extrusion (absolute + value) + + + + + Rotation around local x axis (extrusion axis) + + + + + + Translation along local y axis (perpendicular + to extrusion axis) + + + + + Translation along local z axis (perpendicular + to x ynd y axes) + + + + + + + + + + + + + + atmosphericModelType + + + Defines the the athmospheric model which should be used. + Currently there is only a single option which is ISA for ICAO Standard + atmosphere (ISA) from 1993. For more details on atmospheric + models, please refer to documentation of the <CPACS> root + element. + + + + + + + + + + Atmospheric model (e.g. ISA for ICAO Standard + atmosphere (ISA) from 1993). + + + + + + + + + + + + Offset from temperature of the atmospheric model [K]. + For more details on atmospheric models, please refer to documentation + of the <CPACS> root element. + + + + + + + + + + + + + Attachment pin of the wing-fuselage-attachment. + + + + Attachment pin of the wing-fuselage-attachment. + + + + + + + + + + + + + Definition which translation degrees of + freedom are blocked. Default x=0 (free); y=1 (blocked); z=1 + (blocked). + + + + + + + + + + + + + + + + Definition of attachment pins for the wing-fuselage + attachment. + + + Definition of attachment pins for the wing-fuselage + attachment. + + + + + + + + + + + + + + + + + + + Axle + + + Geometric description and material properties of the + landing gear axle + + + + + + + + + + Length of the axle. For a single wheel, the length is equal to the distance between the center of the piston and the center of the wheel. For two wheels, the length is equal to the distance between the centers of the wheels with the axis being centered w.r.t. to the Piston. + + + + + Axle shaft properties + + + + + Number of wheels attached to this axle + + + + + Defines the side of the first wheel (inboard or outboard; inboard corresponds to the negative y-direction or in flight direction left) for odd number of wheels on this axis. Each additional wheel is the added on the opposite site of the previous wheel. + + + + + + + + + + + + Properties of the wheel(s) attached to this axle. If more than one wheel is attached, all wheels on a single axis have the same properties. + + + + + + + + + + + + + + Definition of the landing gear wheel. + + + The center plane of the wheel is located on the end point of the axle. + + + + + + + + + + Wheel radius + + + + + With of the wheel + + + + + Brake: false = + not braked; true = braked. + + + + + + + + + + + + + + beamCrossSectionType + + + beamCrossSectionType, containing the beam geometrical + properties + + + + + + + + + + + + + + + + + + + + + + + + beamStiffnessType + + + globalBeamStiffnessType, containing the beam + stiffnesses such as EA, EI + + + + + + + + + + + + + + + + + + + + + + + + + + blockedDOFType + + + + + + + + + + + + + + + + + + + + + + + Bogie + + + Geometric description and material properties of the + landing gear axle bogie (including the axle configuration) + + + + + + + + + + Length of the bogie + + + + + Tilt angle of the bogie in airborne conditions + + + + + + + + + + + + + + + + Bogie axle assembly + + + Description of an axle installed on the bogie and its + relative position to it + + + + + + + + + + + Relative position of the axle to the bogie (if more than one axle is defined; 0 = forward end of bogie; 1 = rear end of bogie) + + + + + + + + + + + + + + + + + + + Bogie axle assemblies + + + + A list of axles that are attached to the bogie + and their relative position to it + + + + + + + + + + + + + + + + + + + + cabGeometryType + + + cabGeometry provides the geometry of the cabin in terms + of constant height contour lines. The lines all share a common + x-vector. The vectors yZ[N] provide the lateral contour at + Z-coordinate provided in the vector z. The number of contour + lines can differ and is given by the length of the vector z + + + + + + + + + + + + + x-coordinates for all contour lines, relative + to cabin origin. + + + + + z-coordinate of contour lines. Contour lines + are constant z, so each entry in this vector belongs to a single + contour line. + + + + + + + + + + + + + + + cabinAisleType + + + aisles has as many entries as there are aisles in the + cabin. In a normal single aisle there are two aisles: the cabin + aisle and the aisle leading to the cockpit. + + + + + + + + + + + + Provides the longitudinal coordinates. The + number of coordinates can be chosen as appropriate, the minimum + number is two. The coordinates are relative to the cabin origin. + + + + + + Provides the center points of the aisle. The + y-vector has to have same length as the x-vector. The aisle + stretches equally left and right of the provided y-coordinate. + + + + + + the width of the aisle at floor level at each + y-coordinate. + + + + + + + + + + + + + + cabinAislesType + + + + + + + + + + + + + + + + + + + + + + cabinDoorType + + + doors describe all doors of the cabin. They are linked + to a structural door description. The cabin door is usually equal + in size to the door, but does not need to be. The structural door + might describe a wider cut-out, while the cabin door is primarily + intended for evacuation modeling and cabin layout. In order to + obtain a 3-dimensional door representation, the local cabin + geometry shall be used. + + + + + + + + + + + + + Number of passengers this door adds to the + overall exit capacity limit of the aircraft. + + + + + This is the forward x-coordinate of the door + relative to the cabin origin. + + + + + the door sill height relative to cabin origin. + + + + + + The width of the door in x-direction. + + + + + + the effective height of the door. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cabinDoorsType + + + + + + + + + + + + + + + + + + + + + + cabinFloorElementType + + + floorElement describes objects like monuments or other + installations inside the cabin. + + + + + + + + + + + + + + + + + + + + + + + forward center coordinate of object relative + to cabin origin. + + + + + center y-coordinate relative to cabin origin. + + + + + + length of the object + + + + + length of the object + + + + + length of the object + + + + + + + + + + + + + + + cabinFloorElementsType + + + + + + + + + + + + + + + + + + + + + + cabinSeatElementType + + + seats describe all seats inside the aircraft. They are + – strictly speaking – also objects mounted on the floor, hence + floor objects. But the specific characteristics of seats justify + a differentiation between seats and other objects on the floor. + Seats are seat group, for example a triple seat. Therefore they + have multiple seats. + + + + + + + + + + + + Number of seats + + + + + + + + + + + + + + + + x-coordinate relative to cabin origin. + + + + + + y-coordinate relative to cabin origin. + + + + + + delta-y-coordinate of the individual seat + center points from the y-coordinate of the seat object. This is + important to locate passengers. It is assumed that seats have no + angle. + + + + + length of the seat group. + + + + + width of the seat group. + + + + + height of the seat group. + + + + + + + + + + + + + + + + + cabinSeatElementsType + + + + + + + + + + + + + + + + + + + + + + cabinSpaceType + + + spaces describe areas in the cabin that need to be + clear for use as emergency area. Depending on the type of area, + it can have a height limit. The spaces are required for + downstream cabin design, for example to describe an empty cabin. + + + + + + + + + + + + + x-coordinates. These describe an area, so they + are not monotonous ascending. + + + + + y-coordinates at given x-coordinates. Warning: + x-y do not represent a function as single x-positions can have + multiple y-coordinates. Hence, no interpolation is possible. + + + + + + the height above the floor that is required to + be empty of any objects. + + + + + + + + + + + + + + cabinSpacesType + + + + + + + + + + + + + + + + + + + + + + Cap + + + + SparCap type, containing the cross section area of the + spar cap and the material properties. + Pleas find below a picture where all spar cross + section parameters as well as the orientation refereneces for + the material definition can be found: + + + + + + + + + + + + + + Area of the cap + + + + + + + + + + + + + + cargoCrossBeamStrutsAssemblyType + + + CargoCrossBeamStrutsAssembly type, containing cargo + crossBeam strut assemblys + + + + + + + + + + + + + + + + + + + cargoCrossBeamsAssemblyType + + + CargoCrossBeamsAssembly type, containing cargo + crossBeam assemblys + + + + + + + + + + + + + + + + + + + cargoDoorsAssemblyType + + + CargoDoorsAssembly type, containing cargo door + assemblys + + + + + + + + + + + + + + + + + + + Chordwise positioning of wing cells. + + + CellPositioningChordwise defines the chordwise direction of a wing cell either in two xsi + (xsi1 at innerBorder and xsi2 at outerBorder) coordinates, via referencing a spar-uID or via a + contour coordinate in chordwise direction. + + + + + + + + + + + Relative chordwise position of the inner + end. + + + + + Relative chordwise position of the outer + end. + + + + + + Reference to a spar as chordwise border. + + + + + + Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. + + + + + + + + + + + + + Spanwise positioning of wing cells. + + + CellPositioningSpanwise defines the chordwise direction of a wing cell either in two eta + (eta1 at leadingEdge and eta2 at trailingEdge) coordinates, via referencing a rib-uID or via a contour + coordinate in chordwise direction. + + + + + + + + + + + Relative spanwise position of the forward + end. + + + + + Relative spanwise position of the rear end. + + + + + + + + RibNumber is the reference to the rib number + of the rib set which is referenced by 'ribDefinitionUID'. + + + + + + Reference to a ribDefinition set. The single + rib of this ribDefinition set is defined by using 'ribNumber'. + + + + + + + Spanwise contour coordinate as spanwise border. 0 equals root, 1 equals tip. + + + + + + + + + + + + + centerFuselageAssemblyType + + + CenterFuselageAssembly type, containing wing box + assemblys + + + + + + + + + Choise between diffent center fuselage + modelling options + + + + Simplified center fuselage definition (rigid + body) + + + + UID of first frame in rigid center fuselage + area + + + + + UID of last frame in rigid center fuselage + area + + + + + UID of start stringer to define center + fuselage area + + + + + UID of end stringer to define center fuselage + area + + + + + + Detailled low wing center fuselage definition + (draft definition) + + + + + + Detailled high wing center fuselage definition + (draft definition) + + + + + + + + + + + + + + + centerFuselageAreasAssemblyType + + + centerFuselageAreasAssembly type, containing center + fuselage area assembly + + + + + + + + + + + + + + + + + + + centerFuselageHighWingConfiguration + + + + + + + + + + + + + + + + + + + + + + centerFuselageKeelbeamType + + + CenterFuselage / Keelbeam definition between mainframe1 + und mainframe3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageLateralPanelsType + + + CenterFuselage / lateral Panel definition between + mainframe2 und mainframe3 + + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageLongFloorBeamConnectionType + + + CenterFuselage / Long. floor beam connection + + + + + + + + + + + + + + + + + + + + + centerFuselageLowWingConfiguration + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageMainFramesType + + + CenterFuselage / main frame definition, containing + mainframe and pressure Bulkhead definitions + + + + + + + + + + + + + + + + + + + + + + + + centerFuselagePressureFloorType + + + CenterFuselage / pressure floor definition between + mainframe2 und mainframe3 + + + + + + + + + + + + + + + + + + + + + + + + centerFuselagePressureFloorType + + + CenterFuselage / side box definition between mainframe2 + und mainframe3 + + + + + + + + + + + + + + + + + + + + + certificationCasesType + + + + + + + + + + + + + + + + + + + + + + chargesCostType + + + + + + + + + + + + + + + + + + + + + + + + + + cockpitControlType + + + single cockpitControl is defined by a pilotInput and a + commandOutput. The commandOutput is linked to the commandCase + + + + + + + + + + + + + + + + + + + + + + + + + cockpitControlsType + + + Cockpit controls type, containing the cockpit controls + + Some controls are mandatory, others can be added via + cockpitControl elements + + + + + + + + + + + + + + + + + + + + + + commandCaseCommandType + + + single commandCaseCommand can either hold a + controlFunction or a controlDistributor + + + + + + + + + + + + + + + + + + + + + + + commandCaseType + + + single commandCase Containing several + commandCaseCommands + + + + + + + + + + + + + + + + + + + + + + commandCasesType + + + plural Element for commandCase, some fixed dp, dq, dr + and dx, dy, dz + + + + + + + + + + + + + + + + + + + + + + + + + componentCostType + + + + + + + + + + + + + + + + + + + + + + Load envelope + + + List of load cases defining a load envelope + + + + + + + + + + + Name + + + + + Description + + + + + UID of the corresponding point set + + + + + + List of uIDs defining the loads envelope + + + + + + + + + + + + + componentSegmentPathType + + + + + + + + + + + + + Definition of hingePoint of the + componentSegment. The hingePoint is used as reference point for + the deflection definition. + + + + + Definition of the orientation of the hinge + line with three Euler-rotation angles. The hinge line is + oriented along the global y-axis if all rotations are 0. + + + + + + Definition of all steps of the deflection + path. + + + + + + + + + + + + + componentSegmentStepType + + + + + + + + + + + + + The control parameter is used to reference the + state of a control device, e.g. in the load + case description. Can have any value and is NOT limited to the + range of -1 to 1. + + + + + Translation along the x-, y- and z-Coordinate + of the rotated hinge coordinate system. + + + + + Rotation around the hinge line. + + + + + + + + + + + + + + componentSegmentStepsType + + + + + + + + + + + + + Definition of one step of the deflection path. + + + + + + + + + + + + + + ComponentSegment of the wing. + + + + Within componentSegments the wing structure, the + control surfaces, the wing fuel tanks and the + wingFuselageAttachment is defined by using relative coordinates. + + A componentSegment is defined in the same way as + segments: from one cross section (sections->elements) to + another. Compared to segments one componentSegment can can start + and end at elements that are not consecutive. Therefore that one + componentSegment can be the combination of several segments. + Each wing has at least one componentSegment (from root to tip). + The maximal number of componentSegments equals the number of + segments (each segment is defined as one componentSegment). + This also implies that each segment can only be part of one componentSegment. + + In principal a componentSegment can combine any number + of segments. But if in one section two elements are defined, the + componentSegment has to start/end there as no well-defined + relative coordinats can be defined if steps in the wing occure. + + An example for wing componentSegments can be found in + the picture below: + + + + Within componentSegments a relative spanwise + coordinate (eta) and a relative chordwise coordinate (xsi) is + defined. Those coordinates are used for the definition of e.g. + wing structures and control surfaces. there are two types of eta xsi coordinates. + Segment (eta, xsi) coordinates define the relative local coordinate system for a segment ranging from (0,0) to (1,1). + + + + + + The eta xsi coordinates for a component segment are based on the segment eta xsi planes. + As a reference length for the component segment eta coordinate the + mid chord lines of all the segments are used. + The beginning of this line at from-element equals eta = 0, while the end of this line + at the to-element equals eta = 1. All wing positions that lie on the same + element (segment border) have the same eta coordinate. The points inbetween + two elements are defined by the iso xsi lines of the segment eta xsi space. + An example for the definition of the relative axes can + be found in the picture below: + + + + + In order to calculate the global coordinates of a component segment eta xsi point + one first has to calculate the eta point on the xsi iso line of (xsi=0.5), + and then walk along the iso eta lineof the segment. + + An example for determining the a component + eta xsi point can be found in the picture below: + + + + + + + + + + + + + + + + + + + + + + + + Name of the wing componentSegment. + + + + + + + Description of the componentSegment. + + + + + + + Reference to the element from which the + componentSegment shall start. + + + + + + + Reference to the element from which the + componentSegment shall end. + + + + + + + + + Description of deflection path of + componentSegments (e.g. used for + trimmable HTPs). + + + + + + + + + + + + + + + + + + + ComponentSegments of the wing. + + + ComponentSegments type, containing all the + componentSegments of the wing. + + + + + + + + + + + + + + + + + + + compositeLayerType + + + CompositeLayer type, conatining data of a composite + layer + + + + This type defines single composite layers by + giving a ply thickness, ply reference angle and a materialUID. + + + + + + + + Name of layer + + + + + Description of layer + + + + + Thickness of layer + + + + + Angle of layer in degree + + + + + Material UID of the layer + + + + + + + + + + + + + compositeType + + + Composite type, conatining data of a composite + + + + + Within this type individual stackings of + composites can be introduced by defining an offset and a set of + composite layers. The order of the composite layers defines the + stacking order. + + + + + + + Name of composite + + + + + Description of composite + + + + + offset of the laminate. The reference plane of + the laminate is the arithmetic mean of the laminate thickness. + + + + + + + + + + + + + + + + compositesType + + + + + + + + + + + + + + + + + + + + + + connectivitiesType + + + + + + + + + + + + + + + + + + + + + + connectivityType + + + + + + + + + + + + + + + + + + + + + + + + + + Constraints + + + + Constraint settings for the point performance definition + + + + + + + + + + + Calibrated airspeed [m/s] + + + + + + + Mach number [-] + + + + + + + Climb angle [deg] + + + + + + + Rate of climb [m/s] + + + + + + + Rate of turn [deg/s] + + + + + + Thrust setting for derated engine as fraction of max. thrust (e.g.: for powered descents, deceleration not at IDLE, manoevres) + + + + + + + Rate of velocity [m/s^2] + + + + + + + Duration [s] + + + + + + + Angle of attack [deg] + + + + + + + Constant altitude [m] + + + + + + + + + + + + + + Constraint + + + + + Specification of performance constraints. + + Constraints allow vectors of double values to define parameter lapses within a mission segment. The example below illustrates this by means of an exemplary climb profile of a conventional airliner, in which multiple physical and regulatory speed constraints are simultaneously specified over several altitudes (e.g., to account for the crossover altitude): + <endCondition> + <positionGeo> + <altitude relationalOperator="ge" uID="altClimb">10058.4</altitude> <!-- FL330 --> + </positionGeo> +</endCondition> +<constraint> + <referenceEndConditionUID>altClimb</referenceEndConditionUID> + <endConditionRatio>0.0;0.303</endConditionRatio> <!-- FL0, FL100 --> + <continuitySetting>discrete</continuitySetting> + <CAS relationalOperator="le">128.61;154.33</CAS> <!-- 250 [kt], 300 [kt]--> + <machNumber relationalOperator="le">0.78;0.78</machNumber> + <prioritySetting>velocity</prioritySetting> +</constraint> + + + From FL0 until FL100, the vehicle should fly at a velocity less than or equal to CAS = 250 kt or M = 0.78. In this first segment at low altitudes, the constraint on CAS is triggered. + + + From FL100 until FL330, the vehicle should fly at a velocity less than or equal to CAS = 300 kt or M = 0.78. In this second segment, the vehicle starts by increasing velocity until 300 kt, the constraint on maximum machNumber triggers from the crossover altitude onwards + + + + + + + + + + + + + Reference to the uID of the segment end condition variable + + + + + + + Vector indicating the ratios of the constraintSettings profile with respect to the provided referenceEndCondition, ranging from 0 to 1. If this vector is defined, the provided constraintSettings are expected to be vectors with the same length providing ratio-value pairs. Example: for referenceEndCondition <range><z> (i.e.: flown distance in z direction of the segment), a vector of <CAS> and <machNumber> is provided to define a climb profile. + + + + + + Defines how to interpret the parameter lapses within the segment: discrete steps (C0 continuity) or linear interpolation (C1 continuity) + + + + + + + + + + + + + + + Calibrated airspeed within the + segment + + + + + + + Mach number within the segment + + + + + + + Climb angle within the segment + + + + + + + Climb angle within the segment + + + + + + + Specific excess power within the segment + (e.g.: for defining minimum SEP to + remain after step climbs have been + performed). + + + + + + + Altitude difference of each step climb + + + + + + + + Flight heading at the end of the + segment in compassAngle with + reference to true North [deg] + + + + + + + Total change of heading angle during + segment (a full turn is 360 degrees) + [deg] + + + + + + + + Rate of turn within the segment + + + + + + + Thrust setting for derated engine as + fraction of max. Thrust (e.g.: for + powered descents, deceleration not at + IDLE, manoevres). + + + + + + + Rate of velocity within the segment + + + + + + + Load factor experienced during segment + + + + + + + Constant altitude for the segment. + + + + + + + priority setting indicating which + constraint is preferred within the + segment + + + + + + + + + + + + + + + + + + + + + + Airfoil definition of an control surface at the + inner/outer border. + + + + Optional definition of the exact airfoil shape at the + inner/outer border of the control surface. + The airfoil shape is defined via referencing to the + airfoilUID. As the leading and trailing edge point is fix due to + the outer shape definition of the control surface the airfoil + can only be rotated around the x-axis (axis going from leading + to trailing edge of the inner/outer border of the control + surface). Scaling in x-direction is also defined by the outer + shape, wherefore only scaling in y and z direction is allowed. + + + + + + + + + + + + Reference to the airfoil uID. + + + + + + Rotation around an axis, going from the + leading edge point to the trailing edge point of the inner/outer + border of the control surface. Defaults to 90°, which is + equivalent to perpendicular on the control surface middle plane. + + + + + + Scaling of the airfoil in spanwise direction + (not used for 2D airfoils). + + + + + Scaling in thickness direction of the airfoil. + + + + + + + + + + + + + + controlDistributorType + + + + single controlDistributor bundling several + controlElements + Within some analyses, it might occur that overlapping control element settings are specified. In this case, + it is assumed that a cumulative setting is built by summing up the individual settings. As the behavior of these settings + is not necessarily linear, a certain order of summation has to be followed: + + (1) The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. + (2) With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. + (3) All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. + (4) With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. + (5) During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. + + + + + + + + + + + + + + Vector of command inputs. The minimum and maximum value is given by the lowest and highest entry of the vector, respectively. + + + + + + + + + + + + + + + controlDistributorsType + + + plural Element for controlDistributor + + + + + + + + + + + + + + + + + + + controlElementType + + + Single controlElement linking the inputs of a controlDistributor via a gain + table to a contol device by using its uID. Controls can be ControlSurfaces and in the + future thrust. + + + + + + + + + + UID of the control device, e.g. a control surface. It is not allowed to reference another control distributor. + + + + + Vector of control device states resulting from the input commands. It must be of the same length as the inputCommands element. + The minimum and maximum values are defined according to the minimum and maximum values of the input commands. + + + + + + + + + + + + + controlElementsType + + + plural Element for controlElement + + + + + + + + + + + + + + + + + + + controlFunctionType + + + single controlFunction containing the controller's + parameters + + + + + + + + + + + + + + + + + + + + + + + + + + controlFunctionsType + + + plural Element for controlFuntion + + + + + + + + + + + + + + + + + + + controlLawModeType + + + Control Laws type, containing the aircraft's control + law mode + + + + + + + + + + + + + + + + + + + controlLawModesType + + + Control Laws type, containing the aircraft's control + law modes + + + + + + + + + + + + + + + + + + + controlLawsType + + + Control Laws type, containing the aircraft's control + laws + + + + + + + + + + + + + + + + + + + + Definition of an actuator of the control surface, that + is not placed within a track. + + + Definition of an actuator of the control surface, that + is not placed within a track. + + + + + + + + + + Reference to the actuator (actuator definition + currently not available in CPCAS, status 1.6). + + + + + + + + + + + + + + + + Definition of actuators of the control surface, that + are not placed within a track. + + + Definition of actuators of the control surface, that + are not placed within a track. + + + + + + + + + + + + + + + + + + + Airfoil definition of an control surface between inner + and outer border. + + + + Optional definition of the exact airfoil shape between + the inner and outer border of the control surface. + The airfoil shape is defined via referencing to the + airfoilUID. As the leading and trailing edge point is fix due to + the outer shape definition of the control surface the airfoil + can be rotated around the x-axis (axis going from leading to + trailing edge of the control surface) and around the z-axis + (normal axis on the control surface middle plane). Scaling in + x-direction is also defined by the outer shape, wherefore only + scaling in y and z direction is allowed. + + + + + + + + + + + Relative spanwise coordinate (eta) of the + control surface, where the leading edge of the airfoil is + placed. + + + + + Reference to the airfoil uID. + + + + + + Rotation around an axis, going from the + leading edge point to the trailing edge point of the control + surface. Defaults to 90°, which is equivalent to perpendicular + on the control surface middle plane. + + + + + Rotation of the airfoil around the control + surface middle plane normal direciotn. Reference point is the + most forward point of the airfoil. Defaults to 90°, which is + equivalent to the airfoilplacement in flight direction (along + wings-x axis). + + + + + Scaling of the airfoil in spanwise direction + (not used for 2D airfoils). + + + + + Scaling in thickness direction of the airfoil. + + + + + + + + + + + + + + Inner/outer border of the control surface. + + + + Definition of the inner/outer border of the control + surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + In addition, optionally, the airfoil shape of the + control surface can be defined closer. For the leading edge + devices 'hollow'. If an exact control surface airfoil definition + should be used, outerShape->airfoils can be used. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + Relative spanwise inner/outer position of the + leading edge of the control surface. + + + + + Relative spanwise inner/outer position of the + trailing edge of the control surface. Defaults to 'etaLE'. + + + + + + Relative chordwise inner/outer position of + the trailing edge of the control surface. Reference is eta/xsi + from the parent. + + + + + + + + + + + + + + + + + + + + + + + Inner/outer border of the control surface. + + + + Definition of the inner/outer border of the control + surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + In addition, optionally, the airfoil shape of the + control surface can be defined closer. For the + spoiler'relHeightLE' is used. If an exact control surface + airfoil definition should be used, outerShape->airfoils can + be used. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + Relative spanwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + Relative spanwise inner/outer position of the + trailing edge of the control surface. Reference is eta/xsi from + the parent. Defaults to 'etaLE'. + + + + + Relative chordwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + Relative chordwise inner/outer position of the + trailing edge of the control surface. Reference is eta/xsi from + the parent. + + + + + + Defines the relative high of lowest point of + the spoiler leading edge, relative to the airfoil height of the + parent at this position. See picture below. + + + + + + + + + + + + + + + + Inner/outer border of the control surface. + + + + Definition of the inner/outer border of the control + surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + In addition, optionally, the airfoil shape of the + control surface can be defined closer. For the trailing edge + device this is done at 'leadingEdgeShape', for the spoiler + 'relHeightLE' is used and for the leading edge devices 'hollow'. + If an exact control surface airfoil definition should be used, + outerShape->airfoils can be used. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + Relative spanwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + Relative spanwise inner/outer position of the + trailing edge of the control surface. Reference is eta/xsi from + the parent. Defaults to 'etaLE'. + + + + + Relative chordwise inner/outer position of the + leading edge of the control surface. Reference is eta/xsi from + the parent. + + + + + + + + + + + + + + + + Optional definition of the exact airfoil shape of the + control surface. + + + + + + + + + + + + + + + + + + + + + + This type contains a vector of deflection values for a + single control surface + + + + + 0. General overview + + In this type, a vector of deflections of a single + control surface is specified. + + + + 1. + <controlSurfaceUID> + (mandatory) + + + A reference to a control surface from the aircraft + model + + + + 2. + <controlParameters> + (mandatory) + + + A vector of controlParameters of the selected + control surface (with respect to the defined deflection path). + + + + + + + + + + + + + + Reference to a control surface + + + + + + Control parameters of the control surface + + + + + + + + + + + + + + This type contains a list of control surfaces and their + deflection vectors + + + + + 0. General overview + + In this type, a list of control surfaces is defined. + + + + + 1. + <controlSurface> + (mandatory) + + + One of these nodes per deflected control surface is + required here. + + + + + + + + + + + + + + + + + + + + + + controlSurfaceHingeMomentMapType + + + controlSurfaceHingeMomentMap type, containing a moment + map with aerodynamic data for a control surface. Array order is: + controlParameters min->max then angleOfAttack then angleOfSideslip + then reynoldsNumber then machNumber. AngleOfAttack, angleOfSideslip, + reynoldsNumber and machNumber are taken from the basic + performance map one level above. + + + + + + + + + + Reference to the control surface + + + + + + Control parameters of the control surface + + + + + + + + + + + + + + + + + + + + controlSurfaceHingeMomentMapsType + + + controlSurfaceHingeMomentMapsType type, containing the + aerodynamic moment maps for one or more control surfaces. + + + + + + + + + + + + + + + + + + + + controlSurfaceHingePointType + + + + The deflection path of a control surface is described + with respect to two hinge points - one at the inner border of + the control surface and one at the outer border of the control + surface. Those two points are defined using the xsi and relative + height coordinates of the parent. Therefore those points can also + lay outbound of the control surface. Those two points defined + the hinge line, which is a straight line between the two points. + + An example can be found below: + + + + + + + + + + + + + + Relative chordwise coordinate (xsi) of the + hinge line point. Reference is the parent chord. + + + + + + Relative height of the hinge line point. + Reference is the parent airfoil height. + + + + + Optional absolute translation of the hinge point. + This can be used to move the hinge points outside of the wing shape. + + + + + + + + + + + + + Outer shape definition of the control surface. + + + + + Definition of the outer shape of the leading edge + control surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + + + + + + + + + Outer shape definition of the spoiler control surface. + + + + + Definition of the outer shape of the control surface. + + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + + + + + + + + + Outer shape definition of the control surface. + + + + + Definition of the outer shape of the trailing Edge + control surface. + The position on the planform of the control surface is + defined by defining the eta/xsi coordinates of the inner/outer + and forward/rear border. The eta/xsi coordinates refer to the + parent. + Please find below an example for the definition of the + planform of a trailing edge device. Other controlsurfaces are + similar. + + + + + + + + + + + + + + + + + + + + + + + + + Definition of the deflection path of the control + surface. + + + + The deflection path of a control surface is described + with respect to two hinge points - one at the inner border of + the control surface and one at the outer border of the control + surface. Those two points are defined using the xsi and relative + height coordinates of the parent. Therefore those points can also + lay outbound of the control surface. Those two points defined + the hinge line, which is a straight line between the two points. + + The deflection path of the control surface is defined + within the hinge line coordinat system. This is defined as + follows: The x-hinge coordinate equals the wing x-axis. The + y-hinge coordinate equals the hinge line axis (see above; + positive from inner to outer hinge point). The z-hinge line is + perpendicular on the x-hinge and y-hinge coordinate according to + the right hand rule. The rotation of the control surface is + defined as rotation around the positive y-hinge line. + + The deflection of the is defined in any number of + steps. The deflection of the control surface is done as follows: + First the x-deflection at the inner and outer border; afterwards + the z-deflection of the inner and outer border; last the + y-deflection of the inner border. The y-deflection is only + defined at the inner border, as it is identical to the outer + border. If no values for the outer border deflection are given, + they default to the values of the inner border. + An example can be found below: + + + + + + + + + + + + + + + + + + + + + + + + + controlSurfacePerformanceMapType + + + ControlSurfacePerformanceMap type, containing a delta + performance map with aerodynamic data for a control surface. Array + order is: relativeDeflection min->max then angleOfAttack then + angleOfSideslip then altitude then machNumber. AngleOfAttack, + angleOfSideslip, altitude and machNumber are taken from the + basic performance map one level above. + + + + + + + + + + Reference to the control surface + + + + + + Relative deflection of the control surface + + + + + + + + + + + + + + + + + + + + controlSurfacePerformanceMaps + + + controlSurfacePerformanceMaps type, containing the + aerodynamic delta performance maps for one or more control + surfaces. + + + + + + + + + + + + + + + + + + + Border type for the inner and outer border of a wing + cut out + + + + Maybe applied to specifiy inner and outer border of + the cutout either via eta or rib references + + + + + + + + + + + + + + + Link to a rib definition + + + + + + Rib number in the corresponding + ribDefinitionUID + + + + + + + Spanwise location of the border at the + leading edge of the cut out + + + + + Spanwise location of the border at the + trailing edge of the cut out + + + + + + + + + + + + + + Cut out of the parents upper/lower skin due to a + control surface. + + + + Optional. Definition of the skin cut out due to a + control surface. The cut out of the skin can either be defined + by referencing to a spar uID or by defining the relative chord + values (xsi) of the cut at the inner and outer border of the + control surface. The xsi value is based on the parents chord. + For leading edge devices additional parameters can be defined. + + An example for wing cut outs can be found in the + picture below: + + + + + + + + + + + + + + + Xsi value of the inner border, where the cut + out begins. + + + + + Xsi value of the outer border, where the cut + out begins. + + + + + + Reference to a spar, defining the skin cut + out. + + + + + + + + + + + + + controlSurfaceStepType + + + + The deflection path of the control surface is defined + within the hinge line coordinat system. This is defined as + follows: The x-hinge coordinate equals the wing x-axis. The + y-hinge coordinate equals the hinge line axis (see above; + positive from inner to outer hinge point). The z-hinge line is + perpendicular on the x-hinge and y-hinge coordinate according to + the right hand rule. The rotation of the control surface is + defined as rotation around the positive y-hinge line. + + The deflection of the is defined in any number of + steps. The deflection of the control surface is done as follows: + First the x-deflection at the inner and outer border; afterwards + the z-deflection of the inner and outer border; last the + y-deflection of the inner border. The y-deflection is only + defined at the inner border, as it is identical to the outer + border. If no values for the outer border deflection are given, + they default to the values of the inner border. + An example can be found below: + + + + + + + + + + + + + + The control parameter links a generic floating point value to + a certain status of a control device (e.g. control surface, landing gear, suction + system, brake parachute, ...). See the documentation of the global CPACS-Element for + further information. + + + + + + Translation of the inner hinge line point + within the hinge line coordinate system. Defaults to zero. Not + allowed for spoilers! + + + + + Translation of the outer hinge line point + within the hinge line coordinate system. Defaults to the values + of the inner hinge line point. Not allowed for spoilers! + + + + + + Positve rotation around the hinge line, + heading from the inner to the outer border. Defaults to zero. + + + + + + + + + + + + + + Definition of the steps of the control surface + deflection path. + + + + List of steps. + + + + + + + + + + + + + + + + + + + + Control surface tracks (mechnaical link between control + surface and parent). + + + + A track generally describes the structural connection between a control surface and a wing (or parent element). For example, a track can be a flap track, a revolute joint connecting an aileron or spoiler, or the kinematics of slats on a wing. + The spanwise position of the track is defined by + etaPosition, which refers to the control surface dimensions. + + The structural properties of the track (e.g. + materials) are defined in trackStructure. + If an actuator is included into the the track, a + reference is given in actuator. + The principal kinematic of the track is defined by + setting the trackType and trackSubType. Please refer to the + tables below for setting the trackType and trackSubType + parameter. Note, those tables are not final - they are extended + continuously. + + + + Trailing edge track types + + + trackType + picture + description + trackSubType + picture + description + + + 1 + + + + + + Revolute joint; no actuators; the revolute joint is on TED hinge line. + 1 + + + + + + Revolute attached at the wings rear spar and the TEDs front spar respectively the load + carrying ribs of the TED. + + + 2 + + + + + + Revolute joint; dropped hinge; linear or rotary actuator (subtype-dependent) included. + The drive strut (if any) is defined as strut1. + 1 + + + + + + Box beam design as wing attachment; rotary drive attached at wing rear spar. + + + + + + 2 + + + + + + Wing attachment at wing rear spar; rotary drive attached at wing rear spar + + + + + + 3 + + Track mounted inside the fuselage at wing root. + + + 3 + + + + + + Upside-down, forward link in conjunction with a straight track on a fixed structure + as aft. support; including rotary drive. + 1 + + + + + + Wing attachment using a box beam design where track is mounted; rotary actuator mounted + at the wing rear spar. + + + + + + 2 + + Track mounted inside the fuselage at wing root. + + + 4 + + + + + + Straight and sloped track on a fixed structure as forward support and an upright link as + aft. support; linear or rotary actuator (subtype-dependent) included. + 1 + + + + + + Wing attachment using a box beam design where the track is mounted; rotary actuator at + the wing rear spar. + + + + + + 2 + + + + + + Wing attachment using a box beam design where track is mounted; rotary actuator mounted + on the track. + + + + + + 3 + + Track mounted inside the fuselage at wing root. + + + + + + + + + + + + + + Relative chordwise position of the track. Eta + refers to the control surface. + + + + + Type of the track. Please refer to the remarks + of the controlSrufaceTrackTypeType for details. + + + + + + + + + + + + + + + + Type of the track. Please refer to the remarks + of the controlSrufaceTrackTypeType for details. + + + + + + + + + + + + + + + + + + + + + + + + + + Control surface tracks (mechnaical link between control + surface and parent). + + + + + + + + + + + + + + + + + + + + + + Cut out of the parents structure due to a control + surface. + + + + Optional. Definition of the parents structure cut out + due to a control surface. The cut out is split into three parts: + cut out of the upper and lower skin and the definition of an + profile conecting the cut out of the upper and lower skin. + + An example for wing cut outs can be found in the + picture below: + + + + In the default configuration the cut out is as wide as + the control surface. If additional spacing is necessary inner + and outer border may be set. + + + + + + + + + + + + + + + + + + + + + + + + + controlSurfacesType + + + Definition of the outer shape, structure and deflection + of all control surfaces (flaps, slats, soiler, ailerons...) of + the wing. + + + + + + + + + + + + + + + + + + + + + costAirConditioningSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costAutomaticFlightSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costAuxilaryPowerUnitsType + + + + + + + + + + + + + + + + + + + + + + + + + costBleedAirSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costCommunicationSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costComponentsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costDeIcingSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costElectricalSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costEnginePylonsType + + + + + + + + + + + + + + + + + + + + + + + + + costEquippedEnginesType + + + + + + + + + + + + + + + + + + + + + + + + + costFireProtectionSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costFixedEmergencyOxygenSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + + costFlightControlSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costFuelSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costFurnishingElementsType + + + + + + + + + + + + + + + + + + + + + + + + + + + costFurnishingsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costFuselagesType + + + + + + + + + + + + + + + + + + + + + + + + + costHydraulicSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costInstrumentSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costLandingGearType + + + + + + + + + + + + + + + + + + + + + + + + + costLightingSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costNacellesType + + + + + + + + + + + + + + + + + + + + + + + + + costNavigationSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costPowerUnitsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + costWaterInstallationSystemsType + + + + + + + + + + + + + + + + + + + + + + + + + costWingsType + + + + + + + + + + + + + + + + + + + + + + + + + + + crashLoadCasesType + + + + + + + + + + + + + + + + + + + + + + crashLoadcaseType + + + CrashLoadcase type, containing a crash loadcase + + + + + + + + + + + + + Optional start of crash section: Default: + first frame of model + + + + + Optional end of crash section: Default: last + frame of model + + + + + Initial velocities + + + + + Initial rotations around axes, roll, pitch, + yaw + + + + + Initial rotational velocities aroud axes + + + + + + Definition of reference point to consider + rotation + + + + + AccelerationFields, usually gravity in z + + + + + + Definition of impact Surface for crash + simulation + + + + + + + + + + + + + + + + + + + + + + + crewCostType + + + + + + + + + + + + + + + + + + + + + + + + crossBeamAssemblyPositionType + + + CrossBeamAssemblyPosition type, containing the position + of a crossBeam assembly + + + + + + + + + + UID of profile based structural element to be + used as crossbeam + + + + + UID of the frame to which the crossbeam is + attached + + + + + Referenze z position of the crossbeam + + + + + + + + + + + + + + + + crossBeamStrutAssemblyPositionType + + + CrossBeamStrutAssemblyPosition type, containing a + crossBeam strut assembly position + + + + + + + + + + UID of profile based structural element to be + used as crossbeam strut + + + + + UID of the frame to which the crossbeam strut + is attached + + + + + UID of the crossbeam to which the crossbeam + strut is attached + + + + + Referenze y position of the strut at the + crossbeam intersection + + + + + angle of the strut in global yz plane + + + + + + + + + + + + + + + + cruiseRollerType + + + + + + + + + + + + + Definition of the position of the mid point of + the roll of the cruise roller. + + + + + Definition of the attachment of the cruise + roller to the parent of the flap. This is the track on which the + roll rolls during retracted flap position + + + + + Definition of the attachment of the cruise + roller to the flap. + + + + + Degree of freedom that is blocked by the + cruise roller if the flap is in retracted position. Positive = + cruise roller blockes bending in the direction of the upper skin + of the parent. Negative = cruise roller blockes bending in the + direction of the lower skin of the parent. + + + + + + + + + + + + + + cruiseRollersType + + + + + + + + + + + + + Definition of one cruise rollers/mid-span + stops. + + + + + + + + + + + + + cst2DType + + + + + + + + + + + A 2D impelmentation for Class shape + transformations. For more details look at AIAA Journal of Aircraft + Vol.45 No.1 2008 + + + + + The psi vector for definition of the class and + shape function, i.e. the points at which the CST functions will + be evaluated + + + + + N1 for the class function for the upper side + of the profile + + + + + N2 for the class function for the upper side + of the profile + + + + + B Coefficients for the Bernstein polynominal + on the upper side + + + + + N1 for the class function for the lower side + of the profile + + + + + N2 for the class function for the lower side + of the profile + + + + + B Coefficients for the Bernstein polynominal + on the lower side + + + + + Optionally, the trailingEdgeThickness of the + profile + + + + + + + + + + + + + + + + + + + + + + + curvePointType + + + Point on a curve in normalized curve coordinates. + The referenceUID must reference a one-dimensional curve such as spars. + + + + + + + + + + Relative position on the referenced line/curve. + + + + + This reference uID determines the reference curve. + If it points to a spar, then the eta value is considered to be a spar coordinate + between start (eta=0) and end (eta=1) of the spar. + + + + + + + + + + + + + cutLoadIntegrationPointsType + + + cutLoadIntegrationPoints are defined in a vector + notation, due to the high amounts of data. Usually they well be + defined inbetween the ribs. Each point must have an id. + Optionally it is possible to rotate the orientation within a + cutloadIntegrationPoint to obtain meaningful results. The + orientation is optional and relative to the CPACS coordinate + system + + + + + + + + + + + + + + + + + + + + + + + + + Additional definition of the leading edge cut out. + + + + + Optional. Definition of additional parameters, + describing the shape of the parents leading edge of the cut out + due to leading edge devices. + The parameters are described in the picture below: + + + + + + + + + + + + + + + Relative height of the most forward position of + the parents leading edge, relative to the airfoil height without + cut out. + + + + + Relative chordwise position of the most + forward position of the parents leading edge, relative to the + parents chord without cut out. + + + + + + + + + + + + + cutOutControlPointsType + + + + + + + + + + + + + + + + + + + + + + + Definition of cut out profiles. + + + + Optional, the exact shape between the upper and lower + skin cut out can be given by using cutOutProfiles. In general + cut out profiles are open profiles and not closed profiles as + e.g. wing airfoils. The placement, scaling and (partly) rotation + of the cut out profiles is fixed as the beginning and ending + point of the profile is fixed as can be seen in the two pictures + below. + + + + + + + + + + + + + + + + + Reference to the profile uID. Profiles should + be linked in profiles/structuralProfiles + + + + + Relative spanwise position of the cut out + profile. The eta coordinate refers to the control surface and + desribes the cut out profile at the leading edge of the control + surface. + + + + + Rotation of the airfoil around the control + surface middle plane normal direciotn. Reference point is the + most forward point of the airfoil. Defaults to 90°, which is + equivalent to the airfoilplacement in flight direction (along + wings-x axis). + + + + + + + + + + + + + Definition of cut out profiles. + + + + + + + + + + + + + + + + + + + + + + + + cutOutType + + + CutOut type, containing cut-outs + + + + + + + + + + Name of the cut out element + + + + + + Description of the cut out element + + + + + + Width of the cut element (absolute value) + + + + + + Height of the cut element (absolute value) + + + + + + Fillet radius of the cut element (absolute + value) + + + + + UID of a structural element that reinforces + the cut out + + + + + + + + + + + + + + Damping derivatives for positive and negative rotation + rates + + + + + 0. General overview + + This type contains the damping derivatives. They are + split up into those derivatives for positive rotation rates, + and those for negative rotation rates. + + + + 1. <positiveRates> (optional) + + Damping derivatives, calculated by positive rotation + rates. + + + + 2. <negativeRates> (optional) + + Damping derivatives, calculated by negative rotation + rates. + + + + + + + + + + + + + + + + + + + + + + + + deckType + + + Deck type, containing the data of a deck + + + + + + + + + + Name of the deck + + + + + Description of the deck + + + + + + The starting point of the deck/cabin. In a + conventional aircraft like the A320, it would be the rear wall + of the cockpit. The coordinate is relative to the parent object + defined by “parentUID”, which should be the fuselage. + + + + + + The starting point of the deck/cabin. In a + conventional aircraft like the A320, it would be the rear wall + of the cockpit. The coordinate is relative to the parent object + defined by “parentUID”, which should be the fuselage. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + decksType + + + Decks type, containing the decks of the fuselage + + + + + + + + + + + + + + + + + + + + deltaTemperatureType + + + + + + + + + + + + + + + + + + + + + + + + + + + + Design masses + + + The design mases are requerments wich can com form the + TLARs + + + + + + + + + + Take off mass + + + + + Zero Fuel mass + + + + + Maximum landing mass + + + + + Maximum ramp mass (the maximum weight + authorised for the ground handling) + + + + + + + + + + + + + Design parameter definition + + + Contains a the values of a parameter and its uid as reference. + + + + + + + + + + + + + + + + + + + + + + Design parameters list + + + Contains a list of all design parameters. + + + + + + + + + + + + + + + + + + + + Design space definition + + + Contains the definition of the design space. + + + + + + + + + + + + + + + + + + + + + + + Design study definitions + + + Contains the data of design studies definitions. + + + + + + + + + + + + + + + + + + + + directOperatingCostType + + + + + + + + + + + + + + + + + + + + + + + + + + + + divergenceCaseType + + + DivergenceCase type, containing a case for aeroelastic + divergence analysis + + + + + + + + + + Mach number of divergence case + + + + + + Divergence stagnation pressure + + + + + + + + + + + + + + divergenceCasesType + + + DivergenceCases type, containing the cases for + aeroelastic divergence analysis + + + + + + + + + + + + + + + + + + + doorAssemblyPositionType + + + DoorAssemblyPosition type, containing the position of a door + assembly + + + + + + + + + + + + optional definition of door type (restricted to pax, + service, emergency, cargo) + + + + + + + + + + + + + + + UID of the door element + description + + + + + UID of the forward door frame + + + + + UID of the backward door frame + + + + + UID of the stringer at the upper door + edge + + + + + UID of the stringer at the lower door + edge + + + + + Lower height of the door with respect to the floor. + (Information necessary for boarding and evacuation analysis not + necessarily linked to structures) + + + + + Minimum widh of the door element. (Information + necessary for boarding and evacuation analysis not necessarily + linked to structures) + + + + + Minimum height of the door element. (Information + necessary for boarding and evacuation analysis not necessarily + linked to structures) + + + + + Door on right side of the fuselage = 1; on the left = + -1. (Information necessary for boarding and evacuation analysis not + necessarily linked to structures) + + + + + + + + + + + + + + doorCutOutType + + + CutOut type, containing cut-outs + + + + + + + + + + Name of door cutout element + + + + + Description of door cutout + element + + + + + Fillet radius of door cutout + element + + + + + Reference UID to the description of a DSS (door + surround structure) + + + + + + + + + + + + + + doorSurroundStructurePositionType + + + DoorSurroundStructurePosition type, containing the position of a + door surround structure + + + + + + + + + + + + number of bays effected by DSS in front of + door + + + + + number of bays effected by DSS in behind of + door + + + + + number of bays effected by DSS + + + + + number of bays effected by DSS + + + + + + + + + + + + + + doorSurroundStructuresAssemblyType + + + doorSurroundStructuresAssembly type, containing + dorrSurroundStructure definitions + + + + + + + + + + + + + + + + + + + doorsType + + + Doors type, containing doors + + + + + + + + + + + + + + + + + + + driveSystemType + + + DriveSystem Type, defining a drive system (combination + of transmissions/gearboxes and shafts and their links to engines + and rotors) of a rotorcraft model. + + + + + + + + + + + + + + + + + + + + + driveSystemsType + + + DriveSystems Type, containing all the drive systems + (combination of transmissions/gearboxes and shafts and their + links to engines and rotors) of a rotorcraft model. + + + + + + + + + + + + + + + + + + + dynamicAircraftModelAnalysisType + + + + + + + + + + + + + + + + + + + + + + dynamicAircraftModelCoordinatesType + + + + + + + + + + + + + + + + + + + + + + + + + Emissivity map, containing the diffuse emissivity of a material at different spectral lengths. + + + The emissivity of a material can vary with the spectral wave length. + The vectors diffuseEmissivity and waveLength must have the same size to be valid. + The data should be linearly interpolated. + + + + + + + + + + + Wave length in [m] + + + + + Diffuse emissivity of the material + + + + + + + + + + + + + engineAnalysisType + + + + + + + + + + + + + Thrust at takeoff + + + + + Fan pressure ratio at takeoff + + + + + + Bypass ratio at takeoff + + + + + overall pressure ratio at takeoff + + + + + + Maximum rotations per second, shaft 1 + + + + + + Maximum rotations per second, shaft 2 + + + + + + Design tip relative mach number (FAN) + + + + + + DryMass of engine + + + + + + + + + + + + + + Definition of global geometry parameters of the engine + fan. + + + + + + + + + + + + + Inner radius of the fan. + + + + + Outer radius of the fan. + + + + + + + + + + + + + Definition of the global engine geometry. + + + + All engine geometry definitions refer to the engine + coordinate system. The engine coordinate system has its orgine + in the middle of the fan plan. The positive x-axis is heading to + the rear, the positive z-axis to the top and the y-axis + according to the right hand rule. + + + + + + + + + + + length of engine + + + + + diameter of engine + + + + + dProp + + + + + Chordlength of a fan blade + + + + + + + + + + + + + + + + + engineGlobalType + + + EngineGlobal type, containing global engine data + + + + + + + + + + + Concept of engine + + + + + + + + + + + + + + + Year of first certification + + + + + + Rotation direction of the engine if looking at + it from the front, i.e. from propeller/fan to exhaust + + + + + + + + + + + + + + Hub to tip ratio + + + + + Number of rotor blades of fan + + + + + + Number of outlet guiding vanes + + + + + + Rotor stator spacing (relative to chordlength) + + + + + + + + + + + + + + Definition of one engine mount. + + + + + + + + + + + + + Name of the engine mount. + + + + + Description of the engine mount. + + + + + + position of the engine mount refering to the + engine coordinate system. + + + + + + UID of the engine mount. + + + + + + + + + + + + List of all engine mounts. + + + + + + + + + + + + + + + + + + + + + + Definition of the engine nacelle type. + + + + The engine nacelle is currently located together with + the engine. It gives a simple description of the outer shell of + the engine. All values are defined according to the base area, + center point of the fan(i.e. negative values can occur in the + definition) In most cases there will be a bypass engine. For + non-bypass or mixed engines ignore the bypass nozzle. For further + information on the geometric setup, please refer to the picture + below. + + + + + + + + + + + + + + + + + + + + + + + + + + + + enginePerformanceMapType + + + EnginePerformanceMap type, containing a perfomance map + with engine data + + + + + + + + + + + + + + Flight Level + + + + + Mach number + + + + + Absolute thrust [N] + + + + + Fuel mass flow + + + + + Speed at core engine nozzle + + + + + + Total temperature at core engine nozzle + + + + + + Mass flow through core engine nozzle + + + + + + Speed at bypass nozzle + + + + + Total temperature at bypass nozzle + + + + + + Mass flow through bypass nozzle + + + + + + Percent of n1Max, shaft 1 + + + + + Percent of n2Max, shaft 2 + + + + + Fan pressure ratio + + + + + Fan efficiency + + + + + Turbine entry total temperature + + + + + + Emission index Carbon Monoxide + + + + + + Emission index Nitrogen Oxide + + + + + + Emission index Sulfur Oxide + + + + + + Emission index Soot + + + + + Emission index unburned hydrocarbon + + + + + + air density at core outlet 8 + + + + + + air density at bypass outlet 18 + + + + + + area at core outlet + + + + + area at bypass outlet + + + + + + + + + + + + + + enginePerformanceMapsType + + + + + + + + + + + + + + + + + + + + + + enginePositionType + + + EnginePosition type, containing data for a single + engine + + + + + + + + + + Name of the engine + + + + + Description of the engine + + + + + Reference to the used engine + + + + + + Component, to which the engine is mounted + + + + + + + + + + + + + + + + + + + + + + + + + + + Engine references + + + EnginePositions type, containing a reference to the + used engines and their positions at the configuration + + + + + + + + + + + + + + + + + + + Definition of one engine pylon. + + + + + + + + + + + + + Name of the engine pylon. + + + + + Description of the engine pylon. + + + + + + UID of the parent (normaly wing or fuselage). + + + + + + + + + + + + UID of the engine pylon. + + + + + + + + + + + + + + + + + + + + + + + Engine pylons + + + + + + + + + + + + + + + + + + + + + + Definition of the engine spinner geometry. + + + + + + + + + + + + + Most forward x-position of the spinner. + + + + + + X-position of the spinner base. + + + + + + Radius of the spinner at the base position. + + + + + + + + + + + + + + engineType + + + Engine type, containing engine data. + + + + + + + + + + Name of engine + + + + + Description of engine + + + + + Scaling of engine take-off thrust + + + + + + + + + + + + + + + + + + + Engines + + + Engines type, containing complete engine configurations + + + + + + + + + + + + + + + + + + + + etaIsoLineType + + + Iso line described by point of the same eta coordinate. + Can be either segment or component segment coordinates. + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta value is considered to be in segment + eta coordinate; if it points to a componentSegment, + then componentSegment eta coordinate is used. + + + + + + + + + + + + + fleetType + + + Each fleet can be divided into sub fleet groups + + + + + + + + + + Name of fleet + + + + + Description of the fleet + + + + + Description of sub-fleets. + + + + + + + + + + + + + + flightAnalysisType + + + + + + + + + + + + + + + + + + + + + + + Flight dynamics + + + + + + + + + + + + + + + + + + + + + + + + Linear model parameters + + + + + + + + + + + + + + + + + + + + + + + + + + Trim result + + + + + + + + + + + Mach number + + + + + + + True airspeed + + + + + + + Angle of attack + + + + + + + Altitude + + + + + + + + + + + + + + Load case + + + This node defines the load case + + + + + + + + + + + Name of the load case + + + + + + + Description of the load case + + + + + + + + + + + + + + + + + Load case specification + + + Input values defining a load case + + + + + + + + + + + Environment + + + + + + + Altitude above sea level + + + + + + + Mach number + + + + + + + UID of the aerodynamic loads (aeroCase) + + + + + + + + Controller description. Note: Since there is no controller description in CPACS yet, the expected content of this string element has to be defined individually for each project. + + + + + + + + + + + UID referencing the mass state of aircraft for this load case + + + + + + + + + + + + + + Flight load cases + + + + + + + + + + + + + + + + + + + + + + Flight loads + + + Loads resulting from the load case analysis + + + + + + + + + + + + + + + + + + + + + Load conditions + + + Inertia load conditions acting on the aircraft + + + + + + + + + + + Description + + + + + + + Safety factor applied on the loads + + + + + + + + Rotational rates around centre of gravity + + + + + + + Enumeration flag stating the typ of the load + case (i.e. limit or ultimate loads) + + + + + + + + + + + + + Angle of sideslip [deg] + + + + + + + Angle of attack [deg] + + + + + + + + + + + + + + + + Flight point definition for load case analysis + + + Description of the aircraft's flight state for + this load case. + + + + + + + + + + + + Environmental conditions + + + + + + + Altitude above sea level + + + + + + + Mach number + + + + + + + + + + + + + + Accelerations + + + Translational or rotational accelerations acting + on the aircraft + + + + + + + + + + + Rotational accelerations acting around aircraft centre of gravity [deg/s^2] + + + + + + + + + + + + + Load factors + + + + + + + + + + + + + + Load factor in x-direction + + + + + + + Load factor in y-direction + + + + + + + Load factor in z-direction + + + + + + + + + + + + + + Load case superposition + + + List of uIDs referencing load cases that are superimposed to the current load case + + + + + + + + + + + + UID reference to another load case to be superimposed + + + + + + + + + + + + + + Gust definition + + + The coordinate system of the gust corresponds to the CPACS coordinate system. + + + + + + + + + + Parameters describing the shape of the gust + + + + + + + + + + + + + + + + + Angle between gust and vehicle [deg] (e.g., 0deg: from right to left; 90 deg: downwards; 180deg: from left to right; 270/-90deg: upwards) + + + + + + + Gust length: length of ramp or gradient distance of 1-cos gust + + + + + + + Gust velocity + + + + + + + + + + + + + + Flight path + + + Definition of a flight path by points of longitude, latitude and a descriptive waypoint code. + + + + + + + + + + Vector of waypoint codes. If waypoint codes are not available put empty items into the waypoint string + + + + + Vector of waypoint latitude values in [deg] + + + + + Vector of waypoint longitude values in [deg] + + + + + Indicates the type of the way point. + + + + + + + + + + + + + + + + + + + + Performance case + + + + + + + + + + + + + + Name + + + + + + + Description + + + + + + + UID of flight performance requirement + + + + + + + + + + + + + + + + + + + + + + + Performance cases + + + List of performance cases + + + + + + + + + + + + + + + + + + + + Results of the landing analysis + + + + + + + + + + + + + Determined landing distance. + + + + + + Determined ground phase distance. + + + + + + + + + + + + + + Results of the take-off analysis + + + + + + + + + + + + + Main element containing the results for + take-off calculations optimized for min-imum liftoff speed + VLOFmin. + + + + + Main element containing the results for + take-off calculations optimized for min-imum safety speed V2min. + + + + + + + + + + + + + + flightPointType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flight systems + + + + + + + + + + + + + + + + + + + + + + flightType + + + Flight type, containing data of a scheduled flight + + + + + + + + + + MissionUID for the flights mission definition + + + + + ModelUID of the aircraft appointed to perform the flight + + + + + Departure day of the flight + + + + + Time of departure - the time is defined as SOBT (Scheduled Off-Block Time) / STD (Scheduled Time of Departure) + + + + + Arrival day of the flight + + + + + Time of arrival - the time is defined as SIBT (Scheduled In-Block Time) / STA (Scheduled Time of Arrival) + + + + + Reference to the operating airline of a flight + + + + + + + + + + + + + + + Flights + + + Flighs type, containing all flight definitions + + + + + + + + + + + + + + + + + + + + floorPanelAssemblyPositionType + + + FloorPanelAssemblyPosition type, containing a floor + panel assembly position + + + + + + + + + + x coordinate of the begin of the floor panel + (absolute value) + + + + + x coordinate of the end of the floor panel + (absolute value) + + + + + UID of the first long. floor beam to be + connected to the floor panel + + + + + UID of the second long. floor beam to be + connected to the floor panel + + + + + UID of structural sheet element used for the + floor panel + + + + + + + + + + + + + + + floorPanelsType + + + FloorPanels type, containing floor panel definitions + + + + + + + + + + + + + + + + + + + + Flying qualities + + + Provides a list of flying qualities cases + + + + + + + + + + + + + + + + + + + + + Flying qualities case + + + + + + + + + + + + + Name + + + + + Description + + + + + Aircraft Class; Class 1 small light aircraft; + Class 2 medium weight aircraft, low to medium maneuverability; + Class 3 large, heavy aircraft, low to medium maneuverability; + Class 4 high maneuverability aircraft + + + + + Flight Phase Category; Category A Non-terminal + flight phases requiring maneuvering, precision tracking, or + precise flight-path control (e.g. air-to-air combat, terrain + following). Category B Non-terminal Flight Phases with gradual + maneuvers and without precision tracking, although accurate + flight-path control may be required (e.g. climb, cruise). + Category C Terminal Flight Phases are normally accomplished + using gradual maneuvers and usually require accurate flight-path + control (takeoff, approach and landing). + + + + + main element containing longitudinal transfer + functions + + + + + main element containing lateral directional + transfer functions + + + + + main element containing characteristic + parameters of the handling qualities criteria + + + + + + main element containing handling qualities + ratings + + + + + + + + + + + + + + fqCharParametersType + + + + + + + + + + + + + static margin [-] + + + + + main element containing characteristic + parameter of phugoid damping + + + + + main element containing characteristic + parameters of short period mode criteria + + + + + main element containing characteristic + parameters of roll oscillation criterion + + + + + coupling of roll and spiral mode: normal = no + coupling of roll and spiral mode coupled = coupling of roll and + spiral mode + + + + + main element containing characteristic + parameters of lateral eigenvalues + + + + + main element containing characteristic + parameters of effective roll time constant criterion + + + + + + main element containing characteristic + parameters of roll performance criterion + + + + + + + + + + + + + fqEiglatType + + + + + + + + + + + + + natural frequency of dutch roll mode [rad/s] + + + + + + damping of dutch roll mode [-] + + + + + + roll time constant [s] + + + + + time to double of spiral mode [s] + + + + + + ratio of bank to sideslip angle [-] + + + + + + natural frequency of coupled rollspiral motion + [rad/s] + + + + + damping ratio of coupled roll-spiral motion + + + + + + product of roll-spiral damping and natural + frequency [rad/s] + + + + + handling qualities level of roll time constant + + + + + + handling qualities level of roll spiral mode + + + + + + + + + + + + + + fqLateralType + + + + + + + + + + + + + numerator of transfer function roll control + surface deflection to bank angle + + + + + numerator of transfer function roll control + surface deflection to yaw rate + + + + + numerator of transfer function roll control + surface deflection to sideslip angle + + + + + numerator of transfer function roll control + surface deflection to bank angle of reduced 4th order system + + + + + + numerator of transfer function roll control + surface deflection to sideslip angle of reduced 4th order system + + + + + + numerator of transfer function yaw control + surface deflection to yaw rate + + + + + numerator of transfer function yaw control + surface deflection to sideslip angle + + + + + numerator of transfer function roll stick + input to roll rate + + + + + numerator of transfer function roll stick + input to yaw rate + + + + + numerator of transfer function roll stick + input to bank angle + + + + + numerator of transfer function roll stick + input to sideslip angle + + + + + numerator of transfer function pedal input to + roll rate + + + + + numerator of transfer function pedal input to + yaw rate + + + + + numerator of transfer function pedal input to + bank angle + + + + + numerator of transfer function pedal input to + sideslip angle + + + + + denominator of lateral motion + + + + + + denominator of lateral motion of reduced 4th + order system + + + + + + + + + + + + + fqLongitudinalType + + + + + + + + + + + + + numerator of transfer function pitch stick + input to pitch rate + + + + + numerator of transfer function pitch control + surface deflection to pitch angle + + + + + numerator of transfer function pitch stick + input to pitch angle + + + + + numerator of transfer function pitch stick + input to angle of attack + + + + + numerator of transfer function pitch stick + input to vertical load factor + + + + + denominator of longitudinal motion + + + + + + + + + + + + + + fqPhugoidType + + + + + + + + + + + + + damping ratio of phugoid mode [-] + + + + + + time to double amplitude of unstable phugoid + mode [s] + + + + + + + + + + + + + fqRatingsType + + + + + + + + + + + + + handling qualities level of phugoid damping + + + + + + handling qualities level of C* criterion + + + + + + main element containing handling qualities + levels of short period mode + + + + + main element containing handling qualities + levels of roll oscillation criterion + + + + + main element containing handling qualities + levels of lateral eigenvalues + + + + + handling qualities level of effective roll + time constant + + + + + handling qualities level of roll performance + + + + + + + + + + + + + + fqRollPerfType + + + + + + + + + + + + + time to reach critical bank angle [s] + + + + + + critical bank angle that has to be reached + [deg] + + + + + + + + + + + + + fqRoloscType + + + + + + + + + + + + + ratio of oscillatory component of the roll + rate to the average roll rate [-] + + + + + phase angle of dutch roll oscillation in + sideslip [deg] + + + + + phase angle between roll rate and sideslip in + dutch roll mode [deg] + + + + + ratio of first minimum roll rate to first + maximum [-] + + + + + handling qualities level of ratio of + oscillatory component of roll rate to average roll rate + + + + + + + + + + + + + + fqShortPeriodType + + + + + + + + + + + + + steady state normal acceleration change with + angle of attack [g/rad] + + + + + short period natural frequency of reduced + order system [rad/s] + + + + + short period damping ratio of reduced order + system [-] + + + + + equivalent pitch time delay of reduced order + system [s] + + + + + handling qualities level of CAP criterion + + + + + + + + + + + + + + fqTreffType + + + + + + + + + + + + + effective roll time constant [s] + + + + + + time where tangent of bank angle step response + is placed [s] + + + + + + + + + + + + + frameType + + + frame type, containing frame definition (V1.5+) + + + + + + + + + + + + + + + + + + + + + framesAssemblyType + + + FramesAssembly type, containing frames assembly + + + + + + + + + + + + + + + + + + + + freePathType + + + + + + + + + + + + + + + + + + + + + + + mass + + + + + + + + + + + + + + + + + + + + + + Fuels + + + fuelType containing data for fuels + Can be used as a catalog for different (liquid) fuel + types + + + + + + + + + + + + + at 15deg C + + + + + + + + + + + + + + + + + + + + Fuels + + + fuelType containing data for fuels + + + + + + + + + + + + + + + + + + + fuselageAeroPerformanceType + + + fuselageAeroPerformance type, containing perfomance + maps with aerodynamic data of a fuselage. + + + + + + + + + + Reference to the uID of the analysed fuselage + + + + + + References used for the calculation of the + force and moment coefficients of the fuselage (in the fuselage + axis system!) + + + + + Calculated aerodynamic performance maps of the + fuselage + + + + + + + + + + + + + fuselageCutOutType + + + fuselageCutOut type, containing a fuselage cutout + definition + + + + + + + + + + Name of the cutout + + + + + Description of the cutout + + + + + X position of the cutout center point + + + + + + Y offset of the cutout reference point + + + + + + Z offset of the cutout reference point + + + + + + Angle in degrees of the vector pointing from + the cutout reference point to the cutout center point, measured + relative to the direction of the fuselage z axis. + + + + + + Coordinates of the unit vector defining the + direction of extrusion + + + + + Coordinates of the unit vector defining the + y-axis of the local cutout coordinate system. Must be normal to + the orientationVector. + + + + + This value is used to define the width of the + cutout + + + + + This value is used to define the height of the + cutout + + + + + This value is used to define the width of the + cutout + + + + + This value is used to define the height of the + cutout + + + + + Fillet radius of the cut element (absolute + value) + + + + + Cutout type. Determines the type of the cutout + and how it is treated by the tools. Possible values: + ("window"|"door"|"ramp") + + + + + + + + + + + + + + + + + + + + + + + + + + fuselageCutOutsType + + + fuselageCutOuts type, containing fuselage cutouts + + + + + + + + + + + + + + + + + + + + fuselageElementType + + + FuselageElement type, containing fuselage element data + + + + + + + + + + + Name of fuselage element + + + + + Description of fuselage element + + + + + + Reference to a fuselage profile + + + + + + + + + + + + + + + + fuselageElementsType + + + FuselageElements type, containing the elements of a + fuselage section + + + + + + + + + + + + + + + + + + + Definition of one fuselage fuel tank. + + + The definition of fuselage tanks is still preliminary. + Currently, there is no link to any structural elements + + + + + + + + + + + Name of the fuselage fuel tank. + + + + + + Description of the fuselage fuel tank. + + + + + + Link to the tank geometry defined by a compartment. + + + + + + + + + + + + + + + + + + + List of fuselage fuel tanks. + + + + + + + + + + + + + The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. +The fuel tank volume type should also be used for the wing fuel tank + + + + + + + + + + + + + fuselageProfilesType + + + FuselageProfiles type, containing fuselage profile + geometries. See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + + + fuselageSectionType + + + FuselageSection type, containing fusleage section and + element data + + + + + + + + + + Name of fuselage section + + + + + Description of fuselage section + + + + + + + + + + + + + + + + + fuselageSectionsType + + + FuselageSections type, containing fuselage sections + + + + + + + + + + + + + + + + + + + + fuselageSegmentType + + + FuselageSegment type, containing data of a fuselage + segment + + + + + + + + + + Name of fuselage segment + + + + + Description of fuselage segment + + + + + + Reference to element from which the segment + shall start + + + + + Reference to element at which the segment + shall end + + + + + Optional and additional guidecurves to shape + the outer geometry. + + + + + + + + + + + + + + fuselageSegmentsType + + + FuselageSegments type, containing fuselage segment + definitions (from sections and elements) + + + + + + + + + + + + + + + + + + + fuselageStructureType + + + FuselageStructure type, containing data of the fuselage's + structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fuselageType + + + + Fuselage type, containing all data related to a + fuselage + + + + + + + + + + + + + + + Name of fuselage + + + + + + + Description of fuselage + + + + + + + UID of part to which the fuselage is + mounted (if any) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fuselagesAeroPerformanceType + + + fuselagesAeroPerformance type, containing + fuselagesAeroPerformance + + + + + + + + + + + + + + + + + + + Fuselages + + + Fuselages type, containing the fuselages of the + configuration + + + + + + + + + + + + + + + + + + + This type contains a vector of deflection values for a + single gear + + + + + 0. General overview + + In this type, a vector of deflections of a single + gear is specified. + + + + 1. + <gearUID> + (mandatory) + + + A reference to a gear from the aircraft model + + + + + 2. + <controlParameters> + (mandatory) + + + A vector of control parameters of the selected + gear + + + + + + + + + + + + + Reference to a gear + + + + + Control parameters of the gear + + + + + + + + + + + + + + This type contains a list of gears and their deflection + vectors + + + + + 0. General overview + + In this type, a list of gears is defined. + + + + + 1. + <gear> + (mandatory) + + + One of these nodes per deflected gear is required + here. + + + + + + + + + + + + + + + + + + + + + + stringerFramePositionType + + + stringerFramePosition type, containing individual + stringer / frame postion definition (CPACS V2.1+) + + + + + + + + + + + + + + + + + + + + + Continuity definition for profile extrusion: + 0= C0 (allows sharp edges, default), 2= C2 (defines curvature + continuity) + + + + + + + + + + + + + Definition of interpolation between different + profiles: 0= no interpolation 1= interpolation of strcutural + profile + + + + + + + + + + + + + + + + + + + + + + generalStructuralMemberType + + + + + + + + + + + + + + + + + + + + + + + + generalStructuralMembersAssemblyType + + + generalStructuralMembersAssembly type, containing + structural member assemblys + + + + + + + + + + + + + + + + + + + genericCostType + + + + + + + + + + + + + + + + + + + + + + + + genericGeometricComponentType + + + + In some cases additional geometric components need to + be linked to a CPACS, but these components are not yet handled by + CPACS explicitly. For example, a belly fairing and/or external + tanks. + A generic geometric component may be applied to include + such a geometry from an external file (preferably STEP) in the + context of the overall aircraft. + + + + + + + + + + + + + + Name of genericGeometricComponent + + + + + + Description of genericGeometricComponent + + + + + + UID of part to which the component is mounted + (if any) + + + + + + + + + + + + + + + + + + + + + + + + + + + Generic geometric components + + + + + + + + + + + + + + + + + + + + + + mass + + + genericMassType, describing mass, inertia and CoG data. + + + + + + + + + + + name + + + + + description + + + + + parentUID + + + + + mass value + + + + + mass loaction values (x,y,z) + + + + + + mass orientation values + + + + + + + + + + + + + + + genericSystemsType + + + Node for geometrical layout of system components + based on simple geometric shapes + + + + + + + + + + + + + + + + + + + Generic system type containing describing the basic dimensions of a system component using simple geometric shapes + + + + The generic base types must be one of the following cone|sphere|cube|cylinder. The origin of the shapes is at the center of volume for cube, sphere and cylinder. Since the cone is constructued from a cylindric shape, its origin is at the same location as the origin of the basic cylinder, although not any longer the center of volume due to scaling of one side. While cube and sphere are symmetrical in all three axis, cylinder and cone are standing upright in the direction of cpacs z-axis. The tip of the cone is located in direction of the positive z-axis. The figure below illustrates the default position and orientation of the different shapes. Note that the cube, cylinder and sphere were moved along the x-axis for demonstration by 2, 4 and 6 meters respectively. + For spheres the default diameter is 1m. Cubes have a length of 1m in all three dimensions. Cylinders have a length of 1m and a diameter of 1m for the circular cross section. The cone is a cylinder with the top face scaled down to zero. + + + + + + + + + + + + + + + Name of the system component. + + + + + Description of the system component. + + + + + Enum for selecting the basic shape of the + component + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + geographicPointConstraintType + + + Geographic point constraint, containing a longitude, latitude, altitude data triplet. + + + + + + + + + + Longitude coordinate 0-360 + + + + + Latitude coordinate 0-360 + + + + + Altitude in meters + + + + + + + + + + + + + geographicPointType + + + Geographic point type, containing a longitude, latitude, altitude data triplet. + + + + + + + + + + Longitude coordinate 0-360 + + + + + Latitude coordinate 0-360 + + + + + Altitude in meters + + + + + + + + + + + + + + airfoilAeroPerformanceType + + + airfoilAeroPerformance type, containing perfomance maps + with aerodynamic data of an airfoil. + + + + + + + + + + References used for the calculation of the + force and moment coefficients + + + + + Calculated aerodynamic performance maps of the + full configuration + + + + + + + + + + + + + globalBeamPropertiesType + + + globalBeamPropertiesType, containing the global beam + properties such as EA, EI, mass + + + + + + + + + + + + + + + + + + + + + + + + + + + Ground load Cases + + + + + + + + + + + + + + + + + + + + + + guideCurveProfileGeometryType + + + + A guide curve profile is defined by a profile name, an + optional description and a 3-dimensional relative pointlist with + all three coordinates mandatory. For typical profiles, one of + the coordinate vectors contains only "0" entries. All point + coordinates are transferred to the global coordinate system. + First and last point may, but need not to, be identical. + + The points have to be ordered in a mathematical + positive sense. + A profile can be symmetric. In that case the profile + is interpreted as being not closed and will be closed by + mirroring it on the symmetry plane. + Curves have to go continuously over the whole wing or + fuselage + Connection of guide curves from segment to segment + + + + + + + + Please note, currently it is not possible to apply any + means of class based transformation in the description. However, + this may be an addition for the future. + + + + + + + + + + + Name of profile + + + + + Description of profile + + + + + + + + + + + + + + + + + + + + + + + + + + guideCurveProfilesType + + + Guide Curve Profiles type. This type is used to + describe guide curves that enable designers to create a geometry + that deviates from a standard loft. + + + + + + + + + + + + + + + + + + + + Guide Curve Type + + + + A guide curve may be used to alter the shape of the + outer geometry and "guide" the loft. + The guide curve profiles are defined in the guideCurveProfileGeometryType. + Their use on wing and fuselage components is illustrated in the image below. + + + + + + + + + + + + + + + Name of guide curve + + + + + Description of guide curve + + + + + Reference to a guide curve profile + + + + + + For the first segment fromGuideCurveUID is not + a valid entry! For the first guideCurve + fromRelativeCircumference must be applied! fromGuideCurveUID is + exclusive. + + + + + + Reference to the previous guide curve from + which this guide curve shall start. + + + + + + Continuity definition for geometry + generation. Possible options: C0, C1 from previous, C2 from + previous, C1 to previous, C2 to previous + + + + + + + + + + + + + + + + + + + Reference to the relative circumference + position from which the guide curve shall start. Valid values + are in the interval -1.0...1.0. + + + + + + Tangent at first point + + + + + + + + The relative circumference + position at which the guide curve shall end. Valid values + are in the interval -1.0...1.0. + + + + + + Tangent at last point + + + + + + Local direction along which the relative x-coordinates of + the guide curve points are defined. For the wing the default is + the wing's local x-axis, for the fuselage its the fuselage's local z-axis. + + + + + + + + + + + + + + + Guide Curves Type + + + Guide Curve type. This type is used to describe guide + curves that enable designers to create a geometry that deviates + from a standard loft. + + + + + + + + + + + + + + + + + + + hingeMomentsMapType + + + hingeMomentsMap type, containing a hinge moments map + with aerodynamic data. Array order is: angleOfAttack min->max + then angleOfSideslip then reynoldsNumber then machNumber. + All coefficients in the aeroperformanceMap relate to + the CPACS coordinate system. See documentation of the + CPACS-Element for further information. + + + + + + + + + + Name of the AeroPerformanceMap. + + + + + + Description of the AeroPerformanceMap. + + + + + + Mach number + + + + + Reynolds Number + + + + + Sideslip angle + + + + + Angle of attack + + + + + + + + + + + + + + htpFwdInterfaceDefType + + + Definition of the interface of forward HTP attachment + + + + + + + + + + Definition of the forward HTP attachment + interface + + + + relative width of reinforcement at fwd HTP + attachment, between 0.0 and 1.0 + + + + + relative width of plate at fwd HTP attachment + (only applicable for Type1 model), between 0.0 and 1.0, smaller + than htpPlateWidth + + + + + UID of panel element at HTP forward attachment + in x-direction (shell elements) + + + + + UID of panel element at HTP forward attachment + in z-direction (shell elements) + + + + + UID of reinforcements for panel element at HTP + forward attachment in z-direction (beam elements) + + + + + + UID of the element to fix HTP to fuselage + (beam elements) + + + + + + + + + + + + + + htpInterfaceDefType + + + Definition of the interface of HTP + + + + + + + + + Definition of the HTP interface + + + + + UID of the fuselage frame at the forward HTP + attchment + + + + + + UID of the fuselage frame at the backward HTP + attchment + + + + + + maximum HTP deflection (nose up in + degrees) + + + + + + maximum HTP deflection (nose down in + degrees) + + + + + + angle of the reinforcements at backward HTP + attchment + (in degrees) + + + + + + Defines area (absolute) in x-direction around + htpFrame2UID where the HTP attachmentpoint has correct position + ==> check and potentially warning message + + + + + Defines area (absolute) in y-direction around + the + outer edge of htpFrame2UID where the HTP attachmentpoint has correct + y-position ==> check and potentially warning + message + + + + + + Defines allowed z-position for rear HTP + attachment + relativ to total frame height ==> check and potentially warning + message ==> check and potentially warning + message + + + + + + Definition of HTP structural + elements + + + + + + Definition of HTP forward attachment to + structure + + + + + + + + + + + + + + + htpStructElemDefType + + + definition of structural elements in HTP attachment + + + + + + + + + + Definition of tailplane attachment area + (Standard Configuration) + + + + UID of structural element for HTP front + crossbeams + + + + + UID of structural element for HTP rear + crossbeams + + + + + UID of structural element for HTP diagonal + beams + + + + + UID of structural element for HTP side beams + + + + + + UID of structural element for upper HTP cutout + reinforcement beams, also used for lower cutout reinforcement, + when not explicitely defined + + + + + UID of structural element for lower HTP cutout + reinforcement beams (optional) + + + + + + + + + + + + + + indirectOperatingCostType + + + + + + + + + + + + + + + + + + + + + + interConnectionStrutAttachmentType + + + + + + + + + + + + + Definition of the position of the attachment + joint in relative coordinates. + + + + + Material settings of the attachment. + + + + + + + + + + + + + + interconnectionStrutType + + + + + + + + + + + + + uID of control surface where this flap is + attached to by the interconnection strut. + + + + + Material settings of the strut (if strut is + moddeled as a simple strut). + + + + + Definition of the attachment on this control + surface. + + + + + Definition of the attachment on the other + control surface + + + + + Free path in positive (tensil) and negative + (compression) direction before interconnection strut blocks. + + + + + + + + + + + + + + + interconnectionStrutsType + + + + + + + + + + + + + Definition of one interconnection strut. + + + + + + + + + + + + + + intercostalPositionType + + + intercostalPosition type, containing the position of intercostals + in DSS + + + + + + + + + + + + UID of the frame at which intercostal + starts + + + + + UID of the forward door frame + + + + + UID of the door + + + + + non-dimensional value ranging between 0 and 1 + + + + + + UID of profileBasedStructuralElement used for + intercostal + + + + + + + + + + + + + + IntercostalsAssemblyType + + + IntercostalsAssembly type, containing intercostal + definitions + + + + + + + + + + + + + + + + + + + structuralElementsConnectionsType + + + StructuralElementsConnections type, containing + connections between structural elements + + + + + + + + + + Flag for automatic generation of interface + definitions (draft version) + + + + + + + + + + + + + + + landingGearInterfaceDefinitionsType + + + CenterFuselage landing gear interface definitions + + + + + + + + + + + + + + + + + + + + + + + + + + keelbeamType + + + HighWingCenterFuselage / Keelbeam definition between + mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lateralPanelsType + + + HighWingCenterFuselage / lateral Panel definition + between mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + + + + + longFloorBeamConnectionType + + + HighWingCenterFuselage / Long. floor beam connection + + + + + + + + + + + + + + + + + + + + + centerFuselageMainFramesType + + + High wing main frame definition, containing mainframe + UIDs + + + + + + + + + + + + + + + + + + + + + + + pressureFloorType + + + High Wing Center Fuselage / pressure floor definition + between mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + + sideboxType + + + HighWingCenterFuselage / side box definition between + mainframe1 und mainframe2 + + + + + + + + + + + + + + + + + + + + + + Landing gear position safety margins + + + LandingGearPositionSafetyMargins type, containing the + safety margins of the gear due to its position + + + + + + + + + + Safety margin for landing gear x position + regarding tail clearance at takeoff pitch angle + + + + + + Safety margin for landing gear x position to + avoid tail dropping down during touchDown and ground maneuvering + + + + + + Safety margin for landing gear y position to + avoid wing tip dropping down during ground maneuvering + + + + + + Safety margin for landing gear y position + regarding wingtip or engine nacelle clearance at a certein roll + angle + + + + + + + + + + + + + Landing gears + + + Contains a list of landing gears. + + + + + + + + + + + + + + + + + + + Landing gears + + + LandingGear type, containing the definition of nose, + main and skid gears. + + + + + + + + + + + + + + + + + + + + + Trailing edge device of the wing. + + + A leadingEdgeDevice (LED) is defined via its outerShape + relative to the componentSegment. The WingCutOut defines the area + of the skin that is removed by the LED. Structure is similar to + the wing structure. The mechanical links between the LED and the + parrent are defined in tracks. The deflection path is described + in path. Additional actuators, that are not included into a + track, can be defined in actuators. + Leading and trailing edge are defined by the outer + shape of the wing segments, i.e. the trailing edge of a + trailingEdgeDevice is the trailing edge of the wing. This is also + valid for kinks that are present in the wing but not explicitly + modeled in the control surface. + The edges of the control surface within the wing are a + straight line in absolute coordinates! Hence, there needs to be a + straight connection between the eta-wise outer and inner points + of the edge that is within the wing in absolute coordinates. + + + + + + + + + + + Name of the leading edge device. + + + + + + Description of the leading edge device. + + + + + + UID of the parent of the LED. The parent is + the componentSegment, where it is attached to. + + + + + + + + + + + + + + + + + + + + + Definition of the wings leading edge devices. + + + + Definition of the wings leading edge devices. + + + + + + + + + + + + + + + + + + + + Optional definition of the airfoil inner shape of + leading edge devices (LED). + + + + All parameters are optional. For the definition of the + parameters, please refer to the picture below. Parameters from + the outer border default to the parameters of the inner border. + + + + + + + + + + + + + + + Relative height of the most forward point of + the LED's rear part, based on the airfoil height of the parent + at this position. Optional. + + + + + Relative chordwise position of the most + forward point of the LED's rear part, based on the chord of the + parent at this position. Optional. + + + + + + + + + + + + + Optional definition of the leading edge shape of + trailing edge devices (TED). + + + + All parameters are optional. For the definition of the + parameters, please refer to the picture below. Parameters from + the outer border default to the parameters of the inner border. + + + + + + + + + + + + + + + Relative height of the leading edge of the TED, + based on the airfoil height of the parent at this position. + Optional. + + + + + Relative chordwise upper skin position, of the + border, where the airfoil of the TED is equivalent of the + airfoil from the parent. Measured from the rear to the front (0 + = TED trailing edge; 1 = TED leading edge). Values form the + outer border default to the value of the inner border. Optional. + + + + + + Relative chordwise lower skin position, of the + border, where the airfoil of the TED is equivalent of the + airfoil from the parent. Measured from the rear to the front (0 + = TED trailing edge; 1 = TED leading edge). Values form the + outer border default to the value of the inner border. Optional. + + + + + + + + + + + + + + linerType + + + Liner type, containing liner data + + + + + + + + + + Type of liner + + + + + + + + + + + + + % of fan diameter + + + + + % of fan diameter + + + + + + + + + + + + + linkToFile + + + Please provide a link to the additional file that shall + be loaded by the TIGL library. Furthermore it is necessary to + provide the format attribute so that the file type can be + identified. Several CAD formats provide multiple endings, and + hence, this measure seems necessary. + + + + + + + + + + + + + + + + + + + + + + + + + Load analysis + + + + + + + + + + + + + + + + + + + + + + + loadBreakdownType + + + + + + + + + + + + + + + + + + + + + + + + + + Load cases + + + + + + + + + + + + + + + + + + + + + + + + + loadReferenceAxisPointType + + + + + + + + + + + + + + + + + + + Relative spanwise position. Eta refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative chordwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + Relative height position. + relHeight is relative to the local airfoil thickness. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta-xsi values are considered to be in segment + eta-xsi coordinates; if it points to a componentSegment, + then componentSegment eta-xsi coordinates are used. + + + + + + + + + + + + + + loadReferenceAxisPointsType + + + + + + + + + + + + + + + + + + + + + + Load envelopes + + + The loads envelope is the results of the loadsAnalysis + and lists those loadcases that are limiting for the design + + + + + + + + + + + + + + + + + + + + + logFloorBeamPositionType + + + longFloorBeamPosition type, containing individual + position definition + + + + + + + + + + UID of structural element + + + + + UID of crossbeam to which the long. beam is + attached + + + + + y position of long. beam + + + + + + Continuity definition for profile extrusion: + 0= C0 (allows sharp edges, default), 2= C2 (defines curvature + continuity) + + + + + + + + + + + + + Definition of interpolation between different + profiles: 0= no interpolation 1= interpolation of strcutural + profile + + + + + + + + + + + + + + + + + + + + + + longFloorBeamType + + + longFloorBeam type, containing a long. floor beam + definition + + + + + + + + + + + + + + + + + + + + longFloorBeamsAssemblyType + + + longFloorBeamsAssembly type, containing long. floor + beam assemblys + + + + + + + + + + + + + + + + + + + mAirConditioningType + + + + + + + + + + + + + Air conditioning mass description + + + + + + + + + + + + + + mAutomaticFlightSystemType + + + + + + + + + + + + + Automatic flight system mass description + + + + + + + + + + + + + + mAuxillaryPowerUnitType + + + + + + + + + + + + + Auxillary power unit masse description + + + + + + + + + + + + + + mBellyFairingsType + + + + + + + + + + + + + + + + + + + + + + + mBleedAirSystemType + + + + + + + + + + + + + Bleed air system mass description + + + + + + + + + + + + + + mBulkCargoType + + + + + + + + + + + + + + + + + + + + + + mBulkCargosType + + + + + + + + + + + + + + + + + + + + + + + mBulkheadsType + + + + + + + + + + + + + + + + + + + + + + + mCabinFloorsType + + + + + + + + + + + + + + + + + + + + + + + mCabinLightingsType + + + + + + + + + + + + + + + + + + + + + + + mCargoFloorsType + + + + + + + + + + + + + + + + + + + + + + + mCargoLiningsType + + + + + + + + + + + + + + + + + + + + + + + mCargoLoadingsType + + + + + + + + + + + + + + + + + + + + + + + Cargo masses + + + + + + + + + + + + + Cargo masses description + + + + + Cargo mass description + + + + + + + + + + + + + + + + mCarriagesType + + + + + + + + + + + + + + + + + + + + + + + mCarryOnType + + + + + + + + + + + + + + + + + + + + + + mCarryOnsType + + + + + + + + + + + + + + + + + + + + + + + mCateringsType + + + + + + + + + + + + + + + + + + + + + + + mCellsType + + + + + + + + + + + + + + + + + + + + + + + mCockpitLightingsType + + + + + + + + + + + + + + + + + + + + + + + mCommunicationType + + + + + + + + + + + + + Communication mass description + + + + + + + + + + + + + + mComponentSegmentType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mComponentSegmentsType + + + + + + + + + + + + + + + + + + + + + + + mControlSurfaceSupportType + + + + + + + + + + + + + + + + + + + + + + + + + mControlSurfaceSupportsType + + + + + + + + + + + + + + + + + + + + + + + mCrewMembersType + + + + + + + + + + + + + + + + + + + + + + + mCrewSeatsType + + + + + + + + + + + + + + + + + + + + + + + mDeIcingType + + + + + + + + + + + + + De-icing mass description + + + + + + + + + + + + + mDocumentsToolsType + + + + + + + + + + + + + + + + + + + + + + + mDoorsType + + + + + + + + + + + + + + + + + + + + + + + mElectricalDistributionType + + + + + + + + + + + + + Electrical distribution mass description + + + + + + + + + + + + + + mElectricalGenerationType + + + + + + + + + + + + + Electrical generation mass description + + + + + + + + + + + + + + mEmergencyEquipmentsType + + + + + + + + + + + + + + + + + + + + + + + mEmergencyOxygenSystemsType + + + + + + + + + + + + + + + + + + + + + + + mEmptyULDType + + + + + + + + + + + + + + + + + + + + + + mEmptyULDsType + + + + + + + + + + + + + + + + + + + + + + + mEngineControlType + + + + + + + + + + + + + Engine control mass description + + + + + + + + + + + + + + mEquippedEnginesType + + + + + + + + + + + + + + Equipped engines mass description + + + + + + + + + + + + + + + mExtLightingsType + + + + + + + + + + + + + + + + + + + + + + + mFireProtectionType + + + + + + + + + + + + + Fire protection mass description + + + + + + + + + + + + + + mFixedGalleysType + + + + + + + + + + + + + + + + + + + + + + + mFixedLeadingEdgeType + + + + + + + + + + + + + + + + + + + + + + mFixedLeadingEdgesType + + + + + + + + + + + + + + + + + + + + + + + + mFixedTrailingEdgeType + + + + + + + + + + + + + + + + + + + + + + + + mFixedTrailingEdgesType + + + + + + + + + + + + + + + + + + + + + + + mFlightControlsType + + + + + + + + + + + + + Flight controls mass description + + + + + + + + + + + + + + mFloorCoveringsType + + + + + + + + + + + + + + + + + + + + + + + mFramesType + + + + + + + + + + + + + + + + + + + + + + + + + mFreshWaterSystemsType + + + + + + + + + + + + + + + + + + + + + + + mFuelSystemType + + + + + + + + + + + + + Fuel system mass description + + + + + + + + + + + + + + Fuel mass + + + + + + + + + + + + + Fuel mass description + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Furnishing mass description + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mFuselageStructureType + + + + + + + + + + + + + Fuselage structure mass description + + + + + + + + + + + + + + + + + + + + + + + + + + mWallsType + + + + + + + + + + + + + + + + + + + + + + + mFuselagesStructureType + + + + + + + + + + + + + Fuselages structure mass description + + + + + + + + + + + + + + + mHydraulicDistributionType + + + + + + + + + + + + + Hydraulic distribution mass description + + + + + + + + + + + + + + mHydraulicGenerationType + + + + + + + + + + + + + Hydraulic generation mass description + + + + + + + + + + + + + + mIFESystemsType + + + + + + + + + + + + + + + + + + + + + + + mInstrumentPanelType + + + + + + + + + + + + + Instrument panel mass description + + + + + + + + + + + + + + mInsulationsType + + + + + + + + + + + + + + + + + + + + + + + mIntegratedModularAvionicsType + + + + + + + + + + + + + Integrated modular avionics mass description + + + + + + + + + + + + + + mInterGasSystemType + + + + + + + + + + + + + Inter gas system mass description + + + + + + + + + + + + + + mLandingGearSupportsType + + + + + + + + + + + + + + + + + + + + + + + mLandingGearsType + + + + + + + + + + + + + + Landing Gears mass description + + + + + + + + + + + + + + + + mLavatoriesType + + + + + + + + + + + + + + + + + + + + + + + mLiningsType + + + + + + + + + + + + + + + + + + + + + + + mMainGearsType + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Manufacturer empty mass description + + + + + + + + + + + + + + + + + + mMillitarySystemsType + + + + + + + + + + + + + Millitary systems mass description + + + + + + + + + + + + + + mMiscellaneousType + + + Miscellaneous masses must only specify componenent masses for which NO DEDICATED ELEMENT EXISTS in the mass breakdown list! + + + + + + + + + + + + + + + + + + + mMoveableLeadingEdgeType + + + + + + + + + + + + + + + + + + + + + + + + mMoveableLeadingEdgesType + + + + + + + + + + + + + + + + + + + + + + + mMoveableTrailingEdgeType + + + + + + + + + + + + + + + + + + + + + + + + mMoveablesType + + + + + + + + + + + + + + + + + + + + + + + + mNavigationType + + + + + + + + + + + + + Navigation mass description + + + + + + + + + + + + + + mNoseGearsType + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Operator items mass description + + + + + + + + + + + + + + + + + + + + + mOverheadBinsType + + + + + + + + + + + + + + + + + + + + + + + mPartStowDoorsType + + + + + + + + + + + + + + + + + + + + + + + mPassengerType + + + + + + + + + + + + + + + + + + + + + + mPassengersType + + + + + + + + + + + + + + + + + + + + + + + Passengers masses + + + + + + + + + + + + + Passanger masses Description + + + + + + Passanger mass Description + + + + + + + + + + + + + + Payload mass + + + + + + + + + + + + + Payload mass description + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Power units mass description + + + + + + + + + + + + + + + + + + + + mPylonAttachmentsType + + + + + + + + + + + + + + + + + + + + + + + mPylonsType + + + + + + + + + + + + + + Pylons mass description + + + + + + + + + + + + + + + mRibType + + + + + + + + + + + + + + + + + + + + + + mRibsType + + + + + + + + + + + + + + + + + + + + + + + mSeatsType + + + + + + + + + + + + + + + + + + + + + + + mShellType + + + + + + + + + + + + + + + + + + + + + + + + + mShellsType + + + + + + + + + + + + + + + + + + + + + + + + mSkinPanelsType + + + + + + + + + + + + + + + + + + + + + + + mSkinsType + + + + + + + + + + + + + + + + + + + + + + + mSparsType + + + + + + + + + + + + + + + + + + + + + + + mSpecialStructuresType + + + + + + + + + + + + + + + + + + + + + + + mSpoilersType + + + + + + + + + + + + + + + + + + + + + + + mStringersType + + + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Structure mass description + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Systems mass description + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mTrailingEdgeDeviceType + + + + + + + + + + + + + + + + + + + + + + + + mTrailingEdgeDevicesType + + + + + + + + + + + + + + + + + + + + + + + mULDContentType + + + + + + + + + + + + + + + + + + + + + + mULDContentsType + + + + + + + + + + + + + + + + + + + + + + + mVacuumWasteSystemsType + + + + + + + + + + + + + + + + + + + + + + + mWasteWaterSystemsType + + + + + + + + + + + + + + + + + + + + + + + mWindowsType + + + + + + + + + + + + + + + + + + + + + + + mWingBoxType + + + + + + + + + + + + + + + + + + + + + + + + + mWingStructureType + + + + + + + + + + + + + Wing structure mass description + + + + + + + + + + + + + + + mWingsStructureType + + + + + + + + + + + + + Wings structure mass description + + + + + + + + + + + + + + + Main actuator + + + + Definition of the landing gear main actuator. + + + + + + + + + + + Reference to the main actuator uID of the + landing gear + + + + + + + + + + + + + + Main landing gear + + + List of main gears + + + + + + + + + + + + + + + + + + + mainStrutInterfaceDefinitionsType + + + HighWingCenterFuselage main strut interface definitions + + + + + + + + + + + + + + + + + + + + + + mainStrutFuselageAttachmentType + + + HighWingCenterFuselage / main strut attachment to + fuselage frame and stringer + + + + + + + + + + + + + reference to the structural element that comprises this connection. + + + + + + + + + + + + + + maintenanceCostType + + + + + + + + + + + + + + + + + + + + + + + + Mass breakdown + + + + + 1. General + + + The + massBreakeDown + is subdivided in + designMasses + , + fuel + , + payload + and + mOME + (operating empty mass). + + + designMass + + The design masses contain the overall values for + mTOM and so forth. These should be listed as specified by the + TLAR or found from initial sizing. + + fuel + and + payload + + The fuel and payload nodes should contain maximum + values, i.e. full fuel tanks, all passengers on board and full + cargo holding. These values may exceed the maximum allowable + take-off mass as the actual loading of the aircraft should be + specified in the weight and balance section of the aircraft. + + + mOEM + + + The operation empty mass structure is based on the Airbus Mass + Standard brake down [AIRBUS MASS STANDARD 2008]. The + operator’s mass empty (OME) is defined by the sum of the + following component masses: + + operator’s items + manufacturer’s mass empty (MME) + + + + + + + 2. massDescription + + + Each sub component has the following + massDescription + which include a: + + Name + Description + parentUID + Mass value + Mass location + Mass orientation + Mass Inertia. + + + + The + massdescription + can be found at the + designMasses + direct under each item. At the + fuel + , + payload + and + mOME + under massDescription in each item and sub item. + + Concerning symmetry please note that any item + referenced by its UID, e.g. wingUID, accounts for the complete + component, e.g. right and left side. Hence for these items + their complete mass needs to be specified. If the mass of + geometricallly symmetrical components is different, please use + the symmetry modifyers for UIDs: _symm and _mirror. See also + the overall CPACS definition section on symmetry + + + + + + + + + + + + + + + + + + + + + + + + + Fuel Mass Fraction + + + Describing the mass fraction considered for a mission segment sequence + + + + + + + + + + Reference to the segment from which the fuel fraction should be considered + + + + + Reference to the segment to which the fuel fraction should be considered + + + + + Float value of the mass fraction defined as + fraction = m_end / m_start + + + + + + + + + + + + + massInertiaType + + + massInertiaType + + + + + + + + + + + + + + + + + + + + + + + + massInertiaVectorType + + + + + + + + + + + + + + + + + + + + + + + + + + + materialDefinitionForProfileBasedPointType + + + MaterialDefinitionForProfileBased type, containing a + material definition (Reference to material and thickness) for + profile based objects, addition point reinforcements + + + + + + + + + + uID of the profile point to which the + additional stiffness shall be applied. + + + + + uID of a material definition. + + + + + + cross sectional area of additional long. + stiffener at strctural element point + + + + + optional auxiliary parameter for special use + (no physical meaning) + + + + + optional auxiliary parameter for special use + (no physical meaning) + + + + + + + + + + + + + Definition of the properties of the structural + profile sheet + + + MaterialDefinitionForProfileBased type, containing a + material definition (Reference to material and thickness) for + profile based objects. + + + + + + + + + + + UID of the sheet to which the material + properties shall be applied + + + + + + Predefined ID of the sheet of a standard profile + + + + + + + + + + + + + + + + + + Length of the sheet of a standard profile [m] + + + + + + + + + uID of a composite definition. + + + + + + Orthoropy direction of the composite. + + + + + + Scaling factor of the composite thickness. + + + + + + + + uID of a material definition. + + + + + + Absolute thickness of the material [m] + + + + + + + + + + + + + + + + Material Definition + + + MaterialDefinition type, containing a material + definition (Reference to material and thickness) + + + + + + + + + choice between composite / isotropic material + definition + + + + + uID of a composite definition. + + + + + + Orthotropy direction of the composite. + + + + + + Scaling factor of the composite thickness. + Absolute thicknesses are defined in each composite material + seperatly + + + + + + + uID of a material definition. + + + + + + Absolute thickness of the material. + + + + + + + + + + + + + + + Material + + + + Definition of the material properties for one of the following + material types: + + isotropic materials + anisotropic 2D and 3D materials + orthotropic 2D and 3D materials + + The nonemclature is adopted from [1] to define the material properties in an orthotogonal 1-2-3 + coordinate system. This may be illustrated by the stresses of a three-dimensional cube: + + + + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + + + + + + + + + + + + Name of the material + + + + + Description of the material + + + + + Material density [kg/m^3] + + + + + + + + + + + + + + + + + Reference temperature for thermal expansion + coefficient [K] + + + + + + + + + + + + + + + + + Isotropic material properties + + + + Defines the material properties for an isotropic material. Note that the shear modulus G + is defined in terms of the elastic modulus E and the Poisson's ratio nu as: + + + + Specifying a value for all three properties E, G and nu therefore results in an overdetermined material definition and must be avoided. + + + + + + + + + + + + Young's modulus [N/m^2] + + + + + + + Shear modulus [N/m^2] + + + + + + + Poisson's ratio + + + + + + + Thermal expansion coefficient [1/K] + + + + + + + Thermal conductivity of the material in + [W/(m*K)] + + + + + + + Allowable stress for tension [N/m^2] + + + + + + + Allowable stress for compression [N/m^2] + + + + + + + Allowable stress for shear [N/m^2] + + + + + + + Allowable strain for tension + + + + + + + Allowable strain for compression + + + + + + + Allowable strain for shear + + + + + + + Yield strength, tension [N/m^2] + + + + + + + Yield strength, compression [N/m^2] + + + + + + + Plastification curves for isotropic + materials incl. element elimination + + + + + + + Optional knockdown factor for fatiuqe + (defaults to 1) + + + + + + + Fatigue behaviour of the material + + + + + + + Damage tolerance behaviour of the + material + + + + + + + + + + + + + + + Anisotropic material properties for 2D materials + + + + + Defines the material properties for a linear anisotropic material in the plane stress state (i.e., shell). The stress-strain relationship is defined as: + + + + The terminology of this complex type refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. + + + + + + + + + + + + Coefficient 11 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 12 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 13 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 22 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 23 of reduced stiffness matrix [N/m^2] + + + + + Coefficient 33 of reduced stiffness matrix [N/m^2] + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal expansion coefficient in material direction + 12 [1/K] + + + + + Thermal conductivity of the material in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 2 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 3 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 [N/m^2] + + + + + + Allowable stress for compression in material direction 1 [N/m^2] + + + + + + Allowable stress for tension in material direction 2 [N/m^2] + + + + + + Allowable stress for compression in material direction 2 [N/m^2] + + + + + + Allowable stress for shear [N/m^2] + + + + + + Allowable strain for tension in material direction 1 + + + + + Allowable strain for compression in material direction 1 + + + + + + Allowable strain for tension in material direction 2 + + + + + Allowable strain for compression in material direction 2 + + + + + + Allowable strain for shear + + + + + + + + + + + + + + Orthotropic material properties for 2D materials + + + + + Defines the material properties for an orthotropic material in the plane stress state (i.e., shell). The strain-stress relationship is defined as: + + + + Inverting the strain-stress relation and introducing thermal expansion yields: + + + + with: + + + + The terminology refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + + + + + + + + + + + + Young's modulus in material direction 1 [N/m^2] + + + + + Young's modulus in material direction 2 [N/m^2] + + + + + Shear modulus in material in 2-3 plane [N/m^2] + + + + + Shear modulus in material in 3-1 plane [N/m^2] + + + + + Shear modulus in material in 1-2 plane [N/m^2] + + + + + Poisson's ratio + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal conductivity of the material in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 2 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 + [N/m^2] + + + + + Allowable stress for compression in material + direction 1 [N/m^2] + + + + + Allowable stress for tension in material direction 2 + [N/m^2] + + + + + Allowable stress for compression in material + direction 2 [N/m^2] + + + + + Allowable stress for shear [N/m^2] + + + + + + Allowable strain for tension in material direction 1 + + + + + + Allowable strain for compression in material + direction 1 + + + + + Allowable strain for tension in material direction 2 + + + + + + Allowable strain for compression in material + direction 2 + + + + + Allowable strain for shear + + + + + + + + + + + + + + Anisotropic material properties for 3D materials + + + + + Defines the material properties for a linear anisotropic material in three spatial directions (i.e., solid). The stress-strain relationship is defined as: + + + + The terminology of this complex type refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + [2] J. N. Reddy, Mechanics of Laminated Composite Plates and Shells: Theory and Analysis, Second Edition. CRC Press, 2004. + + + + + + + + + + + + Coefficient 11 of stiffness matrix [N/m^2] + + + + + Coefficient 12 of stiffness matrix [N/m^2] + + + + + Coefficient 13 of stiffness matrix [N/m^2] + + + + + Coefficient 14 of stiffness matrix [N/m^2] + + + + + Coefficient 15 of stiffness matrix [N/m^2] + + + + + Coefficient 16 of stiffness matrix [N/m^2] + + + + + Coefficient 22 of stiffness matrix [N/m^2] + + + + + Coefficient 23 of stiffness matrix [N/m^2] + + + + + Coefficient 24 of stiffness matrix [N/m^2] + + + + + Coefficient 25 of stiffness matrix [N/m^2] + + + + + Coefficient 26 of stiffness matrix [N/m^2] + + + + + Coefficient 33 of stiffness matrix [N/m^2] + + + + + Coefficient 34 of stiffness matrix [N/m^2] + + + + + Coefficient 35 of stiffness matrix [N/m^2] + + + + + Coefficient 36 of stiffness matrix [N/m^2]2] + + + + + Coefficient 44 of stiffness matrix [N/m^2]] + + + + + Coefficient 45 of stiffness matrix [N/m^2] + + + + + Coefficient 46 of stiffness matrix [N/m^2] + + + + + Coefficient 55 of stiffness matrix [N/m^2] + + + + + Coefficient 56 of stiffness matrix [N/m^2] + + + + + Coefficient 66 of stiffness matrix [N/m^2] + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal expansion coefficient in material direction + 3 [1/K] + + + + + Thermal expansion coefficient affecting strain in material direction + 23 [1/K] + + + + + Thermal expansion coefficient affecting strain in material direction + 31 [1/K] + + + + + Thermal expansion coefficient affecting strain in material direction + 12 [1/K] + + + + + Thermal conductivity of the material in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 2 [W/(m*K)] + + + + + + Thermal conductivity of the material in material direction 3 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 + [N/m^2] + + + + + Allowable stress for compression in material + direction 1 [N/m^2] + + + + + Allowable stress for tension in material direction 2 + [N/m^2] + + + + + Allowable stress for compression in material + direction 2 [N/m^2] + + + + + Allowable stress for tension in material direction 3 + [N/m^2] + + + + + Allowable stress for compression in material + direction 3 [N/m^2] + + + + + Allowable stress for shear in 2-3 plane [N/m^2] + + + + + Allowable stress for shear in 3-1 plane [N/m^2] + + + + + + Allowable stress for shear in 1-2 plane [N/m^2] + + + + + Allowable strain for tension in material direction 1 + + + + + + Allowable strain for compression in material + direction 1 + + + + + Allowable strain for tension in material direction 2 + + + + + + Allowable strain for compression in material + direction 2 + + + + + Allowable strain for tension in material direction 3 + + + + + + Allowable strain for compression in material + direction 3 + + + + + Allowable strain for shear in 2-3 plane + + + + + + Allowable strain for shear in 3-1 plane + + + + + + Allowable strain for shear in 1-2 plane + + + + + + + + + + + + + + + Orthotropic material properties for 3D materials + + + + + Defines the material properties for an elastic orthotropic material in three spatial directions (i.e., solid). The strain-stress relationship is defined as: + + + + Note that nuij is related to nuji by: + + + + The terminology refers to the following literature: + + [1] R. M. Jones, Mechanics Of Composite Materials, 2 New edition. Philadelphia, PA: Taylor and Francis Inc, 1998. + + + + + + + + + + + + Young's modulus in material direction 1 [N/m^2] + + + + + Young's modulus in material direction 2 [N/m^2] + + + + + Young's modulus in material direction 3 [N/m^2] + + + + + Shear modulus in the 2-3 plane [N/m^2] + + + + + Shear modulus in the 3-1 plane [N/m^2] + + + + + + Shear modulus in the 1-2 plane [N/m^2] + + + + + Poisson's ratio in in 2-3 plane + + + + + Poisson's ratio in in 3-1 plane + + + + + Poisson's ratio in in 1-2 plane + + + + + Thermal expansion coefficient in material direction + 1 [1/K] + + + + + Thermal expansion coefficient in material direction + 2 [1/K] + + + + + Thermal expansion coefficient in material direction + 3 [1/K] + + + + + Thermal conductivity of the material which couples heat flux in material direction 2 with temperature gradient in material direction 3 [W/(m*K)] + + + + + Thermal conductivity of the material which couples heat flux in material direction 3 with temperature gradient in material direction 1 [W/(m*K)] + + + + + + Thermal conductivity of the material which couples heat flux in material direction 1 with temperature gradient in material direction 2 [W/(m*K)] + + + + + + Allowable stress for tension in material direction 1 + [N/m^2] + + + + + Allowable stress for compression in material + direction 1 [N/m^2] + + + + + Allowable stress for tension in material direction 2 + [N/m^2] + + + + + Allowable stress for compression in material + direction 2 [N/m^2] + + + + + Allowable stress for tension in material direction 3 + [N/m^2] + + + + + Allowable stress for compression in material + direction 3 [N/m^2] + + + + + Allowable stress for shear in 2-3 plane [N/m^2] + + + + + + Allowable stress for shear in 3-1 plane [N/m^2] + + + + + Allowable stress for shear in 1-2 plane [N/m^2] + + + + + + Allowable strain for tension in material direction 1 + + + + + + Allowable strain for compression in material + direction 1 + + + + + Allowable strain for tension in material direction 2 + + + + + + Allowable strain for compression in material + direction 2 + + + + + Allowable strain for tension in material direction 3 + + + + + + Allowable strain for compression in material + direction 3 + + + + + Allowable strain for shear in 1-3 plane + + + + + + Allowable strain for shear in 1-3 plane + + + + + + Allowable strain for shear in 1-2 plane + + + + + + + + + + + + + + Materials + + + Materials type, containing material and composite data. + A material describes the properties of a certain material. + Several materials can be combined within one composite. + + + + + + + + + + + + + + + + + + + + + Mission definitions + + + + Specifies missions for performance evaluation of aircraft. + As the topmost element of the hierarchical mission definition, individual missions are grouped together + in the missions node. Here, segmentBlocks + are referenced. These again link to a list of segments. + + + + + + + + + + + + + + + + + + + + + + Setting default and specific performance maps to be used for a model + + + + + + + + + + Default performance map which is used if no other performance map + is assigned through the specificPerformanceMap node + + + + + List of specific performance maps used on dedicated mission segments + + + + + + + + + + + + + + End condition + + + + + Specifies the end conditions for a segment or segment block (e.g.: an altitude or velocity). If a phase has no endCondition, it will base its endCondition on the segmentBlock settings (e.g.: it is the cruise segment, retrieving its total length based on the length of the segmentBlock minus all other segment lengths avaible within the segmentBlock). + + + + + + + + + + + + + + Calibrated airspeed [m/s] + + + + + + + + + + + + + + Mach number + + + + + + + + + + + + + + + + Global coordinate in xyz coordinates + + + + + + + + + + + + + + Global coordinate in geographic + coordinates (longitude, latitude, + altitude) + + + + + + + + + + + + + + Runway + + + + + + + + + + + + + + + + MassFraction ending the segment + + + + + + + + + + + + + + Fuel mass fraction ending the + segment, as remaining fuel mass with + respect to initial segment fuel mass + + + + + + + + + + + + + + Remaining absolute fuel ending the + segment + + + + + + + + + + + + + + Consumed fuel mass ending the + segment + + + + + + + + + + + + + + + + Flight heading at the end of the + segment in compassAngle with + reference to true North [deg] + + + + + + + + + + + + + + Total change of heading angle during + segment (a full turn is 360 degrees) + [deg] + + + + + + + + + + + + + + + Flown distance in the segment (x, y, z) + + + + + + + + + + + + + + + Duration of the segment [hh:mm:ss] + + + + + + + + + + + + + + UTC time at end of mission + + + + + + + + + + + + + + + Specific excess power at the end of the + segment + + + + + + + + + + + + + + Rate of climb ending the segment + + + + + + + + + + + + + + Achieved flightPathAngle ending the segment + + + + + + + + + + + + + + + + + + + + + Mission block constraints + + + Definition of constraints for the mission segment block + + + + + + + + + + + + + + + + + + + + Segment block + + + A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). + + + + + + + + + + Name + + + + + Description + + + + + + Segment direction. Either 'outbound' or 'inbound'. Only needed for radiusOfAction kind of missions. + + + + + + + + + + + + + + + + Specifies to which type of mass the segment fuel mass + should be added (blockFuel = designFuel + additionalFuel; Total fuel requirement + = blockFuel + reserveFuel; designFuel = the fuel of the segmentBlock is part of the design mission) + + + + + + + + + + + + + + + + Number of repetitions of this segment block, e.g. to perform repeated holding patterns + + + + + + + + + + + + + + + Segment blocks + + + A list of segment blocks. A segment block specifies conditions for a predefined combination of segments (e.g.: setting the total range for a block of segments consisting of a takeOff, climb, cruise, descent and landing segment). + + + + + + + + + + + + + + + + + + + Segment + + + Definition of a mission segment which can be used to define missions. + + + + + + + + + + Name + + + + + Description + + + + + Type of the mission segment (takeOff, clime, cruse, ...) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Indication whether the distance flown during the segment is to be taken into account in the segmentBlock's distance calculation. + + + + + + Environmental conditions. If the environmentalCondition is not provided at segment level, the conditions of the + previous segment are inherited (this inhertance can continue until the startCondition, where the initial + environmentalConditions are provided). + + + + + + + Fuel mass + + + + + + + + + + + + + + + + + + + + Mission segment constraints + + + Contains a set of constraints for the segment + + + + + + + + + + + + + + + + + + + Mission segments + + + A collection of mission segments which can be reused to define missions. + + + + + + + + + + + + + + + + + + + Start conditions + + + Conditions which define the start of a mission + + + + + + + + + + + Calibrated airspeed at the start of the mission [m/s] + + + + + Mach number at the start of the mission + + + + + + + Global coordinate at the start of the mission in xyz coordinates + + + + + Global coordinate at the start of the mission in geographic coordinates (longitude, latitude, altitude) + + + + + + UID of the runway at which the + mission starts + + + + + + + + Flight heading at the start of the mission, in compassAngle with reference to true North + + + + + + UTC time at start of mission + + + + + + + + + + + + + + Mission + + + Contains a list of segmentBlock uID's forming the mission along with additional mission information. + + + + + + + + + + Name + + + + + Description + + + + + + + List of segmentBlock uID's forming the mission. Segments must first be grouped in segmentBlocks to be assigned to a mission. + + + + + + + + + + + + + + + Missions + + + A list of missions. + + + + + + + + + + + + + + + + + + + Monetary values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nacelleProfilesType + + + Nacelle profiles type, containing nacelle profile geometries. + See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + nacelleSectionType + + + + + + + + + + + + + + + + + + + + + + + + + + nacelleSectionsType + + + + + + + + + + + + + + + + + + + + + + Noise + + + + + + + + + + + + + FAR approach noise level + + + + + FAR sideline noise level + + + + + FAR take-off noise level + + + + + + + + + + + + + Nose landing gears + + + List of nose gears + + + + + + + + + + + + + + + + + + + Operating empty mass + + + + + + + + + + + + + Operating empty mass description + + + + + + + + + + + + + + + + operationalCaseType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + operationalCasesType + + + + + + + + + + + + + + + + + + + + + + outerCutOutProfileType + + + + + + + + + + + + + + + + + + + + + + + Parameter definition for design studies. + + + Contains a name for the design parameter to give semantic meaning to parameters used in design studies. + + + + + + + + + + + Name of parameter + + + + + + + + + + + + + + Container for parameter definitions + + + Contains a of the design parameter definitions. + + + + + + + + + + + + + + + + + + + + paxCrossBeamStrutsAssemblyType + + + PaxCrossBeamStrutsAssembly type, containing pax + crossBeam strut assemblys + + + + + + + + + + + + + + + + + + + paxCrossBeamsAssemblyType + + + PaxCrossBeamsAssembly type, containing pax crossBeam + assemblys + + + + + + + + + + + + + + + + + + + paxDoorsAssemblyType + + + PaxDoorsAssembly type, containing pax door assemblys + + + + + + + + + + + + + + + + + + + + payloadGlobalType + + + + + + + + + + + + + + + + + + + + + + + Flight performance requirements + + + Contains a list of flight performance requirements + + + + + + + + + + + + + + + + + + + + Flight performance requirement + + + + + + + + + + + + + Name of the performance case + + + + + Description of the performance case + + + + + Requirement classification based on the MoSCoW method (must, should, could or wont) + + + + + + + + + + + + + + + Reference to the considered weightAndBalance case + + + + + The UID of the mission to be flown + + + + + List of point performance uIDs constraining the mission + + + + + + + + + + + + + + + + Selection of performance maps + + + + + + + + + + Engine performance map selection + + + + + Aerodynamic performance map selection + + + + + + + + + + + + + Performance requirements + + + + + + + + + + + + + + + + + + + + + + + + + + performanceTargetsGlobalType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Piston + + + + Geometric description and material properties of the + landing gear piston. The figure below shows the condition of the + uncompressed piston, where the length of the exposed part is the + sum of the maxSpringDeflection + and the compressedExternalLength: + + + + + + + + + + + + + + + Length of the piston + + + + + + Maximum spring deflection of the piston (difference between minimum and maximum deflection) + + + + + Length of the piston that remains outside of the main strut in fully compressed state + + + + + + + + + + + + + + plasticityCurvePointType + + + + + + + + + + + + + Tangent modulus [N/m^2] + + + + + True stress [N/m^2] + + + + + + + + + + + + + Points on plasticity curve of material + (min. 1 point) + + + + + + + + + + + + pointPerformanceType + + + Specific performance settings for the point performance calculation (e.g.: a cruise Mach number) + + + + + + + + + + Name + + + + + Description + + + + + + + Defines at which part of the mission + the point performance should be + considered - after indicated segment + of the mission as defined in + performanceCase + + + + + + + Defines at which part of the mission + the point performance should be + considered - at the defined + massFraction within the mission as + defined in performanceCase + (mCurrent/mTO) + + + + + + + Defines at which part of the mission + the point performance should be + considered - at the defined + fuelFraction within the mission as + defined in performanceCase + (mFuelCurrent/mFuelTO) + + + + + + + + Indicates the type of point performance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Point performance definitions + + + List of point performance definitions + + + + + + + + + + + + + + + + + + + pressureBulkheadAssemblyPositionType + + + PressureBulkheadAssemblyPosition type, containing a + pressure bulkhead assembly position + + + + + + + + + + Frame to which bulkhead is attached to + + + + + + UID of bulkhead element desription + + + + + + + + + + + + + + + pressureBulkheadAssemblyType + + + PressureBulkheadAssembly type, containing pressure + bulkhead assemblys + + + + + + + + + + + + + + + + + + + pressureBulkheadType + + + PressureBulkhead type, containing data of a pressure + bulkhead + + + + + + + + + + Name of the pressure bulkhead structural + element + + + + + Description of the pressure bulkhead + structural element + + + + + UID of structural sheet element used for the + bulkhead + + + + + Choice between flat and curved bulkhead types + + + + + additional data for flat (forward) pressure + bulkhead + + + + Number of vertical reinforcements on flat + bulhhead + + + + + UID of structural elements used as vertical + reinforcements + + + + + Number of horizontal reinforcements on flat + bulhhead + + + + + UID of structural elements used as + horizontal reinforcements + + + + + + additional data for curved (rear) pressure + bulkhead + + + + Radius of bulkhead calotte in the plane of + the adjacent frame + + + + + maximum flection of the pressure bulkhaed + calotte + + + + + Number of radial reinforcements (equally + distributed) on curved bulhhead + + + + + UID of structural elements used as radial + reinforcements on curved bulkheads + + + + + + + + + + + + + + + + pressureBulkheadsType + + + PressureBulkheads type, conteining pressure bulkheads + + + + + + + + + + + + + + + + + + + + Structural elements based on profiles + + + + + Short description + + The ProfileBasedStructuralElement type containins the + data of a structural element, that are based on 2-dimensional profiles. + There are three approaches to model profile based structural elements: + + by specifying global beam properties + by referencing a structuralProfile2D element + by choosing one of the prescribed standard profiles + + + + + + 1. Global beam properties + + In the section globalBeamProperties the properties + of the structural profile in an equivalent beam representation + are defined. + + + + 2. Structural 2D profile + + The structuralProfileUID element refers to the uID of the structuralProfile2D element. + As described in the corresponding documentation, this profile is defined by several points in the x-y-space. + Two points always form a sheet. + The properties of each sheet are defined in the sheetProperties element. + The orthotropy direction of composite materials equals the sheets' x-axis. + The orthotropy direction angle equals a positive rotation around the sheets' z-axis as indicated in the picture below (part 3), which shows an example of a wing stringer.: + + + + + + + 3. Standard structural 2D profile + + Instead of referencing a structuralProfile2D element, it is also possible to select a predefined standard profile. + These profiles are listed in the figure below. + Under sheetProperties, only the standardProfileSheetID (equals S1, S2, ...) must now be specified along with a corresponding length. + + + + + + + + + + + + + + + + Name of the profile based structural element + + + + + + Description of the profile based structural + element + + + + + Choice between global beam properties and sheet properties + + + + + + Choice between general profile element + description (referencing a structuralProfile) and predefined + standard profiles + + + + Definition based on structuralProfile + definition + + + + Reference to the structural profile profile + uID + + + + + + Reference point in structural profile + definition for structural element definition + + + + + + + Standard Profile Type, see picture below for + further information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + structuralElementType + + + profileBasedStructuralElements type, containing a list + of profile based structural elements + + + + + + + + + + + + + + + + + + + profileGeometryType + + + + A profile is defined by a profile name, an optional + description and a 3-dimensional pointlist with all three + coordinates mandatory. For typical profiles, one of the + coordinate vectors contains only "0" entries. All point + coordinates are transferred to the global coordinate system. The + points have to be ordered in a mathematical positive sense. + Normalized coordinates are not required. First and last point + may, but need not to, be identical. Hence, it is possible to + include "open" profiles. However, the trailing edge position of + the upper and lower point need to be identical. No crooked + trailing edges are possible. + Example 1: For a conventional wing, the airfoil + coordinates are defined in x and z with all the y-coordinates + set to "0". The points have to be ordered from the trailing edge + along the lower side to the leading edge and then along the + upper side back to the trailing edge. + Example 2: For a fuselage, the coordinates are + typically given in y and z with x set to "0". Starting point of + the profile sould be the lowest point (typically in the symmetry + plane), then upwards on the positive y-side up to the highest + point (again, typically in the symmetry plane). Depending on, + whether the fuselage shall be specified with symmetry condition + or not, the profile either ends there, or continues on the + negative y-side back down to the lowest point. + Alternatively, it is possible to specify the + coordinates of a profile via the CST (class function /shape + function transformation technique) notation. Please see the + cst2DType for further information. + A profile can be symmetric. In that case the profile + is interpreted as being not closed and will be closed by + mirroring it on the symmetry plane. + + + + + + + + + + + Name of profile + + + + + Description of profile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + profileGeometry2DType + + + + A profile is defined by a profile name, an optional + description and a 2-dimensional pointlist with both + coordinates mandatory. All point coordinates are transferred + to the global coordinate system depending on the context they + are used in. The points have to be ordered in a mathematical + positive sense. The x-coordinates of the profile has to be + normalized between 0 and 1. First and last point + may, but need not to, be identical. Hence, it is possible to + include "open" profiles. However, the trailing edge position of + the upper and lower point need to be identical. No crooked + trailing edges are possible. + Example 1: For a conventional nacelle profile, the airfoil + coordinates are defined in x and y. The points have to be ordered + from the trailing edge along the lower side to the leading + edge and then along the upper side back to the trailing edge. + When used for a nacelle the profile axis align + with the global axes as follows: + +x_profile -> +x_global; + +y-profile -> -z_global + Example 2: For a fuselage, the coordinates are + also given in x and z with x as the normalized fuselage height. + Starting point of the profile sould be the lowest point + (typically in the symmetry plane), then upwards on the positive x-side up to the highest + point (again, typically in the symmetry plane). Depending on, + whether the fuselage shall be specified with symmetry condition + or not, the profile either ends there, or continues on the + negative x-side back down to the lowest point. + Alternatively, it is possible to specify the + coordinates of a profile via the CST (class function /shape + function transformation technique) notation. Please see the + cst2DType for further information. + A profile can be symmetric. In that case the profile + is interpreted as being not closed and will be closed by + mirroring it on the symmetry plane. + + + + + + + + + + + Name of profile + + + + + Description of profile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Profiles + + + Profiles type, containing profile geometries + + + + + + + + + + + + + + + + + + + + + + + + + + Attachment of the pylon to the parent. + + + + + + + + + + + + + Material properties of the attachment. + + + + + + Link to the structural profile of the + attachment. + + + + + + UID of the attachment. + + + + + + + + + + + + Attachments of the pylon to the parent. + + + + + + + + + + + + + + + + + + + + + + + Structural properties of the pylon box (ribs, upper, + lower and side panels). + + + + + + + + + + + + + + + + + + + UID of the pylon box. + + + + + + + + + + + + Definition of one pylon pin. + + + + + + + + + + + + + First element (parentAttachmentUID, engineUID + or uID of a pylon structure. + + + + + Second element (parentAttachmentUID, engineUID + or uID of a pylon structure. + + + + + Position of the pylon pin related to the pylon + coordinate system. + + + + + + Blocked DOFs. Referes to the rotated + coordinate system that is defined in 'orientation'. + + + + + + + + UID of the pin. + + + + + + + + + + + + Definition of pylon pins. + + + + + + + + + + + + + + + + + + + + + + Definition of a rib set. + + + + RibDefinitionType, containing the definition for ribs. + Ribs are defined in sets of one or more ribs. The positions of + the rib, as well as the orientation of the ribs are defined in + 'ribPositioing'. The cross section properties, as e.g. + materials, are defined in 'ribCrossSection'. + + + + + + + + + + + Name of the rib set. + + + + + Description of the rib set. + + + + + + + + + + + + + + + + + Structural properties of all tibs of the engine pylon + box. + + + + + + + + + + + + + + + + + + + + + + pylonRibsPositioningType + + + + Within the ribsPositioning type the position and the + orientation of the ribs of the rib set are defined. + The forward and the rear beginning of the rib set is + defined using relDepthStart and relDepthEnd. The orientation of + the ribs is defined in ribRotaton. The number of ribs of the + current rib set is either defined by ribNumber or by spacing. + + + + + + + + + + + + relDepthStart defines the forward location of + the beginning of the rib set. 0 equals the forward end of the + pylon box, while 1 equals the rear end of the pylon box. + + + + + + relDepthEnd defines the rear end. 0 equals the + forward end of the pylon box, while 1 equals the rear end of the + pylon box. + + + + + Ribs can be rotated in the side view. The + defaults to 90°, which equals an orientation along the pylons + z-axis. The angle is meassured around the positive y-direction + of the pylon. + + + + + + The spacing of the ribs defines the distance + between two ribs, measured along the pylons x-axis. First rib + is placed at relDepthStart. + + + + + RibNumber defines the number of ribs in this + ribSet. First rib is at relDepthStart along the pylons x-axis, + last rib is at relDepthEnd. The spacing is constant. + + + + + + + + RibCrossingBehaviour can either be "cross" or + "end". If it is end then ribs will end it they intersect + another rib. It it is cross ribs are placed uncut. + + + + + + + + + + + + + + + + + + + + + Structural properties of a pylon shackle. + + + + + + + + + + + + + Material properties of the shackle. + + + + + + Link to the structural profile of the shackle. + + + + + + + UID of the shackle. + + + + + + + + + + + + Structural properties of pylon shackles (for pylon to + parent attachment), if existing. + + + + + + + + + + + + + + + + + + + + + + + Structural properties of the pylon shells. + + + + + + + + + + + + + + UID of the structural profile. + + + + + + Material settings. + + + + + + UID of the structure. + + + + + + + + + + + + Definition of the load carrying structure of the engine + pylon. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Structural properties of struts (drag struts, upper + links and tangent links), if existing. + + + + + + + + + + + + + + + + + + + + + + + + radiativeForcingType + + + + + + + + + + + + + + + + + + + + + + + + + + + + recurringCostType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reference values + + + Reference type, containing the reference values of the + aircraft model + + + + + + + + + + Reference area (typically planform area) + + + + + + Reference length (typically Mean Aerodynamic + Chord MAC). In CPACS, only one reference length exists (and is + used, e.g. for all three moment coefficients. Coordinates given + relative to MAC shall always use this length as MAC. + + + + + + Moment reference point (in global coordinate + system). The x-coordinate is typically chosen same as of the + leading edge of the wing in the spanwise section having a + chordlength identical to MAC. Coordinates given as %MAC shall + always use this x-coordinate and length (e.g. 0%MAC = x, 100%MAC + = x + length). The y coordinate is typically 0. The z coordinate + is often chosen either as 0., or as z of fueselage nose or as z + of middle of center fuselage part. + + + + + + + + + + + + + requirementType + + + + + + + + + + + + + + + + + + + + + + + RibIdentificationType, defining one rib. + + + + + + + + + + + + + UID of the rib definition set. + + + + + + Number of the rib of the rib definition set. + + + + + + + + + + + + + + Definition of the rib rotation + + + The rotation around z describes the rotation around the + wings midplane normal axis. The defaults to 90°. The reference + for the 'zero-angle' of the z-rotation is defined in + ribRotationReference. + + + + + + + + + + RotationReference defines the reference for + the z-rotation it is either sparUID, „LeadingEdge“, + „TrailingEdge“, "globalX", "globalY" or "globalZ". + If it is not defined the rotation reference is + the eta-axis (=leading edge, that is projected on the wings + y-z-plane). A z-rotation angle of 90 degrees means, that the rib + is perpendicular on the ribRotationReference (e.g. spar, leading + edge...). The rib itself is always straight, and the rotation + is defined with respect of the intersection point of the rib + with the ribRotationReference. + + + + + The rotation around z describes the rotation + around the wings midplane normal axis. The defaults to 90°. The + reference for the 'zero-angle' of the z-rotation is defined in + ribRotationReference. + + + + + + + + + + + + + rivetJointAreaAssemblyPositionType + + + RivetJointAreaAssemblyPosition type, containing a rivet + joint area assembly position + + + + + + + + + + + + + + + + + + + + + rivetJointAreasAssemblyType + + + RivetJointAreasAssembly type, containing rivet joint + area assemblys + + + + + + + + + + + + + + + + + + + rivetType + + + Rivet type, containing a rivet + + + + + + + + + + Name of the rivet type + + + + + Description of the rivet type + + + + + + Tensile Strength of the rivet type + + + + + + Shear Strength of the rivet type + + + + + + + + + + + + + + + rivetsType + + + Rivets type, containing rivets + + + + + + + + + + + + + + + + + + + rotorAirfoilsType + + + RotorAirfoils type, containing rotor airfoil + geometries. See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + + rotorBladeAttachmentType + + + RotorBladeAttachment type, defining the elements used + to attach one or more rotor blades to the rotor head. + + + + + + + + + + Name of the blade attachment. + + + + + + Description of the blade attachment. + + + + + + + The azimuthAngles element is used to specify + a list of discrete azimuth angles (in deg) at which instances + of attached blades are to be created. The number of blades will + equal to the number of elements of the vector. E.g. + <azimuthAngles>0;90;180;270</azimuthAngles> for a + four blade rotor with equal equiangularly distributed blades. + The transformation of the respective rotor blade corresponds to + a rotation by azimuthAngle around the z axis of the rotor + coordinate system in mathematically positive sense of rotation. + + + + + + If only the number of blades is specified, + the attached blades will be distributed equiangularly and the + first blade will be attached at azimuth angle 0. (Formula: + azimuthAngle[i] = i*360deg/numberOfBlades, + i=0..numberOfBlades-1) + + + + + + Definition of all hinges used to attach the + rotor blade. + + + + + UID of the rotorBlade which should be attached + to the rotor hub. + + + + + + + + + + + + + + rotorBladeAttachmentsType + + + RotorBladeAttachments type, containing all hinges and + blade UIDs attached to the current rotor hub. + + + + + + + + + + + + + + + + + + + rotorBladesType + + + + RotorBlades type, containing all the rotor blade + gometry definitions of an rotorcraft model. + Rotor blade geometries are defined using the same data + structure as wings (wingType). But in order to be compatible + with the other rotor blade related types (e.g. rotorType, + rotorHubType, rotorHubHingeType) there are some additional + conventions/requirements regarding the definition and + orientation of rotorBlade geometries: + + Rotor blades should be positioned relative to the + global z-axis the way they will be positioned to the rotor + shaft (when blade azimuth=0deg). + The global x-axis should be used as radial axis + (usually the quarter chord line of the rotor blade coincides to + a great extent with the x-axis of the rotor blade coordinate + system). + All sections should be positioned in the positive + x halfspace. + Segments should connect sections with ascending x + coordinates. + Airfoils defined in the rotorAirfoils node should + be used instead airfoils from the wingAirfoils node. + + + + + + + + + + + + + + + + Rotor blade geometries are defined using the + same data structure as wings (wingType). But in order to be + compatible with the other rotor blade related types (e.g. + rotorType, rotorHubType, rotorHubHingeType) there are some + additional conventions/requirements regarding the definition and + orientation of rotorBlade geometries: see remarks. + + + + + + + + + + + + + + rotorHubHinge type, containing a rotor hub hinge + (flap/leadLag/pitch). + + + + RotorHubHinge type, containing a rotor hub hinge + (flap/leadLag/pitch) of a rotorcraft model. + + + + + + + + + + + Name of the hinge. + + + + + Description of the hinge. + + + + + + Hinge type. Possible values: "flap", "pitch" + "leadLag". This is used to define the rotation axis of the hinge + (flap = y-axis in blade cs, pitch = x-axis in blade cs, lead-lag + = z-axis in blade cs). + + + + + + + + + + + + The angle (in deg) at which the hinge is in + neutral position. This element is normally used to define + precone or prelag angles of the attached blade. Defaults to 0. + + + + + + Static stiffness of the hinge in (N/m) for + linear hinges and (N.m/deg) for angular hinges. Default value: + +inf (statically rigid hinge) + + + + + Dynamic stiffness of the hinge in (N/m) for + linear hinges and (N.m/deg) for angular hinges. Default value: + +inf (statically rigid hinge) + + + + + Damping of the hinge in (N/(m/s)) for linear + hinges and (N.m/(deg/s)) for angular hinges. Default value: +inf + + + + + + + + + + + + + + + rotorHubHingesType + + + RotorHubHinges type, defining hinges used to attach a + rotor blade to the rotor head. + + + + + + + + + + Definition of a flap, lead-lag or pitch hinge. + + + + + + + + + + + + + + rotorHubType + + + RotorHub type, containing definitions for the rotor hub + and attached hinges and blades. + + + + + + + + + + Name of the rotor hub. + + + + + Description of the rotor hub. + + + + + + Rotor head type. Possible values: "semiRigid", + "rigid", "articulated", "hingeless" + + + + + + + + + + + + + Rotor blade attachments are used to define how + many rotor blades are attached at which azimuth positions of the + rotor hub and the used hinges. + + + + + + + + + + + + + + Rotor type, containing a rotor (main rotor, tail rotor, + fenestron, propeller,...) of an rotorcraft model. + + + + Rotor type, containing a rotor (e.g. main rotor, tail + rotor, fenestron, propeller,...) definition of a rotorcraft + model. + The position and attitude of the rotor is defined + using the transformation element. The following image shows the + CPACS conventions for the orientation of rotors and rotor axis + systems: + + + + + The origin coincides with the center of rotation. + + The z-axis corresponds to the axis of rotation + and thus coincides with the rotor shaft centerline. It Points + in the main thrust direction of the rotor (usually upwards for + a main rotor, forwards for a propeller). + The x-axis points from nose to tail (usually + rearwards for main and tail rotors, upwards for a propeller). + + The y-axis completes the right-handed orthogonal + coordinate system. + + Rotor hub attributes, hinges and references to + attached rotor blades are defined in the rotorHub element. + + + Note that rotor blade geometries are only referenced and not + defined in the child nodes of the rotor element. Refer to the + documentation of rotorBladesType ( + Empty#T/rotorBladesType + ) and wingType ( + Empty#T/wingType + ) for information on the definition of rotor blade geometries. + + The following figure shows the transformations to be + applied to rotorBlade geometries to visualize them in the rotor + frames for a given state (each rotor: rotorAzimuth given, each + hinge: hingeDeflection given): + + + + + + + + + + + + + + Name of the rotor. + + + + + Description of the rotor. + + + + + UID of the part to which the rotor is mounted + (if any). The parent of the rotor can e.g. be the fuselage. In + each rotorcraft model, there is exactly one part without a + parent part (The root of the connection hierarchy). + + + + + + Rotor type. Possible values: "mainRotor" + (default), "tailRotor", "fenestron" or "propeller".. + + + + + + + + + + + + + + Nominal value of the angular rotation speed in + rotations per minute (rpm). + + + + + Transformation (scaling, rotation, + translation). This element is used to define the position and + attitude of the rotor relative to the global or the parent + component's axis system. Note that an anisotropical scaling + transformation should not be applied to the rotor. + + + + + + The rotorHub element contains the definition + of the rotor hub type and number and azimuth angles of the + attached blades and their hinges. The rotor hub position and + attitude coincides with the rotor axis system's origin and z + axis. + + + + + + + + + + + + + + + + + + + + + + + + + rotorcraftAnalysesType, results from several analysis + modules connected to CPACS + + + RotorcraftAnalyses type, containing detailed analysis + data of the rotorcraft + Within this element results from analysis modules are + stored that rely to the overall definition of the rotorcraft. + These include e.g. aerodynamic data or loadCases + For further documentation please refer to the + respective elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + rotorcraftGlobalType + + + RotorcraftGlobalType type, containing global data of + the rotorcraft + + + + + + + + + + Number of passenger seats + + + + + Cargo transport capacity [kg] + + + + + + Cruise Mach Number + + + + + Configuration of the rotorcraft: + standard(single main rotor, single tail rotor) / tandem / + coaxial/intermeshing / sideBySide/tiltRotor/tiltWing + + + + + + + + + + + + + + massBreakdownType + + + + + 1. General + + + The + massBreakeDown + is subdivided in + designMasses + , + fuel + , + payload + and + mOME + (operating empty mass). + + + designMass + + The design mass is a description from TLARs and can + be understand as design criteria. + + fuel + and + payload + + The fuel and payload mass are the maximum masses + which can be achieved. Full fuel tanks, all passengers on + board and full cargo holding. + + mOEM + + + The operation empty mass structure is based on the Airbus Mass + Standard brake down [AIRBUS MASS STANDARD 2008]. The + operator’s mass empty (OME) is defined by the sum of the + following component masses: + + operator’s items + manufacturer’s mass empty (MME) + + + + + + + 2. massDescription + + + Each sub component has the following + massDescription + which include a: + + Name + Description + parentUID + Mass value + Mass location + Mass orientation + Mass Inertia. + + + + That + massdescription + can be found at the + designMasses + direct under each item. At the + fuel + , + payload + and + mOME + under massDescription in each item and sub item. + + + + For the clean up the + mOME + there is consisting a script witch is programmed in Matlab but + also as standalone vision available. Setting for that tool can + be done under + toolspesifics/cmu + . + + + + + + + + + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Manufacturer empty mass description + + + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Group mass of hierarchy level 1 + + + + + + + + + + + + + + + Mass + + + + + + + + + + + + + Group mass of hierarchy level 2 + + + + + + + + + + + + + + + Operating empty mass + + + + + + + + + + + + + Operating empty mass description + + + + + + + + + + + + + + + + rotorcraftModelType + + + RotorCraftModel type, containing a complete rotorcraft + model (Geometry and all specific data). The rotorcraftModelType + is basically a copy of the aircraftModelType with the following + additional elements: rotors, rotorBlades, driveSystems. + Furthermore the folowing elements have been adapted for + rotorcraft: global and analyses (aeroPerformance and + massBreakdown). + + + + + + + + + + Name of rotorcraft model + + + + + Description of rotorcraft model + + + + + + + + + + + + + + + + + + + + + + + + + + Rotorcraft + + + Rotorcraft type, containing all the rotorcraft models. + + Most of the extensions used in the rotorcraft type have + been defined as part of the work in the DLR project RIDE + (Rotorcraft Integrated Design and Evaluation, 2009-2012). + Therefore some of the definitions and conventions are tightly + coupled to the RIDE toolchain and tools. Further generalization + and assimilation of these parts to the definitions for fixed-wing + aircraft is planned for the near future. + + + + + + + + + + + + + + + + + + + rotorsType + + + Rotors type, containing all the rotors (mainRotors, + tailRotors, fenestrons, propellers, ...) of an rotorcraft model. + + + + + + + + + + + + + + + + + + + + runwayILSType + + + RunwayILS type, containing ILS data of a runway + + + + + + + + + + + Position of the localizer antenna + + + + + + + Position of the glide slope antenna + + + + + + Angle of the glide path + + + + + + + + + + + + + + runwayType + + + Runway type, containing data of a runway + + + + + + + + + + Name of runway + + + + + Description of runway + + + + + Position in degrees north + + + + + Position in degrees east + + + + + Threshold elevation + + + + + Runway heading + + + + + Takeoff run available + + + + + Landing distance available + + + + + Conditions of the runway + + + + + + + + + + + + + + + runwaysType + + + Runways type, containing data of the airport's runways + + + + + + + + + + + + + + + + + + + + seatModuleType + + + SeatModule type, containing data of a seat module + + + + + + + + + + + Name of the seat module + + + + + Description of the seat module + + + + + + Number of seats in the seat module, e.g 1, 2 + or 3 + + + + + Total width of the seat module + + + + + + seat module mass (optional, use of data to be + clarified) + + + + + seat module mass CoG (optional, use of data to + be clarified) + + + + + + + + + + + + + + seatModulesType + + + SeatModules type, containing seat modules + + + + + + + + + + + + + + + + + + + shaftLinkedComponentsType + + + ShaftLinkedComponents type, containing UIDs of engines, + transmissions and rotors linked by a shaft. + + + + + + + + + + + UID of a linked engine. + + + + + UID of a linked transmission shaft input. + + + + + + UID of a linked transmission shaft output. + + + + + + UID of a linked rotor. + + + + + + + + + + + + + + shaftType + + + Shaft type defining a shaft used as a link between + drive system components. + + + + + + + + + + + + + + + + + + + + + + shaftsType + + + Shafts type, containing all the shafts of a drive + system. + + + + + + + + + + + + + + + + + + + sheet3DType + + + + + + + + + + + + + + + + + + + + + + + + + + sheetBasedStructuralElementType + + + sheetBasedStructuralElementType type, sheet definition + for use in fuselage/structure + + + + + + + + + + Material definition of the skin segment + (Material, thickness, (lay-up)) + + + + + + + + + + + + + + sheetBasedStrcuturalElementsType + + + sheetBasedStrcuturalElementsType, containing sheet + based structural element definitions + + + + + + + + + + + + + + + + + + + sheetList3DType + + + + + + + + + + + + + + + + + + + + + + List of sheets, connecting 2-dimensional profile + points. + + + SheetList type, containing a list of sheets. Each sheet + combines two points to one sheet. + + + + + + + + + + + + + + + + + + + sheetPointsType + + + + + + + + + + + + + + + + + + + + + + sheetType + + + Sheet type, containing connection data of a sheet + + + + + + + + + + + Name of sheet within the profile definition + + + + + + Description of sheet within the profile + definition + + + + + Point from which the sheet definition starts + start + + + + + Continuity definition for profile geometry + generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines + tangential continuity), 2= C2 (defines curvature continuity) + 2=all + + + + + + + + + + + + + + Definition of an orientation vector at P1 + + + + + + Point at which the sheet definition ends + + + + + + Continuity definition for profile geometry + generation. 0= C0 (allows sharp edges, deafault), 1= C1 (defines + tangential continuity), 2= C2 (defines curvature continuity) + 2=all + + + + + + + + + + + + + + Definition of an orientation vector at P2 + + + + + + + + + + + + + + + singleGenericMassType + + + + + + + + + + + + + + + + + + + + + + Skid landing gears + + + List of skid gears + + + + + + + + + + + + + + + + + + + fuselagePanelType + + + FuselagePanel type, panel of the fuselage between + stringers/ frames (new in V1.5) + + + + + + + + + + UID of sheetBasedStructuralElement used for + the panel + + + + + UID of frame at start of the skin segment + + + + + + UID of frame at end of the skin segment + + + + + + UID of stringer at start of the skin segment + + + + + + UID of stringer at end of the skin segment + + + + + + + + + + + + + + + fuselageSkinSegmentType + + + FuselageSkinSegment type, containing material on skin + over circumference + + + + + + + + + + + + + + + + + + + skinType + + + Containing data defining the skin + + + + + + + + + + Default UID of sheetBasedStructuralElement + used for the fuselage skin not covered by individual panels + + + + + + + + + + + + + + + Spar cell of the spar. + + + + Within spar cells a special area of the spar is + defined where different cross section and material properties + shall be defined. + The area of the spar is defined by using the + parameters 'fromEta' and 'toEta'. The definition of the caps, + webs and rotation is equivalent to the cross section definition + of the complete spar. + + + + + + + + + + + Beginning (= inner border) of the spar cell. + + + + + + Ending (= outer border) of the spar cell. + + + + + + Upper Cap + + + + + + Lower Cap + + + + + + Web 1 + + + + + + Web 2 + + + + + + The angle between the wing middle plane and + web 1 [deg]. Default is 90 degrees. Positive rotation is around the + spar axis heading along with the positive eta-axis. + + + + + + + + + + + + + + + SparCells of current spar. + + + sparCells are an optional Element. They are defined via + the etaCoordinates and define a region of special cross section + and material properties. + + + + + + + + + + + + + + + + + + + Definition of the spar cross section. + + + + Spar type, containing the cross section definition of + a spar. The spar middle point is defined by the intersection of + the wing middle plane and web1. This equals the coordinate + defined within the sparPosition. + Please find below a picture where all spar cross + section parameters as well as the orientation refereneces for + the material definition can be found: + + + + + + + + + + + + + + + + + + + The angle between the wing middle plane and + web1. Default is 90 degrees. Positive rotation is around the + intersection axis of the spar and the wing middle plane. The + positive heading of this axis is inline with the positive + heading of the componentSegment eta-axis. + + + + + + + + + + + + + Spar position on the wing + + + + sparPositionType, a sparPostion defines a location + within the componentSegment where a spar in mounted. Eta and xsi + are relative to the componentSegment. + Please find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + As an alternative to the relative eta coordinate it is + possible to specify an elementUID so that the spar position is + relative to the outer geometry, e.g. kink, of the wing. + + + + + + + + + + + + Defines a spar position on an existing rib using a relative xsi coordinate + to determine the chord wise position on that rib + + + + + Defines a spar position using relative eta/xsi coordinates + + + + + + + + + + + + + + sparPositionUIDs of the spar. + + + + sparPositionType, a sparPostion defines a location + within the componentSegment where a spar in mounted. Those + positions are combined to spars by using a list of spar position + uIDs. The order of the sparPositionUIDs must be the same as the + order of the points on the real spar (from root to tip or from + tip to root). + Pleas note: orientation of a spar must be allways + outbound or allways inbound. A zigzag spar orientation where + e.g. the spar starts at the root, goes to the tip and goes back + to another point at the root is not allowed. + Pleas find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + + + + + + + + + + + List of spar position uIDs. + + + + + + + + + + + + + + Spar definition points on the wing. + + + + sparPositionType, a sparPostion defines a location + within the componentSegment where a spar in mounted. Eta and xsi + are relative to the componentSegment. + Please find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + + + + + + + + + + + + + + + + + + + + SparSegments (=spars) of the wing. + + + SparSegmentType, each spar is defined by multiple + sparPositions that are referenced via their uID. The spar cross + section is defined in 'sparCrossSection'. + + + + + + + + + + Name of the spar segment (=spar). + + + + + + Description of the spar segment (spar). + + + + + + + + + + + + + + + + + Spar segments of the wing. + + + sparSegmentsType, containing multiple sparSegment + (=spars) of the wing. + + + + + + + + + + + + + + + + + + + Specific heat map, containing the specific heat capacity of a material at different temperatures. + + + The specific heat of a material can vary with the temperature. The vectors specificHeat and temperature + must have the same size to be valid. The data should be linearly interpolated. + + + + + + + + + + + Temperature in [K] + + + + + Specific heat capacity of the material in [J/(kg*K)] + + + + + + + + + + + + + Specific performance map + + + + Applying a specific performance map to selected mission segments. In addition to the obligatory defaultPerformanceMapUID at least a segmentUID or pointPerformanceUID must be given. + + + + + + + + + + + UID of performance map to be used for mission segments + + + + + + + List of all mission segment UIDs to which the performance map is to be applied + + + + + List of point performance UIDs to which the performance map is to be applied + + + + + + List of point performance UIDs to which the performance map is to be applied + + + + + + + + + + + + + + specificPerformanceMapsType + + + Collection of all assignments of specific performance maps to selected mission segments + + + + + + + + + + + + + + + + + + + Spoilers of the wing. + + + A spoiler is defined via its outerShape relative to the + componentSegment. The WingCutOut defines the area of the upper + skin that is removed by the spoiler. Structure is similar to the + wing structure. The mechanical links between the spoiler and the + parrent are defined in tracks. The deflection path is described + in path. Additional actuators, that are not included into a + track, can be defined in actuators. + + + + + + + + + + Name of the spoiler. + + + + + Description of the spoiler. + + + + + + UID of the parent of the spoiler. The parent + is the componentSegment, where the spoiler is attached. + + + + + + + + + + + + + + + + + + + + + Definition of the wings spoilers. + + + Definition of the wings spoilers. + + + + + + + + + + + + + + + + + + + State parameter definition + + + Contains the values of a parameter and its uid as reference. + + + + + + + + + + + + + + + + + + + + + + + + State parameters list + + + Contains a list of all state parameters. + + + + + + + + + + + + + + + + + + + + stiffnessType + + + + + + + + + + + + + + + + + + + + + + + + + + + stringerFramePositionType + + + + Description of individual stringer / frame postions + + + + + + + + + + + + + + UID of profile based structural element + + + + + + + x position in absolute value + + + + + + UID reference to a fuselageSectionElement + + + + + + + y coordinate of reference system + + + + + + z coordinate of reference system + + + + + + angle definition to calculate intersection + with loft + + + + + + Continuity definition for profile extrusion: + 0= C0 (allows sharp edges, default), 2= C2 (defines curvature + continuity) + + + + + + + + + + + + + Definition of interpolation between different + profiles: 0= no interpolation 1= interpolation of strcutural + profile + + + + + + + + + + + + + + + + + + + + + + arbitraryStringerType + + + ArbitraryStringer type, containing stringer definition + (CPACS V1.5+) + + + + + + + + + + + + + + + + + + + + stringersAssemblyType + + + StringersAssembly type, containing an assembly of + stringers (new V1.5) + + + + + + + + + + + + + + + + + + + Structural elements + + + structuralElements Type, containing the different structural + elements + + + + + + + + + + + + + + + + + + + + + + + + + + + structuralMountType + + + + + + + + + + + + + + If this value is set to true then only the end points of the intersection shall be included as nodes in the model. + + + + + + The UID for the first connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. + + + + + + Optional counter to specify numbered items, e.g. ribs in a ribSet. + + + + + + The UID for the second connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. + + + + + + Optional counter to specify numbered items, e.g. ribs in a ribSet. + + + + + + + + + + + + + + + structuralProfile3DType + + + + + + + + + + + + + + + + + + + + + + + + + + 2-dimensional cross sections of structural profiles. + + + + + StructureProfile type, containing data of a structure + profile cross sections. The cross section profile is defined by + several points (->pointList) in the x-y-space. Two points are + combined to one sheet (->sheetList) by using the pointUIDs. + + This profile is defined by several points in the + x-y-space. Allways two points are combined to one sheet. The + properties of each sheet are defined in the 'sheetProperties' + section by referencing on the sheetUID and the material + properties. The orthotropy direction of composite materials equals + the x-sheet axis. The orthotropy direction angle equals a positive + rotation around the z-sheet axis as indicated in the picture below + (part 3.), where a wing stringer is defined as an example: + + + + + + + + + + + + + + + Name of the structure profile. + + + + + + Description of the structure profile. + + + + + + List of structural profile points, only x and + y. + + + + + + + + + + + + + + + Definition cross sections of structural profiles. + + + + Structuralprofiles type, containing cross section + information of structural profiles. + + + + + + + + + + + + + + + + + + + + Geometric description and material properties of a strut + + + + + + + + + + Length of the strut + + + + + + + + + + + + + + Design study parameters and results + + + + Contains optimization data such as definitions of design parameters and design studies. + + + + + + + + + + + + + + + + + + + + + + + + + subFleetType + + + Each fleet can be divided into sub fleet groups + + + + + + + + + + Name of fleet + + + + + Description of the fleet + + + + + A ; separated list of all tailsign strings + + + + + + + + + + + + + + subFleetsType + + + Contains a list of different sub fleets + + + + + + + + + + + + + + + + + + + subLoadType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Systems + + + + Systems type, containing the aircraft's control system + data + Please see the attached picture for further + documentation + + + + + + + + + + + + + + Node for geometrical layout of system components + based on simple geometric shapes + + + + + + Cockpit controls, e.g. stickRoll, pedals + + + + + + Different commandCases that are commanded, + e.g. roll, accelerate + + + + + Control Distributors, deliver inputs to the + control actuators. E.g. different angles of different ailerons. + + + + + + Control laws, for regulated actuation + + + + + + + + + + + + + + tailplaneAttachmentAreaType + + + tailplaneAttachmentArea type, containing dat on + fuselage + structure to attach tailplaine + + + + + + + + + + Definition of tailplane attachment area + (Standard + Configuration) + + + + + type of tailplane attachment: Currently + restricted to + 'Type1' and 'Type2' (see documentation) + + + + + + + + + + + + + + Definitions of VTP interface + + + + + + Definitions of VTP interface + + + + + + + + + + + + + + + takeoffPerformanceParametersType + + + + + + + + + + + + + Take-off distance at liftoff speed VLOF. + + + + + + Take-off distance at safety speed V2. + + + + + + Optimal speed Velev at point of initiating + take-off rotation by elevator deflection for a minimum take-off + distance. + + + + + Optimal rotation speed VR for a mini-mum + take-off distance + + + + + Liftoff speed VLOF. + + + + + Safety speed V2. + + + + + Take-off decision speed V1 + + + + + Minimum control speed ground VMCG. + + + + + + Flight path angle being achieved at V2 with + one engine failure in 400 ft height above ground. This is the + result of a post trim calculation using the deter-mined V2. If + the trim calculation fails the entry is set to -90. + + + + + + + + + + + + + + Structural properties of the tangent links, if + existing. The tangent links do connect the engine pylon with the + engine to carry the thrust forces. + + + + + + + + + + + + + + + + + + + + + + simpleConnectionType + + + SimpleConnection type, containing a simple connection + + + + + + + + + + + Can be each structural member (skinSegment, + stringer, frame, paxCrossBeam, cargoCrossBeam, + paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, + floorPanel, seatModule) + + + + + Can be each structural member (skinSegment, + stringer, frame, paxCrossBeam, cargoCrossBeam, + paxCrossBeamStrut, cargoCrossBeamStrut, long. floor beams, + floorPanel, seatModule) + + + + + + + + + + + + + + + simpleConnectionsType + + + SimpleConnections type, containing simple connections + + + + + + + + + + + + + + + + + + + + topologyEntriesType + + + + + + + + + + + + + + + + + + + + + + topologyEntryType + + + A topology entry is used to combine the dynamic aicraft + models of several components, e.g. wing and fuselage. By default + these will be stiff. If desired stiffness and rotation with + respect to the CPACS coordinate system may be specified. + + + + + + + + + + + + + + + + + + + + + + + totalOperatingCostType + + + + + + + + + + + + + + + + + + + + + + + + trackActuatorType + + + + + + + + + + + + + Reference to the uID of the actuator of the + track. + + + + + Definition of the material properties of the + actuator to track attachment. + + + + + + + + + + + + + + wingSparsType + + + Spars type, a spar is defined by sparSegments that + stretch between multiple sparPositions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Definition of the struts of a control surface track. + + + + Definition of the struts of a control surface track. + + + + + + + + + + + + + + + + + + + + Definition of a strut of a control surface track. + + + + Definition of a strut of a control surface track. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specification of joint coordinates. + + + + Specification of joint coordinates. + + + + + + + + + + + + + + + + + + + + Set of joint coordinates + + + + Definition of a set of joint coordinates. + + + + + + + + + + + Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + + + + + + + + Joint coordinates + + + + Definition of a joint coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Trailing edge device of the wing. + + + A trailingEdgeDevice (TED) is defined via its + outerShape relative to the componentSegment. The WingCutOut + defines the area of the skin that is removed by the TED. + Structure is similar to the wing structure. The mechanical links + between the TED and the parrent are defined in tracks. The + deflection path is described in path. Additional actuators, that + are not included into a track, can be defined in actuators. + + Leading and trailing edge are defined by the outer + shape of the wing segments, i.e. the trailing edge of a + trailingEdgeDevice is the trailing edge of the wing. This is also + valid for kinks that are present in the wing but not explicitly + modeled in the control surface. + The edges of the control surface within the wing are a + straight line in absolute coordinates! Hence, there needs to be a + straight connection between the eta-wise outer and inner points + of the edge that is within the wing in absolute coordinates. + + + + + + + + + + + Name of the trailing edge device. + + + + + + Description of the trailing edge device. + + + + + + UID of the parent of the TED. The parent can + either be the uID of the componentSegment of the wing, or the + uID of another TED. In the second case this TED is placed within + the other TED (double slotted flap). In this way n-slotted TEDs + can be created. + + + + + + + + + + + Definition of cruise rollers/mid-span stops. + Those features are small rolls at the leading edge of a flap + that keep the flap within the bending wing at cruise + configuration. + + + + + Definition of interconnection struts. Those + struts connect two neighbouring flaps and are load carrying in + case of an actuator of flap track failour. + + + + + Definiton of z-couplings. Those elements + couple two neighbouring flaps in z-direction. + + + + + + + + + + + + + + + Definition of the wings trailing edge devices. + + + + Definition of the wings trailing edge devices. + + + + + + + + + + + + + + + + + + + + Trajectories + + + + + + + + + + + + + + + + + + + + + + trajectoryGlobalType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + trajectoryType + + + + + + + + + + + + + + + + + + + + + + + + + + + transmissionGearRatioType + + + TransmissionGearRatio type, defining the ratio of + output rotation velocity to input rotation velocity. + + + + + + + + + + + + + + + + + + + + transmissionShaftInputType + + + TransmissionShaftInput type, defining a shaft input for + a transmission. + + + + + + + + + + + + + + + + + + + + transmissionShaftInputsType + + + TransmissionShaftInputs type, defining the shaft inputs + of a transmission. + + + + + + + + + + + + + + + + + + + transmissionShaftOutputType + + + TransmissionShaftOutput type, defining a shaft output + for a transmission. + + + + + + + + + + + + + + + + + + + + + transmissionShaftOutputsType + + + TransmissionShaftOutputs type, defining the shaft + outputs of a transmission. + + + + + + + + + + + + + + + + + + + transmissionType + + + Transmission type, defining a transmission/gearbox. + + + + + + + + + + + + + + + + + + + + + + + + + transmissionsType + + + Transmissions type, containing all the + transmissions/gearboxes of a rotorcraft model. + + + + + + + + + + + + + + + + + + + + + + + + + + + updateType + + + Update type, containing a datablock for each update of + the CPACS dataset + + + + + + + + + + Description of Modification of CPACS data + + + + + + Creator of CPACS modification + + + + + + Timestamp of CPACS modification + + + + + + New version number of CPACS dataset after + modification + + + + + CPACS version that the dataset is valid to + + + + + + + + + + + + + + Structural properties of the upper links, if existing. + The upper links do connect the upper forward part of the pylon + box with the forward wing attachment. + + + + + + + + + + + + + + + + + + + + + + variableSegmentType + + + + Containing the definition of variable segments for a segment block + + + + + + + + + + + defines uID of the segment having variable conditions + + + + + defines which condition(s) are variable within the segment (must be one of the defined + endConditions for the segmentBlock) + + + + + + + + + + + + + + + + + + + + List of segments that are allowed to be varied within a mission optimization. + + + + Provides a list of segments having variable conditions within the segmentBlock. + Example: a segmentBlock containing takeOff, climb, cruise, decent, landing segments has a cruise segment for which the range is variable. + The range of this segment is then to be calculated using the range defined for the segmentBlock while concerning the known ranges of all + other segments within the segmentBlock. + This concept needs to be practically tested. Does it suffice to mention (a list of) segments that are free to change to fit the overall block constraints? What happens if a segment is variable, though it has some constraints? When to define a segment as variable (climb until endPosition z, then endPosition x should be left free. Is the segment then variable? Probably not.). Somehow the 'free' segment should be in between fully defined segments (i.e.: a cruise+descent in between endPosition z == ICA and endPosition z == 0 for landing to define max range. How to define this exactly?) + + + + + + + + + + + + + + + + + + + Vehicles + + + + The vehiclesType contains all vehicle-specific + data. + This includes the vehicle itself (i.e. aircraft + and rotorcraft). Furhtermore, components + (e.g. engines, structuralElements, etc.) + as well as physical properties of materials and + fuels can be predefined for easy and consistent reuse via + uID-references. + + + + + + + + + + + + + + + + + + + + + + + + + + + + vtpFrameDefType + + + Definition of the individual VTP attachments + + + + + + + + + + Definition of tailplane attachment area + (Standard Configuration) + + + + UID of the fuselage frame at this VTP + attchment + + + + + Flag for option for VTP attachment between + defined FrameUID and the next one + + + + + UID of panel element at VTP attachment (shell + elements) + + + + + UID of structural element at VTP attachment + (base, beams) + + + + + UID of structural element at VTP attachment + (horizontal, beams) + + + + + UID of structural element at VTP attachment + (radial, beams) + + + + + + + + + + + + + + vtpInterfaceDefType + + + Definition of the interface of the VTP + + + + + + + + + Definition of the VTP interface + + + + + Definition of the VTP attachment frames and + their + reinforcement + + + + + + Defines area for valid x-position of VTP (just + used + if attachmentpoint is directly based on frame) ==> check and + potentially warning message + + + + + + Definition of the max. distance between + fuselage and + the defined VTP pins ==> check and potentially warning + message + + + + + + Definition of reinforcement area at VTP frame + positions (relative coordinate, smaller than + 1.0) + + + + + + Definition of vertical reinforcements at VTP + frame + positions (relative coordinate, smaller than + 1.0) + + + + + + value to change from horizontal to radial + reinforcements for VTP frame plates + + + + + + UID of elements to connect VTP pins with + fuselage + (beam elements) + + + + + + + + + + + + + + + webType + + + + SparWeb type, containing the cross section area of the + spar web and the material properties. + Pleas find below a picture where all spar cross + section parameters as well as the orientation refereneces for + the material definition can be found: + + + + + + + + + + + + + + Material definition of the spar web. + + + + + + relPos ranges from 0 to 1 It defines the + position of the web relative to the caps (see picture below).. + + + + + + + + + + + + + + weightAndBalanceCaseType + + + WeightAndBalanceCase type, containing weight and + balance data for one case + + + + + + + + + + + + + + + + + + + + + + + + weightAndBalanceFuelInTankType + + + + + + + + + + + + + + + + + + Ranges from 0 for empty tank to 1 + + + + + + + + + + + + + + weightAndBalanceFuelInTanksType + + + + + + + + + + + + + + + + + + + + + + weightAndBalanceFuelType + + + + + + + + + + + + + + + + + + + + + + + + + weightAndBalancePayloadType + + + + + + + + + + + + + + + + + + + + + + + + + + Weight and balance + + + WeightAndBalance type, containing weight and balance + datasets + + + + + + + + + + + + + + + + + + + + weightAndBalancemCargosType + + + For a higher ganularity it is possible to add more + information on the actual Cargo that are included in the + operational case. Please note that the information needs to be + identical with the massBreakdown. Hence, only links via uIDs can + be specified. + + + + + + + + + + + + + + + + + + + + + + weightAndBalancemPaxxType + + + For a higher ganularity it is possible to add more + information on the actual Pax that are included in the + operational case. Please note that the information needs to be + identical with the massBreakdown. Hence, only links via uIDs can + be specified. + + + + + + + + + + + + + + + + + + + + + + windowAssemblyPositionType + + + WindowAssembly type, containing an the position of a + windows assembly + + + + + + + + + + UID of the window element to be used + + + + + + x position of window elemment on global x axis + + + + + + z position of window elemment refernce point + + + + + + angle around global x axis to define window + position with respect to positionX and postionZ + + + + + + + + + + + + + + + windowsAssemblyType + + + WindowsAssembly type, containing an assembly of windows + + + + + + + + + + + + + + + + + + + + windowsType + + + Windows type, containing windows + + + + + + + + + + + + + + + + + + + + wingAeroPerformanceType + + + wingAeroPerformance type, containing perfomance maps + with aerodynamic data of a wing. + + + + + + + + + + Reference to the uID of the analysed wing + + + + + + References used for the calculation of the + force and moment coefficients of the wing (in the wing axis + system!) + + + + + Calculated aerodynamic performance maps of the + wing + + + + + + + + + + + + + wingAirfoilsType + + + WingAirfoils type, containing wing airfoil geometries. + See profileGeometryType for further documentation + + + + + + + + + + + + + + + + + + + Cell of the wing + + + + A cell defines a special region of the wing. Within + this region skin and stringer properties can be defined that + differer from the properties of the rest of the wing. In general + a cell is defined by defining four borders – the cell leading + and trailing edge and the inner border and the outer border. + Those borders can either be defined by using eta/xsi coordinates + or by referencing to spars and ribs. Mixed definitions (e.g. + forward border is defined due to a spar, side borders due to eta + coordinates) is allowed. In general a cell is quadrilateral. But + if e.g. the spar, which is used for the definition of the + trailing edge, has a kink, the cell can have more than four + corners. + The cell leading and trailing edge (= forward and rear + border) can either be defined by referencing to a spar + (->sparUID) or by the defining the xsi (=relative chord) + coordinates of the border (xsi1 = inner end; xsi2 = outer end). + + The cell inner and outer border can either be defined + by referencing to a rib (->ribDefinitionUID and ribNumber) or + by the defining the eta (=relative spanwise) coordinates of the + border (eta1 = forward end; eta2 = rear end). + Some examples for wing cells can be found in the + picture below: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cells of the wing. + + + WingCells type, containing all the cells of the wing. + + + + + + + + + + + + + + + + + + + + Structure of the wing + + + wingComponentSegmentStructure type, containing the + whole structue (skins, ribs, spars...) of the wing. + + + + + + + + + + + + + + + + + + + + + + + Element of the section. + + + + Within elements the airfoils of the wing are defined. + Each section can have one or more elements. Within each element + one airfoil have to be defined. If e.g. the wing should have a + step at this section, two elements can be defined for the two + airfoils. + Mathematically spoken a element is a coordinate system + that is translated, rotated and scaled relative to the section + coordinate system. This transformation parameters are defined + withing the transformation section. The wirfoil, which is linked + by using the parameter airfoilUID is directly 'copied' in the + element coordinate system. If e.g. the airfoil is defined from 0 + to 1 in x-direction and the total scaling of the elements x-axis + equals 3.5 the wing chord is 3.5 m long. + An example for wing element can be found in the + picture below: + + + + + + + + + + + + + + Name of the wing element. + + + + + Description of the wing element. + + + + + + Reference to a wing airfoil. + + + + + + + + + + + + + + + + Elements of the wing. + + + WingElements type, containing the elements of a wing + section. + + + + + + + + + + + + + + + + + + + Border of the fuel tank (either rib or spar). + + + + + + + + + + + + + + Spar uID of the bordering spar. + + + + + + + UID of the rib set of the bordering rib. + + + + + + RibNumber of the rib set of the bordering + rib. + + + + + + + + + + + + + + Definition of the geometry of the wing fuel tank by + defining a continouse list of borders. + + + + + + + + + + + + + + + + + + + + + + Definition of one wing fuel tank. + + + + + + + + + + + + + Name of the wing fuel tank. + + + + + + Description of the wing fuel tank. + + + + + + + + + + + + + + + + + Definition of different volumes of the fuel tank. + + + + + + + + + + + + + + Theoretical volume if material thicknesses + (ribs, spars, skins, stringers) and systems (fuel pumps, + pipes...) are neglected. + + + + + + + Usable fuel volume aircraft operations. + + + + + + Total real fuel tank volume. + + + + + + + + Factor between the usalbe fuel volume and + the real fuel volume. + + + + + Factor between the real fuel volume and the + theoretical optimum fuel volume. + + + + + + + + + + + + + + + List of wing fuel tanks. + + + + + + + + + + + + + + + + + + + + + + Definition of the wing-fuselage attachment + + + + Definition of the wing-fuselage attachment. The area + of the fuselage attachment (resp. center wing box, CWB) is + defined by defining one resp. two ribs from the rib definition. + If one rib is defined (rib1) the CWB goes from the closer end of + the componentSegment (e.g. wing symetry plane) to the defined + rib. If two ribs are defined (rib1 and rib2), the CWB is between + both ribs. + Additionally attachment pins can be defined. At those + positions the wing is attached to the fuselage. This can be e.g. + used for defining the wing-attachment of high wing + configurations, HTPs or VTPs. + + + + + + + + + + + Definition of first (=inner) rib of the + fuselage attachment. + + + + + Definition of the second (=outer) rib of the + fuselage attachment. Optional. Only to be used if attachment is + defined over two ribs. + + + + + Definition of position, orientation, materials + and blocked DOFs of attachment pins. + + + + + Definition of actuators (e.g. trim actuator of + an HTP) of the attachment. + + + + + + + + + + + + + Definition of the wing-fuselage attachment. + + + Definition of the wing-fuselage attachment + + + + + + + + + + + + + + + + + + + wingInterfaceDefinitionsType + + + CenterFuselage high wing interface definitions + + + + + + + + + + + + + + + + + + + + + + + + + centerFuselageMainFramesType + + + High wing main frame definition, containing mainframe + UIDs + + + + + + + + + + + + + + + + + + + + + wingInterfaceSupportStrutType + + + wingInterfaceSupportStrut type, containing support + strut definition + + + + + + + + + + Name of support strut. + + + + + Type description: lateral or longitudinal + support strut. + + + + + + + + + + + + + + + + + + wingInterfaceSupportStrutsAssemblyType + + + wingInterfaceSupportStrutsAssembly type, containing + support struts assembly + + + + + + + + + + + + + + + + + + + + Definition of the cell of the intermediateStructure + + + + + IntermediateStructure: + It defines the filling materials between the upper and + lower shell (e.g. honeycombe structures in a smeared + representation). IntermediateStructure is optional.The position + of the intermediateStructure is defined in so called cells (= + special areas on the wing). Default is no intermediateStructure. + + Material Definition of intermediateStructure: + + The material of the intermediateStructure is reference + by 'material'. The material orientation is defined by 'rotX' and + 'rotZ'. 'rotZ' is defined equivalent to the stringer angle resp. + the skin orthotropyDirection. 'rotX' equals a positive rotation + around the wings x-axis, while a rotation of zero is equivalent + to the wing middle plane. + A picture to clarify the reference direction of rotZ + (equivalent to orthothropy direction of the wing) can be found + in the picture below: + + + + Position definition by using cells: + A cell defines a special region of the wing. Within + this region the cell properties are defined. In general a cell + is defined by defining four borders – the cell leading and + trailing edge and the inner border and the outer border. Those + borders can either be defined by using eta/xsi coordinates or by + referencing to spars and ribs. Mixed definitions (e.g. forward + border is defined due to a spar, side borders due to eta + coordinates) is allowed. In general a cell is quadrilateral. But + if e.g. the spar, which is used for the definition of the + trailing edge, has a kink, the cell can have more than four + corners. + The cell leading and trailing edge (= forward and rear + border) can either be defined by referencing to a spar + (->sparUID) or by the defining the xsi (=relative chord) + coordinates of the border (xsi1 = inner end; xsi2 = outer end). + + The cell inner and outer border can either be defined + by referencing to a rib (->ribDefinitionUID and ribNumber) or + by the defining the eta (=relative spanwise) coordinates of the + border (eta1 = forward end; eta2 = rear end). + Some examples for wing cells can be found in the + picture below: + + + + + + + + + + + + + + + + + + Reference to the material of the intermediate + structure. + + + + + 'rotX' equals a positive rotation around the + wings x-axis, while a rotation of zero is equivalent to the wing + middle plane direction. + + + + + 'rotZ' is defined equivalent to the stringer + angle resp. the skin orthotropyDirection. + + + + + + + + + + + + + + IntermediateStructure cells + + + Definition of the intermediateStructure of the + componentSegment of the wing. + + + + + + + + + + + + + + + + + + + Definition of a ribCell + + + RibCells are optional elements. They are defined via a + fromRib and a toRib. The enumeration is within the ribSet. + RibNumber 1 starts at etaStart. + + + + + + + + + + Defines the beginning of the ribCell. The + enumeration is within the ribSet. + + + + + Defines the ending of the ribCell. The + enumeration is within the ribSet. + + + + + WING: The Rotation along the x describes a + rotation around a line, that is defined by the intersection of + the rib with the wing middle plane (orientated from leading to + trailing edge). This angle defaults to 90° which means, that the + rib is perpendicular on the wings middle plane. PYLON: The + Rotation along the z describes a rotation around the pylons + z-axis (= rotation in top view). This angle defaults to 90° + which means, that the rib is perpendicular to the pylons x-axis. + + + + + + The orthotropyDirection is defined as rotation + around the ribs z-axis. The rib coordinate system is defined as + follows: x-axis is from leading to trailingeEdge of the + componentSegment in the direction of the rib elongation. z-axis + is normal to the rib in the direction of positive eta. y is + defined by right hand rule. Rotation is around the z-axis. Zero + degrees are at the x-axis positive direction. + + + + + + + + + + + + + + + + + Cross section properties of a wing rib + + + wingRibCrossSectionType, containing the definition of + ribsCrossSection + + + + + + + + + + The orthotropyDirection is defined as rotation + around the ribs z-axis. The rib coordinate system is defined as + follows: x-axis is from leading to trailingeEdge of the + componentSegment in the direction of the rib elongation. z-axis + is normal to the rib in the direction of positive eta. y is + defined by right hand rule. Rotation is around the z-axis. Zero + degrees are at the x-axis positive direction. + + + + + + WING: The Rotation along the x describes a + rotation around a line, that is defined by the intersection of + the rib with the wing middle plane (orientated from leading to + trailing edge). This angle defaults to 90° which means, that the + rib is perpendicular on the wings middle plane. The rotation + angle is defined at the intersection point of the rib with the + ribReference line. The rib itself is allways straight and not + twisted. PYLON: The Rotation along the z describes a rotation + around the pylons z-axis (= rotation in top view). This angle + defaults to 90° which means, that the rib is perpendicular to + the pylons x-axis. + + + + + + + + Post element definition applied to all vertical intersections with spars + + + + + + + + + + + + + Explicit positioning of a wing rib + + + + Use this type for an explicit positioning of a rib. As opposed to + ribsPositioning, this defines a single rib connecting a specified start + and end point. + + + + + + + + + + + + + Defines the start of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the start of the rib defined by a point on a reference curve + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the beginning of the rib using a specific sparPosition. + + + + + + + + + Defines the end of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the end of the rib given by a point on a reference curve + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the end of the rib using a specific sparPosition. + + + + + + + + Defines the forward beginning of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + RibEnd defines the backward ending of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + + + + + + + + wingRibPointType + + + + The wingRibPointType is used to define reference points on ribs. + It can be used for rib set definitions (wingRibsPositioningType) as + well as explicit rib definitions (wingRibExplicitPositioningType). + + + + + + + + + + + + The UID of the rib definition. Can be a reference to nodes + of either wingRibsPositioningType or wingRibExplicitPositioningType. + + + + + + + For references of type wingRibsPositioningType this node indicates the rib number of the rib set. + If not given it defaults to 1. + + + + + + + Normalized xsi coordinate of the rib point which is measured along the rib + from the start point [0] towards the end point [1]. + + + + + + + + + + + + + + Definition of a set of ribs + + + + RibDefinitionType, containing the definition for ribs. + Ribs are defined in sets of one or more ribs. The positions of + the rib, as well as the orientation of the ribs are defined in + 'ribPositioing'. The cross section properties, as e.g. + materials, are defined in 'ribCrossSection'. + + + + + + + + + + + Name of the rib set + + + + + Description of the rib set + + + + + + + + + + + + + + + + + + + + Wing ribs + + + RibDefinitions type, containing the definition of all + ribs of the wing. + + + + + + + + + + + + + + + + + + + Positioning of a set of wing ribs + + + + The ribsPositioning type allows the definition of a set + of ribs which is distributed over a specified spanwise area. + The positions of the ribs are defined by placing the + ribs on a reference line on the wing (ribReference). The inner + and the outer beginning of the rib set is defined using etaStart + and etaEnd. The position of the forward and rear end of the ribs + is defined by ribStart and ribEnd. The orientation of the ribs + is defined in ribRotation. The number of ribs of the current rib + set is either defined by ribNumber or by spacing. + Three examples how ribs can be placed on the wing are + illustrated in the picture below. For more detailed information, + please refer to the description of each parameter. + + + + + + + + + + + + + + + + Defines the start of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the start of the rib by a point on a reference curve, + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the beginning of the rib using a specific sparPosition + + + + + + + + + Defines the end of the rib defined in eta-xsi coordinates of a reference plane + + + + + + + Defines the end of the rib defined by a point on a reference curve + such as a spar, but not an explicit sparPosition + + + + + + + Defines the location of the end of the rib using a specific sparPosition + + + + + + + + Defines the forward beginning of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + Defines the backward ending of the ribs. It can either be a + sparUID or "trailingEdge" or "leadingEdge". + + + + + + + + The spacing of the ribs defines the distance between two ribs, + measured on the + ribReferenceLine. First rib is placed at etaStart. + + + + + + + Defines the number of ribs in this ribSet. First rib is at + etaStart on the + referenceLine, last rib is at etaEnd. The spacing is constant on the + ribReferenceLine. + + + + + + + + The ribReference is the reference line for the computation of the rib set spacing. + It can either be a sparUID or "trailingEdge" or "leadingEdge" + + + + + + + + RibCrossingBehaviour can either be 'cross' or 'end'. If it is set to'end' the ribs + of this rib set will end at the intersection with another rib. + If it is set to + 'cross' the ribs of this rib set will continue at the intersection + with another rib. + + + + + + + + + + + + + + + + + + + + + + Section of the wing. + + + + WingSection type, containing a wing section. The + sections contains elements, where the airfoils are defined. For + the definition of a wing at least two sections (root and tip) + have to be defined, but any number greater than 2 is also + possible. + Mathematically spoken a section is a coordinate system + that is translated, rotated and scaled relative to the wing + coordinate system. This transformation parameters are defined + withing the transformation section. + In addition to the translation, which is defined in + the transformation part, the section can be translated by using + the positionings vectors (wing->positiongs). Translation of + the positionings vectors is added to the translation of the + section. + An example for wing sections can be found in the + picture below: + + + + + + + + + + + + + + Name of wing the wing section. + + + + + + Description of the wing section. + + + + + + + + + + + + + + + + + Sections of the wing. + + + WingSections type, containing all the sections of the + wing. + + + + + + + + + + + + + + + + + + + Segment of the wing. + + + + A segment defines which two wing elements (=cross + sections) are linked to one wing segment. + An example for wing segments can be found in the + picture below: + + + + + + + + + + + + + + Name of wing the wing segment. + + + + + + Description of the wing segment. + + + + + + Reference to the element from which the + segment shall start. + + + + + Reference to the element at which the segment + shall end. + + + + + Optional and additional guidecurves to shape + the outer geometry. + + + + + + + + + + + + + + Segments of the wing. + + + WingSegments type, containing all the segments of the + wing. + + + + + + + + + + + + + + + + + + + Shells of the wing + + + Within the wingShellType the upper and lower skin of a + and the skin stringers are defined. At 'skin' and 'stringer' the + skin and stringer properties of the complete componentSegment are + defined. If different skin or stringer properties should be + defined in a special region of the wing this can be done within + 'cells'. + If the stringer should not be defined explicite, they + can be defined implizite by defining an equivalent material layer + and using a composite as material. + + + + + + + + + + + + + + + + + + + + + + Material properties of the wing skin. + + + + The wingSkinType describes the material properties of + the wing. + For composites materials: the positive z-direction is + from the outer side to the inner side. + For composites materials: the reference axis for the + orthotropyDirection is defined by the two leading edge points of + the 'from'- and the 'to'-element of the componentSegment + definition. The angle between the reference axis and the + orthotropyDirection equals the rotation around the z-reference + axis. For details, please refer to the picture below: + + + + + + + + + + + + + + + Material properties of the wing skin. + + + + + + + + + + + + + + Wing spars + + + + Spars type, a spar is defined by sparSegments that + stretch between multiple sparPositions. The spar definition is + very flexible in CPACS. Spars can start and end at any position + of the wing, spars can have kinks at any position of the wing + and spars can cross each other or merge. + At first the spar points (->sparPositions) have to + be defined. Spar points are defined using the relative + coordinates eta and xsi. Spar points do lay on wing middle + plane. + Two or more spar points are connected to on spar + segment (->sparSegments). Each spar segment can be seen as + one spar. The spar geometry between two spar points is defined + as a direct/straight connection in global coordinate system + and not in eta xsi coordinates of the component segment. + One spar point can be used by more than one spar, if + e.g. two spars are merging. The detailed cross section of the + spar is also defined with sparSegments. + Pleas find below a picture for an example definition + of 3 spars in one wing, by using spar position points and spar + segments: + + + + + + + + + + + + + + + + + + + + + + + + Definition of the wing stringers. + + + + Within the wingStringerType wing stringers are + defined. The stringer are defined by referencing on the + stringerStructureUID, where the shape and material settings of + one single stringer is defined. In addition the orientaion and + the stringer pitch have to be defined: + One stringer intersects the point at the given xsi and + eta position. + + + + Alternatively, an exlicit stringer definition can be + applied if the stringers shall be tapered. + + + + + + + + + + + + + This is the simple and default stringer + definition + + + + The pitch describes the distance between to + adjacent stringers in the plane rectangular to the stringer + elongation direction. + + + + + + Stringer angle: the reference axis for the + stringer angle is defined by the two leading edge points of + the 'from'- and the 'to'-element of the componentSegment + definition. The angle between the reference axis and the + stringers equals the rotation around the z-reference axis. For + details, please refer to the picture below. + + + + + + If the reference of the stringer angle shall + be different from the default implementation then this + parameter may be set. Allowed values include: leadingEdge, + trailingEdge and globalY. Furthremore, it is possible to + provide the UID of a spar. + + + + + + This is the explicit stringer definition. + Please note that for a consistent definition two out of the + possible three elements innerBorder (xsiLE, xsiTE), outerBorder + (xsiLE, xsiTE) and stringer angle (and angle reference) must be + defined. Any combination of two of the three is valid + + + + + The number of stringers; default is 0 + + + + + + Stringer angle: the reference axis for the + stringer angle is defined by the two leading edge points of + the 'from'- and the 'to'-element of the componentSegment + definition. The angle between the reference axis and the + stringers equals the rotation around the z-reference axis. For + details, please refer to the picture below. + + + + + + If the reference of the stringer angle shall + be different from the default implementation then this + parameter may be set. Allowed values include: leadingEdge, + trailingEdge and globalY. Furthremore, it is possible to + provide the UID of a spar. + + + + + Inner border xsi coordinate at the leading + edge of the stringer definition + + + + + Outer border xsi coordinate at the leading + edge of the stringer definition + + + + + Inner border xsi coordinate at the trailing + edge of the stringer definition + + + + + Outer border xsi coordinate at the trailing + edge of the stringer definition + + + + + + + + + + + + + + + wingStructuralMountsType + + + + + + + + + + + + + + + + + + + + + + Wing type, containing all a lifting surface (wing, HTP, + VTP, canard...) of an aircraft model. + + + + Wing type, containing all a lifting surface (wing, + HTP, VTP, canard...) of an aircraft model. + Position of the wing: The position of the wing is + defined using the transformation parameters. Using those + parameters, the wing coordinate system is translated, rotated + and scaled. + Definition of the wings outer shape: The outer shape + of the wing is defined by airfoils that are placed within the 3D + space. Two airfoils are combined to one wing segment within the + segments. For the definition of the positions of the airfoils, + differnt sections are defined. Within each section one or more + elements are defined. The airfoil shape is defined within the + elements. If the wings outer shape should e.g. have a step it is + possible to define two different airfoils in one section by + using two elements. In most cases each section will only include + one element. Positionings are vectors that are used for an + additional translation of the sections by using 'user friendly + paramaters' as e.g. sweep and dihedral. Please note, the first + positioning may be non-zero. Often it will be zero just to + locate the wing at the position stated by the translation, but + this is not necessary. Finally the wing segments are defined by + combining two consecutive elements. A more detailed description + is given within the different parameters. + Definition of control surfaces, wing structures, wing + fuel tank and wing fuselage attachment: those parts are defined + within componentSegments. Please refer to the documentation + there. + + + + + + + + + + + + + + Name of the wing. + + + + + Description of the wing. + + + + + UID of part to which the wing is mounted (if + any). The parent of the wing can e.g. be the fuselage. In each + aircraft model, there is exactly one part without a parent part + (The root of the connection hierarchy). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The two elements that where the structural connection + is placed. + + + + + + + + + + + + + Element uID of the element of the CURRENT + componentSegment where the structural connection is placed. + + + + + + Element uID of the element of the second + componentSegment where the structural connection is placed. + + + + + + + + + + + + + + Two spars that are structurally connected. + + + + + + + + + + + + + Spar uID of the CURRENT componentSegment. + + + + + + Spar uID of the second componentSegment. + + + + + + + + + + + + + + wingWingAttachmentType + + + Definition of the structural connection between two + wings resp. two componentSegments. Note: All structural + connections between two wings/componetSegments have to be defined + using wingWingAttachments. The wingWingAttachment has only be + defined in one of the two componentSegments, that are connected. + + + + + + + + + + + UID of the componentSegment, that is connected + with the current one. + + + + + + + Defines if the upper shell of the current + componentSegment is structurally connected to the upper or lower + shell of the second componentSegment. Can have the values + 'upperShell' or 'lowerShell'. + + + + + Defines if the lower shell of the current + componentSegment is structurally connected to the upper or lower + shell of the second componentSegment. Can have the values + 'upperShell' or 'lowerShell'. + + + + + + + + + + + + + wingWingAttachmentsSparsType + + + + + + + + + + + + + + + + + + + + + + List of wingWingAttachments. + + + + + + + + + + + + + + + + + + + + + + wingsAeroPerformanceType + + + wingsAeroPerformance type, containing + wingsAeroPerformance + + + + + + + + + + + + + + + + + + + Wings + + + Wings type, containing all the lifting surfaces (wings, + HTPs, VTPs, canards...) of an aircraft model. + + + + + + + + + + + + + + + + + + + xsiIsoLineType + + + Iso line described by point of same xsi coordinate. + Can be either segment or component segment coordinates. + + + + + + + + + + Relative spanwise position. Xsi refers to the segment or componentSegment depending on the referenced uID. + + + + + This reference uID determines the reference coordinate system. + If it points to a segment, then the eta value is considered to be in segment + eta coordinate; if it points to a componentSegment, + then componentSegment eta coordinate is used. + + + + + + + + + + + + + zCouplingType + + + + + + + + + + + + + Reference to the control surface that is + connected to this controll surface by the z-coupling.. + + + + + + Material of the movable part of the + z-coupling. + + + + + Definition of the attachment of the z-coupling + to this control surface. + + + + + Definition of the attachment of the z-coupling + to the other control surface. + + + + + + + + + + + + + + zCouplingsType + + + + + + + + + + + + + Definiton of one z-coupling. + + + + + + + + + + + + + + damTolBehaviourType + + + + + + + + + + + + + Damage tolerance law, Walker approach + + + + + Damage tolerance law, Forman approach + + + + + + + + + + + + + fatigueStressBasedBrownMillerType + + + + + + + + + + + + + Parameter sigma_f [N/m^2] + + + + + Parameter b [-] + + + + + Parameter epsilon_f [-] + + + + + Parameter c [-] + + + + + + + + + + + + + damTolWalkerType + + + + + + + + + + + + + Fracture toughness KIc [Pa m^0.5] + + + + + Parameter C0 [m/cycle] + + + + + Parameter m [-] + + + + + Parameter gamma [-] + + + + + + + + + + + + + damTolFormanType + + + + + + + + + + + + + Parameter Kc [Pa m^0.5] + + + + + Parameter C2 [m/cycle] + + + + + Parameter m2 [-] + + + + + + + + + + + + + + + + + The compartment defines an enclosed volume within the fuselage. It is defined by a set of border geometries. This could be pressureBulkheads, walls or floors and they are referred by their uIDs. The volume is closed with the fuselage skin. The geometry tool has to check, if the compartment definition gives a closed geometry. + + + + + + + + + + + The compartment defines an enclosed volume in the + fuselage. It is defined by a set of border geometries. + This could be pressureBulkheads, walls or floors and + they are referenced by their uIDs. The volume is closed + with the fuselage skin. The geometry tool has to check, + if the compartment definition gives a closed geometry. + + + + + + + + + Compartment geometry uIDs list. + + + + + + + Name of the compartment. + + + + + + + Description of the compartment. + + + + + + + Ideal design volume of the compartment. + + + + + + + + + + + + + + + + + + + + + + + UIDs of 2d structural fuselage elements + (e.g., pressure bulkheads, walls or + floors). The compartment will be + enclosed with the fuselage skin + + + + + + + + + + + + + + fatigueBehaviourType + + + + + + + + + + + + + Fatigue law, stress based Brown Miller approach [N/m^2] + + + + + + + + + + + + + plasticityCurvesType + + + + + + + Plastification curve incl. element elimination (isotropic + materials). The data may be used to describe the plastic behavior of isotropic + materials in non-linear analysis, such as crash simulations. The input is defined + according to the needs of Material 103 (single stress strain option) in the + PAM-CRASH explicit Finite Element code, but can also be used for equivalent material + laws in alternative simulation environment (see PAM-CRASH Solver Reference Manual., + Material 103). + + + + + + + + + + + + + + + + This type describes the plasticity curve of isotropic + materials + + + + ... + + Plastification curve incl. element elimination + (isotropic materials) + + Plastification curve incl. element elimination (isotropic + materials) The data may be used to describe the plastic behavior of + isotropic materials in non-linear analysis, such as crash + simulations. The input is defined according to the needs of Material + 103 (single stress strain option) in the PAM-CRASH explicit Finite + Element code, but can also be used for equivalent material laws in + alternative simulation environment (see PAM-CRASH Solver Reference + Manual., Material 103) + Source: PAM-CRASH V2010 - Notes Manual + + + + + + + + + + + + Name of the post failure definition + + + + + + + Description of the post failure + definition + + + + + + + Strain rate for following plastcity + curve [1/s] + + + + + + + + + + plasticEliminationStrain [-]; Plastic + strain for element elimination during + the non-linear analysis + + + + + + + + + + + + + + + + Definition of wall positions to place + walls inside fuselage. + + + + + + + List of wall segments. + + + + + + + + + + + + Definition of wall positions to place walls inside fuselage. + + + + + + + Wall position definition specifying a point in the fuselage to be connected to a wall segment. + + + + + + + + + + + + + + Wall segment definition. + + + + + + + + + + Definition of a wall position to place walls inside fuselage. + + + + + + + UID of a bulkhead determining the + x-coordinate of the position with the given + y- and z-coordinates. + + + + + + + UID of a wall segment determining the + x-coordinate of the position with the given + y- and z-coordinates. + + + + + + + DEPRECATED: use sectionUID instead. + UID of a fuselage section determining the + x-coordinate of the position with the given + y- and z-coordinates. + + + + + + + UID of a section determining the + x-coordinate of the position with + the given y- and z-coordinates. + + + + + + Absolute x-coordinate of wall position in fuselage coordinate system. + + + + + + Absolute y-coordinate of wall position in fuselage coordinate system. + + + + + Absolute z-coordinate of wall position in fuselage coordinate system. + + + + + + + + + + + + Defines extrusion direction. Rotation angle + around fuselage x-axis of extrusion direction. A + value of 0deg means fuselage z-axis as extrusion + direction. Default: 0.0deg. + + + + + + + + + + + + + + By default, the wall is only extruded in positive direction. If doubleSidedExtrusion is true, the wall is additionaly extruded in negative direction as well. Default: false. + + + + + Rotates the first edge of the wall segment so that it is adjacent with the structural element defined in the first wall position (bulkhead, fuselage section or another plane wall). Default: false. + + + + + Rotates the last edge of the wall segment so that it is adjacent with the structural element defined in the last wall position (bulkhead, fuselage section or another plane wall). Default: false. + + + + + + A list of uIDs referencing other + structural/geometric elements that shall serve + as a boundary of the wall element. Possible + references are floor, wall or + genericGeometryComponent. A major requirement is + that the referenced element has an intersection + with the wall for at least the distance between + two wall positions. So that a full geometric + face of the wall is bounded by it. Neighbouring + wall faces that are not completely bounded by + the reference element are not affected. + + + + + + + Reference to the structural property definition + of this wall segment. + + + + + + + List of wall position uIDs that are used for + this wall segment. At least two positions must + be defined (for start and end position of wall). + If more than two positions are referenced here, + the wall is constructed out of several planar + faces that connect two consecutive positions + (Note: Order of position uIDs defines + connectivity). + + + + + + + + + + + A list of uIDs referencing other structural/geometric + elements that shall serve as a boundary of the wall + element. Possible references are floor, wall or + genericGeometryComponent. A major requirement is that + the referenced element has an intersection with the wall + for at least the distance between two wall positions. So + that a full geometric face of the wall is bounded by it. + Neighbouring wall faces that are not completely bounded + by the reference element are not affected. + + + + + + + + + UID referencing another + structural/geometric element that shall + serve as a boundary of the wall element. + Possible references are floor, wall or + genericGeometryComponent. + + + + + + + + + + + + + + + Structural wall reinforcement definition specifying physical properties of a fuselage wall segment. + + + + + + + + + + + + + + Reference to a sheet element definition specifying the physical properties of the wall's shell. + + + + + Reinforcements running along the position polygon of the wall positions. + + + + + Reinforcements running in lateral/radial direction in the wall segment plane. + + + + + Reinforcement at inner side of wall. This is either, depending on the extrusion direction flag, the edge of the wall that connects the positions ("positiveDirection") or the edge of the wall where the wall intersects with the fuselage skin in the opposite direction of the extrusion direction. + + + + + + Reinforcement at outer side of wall. The outer side of the wall is defined as the edge of the wall at the intersection of the wall with the fuselage skin running along the main direction of the wall. + + + + + + + Lateral caps are the reinforcements of + the wall at the edges lateral to the + main direction of the wall. These caps + can be either defined at start, end, + start and end or at all wall positions + according to the placement flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reference to wall position uID. + + + + + + + + + + + + nacelleCowlType + + + + Describes the cowl geometry for nacelles + using sections positioned around the + rotational center of the engine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nacelleCenterCowlType + + + + Describes the curve for defining rotational center of the engine. + + + + + + + + + + + + + + + + + + + + + + Aerodynamic performance + + + + The aerodynamic coefficients and derivatives are stored in aerodynamic maps. Individual maps can be used to + gather the aerodynamic characteristics for specific boundary conditions. + + + + + + + + + + + + + + + + + + + + + Aerodynamic map + + + + + The aeroMap contains aerodynamic coefficients and derivatives for a specific set of aerodynamic + and configurative boundary conditions. + + The aeroMap allows for the simultaneous specification of multiple + controlDevice settings. + In this case, it is assumed that a cumulative setting is built by summing up the individual settings. The correct + sequence of this summation is described in the controlDistributorType documentation. + + + + + + + + + + + + Name + + + + + Description + + + + + + + + + + + + + + + + + + + + Boundary conditions + + + Specification of boundary conditions. + + + + + + + + + + + + + + Offset from temperature of the + atmospheric model [K]. For more details + on atmospheric models, please refer to + documentation of the <CPACS> root + element. + + + + + + + Configuration settings + + + + + + + + + + + + + + Control elements + + + Specification of control element settings. Control elements can be controlDistributors + or individual control devices, such as control surfaces or landing gears. + + + + + + + + + + + + + + + + + + + + Control element + + + Specification of an control element setting. A control element can be a controlDistributor + or an individual control device, such as a control surface or a landing gear. + + + + + + + + + + + Reference to the uID of a control device, e.g. a control surface or a landing gear + + + + + Control parameter of the control device + + + + + + + Reference to a control distributor uID + + + + + Value of the command parameter of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + + + + + + + + Aerodynamic coefficients and derivatives + + + + + Description + + The aeroPerformanceMap contains a map + with aerodynamic data of the complete aircraft in the form of + nondimensional coefficients. The force coefficients in + i-direction (ci) + are nondimensionalized by dynamic pressure and reference area, + the moment coefficients (cmi) by dynamic pressure, reference + area and reference length. + + All coefficients in the aeroPerformanceMap relate to + the aerodynamic coordinate system which is deducted from the CPACS coordinate system by + the transformations of angle of attack and angle of yaw. See the documentation of the + CPACS element for further details. + + The dependend parameters of the aeroPerformanceMap are altitude, + machNumber, angleOfSideslip and + angleOfAttack. These elements are vectors of equal length, where values + with identical indices belong together. The solution vectors ci and + cmi have the same length as the input vectors. Shown below is an example where + with 10 values per vector: + + <altitude mapType="vector">12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02;12e+02</altitude> +<machNumber mapType="vector">0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2</machNumber> +<angleOfSideslip mapType="vector">0;0;0;0;0;2;2;2;2;2</angleOfSideslip> +<angleOfAttack mapType="vector">-2;0;2;4;6;-2;0;2;4;6</angleOfAttack> +<cd mapType="vector">0.056;0.094;0.132;0.17;0.208;0.072;0.11;0.148;0.186;0.224</cd> +<cs mapType="vector">0.;0.;0.;0.;0.;0.01;0.015;0.02;0.025;0.03</cs> +<cl mapType="vector">-0.1;0.04;0.18;0.32;0.46;-0.08;0.03;0.14;0.25;0.36</cl> + + The aerodynamic coefficients for altitude=1200m, machNumber=0.2, + angleOfSideslip=0° and angleOfAttack=6° can be found at the 5th index: + cd=0.208, cs=0 and cl=0.46. + + + + + + + + + + + + + + + Altitude [m] + + + + + + + Mach number + + + + + + + Sideslip angle [deg] + + + + + + + Angle of attack [deg] + + + + + + + Drag coefficient in aerodynamic + coordinates + + + + + + + Coefficient of the side force vector in + aerodynamic coordinates (perpendicular + to lift and drag) + + + + + + + Lift coefficient in aerodynamic + coordinates + + + + + + + + + + + + + + + + + + + Increment maps for aerodynamic coefficients + + + + + + + + + + + + + + + + + + + Increment map from aerodynamic coefficients + + + The increment map is composed of two-dimensional arrays. The first dimension is given by the + length of the input vectors of the baseline aeroPerformanceMap and the second dimension by the vector of relative + deflections (or command inputs) of control surfaces (or control distributors). An example is described in the <CPACS> + root element. + + + + + + + + + + + + Reference to the uID of a control device, e.g. a control surface or a landing gear + + + + + Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + Reference to a control distributor uID + + + + + Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + Increment of drag coefficient in aerodynamic coordinates + + + + + Increment of coefficient of the side force vector in aerodynamic coordinates (perpendicular to lift and drag) + + + + + Increment of lift coefficient in aerodynamic coordinates + + + + + Increment of cmd + + + + + Increment of cms + + + + + Increment of cml + + + + + + + + + + + + + + Aerodynamic limitations + + + + This map explicitly specifies limitations of a vehicle in terms of angles of attack and sideslip angles. + All vectors, i.e. altitude, machNumber, + angleOfSideslip and angleOfAttack, must have the + same length. To avoid redundancy with the aeroPerformanceMap, this type does not contain + any aerodynamic coefficients. + Since angleOfSideslip and angleOfAttack + are closely interdependent for a given machNumber and altitude + combination, a positive and negative maximum angleOfAttack is defined for a given combination of + machNumber, altitude and + angleOfSideslip. The limits of angleOfSideslip + can be determined by evaluating the nominal decrease of angleOfAttack values or by + agreeint with the data supplier that the minimum and maximum value of the angleOfSideslip + vector corresponds with physical limits. + In order to avoid data redundancy, the operational limits should not reflect the extrema of aerodynamic + coefficients as these can be extracted from the performanceMap via interpolation. + Note: In future CPACS versions, a revision of the aeroLimitsMap + will be targeted, since operational limits are not a purely aerodynamic issue. + + + + + + + + + + + + Altitude [m] + + + + + + + Mach number + + + + + + + Angle of sideslip + + + + + + + + + + + + + + + + Increment maps for limitation values due to movable device deflections + + + Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control + surfaces or landing gears). + + + + + + + + + + + + + + + + + + + Increment maps for limitation values due to movable device deflections + + + Specification of aerodynamic coefficient increments due to movable device deflections (e.g., control + surfaces or landing gears). + + + + + + + + + + + + Reference to the uID of a control device, e.g. a control surface or a landing gear + + + + + Value of the command parameters of a control distributor. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + + Reference to a control distributor uID + + + + + Command inputs of a control distributor given as vector. If not given explicitly in the control distributor, linear interpolation between the neighboring points is required. + + + + + + Reference to an increment map of the aeroPerformanceMap + + + + + + Increments of the vehicle operation limits + + + + + + + + + + + + + + Damping derivatives for positive and negative rotation rates + + + + + 0. General overview + + This type contains the damping derivatives. They are + split up into those derivatives for positive rotation rates, + and those for negative rotation rates. + + + + 1. <positiveRates> (optional) + + Damping derivatives, calculated by positive rotation + rates. + + + + 2. <negativeRates> (optional) + + Damping derivatives, calculated by negative rotation + rates. + + + + + + + + + + + + + + + + + + + + + + + Damping derivatives + + + This type contains aerodynamic performance maps with + the damping derivatives. The derivatives are calculated using + rotational rates [rad/s], normalized by: + Rate*ReferenceLength/flow speed. The rotations are performed + around the global axis directions with the aircraft model's + global reference point as origin. The damping derivative + performance maps are vectors of the same length as the input + vectors of the baseline aerodynamic performance maps, consisting of + semicolon separated values. + + + + + + + + + + + Change of cd by normalized roll rate + + + + + Change of cd by normalized pitch rate + + + + + Change of cd by normalized yaw rate + + + + + Change of cs by normalized roll rate + + + + + Change of cs by normalized pitch rate + + + + + Change of cs by normalized yaw rate + + + + + Change of cl by normalized roll rate + + + + + Change of cl by normalized pitch rate + + + + + Change of cl by normalized yaw rate + + + + + Change of cmd by normalized roll rate + + + + + Change of cmd by normalized pitch rate + + + + + Change of cmd by normalized yaw rate + + + + + Change of cms by normalized roll rate + + + + + Change of cms by normalized pitch rate + + + + + Change of cms by normalized yaw rate + + + + + Change of cml by normalized roll rate + + + + + Change of cml by normalized pitch rate + + + + + Change of cml by normalized yaw rate + + + + + + + + + + + + + Vehicle operation limit + + + Vehicle operation limit defined by sets of minimum and maximum angleOfSideslip + and minimum and maximum angleOfAttack for a given altitude and Mach number. + This might be, e.g., a safety margin to the angle of attack at maximum lift or the flight + attitude a fighter aircraft is capable to fly in stalled conditions. The corresponding aerodynamic coefficients must + be extracted from the aeroPerformanceMap. + + + + + + + + + + Minimum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] + + + + + Maximum angle of attack defining the operation limit. Must be a vector of the same length as angleOfSideslip, machNumber and altitude. [deg] + + + + + + + + + + + + + Operation Limit Increments + + + Changes of the deltas of operation limit angles with respect to the corresponding increment aeroPerformanceMaps. + Values are specified as an array with same indices like the corresponding increment map. + + + + + + + + + + Minimum delta angle of attack [deg] + + + + + Maximum delta angle of attack [deg] + + + + + + + + + + + + + Toolspecific data + + + + This type contains a list of tools each specifying some basic tool information as well as the actual toolspecific part. + + The toolspecific elements must be defined in a separate namespace which can be specified and linked with the corresponding XSD file + in the CPACS header: + <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd" + xsi:schemaLocation="http://www.cpacs.de/myTool pathToToolspecificSchemaFile/toolspecific_myTool.xsd"> + + A simple example could look like this: + <toolspecific> + <tool> + <name>myToolName</name> + <version>1.2.3</version> + <myTool xmlns="http://www.cpacs.de/myTool" schemaVersion="1.0"> + <parentElement> + <childElement1>stringValue</childElement1> + <childElement2>1.0</childElement2> + </parentElement> + </myTool> + </tool> +</toolspecific> + + + + + + + + + + + + + + + + + + + + Tool identification + + + + Tool information as described in the toolspecificType. + + + + + + + + + + + + Name of the tool + + + + + + + Version of the tool + + + + + + + Wildcard for the root element of a toolspecific namespace + + + + + + + + + + + + + + Global analysis information + + + + + + + + + + + + + + + + + + + + + + + Load application points + + + + Multiple sets of scattered load application points can be defined. However, no specific information about the corresponding loads (e.g. whether aerodynamic or structural loads are involved) or mesh topologies are specified here, as such assumptions are tool-specific. + + + + + + + + + + + + + + + + + + + + + Load application point set + + + + + A point set contains discrete spatial points at which loads are applied (e.g., aerodynamic or structural loads). A typical procedure in CPACS is as follows: + + + + Reference a wing, fuselage or control surface by its uID using the componentUID node. + Define a reference axis through the above component with the loadReferenceLine element to specify where a load distribution shall be applied. + Compute the intersections with (e.g.) ribs of the referenced component (wing, fuselage or control surface) and write the results into loadApplicationPoints. This procedure results from common practice where the forces in structural analyses are typically introduced at structural elements such as ribs and spars. With respect to preliminary aircraft design a two-dimensional load distribution is preferred. However, an arbitrary distribution of the load application points is possible (without the intersection of structural elements with a reference axis in the previous step), for example to define discrete load distributions on the wing surface in streamwise and spanwise direction. + Specify the location and orientation of cut loads in the cutLoadIntegrationPoints element and the corresponding connectivity information in the connectivities node. + + + + + + + + + + + + + + + + + UID of a wing, fuselage or control surface + + + + + + + Reference axis (line) for load distribution + + + + + + + List of points at which load vectors are + applied to + + + + + + + List of points at which cut loads are applied to + + + + + + + Specification of connectivity properties between points + + + + + + + + + + + + + + + Vehicle configurations + + + + List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) + + + + + + + + + + + + + + + + + + + + + Vehicle configurations + + + + List of vehicle configurations (e.g., setting of control surfaces, landing gear, etc.) + + + + + + + + + + + + Name + + + + + + + Description + + + + + + + + + Deck configurations + + + + + + + + + + + + + + + Internal pressure of a deck + + + + + + + + + + + Internal pressure of a fuselage, deck or compartment + + + + + + + + + + + + + + Cabin pressure + + + + Internal pressure of a fuselage, deck or compartment + + + + + + + + + + + + UID of a fuselage, deck or compartment + + + + + + + Internal pressure [Pa] + + + + + + + + + + + + + + Load set + + + A set of forces and moments + + + + + + + + + + + Description + + + + + + + UID of load application point set (analysis/global/loadApplicationPoints) + + + + + + + Force in x-direction [N] + + + + + + + Force in y-direction [N] + + + + + + + Force in z-direction [N] + + + + + + + Moment around x-axis [Nm] + + + + + + + Moment around y-axis [Nm] + + + + + + + Moment around z-axis [Nm] + + + + + + + Nodal displacement in x-direction [m] + + + + + + + Nodal displacement in y-direction [m] + + + + + + + Nodal displacement in z-direction [m] + + + + + + + Nodal rotation around x-axis [deg] + + + + + + + Nodal rotation around y-axis [deg] + + + + + + + Nodal rotation around z-axis [deg] + + + + + + + Load brake-down + + + + + + + + + + + + + + + Load sets + + + + A list of load sets + + + + + + + + + + + + + + + + + + + + + Aerodynamic load cases + + + + Combines a set of aerodynamic load cases + + + + + + + + + + + + + + + + + + + + Aerodynamic load case + + + + Specification of an aerodynamic load case + + + + + + + + + + + + Name + + + + + + + Description + + + + + + + + + + + + + + + + + + Specification + + + + Specification of the vehicle properties and dynamics + + + + + + + + + + + Altitude + + + + + + + Mach number + + + + + + + Angle of sideslip [deg] + + + + + + + + Angle of attack [deg] + + + + + + + Target lift coefficient + + + + + + + + Normalized roll rate [rad/sec]. It is specified around the global x-axis + with the aircraft model's global reference point as origin and + nondimensionalized by: pStar = p * reference length / flow speed. + + + + + + + Normalized pitch rate [rad/sec]. It is specified around the global y-axis + with the aircraft model's global reference point as origin and + nondimensionalized by: qStar = q * reference length / flow speed. + + + + + + + Normalized yaw rate [rad/sec]. It is specified around the global z-axis + with the aircraft model's global reference point as origin and + nondimensionalized by: rStar = r * reference length / flow speed. + + + + + + + + Reference to a weight and balance description + + + + + + + + + + + + Aerodynamic loads + + + + Description of the aerodynamic loads + + + + + + + + + + + + Angle of attack [deg] + + + + + + + Angle of sideslip [deg] + + + + + + + + + + + + + + + + Aerodynamic loads of components + + + + Specification of the aerodynamic loads of components + + + + + + + + + + + + + + + + + + + + Aerodynamic data of components + + + + Aerodynamic data of individual components of the aircraft (e.g. control surface loads and hinge moments) + + + + + + + + + + + + Reference to a component uID + + + + + + + + + + + + + + + Aerodynamic loads of the vehicle + + + + Description of the aerodynamic loads of the vehicle + + + + + + + + + + + + + + + + + + + + + Aerodynamic coefficients + + + + A set of aerodynamic coefficients in the aerodynamic coordinate system + + + + + + + + + + + + Drag coefficient in aerodynamic + coordinates + + + + + + + Coefficient of the side force vector in + aerodynamic coordinates (perpendicular + to lift and drag) + + + + + + + Lift coefficient in aerodynamic + coordinates + + + + + + + Aerodynamic moment around d-axis of the aerodynamic coordinate system + + + + + + + Aerodynamic moment around s-axis of the aerodynamic coordinate system + + + + + + + Aerodynamic moment around l-axis of the aerodynamic coordinate system + + + + + + + + + + + + + + + Drag contributions + + + + The drag contributions relate to different physical mechanisms. The sum of the contributions does not have to be equal to the total drag. + + + + + + + + + + + + Drag contributions due to the displacement of the flow around a component. Zero for irrotational two-dimensional flows. + + + + + + + Drag contributions due to shear forces on surfaces + + + + + + + Drag contributions due to friction + + + + + + + Drag contributions due to energy loss through vortex structures caused by the pressure difference between the upper and lower sides of three-dimensional lifting surfaces. + + + + + + + Drag contributions due to mixing of streamlines between airframe components (e.g., interaction between wing and fuselage or pylon and wing). + + + + + + + Drag contributions due to energy dissipation in shock waves + + + + + + + Drag contributions due to trimmed aircraft configuration + + + + + + + + + + + + + + Aerodynamic coefficients breakdown + + + + + Breakdown of the total aerodynamic coefficients into contributions + from the various vehicle componenents. A detailed breakdown is only specified + for the wing. Other components, such as the fuselage, are more generically + referred to as otherComponents. Since + the sum of the contributions within a breakdown must equal the total + coefficients, the remaining contributions must be listed in + remainingContributions. + + + The remainingContributions cannot be defined alone. Either the + definition of a wing, otherComponents + or both together is valid and can be combined with remainingContributions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of the wings + + + + Contains a list of wings for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a wing + + + + + Describes the contributions of a specific wing to the total aerodynamic coefficients of a vehicle + + + It is obligatory to reference a wing via its uID and to provide its + coefficients. The breakdown of the coefficients comprises the segments + and remainingContributions. The latter must only be specified if segments + is given. + + + + + + + + + + + + + Reference to a wing uID + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of wing segments + + + + Contains a list of wing segments for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a wing segment + + + + + Describes the contributions of a specific wing segment to the total aerodynamic coefficients of a wing + + + It is obligatory to reference a segment via its uID and to provide its + coefficients. The breakdown of the coefficients comprises the strips + and remainingContributions. The latter must only be specified if strips + is given. + + + + + + + + + + + + + Reference to a wing segment uID + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of strips within a wing segment + + + + Contains a list of strips within a wing segment for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a strip within a wing segment + + + + + Describes the contributions of a specific strip within a wing segment to the total aerodynamic coefficients of a wing segment + + + The strip extends spatially between two eta coordinates (i.e., from an inner border to an outer border). + In order to avoid redundancy, the inner border (denoted as from) is always identical to the outer border of the previous strip (denoted by to). + Accordingly, only the to-border can be specified explicitly, while the from-border equals implicitly either to 0 + (for the first strip) or the toSegmentEta value of the previous element. The toSegmentEta of the last strip + must be equal to 1! + + + It is obligatory to provide the coefficients of the strip. The breakdown comprises the chordwiseParts + and remainingContributions. The latter must only be specified if the breakdown into chordwiseParts + is given. This breakdown is optional. If it is specified, but the sum of all chordwiseParts does not match the strip coefficients, one or more remainingContributions may be applied + to ensure consistency (sum of all chordwiseParts + sum of all remainingContributions must be equal to total strip coefficients). + + + + + + + + + + + + + Spanwise coordinate eta in the segment coordinate system to define the end of the strip + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a chrordwise part within a wing segment strip + + + + Contains a list of chordwise parts within a wing segment strip for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a chordwise part within a within a wing segment strip + + + + + Describes the contributions of a specific par within a wing segment to the total aerodynamic coefficients of a wing segment strip + + + A chordwisePart aescribes the contributions of a specific chordwise part within a wing strip + to the total aerodynamic coefficients of this strip. It extends spatially between the two eta + positions of the parent strip (see strip documentation) and four xsi positions in the segment coordinate system. + As with the parent stips, only the trailing border (..ToSegmentXsi) of a chordwisePart is defined, while the leading border always equals the trailing border of the preceding chordwisePart (or 0 for the first part). + To account for oblique trailing borders (e.g., to match the aileron on a tapered wing) two different toSegmentXsi positions can be defined, one at the inner border (innerBorderToSegmentXsi) and one at the outer border (innerBorderToSegmentXsi) of the parent strip. + The innerBorderToSegmentXsi and outerBorderToSegmentXsi of the last chordwisePart must be equal to 1. + + + + + + + + + + + + + Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the inner eta border + + + + + + + Chordwise coordinate xsi in the segment coordinate system to define the end position of the chordwisePart at the outer eta border + + + + + + + + + + + + + + + + Remaining contributions to aerodynamic coefficients + + + + This node lists the remaining contributions which were not specified so that the sum of the coefficients are equal to the total coefficients. + + + + + + + + + + + + + + + + + + + + Remaining contribution to aerodynamic coefficients + + + + This node lists a remaining contribution which was not specified so that the sum of the coefficients are equal to the total coefficients. + + + + + + + + + + + + Name + + + + + + + Description + + + + + + Type (numerical/unspecified): "numerical", for example, describes rounding errors to clearly + separate them from other effects currently labeld as "unspecified". + The latter usually summarizes physical effects such as viscosity and should be further described via "description". + The approach is currently being tested in practice in order to derive a robust definition of categories in the future. + + + + + + + + + + + + + + + + + + + + + + + + Reference values for aerodynamic coefficients + + + + Specification of reference values for aerodynamic coefficients. + + + + + + + + + + + + Reference area + + + + + + + Reference lengt + + + + + + + Reference point + + + + + + + Reference translation + + + + + + + Reference rotation + + + + + + + + + + + + + + Aerodynamic contributions of the components + + + + Contains a list of components for which aerodynamic coefficients are specified + + + + + + + + + + + + + + + + + + + + Aerodynamic contributions of a component + + + + Describes the contributions of a specific component to the total aerodynamic coefficients + + + + + + + + + + + + Reference to a component + + + + + + + + + + + + + + + Atmospheric model + + + Available options: ISA. See documentation of <CPACS> root element for further details. + + + + + + + + + + + + + + + + + + Flight Envelopes + + + + Specification of flight envelopes + + + + + + + + + + + + + + + + + + + + + Flight Envelope + + + + Specification of a flight envelope + + + + + + + + + + + + Offset from temperature of the atmospheric model [K] + + + + + + + + + + + + + + + Flight envelope speed + + + + Specification of the V-speed + + + + + + + + + + + + + Vector with altitudes + + + + + + + Vector with True Airspeeds + + + + + + + + + + + + + + Speed designators + + + + Provides an enumerated list of V-speeds as defined by regulations. + + + + + + + + + + + Design maneuvering speed + + + + + + + Design speed for maximum gust intensity + + + + + + + Design cruise speed, used to show compliance with gust intensity loading + + + + + + + Design diving speed, the highest speed planned to be achieved in testing + + + + + + + Designed flap speed + + + + + + + Stall speed or minimum steady flight speed for which the aircraft is still controllable + + + + + + + Stall speed or minimum flight speed in landing configuration + + + + + + + Stall speed or minimum steady flight speed for which the aircraft is still controllable in a specific configuration + + + + + + + Minimum control speed + + + + + + + Never exceed speed + + + + + + + Maximum operating limit speed + + + + + + + + + + + + + Landing gear base + + + + Base type for landing gears (i.e. nose gear, main gear and skid gear). + An example of a nose and main gear is shown below: + + + + + + + + + + + + + + Name + + + + + Description + + + + + UID of the parent component. If set, the position of the main strut is defined relative to the parent coordinate system. + + + + + + + + + Total length of landing gear, equals the distance from the middle of the bogie/axles to the axis of rotation of the pintle strut. Distance is measured while landing gear is fully extended and in airborne condition (i.e., if a spring is present, the totalLength includes the springDeflectionLength) + + + + + Static suspension travel means the positive distance between the total length in airborne condition and the reduced length due to compression on the ground. + + + + + Compressed suspension travel means the positive distance between the total length in airborne condition and the maximum reduced length due to maximum compression on the ground (e.g., landing shock). + + + + + + + Transformation with respect to the uppermost point of the main strut. From this point the landing gear is oriented in negative z-direction by default. + + + + + + + + + + + + + + + + + + + + + + + + + Landing gear control parameters + + + + Parameters of a landing gear control such as extraction or steering. + + + + + + + + + + + + Retraction angle of the main landing + gear. Equals a rotation around the + global z-axis in degrees. 0 = retraction + to the front; 90 = retraction to the + left; 180 = retraction to the rear; 270 + = retraction to the right. + + + + + + + + Distance of the center of rotation to the top of the main strut + for retracting and extending the landing gear. I.e., a value of + 0 means that the landing gear will rotate around the upper end + of the main strut during retraction. If this value is greater + than 0, the center of rotation is shifted by this value above + the main strut end point (translation along the main strut axis). + + + + + + + + + + + + + + Landing gear control functions + + + + + A list of functions which can be addressed by the controlDistributor. + + + + + + + + + + Extension path + + + + + Steering path + + + + + Braking state + + + + + + + + + + + Braking function + + + + + Describes the braking state of the landing gear. + + + + + + + + + + Control parameter indicating that the brake is set + + + + + Control parameter indicating that the brake is released + + + + + + + + + + + + Steering path + + + + + Describes the steering path of the landing gears via a list of steps. + + + + + + + + + + Step within the steering path + + + + + + + + + + + + Steering step + + + + + Describes a step with the steering path of the landing gear. + + + + + + + + + + Step type (centered, fullBackboard or fullStarboard) + + + + + + + + + + + + Control parameter + + + + + Steering angle [deg] + + + + + + + + + + + Extension path + + + + + Describes the extension path of the landing gears via a list of steps. + + + + + + + + + + Step within the extension path + + + + + + + + + + + + Extension step + + + + + Describes a step with the extension path of the landing gear. Make sure to provide a least one step with stepType=extracted! + + + + + + + + + + Step type (retracted or extracted) + + + + + + + + + + + + Control parameter + + + + + Extension angle of the main strut [deg] + + + + + + + + + + + Assembly of landing gear components + + + + + Describes an assembly of the various landing gear components + + + + + + + + + + + + Main strut + + + + + + + + + + Drag strut (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) + + + + + + + + + + + Pintle strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) + + + + + Pintle strut (one or two pintle struts are supported) + + + + + + + + Side strut(s) (Assumption: one end of the strut will connect to the main strut and the other end will be given as endPoint) + + + + + + + + + + + + Strut assembly + + + Geometric description, spatial placement and specification of material parameters + + + + + + + + + + Strut properties + + + + + The starting point of the support strut must connect to the main strut. This element specifies the relative position on the main strut (0 -> top end, 1 -> bottom end). + + + + + + + + + + + + End position in absolute coordinates. Coordinates are relative to parent if it has a parentUID reference (otherwise global). + + + + + End position in eta/xsi/relHeight coordinates + + + + + End position as a relative position on another strut of this landing gear + + + + + + Attachment to an aircraft wing or fuselage component + + + + + Reference to an actuator uID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Strut properties + + + + + Geometric description and material properties + of a strut + + + + + + + + + + + + + (Outer) radius of the strut + + + + + + Material of the strut + + + + + Inner radius of the strut + + + + + + + + Reference to structural element for a more + detailed cross section definition + + + + + + + + + + + + + + + + Definition of the wing attachment + + + + + Definition of the wing attachment, if + attached to the wing. The definition + includes the position of the landing gear as + well as the information to which spars resp. + supportBeam the gear is attached. + + + + + + + + + + + + UID of the second spar, where the landing gear is attached to. Only used, if the landing gear is attached between two spars. + + + + + + UID of a set of ribs (ribDefinition) + + + + + Number of the rib in the rib set (ribDefinition) + + + + + + + + UID of the structural mount + + + + + + + + + + + + + + + Main landing gear support beam + + + + Definition of the main landing gear support beam, if a + support beam is used for the attachment. The defintion includes + cross section properties as well as the position of the support + beam. + + + + + + + + + + + + + + + + + + + + + framePositionUIDs of the frame + + + + + A framePostion defines a location where a frame in mounted. + + + + + + + + + + + framePositionUID of the frame, where the landing gear + is attached to. + + + + + + + + + + + + + Position of the landing gear on a wing + + + + Definition of the position of the landing gear + (intersection point of main strut and pintle sturt) on a wing, + using relative componentSegment coordinates + + + + + + + + + + Relative height of spar or rib at which landing gear is attached. + + + + + + Relative spanwise position (eta) of spar at which landing gear is attached. + + + + + Relative chordwise position (xsi) of the rib at which landing gear is attached. + + + + + + + + + + + + + Definition of the main landing gear support beam + position + + + Definition of the main landing gear support beam + position + + + + + + + + + + Relative chordwise coordinate (xsi) of the + inner end of the support beam. The eta + position of the inner end is defined by the eta position of the + wing root (=wing-fuselage attachment). + + + + + Relative spanwise coordinate (eta) of the + outer end of the support beam. The xsi + coordinate of the outer end is defined by the spar position + (first spar), where the support beam is attached to. + + + + + + + + + + + + + + Configuration + + + + Contains references to control control devices and (or) the global aircraft configuration node. + + + + + + + + + + + + + Reference to the aircraft configuration node (aircraft/model/configurations/configuration) + + + + + + + State description of the control elements + + + + + + + + + + + + + + Standard profile + + + + + + + + + + + + + + + + + + + + + + + Rectangle + + + + The width of the profile is always 1, since scaling is performed after referencing it (e.g., in the fuselage). + The resulting profile is defined by the following equation: + + + + with c = cornerRadius and r = heightToWidthRatio. + Example: Rectangle with cornerRadius=0.125 and heightToWidthRatio=0.5 + + + + + + + + + + + + + + + + + + Corner radius + + + + + + + + + + + + + + + + + + Height-to-width ratio + + + + + + + + + + + + + + + + Superellipse + + + + A profile based on superellipses is composed of an upper and a lower semi-ellipse, which may differ from each other in their parameterization. The total width and height of the profile is always 1, since scaling is performed after referencing (e.g., in the fuselage). + This lowerHeightFraction describes the portion of the lower semi-ellipse on the total height. + The resulting profile is defined by the following set of equations: + + + + + + + with + + + + The following examples indicate the various possibilities of parametric profiles: + Example 1: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (0.5; 2; 5; 3; 0.25) + + + + Example 2: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (2; 2; 2; 2; 0.5) = a circle + + + + Example 3: (mUpper,nUpper,mLower,nLower, lowerHeightFraction) = (1; 1; 1; 1; 0.5) = a square / diamond + + + + Note: For exponents that are infinitely large, the superellipse converges to a rectangle. However, the value Inf is not a valid entry at this point. Use the square element instead. + + + + + + + + + + + Exponent m for upper semi-ellipse + + + + + Exponent n for upper semi-ellipse + + + + + Exponent m for lower semi-ellipse + + + + + Exponent n for lower semi-ellipse + + + + + + Fraction of height of the lower semi-ellipse relative to the total height + + + + + + + + + + + + + + + + + + + + Performance Cases + + + + Definition of missions and point performance events to evaluate the performance of a vehicle. + The definition of performance cases is independent from a specific vehicle. + + + + + + + + + + + + + + + + + + + + + + + + UID of the runway + + + + + + + Offset from runway threshold in cartesian coordinates in the runway coordinate system + + + + + + + + + + + + + + + + UID of the runway + + + + + + + Offset from runway threshold in cartesian coordinates in the runway coordinate system + + + + + + + + + + + + + + + Requirements + + + + Requirement settings for the point performance definition + + + + + + + + + + + Sustained load factor to be achieved + + + + + + + Instantaneous load factor to be achieved + + + + + + + Specific excess power to be achieved [m/s] + + + + + + + Roll rate to be achieved [deg/s] + + + + + + + Roll acceleration to be achieved upon control onset [deg/s^2] + + + + + + + Roll acceleration to be achieved upon control stop [deg/s^2] + + + + + + + + + + + + + + Controllability requirements + + + Contains a list of controllability requirements + + + + + + + + + + + + + + + + + + + + Trim requirements + + + Contains a list of trim requirements + + + + + + + + + + + + + + + + + + + + + Controllability requirement + + + + + + + + + + Name + + + + + Description + + + + + UID of point performance definition + + + + + UID of weight and balance description + + + + + + + + + + + + + + + + + Trim requirement + + + + + + + + Name + + + + + Description + + + + + UID of a predefined flight point + + + + + UID of weight and balance description + + + + + + + + + + + + + + + Trim + + + + Provides a list of trim cases + + + + + + + + + + + + + + + + + + + + + + Trim case + + + + + + + + + + + + + + Name + + + + + Description + + + + + UID of trim requirement + + + + + + + Description of the linear model + + + + + + + + + + + + + + Turn + + + + + + + + + + + + + ... + + + + + ... + + + + + + + + + + + + + + Level flight + + + + + + + + + + + + + + Specific excess power + + + + + + + + + + + + + + Climb + + + + + + + + + + + + + + + + + + + + Descent + + + + + + + + + + + + + + + + + + + + Environmental conditions + + + + Specification of environmental conditions + + + + + + + + + + + + Delta temperature + + + + + + + + + + + + + + Flight Cases + + + + + + + + + + + + + + + + + + + + + + + + Flight point + + + + + + + + + + + + + + + + + + + + Mach number + + + + + + + Calibrated air speed + + + + + + + True air speed + + + + + + + + + + + + + + + + + Configurations which apply for this performance requirement + + + + + + + + + + + + + + + + Default configuration uID + + + + + + + + + + + + + + + Specific configuration uIDs + + + + + + + + + + + + + + + + + + + + + + + + Connection between segments, pointPerformances and a configurationUID + + + + + + + + + + + + + + + + Configuration uID + + + + + + + + List of pointPerformanceUIDs + + + + + + + + + + + + + + Segments + + + + + + + + + + + + + + + + + + + + + + + + Specification of a segment uID and index of the parameter lapses + + + + + + + + + + + + + + + + + Vector with semicolon separated indices of the parameters within a segment. If not given then the complete segment is applied. + + + + + + + + + + + + + + Released stores + + + + + + + + + + + + + + + + + + + + + + + + Released store + + + + + + + + + + + + + + + + UID of the released store. + + + + + + + Quantity of the released store. + + + + + + + + + + + + + + Runway start position + + + + + Description of the vehicle on the runway relative to the runway threshold. + + + + + + + + + + + + + + X-position in cartesian coordinates in the runway coordinate system + + + + + + + Y-position in cartesian coordinates in the runway coordinate system + + + + + + + Z-position in cartesian coordinates in the runway coordinate system + + + + + + + + + Lengthwise distance along the runway centerline from the runway threshold + + + + + + + Lateral offset from the runway centerline. Positive values on the starboard side. + + + + + + + + + + + + + + + Ducts + + + + + + + + + + + + + + + + + + + + Duct assembly + + + + + + + + + + + Name + + + + + + + Description + + + + + + + UID of part to which the duct is + mounted (if any) + + + + + + + + + + + + + + + + + + Duct + + + + + + + + + + + Name + + + + + + + Description + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Duct structure + + + + + + + + + + + + + + + + + + + + + Version Informations + + + + + + + + + + + + + + + + + + + Version Information + + + + + + + + + + CPACS version of the dataset + + + + + + Description of CPACS dataset + + + + + + Timestamp of initial CPACS dataset creation + + + + + + Creator of initial CPACS dataset + + + + + + + + + + + + + + + + Change log + + + + + + + + + + + + + + + + + + + Log entry + + + + + + + + + + Description of CPACS dataset + + + + + + Timestamp + + + + + + Creator (tool, person, etc.) + + + + + + + + + + + + + + Fuel tanks + + + + + + + + + + + + + + + + + + + + + + Fuel tank + + + + + + + + + + Name + + + + + + Description + + + + + + Parent component + + + + + + + + Volume + + + + + Burst pressure + + + + + + + + + + + + + + + + + + + + + + + + + Hulls + + + + + + + + + + + + + + + + + + + Hulls + + + + + + + + + + Name + + + + + + Description + + + + + + + + + + + + + Inner radius of the cylinder + + + + + Inner length of the cylinder + + + + + + + + + + + + + + + + + + + Dome Type + + + + + + + + + + + + + + + + + + + + + + + + Ellipsoid dome + + + + + + + + + + Half axis fraction + + + + + + + + + + + + + Torispherical dome + + + + + + + + + + R1: dish radius + + + + + R2: knuckle radius + + + + + + + + + + + + + Isotensoid dome + + + + + + + + + + Radius of the fitting/smaller polar opening + + + + + + + + + + + + + Structure + + + + + + + + + + + + + + + + + + + + + + + + + Skin Layers + + + + + + + + + + + + + + + + + diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSHull.h index 8d1ccbf5bd..d0ed283e5b 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSHull.h @@ -19,7 +19,8 @@ * @brief Implementation of CPACS hull handling routines. */ -#pragma once +#ifndef CCPACSHULL_H +#define CCPACSHULL_H #include "generated/CPACSHull.h" #include "CTiglRelativelyPositionedComponent.h" @@ -29,7 +30,6 @@ namespace tigl { - class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositionedComponent { public: @@ -133,3 +133,5 @@ class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositioned }; } // namespace tigl + +#endif // CCPACSFUSELAGE_H diff --git a/src/fuelTanks/CCPACSHullStructure.cpp b/src/fuelTanks/CCPACSHullStructure.cpp index b5292af50a..7646e94a92 100644 --- a/src/fuelTanks/CCPACSHullStructure.cpp +++ b/src/fuelTanks/CCPACSHullStructure.cpp @@ -1,28 +1,28 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "CCPACSHullStructure.h" -#include "CCPACSHull.h" - -namespace tigl -{ -CCPACSHullStructure::CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr) - : generated::CPACSHullStructure(parent, uidMgr) - , ITiglFuselageDuctStructure(parent) -{ -} - -} // namespace tigl +/* +* Copyright (c) 2018 RISC Software GmbH +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "CCPACSHullStructure.h" +#include "CCPACSHull.h" + +namespace tigl +{ +CCPACSHullStructure::CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr) + : generated::CPACSHullStructure(parent, uidMgr) + , ITiglFuselageDuctStructure(parent) +{ +} + +} // namespace tigl diff --git a/src/fuelTanks/CCPACSHullStructure.h b/src/fuelTanks/CCPACSHullStructure.h index 68aef14f9e..b7d6b0b690 100644 --- a/src/fuelTanks/CCPACSHullStructure.h +++ b/src/fuelTanks/CCPACSHullStructure.h @@ -1,37 +1,37 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS hulls handling routines. -*/ - -#pragma once - -#include "generated/CPACSHullStructure.h" -#include "CTiglRelativelyPositionedComponent.h" -#include "ITiglFuselageDuctStructure.h" - -namespace tigl -{ - -class CCPACSHullStructure : public generated::CPACSHullStructure, public ITiglFuselageDuctStructure -{ -public: - TIGL_EXPORT CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr); -}; - -} //namespace tigl +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hulls handling routines. +*/ + +#pragma once + +#include "generated/CPACSHullStructure.h" +#include "CTiglRelativelyPositionedComponent.h" +#include "ITiglFuselageDuctStructure.h" + +namespace tigl +{ + +class CCPACSHullStructure : public generated::CPACSHullStructure, public ITiglFuselageDuctStructure +{ +public: + TIGL_EXPORT CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr); +}; + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp index a182219ddc..656da8b12a 100644 --- a/src/fuelTanks/CCPACSHulls.cpp +++ b/src/fuelTanks/CCPACSHulls.cpp @@ -1,75 +1,75 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS hulls handling routines. -*/ - -#include "CCPACSHulls.h" -#include "CCPACSHull.h" -#include "CTiglError.h" - -namespace tigl -{ - -CCPACSHulls::CCPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) - : generated::CPACSHulls(parent, uidMgr) -{ -} - -int CCPACSHulls::GetHullsCount() const -{ - return static_cast(m_hulls.size()); -} - -CCPACSHull const& CCPACSHulls::GetHull(std::string const& uID) const -{ - return const_cast(*this).GetHull(uID); -} - -CCPACSHull& CCPACSHulls::GetHull(std::string const& uID) -{ - auto it = std::find_if(m_hulls.begin(), m_hulls.end(), - [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); - - if (it != std::end(m_hulls)) { - return **it; - } - throw CTiglError("Could not find hull with uid" + uID); -} - -CCPACSHull& CCPACSHulls::GetHull(int index) const -{ - index--; - if (index < 0 || index >= GetHullsCount()) { - throw CTiglError("Invalid index in CCPACSHulls::GetHull", TIGL_INDEX_ERROR); - } - return *m_hulls[index]; -} - -int CCPACSHulls::GetHullIndex(const std::string& uID) const -{ - for (int i = 0; i < GetHullsCount(); i++) { - const std::string tmpUID(m_hulls[i]->GetUID()); - if (tmpUID == uID) { - return i + 1; - } - } - throw CTiglError("Invalid UID in CCPACSHulls::GetHullIndex", TIGL_UID_ERROR); -} - -} //namespace tigl +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS hulls handling routines. +*/ + +#include "CCPACSHulls.h" +#include "CCPACSHull.h" +#include "CTiglError.h" + +namespace tigl +{ + +CCPACSHulls::CCPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) + : generated::CPACSHulls(parent, uidMgr) +{ +} + +int CCPACSHulls::GetHullsCount() const +{ + return static_cast(m_hulls.size()); +} + +CCPACSHull const& CCPACSHulls::GetHull(std::string const& uID) const +{ + return const_cast(*this).GetHull(uID); +} + +CCPACSHull& CCPACSHulls::GetHull(std::string const& uID) +{ + auto it = std::find_if(m_hulls.begin(), m_hulls.end(), + [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); + + if (it != std::end(m_hulls)) { + return **it; + } + throw CTiglError("Could not find hull with uid" + uID); +} + +CCPACSHull& CCPACSHulls::GetHull(int index) const +{ + index--; + if (index < 0 || index >= GetHullsCount()) { + throw CTiglError("Invalid index in CCPACSHulls::GetHull", TIGL_INDEX_ERROR); + } + return *m_hulls[index]; +} + +int CCPACSHulls::GetHullIndex(const std::string& uID) const +{ + for (int i = 0; i < GetHullsCount(); i++) { + const std::string tmpUID(m_hulls[i]->GetUID()); + if (tmpUID == uID) { + return i + 1; + } + } + throw CTiglError("Invalid UID in CCPACSHulls::GetHullIndex", TIGL_UID_ERROR); +} + +} //namespace tigl diff --git a/src/fuselage/CCPACSFramesAssembly.cpp b/src/fuselage/CCPACSFramesAssembly.cpp index b43c89cd27..d3ab3917bf 100644 --- a/src/fuselage/CCPACSFramesAssembly.cpp +++ b/src/fuselage/CCPACSFramesAssembly.cpp @@ -1,75 +1,75 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "CCPACSFramesAssembly.h" -#include "CTiglTransformation.h" -#include "CCPACSFrame.h" -#include "CCPACSFuselage.h" -#include "CCPACSDuct.h" -#include "ITiglFuselageDuctStructure.h" - -namespace tigl -{ -CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFramesAssembly(parent, uidMgr) -{ -} - -CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFramesAssembly(parent, uidMgr) -{ -} - -CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) - : generated::CPACSFramesAssembly(parent, uidMgr) -{ -} - -void CCPACSFramesAssembly::Invalidate(const boost::optional& source) const -{ - for (size_t i = 0; i < m_frames.size(); i++) - m_frames[i]->Invalidate(source); -} - - -CTiglRelativelyPositionedComponent const* CCPACSFramesAssembly::GetParentComponent() const -{ - if (IsParent()) { - return GetParent()->GetParent(); - } - if (IsParent()) { - return GetParent()->GetParent(); - } - throw CTiglError("Unexpected error: Parent of CCPACSFramesAssembly must either be CCPACSDuctStructure or CCPACSFuselageStructure."); -} - -CTiglTransformation CCPACSFramesAssembly::GetTransformationMatrix() const -{ - return GetParentComponent()->GetTransformationMatrix(); -} - -ITiglFuselageDuctStructure const* CCPACSFramesAssembly::GetStructureInterface() const -{ - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent(); - } - throw CTiglError("Unexpected error: Parent of CCPACSFramesAssembly must either be CCPACSDuctStructure or CCPACSFuselageStructure."); -} - -} // namespace tigl +/* +* Copyright (c) 2018 RISC Software GmbH +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "CCPACSFramesAssembly.h" +#include "CTiglTransformation.h" +#include "CCPACSFrame.h" +#include "CCPACSFuselage.h" +#include "CCPACSDuct.h" +#include "ITiglFuselageDuctStructure.h" + +namespace tigl +{ +CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFramesAssembly(parent, uidMgr) +{ +} + +CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFramesAssembly(parent, uidMgr) +{ +} + +CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : generated::CPACSFramesAssembly(parent, uidMgr) +{ +} + +void CCPACSFramesAssembly::Invalidate(const boost::optional& source) const +{ + for (size_t i = 0; i < m_frames.size(); i++) + m_frames[i]->Invalidate(source); +} + +// ToDo: Add hulls +CTiglRelativelyPositionedComponent const* CCPACSFramesAssembly::GetParentComponent() const +{ + if (IsParent()) { + return GetParent()->GetParent(); + } + if (IsParent()) { + return GetParent()->GetParent(); + } + throw CTiglError("Unexpected error: Parent of CCPACSFramesAssembly must either be CCPACSDuctStructure or CCPACSFuselageStructure."); +} + +CTiglTransformation CCPACSFramesAssembly::GetTransformationMatrix() const +{ + return GetParentComponent()->GetTransformationMatrix(); +} + +ITiglFuselageDuctStructure const* CCPACSFramesAssembly::GetStructureInterface() const +{ + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + throw CTiglError("Unexpected error: Parent of CCPACSFramesAssembly must either be CCPACSDuctStructure or CCPACSFuselageStructure."); +} + +} // namespace tigl diff --git a/src/fuselage/CCPACSFramesAssembly.h b/src/fuselage/CCPACSFramesAssembly.h index dcf5095d0f..a97936d208 100644 --- a/src/fuselage/CCPACSFramesAssembly.h +++ b/src/fuselage/CCPACSFramesAssembly.h @@ -1,48 +1,48 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#pragma once - -#include -#include -#include "CTiglTransformation.h" -#include "generated/CPACSFramesAssembly.h" - -namespace tigl -{ - -class CTiglRelativelyPositionedComponent; -class ITiglFuselageDuctStructure; - -class CCPACSFramesAssembly : public generated::CPACSFramesAssembly -{ -public: - TIGL_EXPORT CCPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; - - // returns the (grand)-parent component (either a fuselage or a duct) - TIGL_EXPORT CTiglRelativelyPositionedComponent const* GetParentComponent() const; - - // returns the transformation matrix of the (grand-)parent component - TIGL_EXPORT CTiglTransformation GetTransformationMatrix() const; - - TIGL_EXPORT ITiglFuselageDuctStructure const* GetStructureInterface() const; -}; - -} // namespace tigl +/* +* Copyright (c) 2018 RISC Software GmbH +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include +#include +#include "CTiglTransformation.h" +#include "generated/CPACSFramesAssembly.h" + +namespace tigl +{ + +class CTiglRelativelyPositionedComponent; +class ITiglFuselageDuctStructure; + +class CCPACSFramesAssembly : public generated::CPACSFramesAssembly +{ +public: + TIGL_EXPORT CCPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; + + // returns the (grand)-parent component (either a fuselage or a duct) + TIGL_EXPORT CTiglRelativelyPositionedComponent const* GetParentComponent() const; + + // returns the transformation matrix of the (grand-)parent component + TIGL_EXPORT CTiglTransformation GetTransformationMatrix() const; + + TIGL_EXPORT ITiglFuselageDuctStructure const* GetStructureInterface() const; +}; + +} // namespace tigl diff --git a/src/fuselage/ITiglFuselageDuctStructure.h b/src/fuselage/ITiglFuselageDuctStructure.h index 8cedf84071..167d19a997 100644 --- a/src/fuselage/ITiglFuselageDuctStructure.h +++ b/src/fuselage/ITiglFuselageDuctStructure.h @@ -1,65 +1,65 @@ -/* -* Copyright (C) 2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-03-16 Jan Kleinert -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#pragma once - -#include "tigl.h" -#include "Cache.h" -#include "CTiglRelativelyPositionedComponent.h" - -class TopoDS_Shape; -class TopoDS_Wire; -class gp_Lin; -class gp_Pnt; - -namespace tigl { - -class CCPACSFuselageStringerFramePosition; - -/** - * @brief The ITiglFuselageDuctStructure class provides some common - * geometric functionality needed by structural elements of - * ducts, fuselages, and hulls - */ -class ITiglFuselageDuctStructure -{ -public: - TIGL_EXPORT ITiglFuselageDuctStructure(CTiglRelativelyPositionedComponent const* parent); - - TIGL_EXPORT void Invalidate() const; - - TIGL_EXPORT TopoDS_Shape const& GetLoft() const; - - // calculates the intersection of the stringer frame position with the parent loft (duct/fuselage/hull) - TIGL_EXPORT gp_Lin Intersection(CCPACSFuselageStringerFramePosition const& pos) const; - TIGL_EXPORT gp_Lin Intersection(gp_Pnt pRef, double angleRef) const; - - // project the edge/wire onto the fuselage/duct loft - TIGL_EXPORT TopoDS_Wire projectConic(TopoDS_Shape wireOrEdge, gp_Pnt origin) const; - TIGL_EXPORT TopoDS_Wire projectParallel(TopoDS_Shape wireOrEdge, gp_Dir direction) const; - -private: - - void StoreLoft(TopoDS_Shape& cache) const; - - CTiglRelativelyPositionedComponent const* m_parent; - Cache m_loft; - -}; - -} //namespace tigl +/* +* Copyright (C) 2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-03-16 Jan Kleinert +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include "tigl.h" +#include "Cache.h" +#include "CTiglRelativelyPositionedComponent.h" + +class TopoDS_Shape; +class TopoDS_Wire; +class gp_Lin; +class gp_Pnt; + +namespace tigl { + +class CCPACSFuselageStringerFramePosition; + +/** + * @brief The ITiglFuselageDuctStructure class provides some common + * geometric functionality needed by structural elements of + * ducts, fuselages, and hulls + */ +class ITiglFuselageDuctStructure +{ +public: + TIGL_EXPORT ITiglFuselageDuctStructure(CTiglRelativelyPositionedComponent const* parent); + + TIGL_EXPORT void Invalidate() const; + + TIGL_EXPORT TopoDS_Shape const& GetLoft() const; + + // calculates the intersection of the stringer frame position with the parent loft (duct/fuselage/hull) + TIGL_EXPORT gp_Lin Intersection(CCPACSFuselageStringerFramePosition const& pos) const; + TIGL_EXPORT gp_Lin Intersection(gp_Pnt pRef, double angleRef) const; + + // project the edge/wire onto the fuselage/duct loft + TIGL_EXPORT TopoDS_Wire projectConic(TopoDS_Shape wireOrEdge, gp_Pnt origin) const; + TIGL_EXPORT TopoDS_Wire projectParallel(TopoDS_Shape wireOrEdge, gp_Dir direction) const; + +private: + + void StoreLoft(TopoDS_Shape& cache) const; + + CTiglRelativelyPositionedComponent const* m_parent; + Cache m_loft; + +}; + +} //namespace tigl diff --git a/src/generated/CPACSBoundingElementUIDs.cpp b/src/generated/CPACSBoundingElementUIDs.cpp index de2bd49cbc..eabc8723df 100644 --- a/src/generated/CPACSBoundingElementUIDs.cpp +++ b/src/generated/CPACSBoundingElementUIDs.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CCPACSFuselageWallSegment.h" +#include "CCPACSWallSegment.h" #include "CPACSBoundingElementUIDs.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -28,7 +28,7 @@ namespace tigl { namespace generated { - CPACSBoundingElementUIDs::CPACSBoundingElementUIDs(CCPACSFuselageWallSegment* parent, CTiglUIDManager* uidMgr) + CPACSBoundingElementUIDs::CPACSBoundingElementUIDs(CCPACSWallSegment* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -44,12 +44,12 @@ namespace generated } } - const CCPACSFuselageWallSegment* CPACSBoundingElementUIDs::GetParent() const + const CCPACSWallSegment* CPACSBoundingElementUIDs::GetParent() const { return m_parent; } - CCPACSFuselageWallSegment* CPACSBoundingElementUIDs::GetParent() + CCPACSWallSegment* CPACSBoundingElementUIDs::GetParent() { return m_parent; } diff --git a/src/generated/CPACSBoundingElementUIDs.h b/src/generated/CPACSBoundingElementUIDs.h index 77c1be0919..889bb9b6c6 100644 --- a/src/generated/CPACSBoundingElementUIDs.h +++ b/src/generated/CPACSBoundingElementUIDs.h @@ -27,7 +27,7 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSFuselageWallSegment; +class CCPACSWallSegment; namespace generated { @@ -37,13 +37,13 @@ namespace generated class CPACSBoundingElementUIDs : public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSBoundingElementUIDs(CCPACSFuselageWallSegment* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSBoundingElementUIDs(CCPACSWallSegment* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSBoundingElementUIDs(); - TIGL_EXPORT CCPACSFuselageWallSegment* GetParent(); + TIGL_EXPORT CCPACSWallSegment* GetParent(); - TIGL_EXPORT const CCPACSFuselageWallSegment* GetParent() const; + TIGL_EXPORT const CCPACSWallSegment* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -59,7 +59,7 @@ namespace generated TIGL_EXPORT virtual bool RemoveFromBoundingElementUIDs(const std::string& value); protected: - CCPACSFuselageWallSegment* m_parent; + CCPACSWallSegment* m_parent; CTiglUIDManager* m_uidMgr; diff --git a/src/generated/CPACSWallPosition.cpp b/src/generated/CPACSWallPosition.cpp index e26e6733fd..f1c83c1ae2 100644 --- a/src/generated/CPACSWallPosition.cpp +++ b/src/generated/CPACSWallPosition.cpp @@ -43,7 +43,7 @@ namespace generated if (m_bulkheadUID_choice1 && !m_bulkheadUID_choice1->empty()) m_uidMgr->TryUnregisterReference(*m_bulkheadUID_choice1, *this); if (m_wallSegmentUID_choice2 && !m_wallSegmentUID_choice2->empty()) m_uidMgr->TryUnregisterReference(*m_wallSegmentUID_choice2, *this); if (m_fuselageSectionUID_choice3 && !m_fuselageSectionUID_choice3->empty()) m_uidMgr->TryUnregisterReference(*m_fuselageSectionUID_choice3, *this); - if (m_hullSectionUID_choice4 && !m_hullSectionUID_choice4->empty()) m_uidMgr->TryUnregisterReference(*m_hullSectionUID_choice4, *this); + if (m_sectionUID_choice4 && !m_sectionUID_choice4->empty()) m_uidMgr->TryUnregisterReference(*m_sectionUID_choice4, *this); } } @@ -126,13 +126,13 @@ namespace generated if (m_uidMgr && !m_fuselageSectionUID_choice3->empty()) m_uidMgr->RegisterReference(*m_fuselageSectionUID_choice3, *this); } - // read element hullSectionUID - if (tixi::TixiCheckElement(tixiHandle, xpath + "/hullSectionUID")) { - m_hullSectionUID_choice4 = tixi::TixiGetElement(tixiHandle, xpath + "/hullSectionUID"); - if (m_hullSectionUID_choice4->empty()) { - LOG(WARNING) << "Optional element hullSectionUID is present but empty at xpath " << xpath; + // read element sectionUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sectionUID")) { + m_sectionUID_choice4 = tixi::TixiGetElement(tixiHandle, xpath + "/sectionUID"); + if (m_sectionUID_choice4->empty()) { + LOG(WARNING) << "Optional element sectionUID is present but empty at xpath " << xpath; } - if (m_uidMgr && !m_hullSectionUID_choice4->empty()) m_uidMgr->RegisterReference(*m_hullSectionUID_choice4, *this); + if (m_uidMgr && !m_sectionUID_choice4->empty()) m_uidMgr->RegisterReference(*m_sectionUID_choice4, *this); } // read element x @@ -164,7 +164,7 @@ namespace generated void CPACSWallPosition::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "bulkheadUID", "wallSegmentUID", "fuselageSectionUID", "hullSectionUID", "x", "y", "z" }; + const std::vector childElemOrder = { "bulkheadUID", "wallSegmentUID", "fuselageSectionUID", "sectionUID", "x", "y", "z" }; // write attribute uID if (m_uID) { @@ -209,14 +209,14 @@ namespace generated } } - // write element hullSectionUID - if (m_hullSectionUID_choice4) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hullSectionUID", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/hullSectionUID", *m_hullSectionUID_choice4); + // write element sectionUID + if (m_sectionUID_choice4) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/sectionUID", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/sectionUID", *m_sectionUID_choice4); } else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/hullSectionUID")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/hullSectionUID"); + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sectionUID")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/sectionUID"); } } @@ -256,7 +256,7 @@ namespace generated || m_fuselageSectionUID_choice3.is_initialized() || - m_hullSectionUID_choice4.is_initialized() + m_sectionUID_choice4.is_initialized() || m_x_choice5.is_initialized() ) @@ -272,7 +272,7 @@ namespace generated || m_fuselageSectionUID_choice3.is_initialized() || - m_hullSectionUID_choice4.is_initialized() + m_sectionUID_choice4.is_initialized() || m_x_choice5.is_initialized() ) @@ -288,7 +288,7 @@ namespace generated || m_wallSegmentUID_choice2.is_initialized() || - m_hullSectionUID_choice4.is_initialized() + m_sectionUID_choice4.is_initialized() || m_x_choice5.is_initialized() ) @@ -296,7 +296,7 @@ namespace generated + ( // mandatory elements of this choice must be there - m_hullSectionUID_choice4.is_initialized() + m_sectionUID_choice4.is_initialized() && // elements of other choices must not be there !( @@ -322,7 +322,7 @@ namespace generated || m_fuselageSectionUID_choice3.is_initialized() || - m_hullSectionUID_choice4.is_initialized() + m_sectionUID_choice4.is_initialized() ) ) == 1 @@ -394,18 +394,18 @@ namespace generated m_fuselageSectionUID_choice3 = value; } - const boost::optional& CPACSWallPosition::GetHullSectionUID_choice4() const + const boost::optional& CPACSWallPosition::GetSectionUID_choice4() const { - return m_hullSectionUID_choice4; + return m_sectionUID_choice4; } - void CPACSWallPosition::SetHullSectionUID_choice4(const boost::optional& value) + void CPACSWallPosition::SetSectionUID_choice4(const boost::optional& value) { if (m_uidMgr) { - if (m_hullSectionUID_choice4 && !m_hullSectionUID_choice4->empty()) m_uidMgr->TryUnregisterReference(*m_hullSectionUID_choice4, *this); + if (m_sectionUID_choice4 && !m_sectionUID_choice4->empty()) m_uidMgr->TryUnregisterReference(*m_sectionUID_choice4, *this); if (value && !value->empty()) m_uidMgr->RegisterReference(*value, *this); } - m_hullSectionUID_choice4 = value; + m_sectionUID_choice4 = value; } const boost::optional& CPACSWallPosition::GetX_choice5() const @@ -454,8 +454,8 @@ namespace generated if (m_fuselageSectionUID_choice3 && *m_fuselageSectionUID_choice3 == oldUid) { m_fuselageSectionUID_choice3 = newUid; } - if (m_hullSectionUID_choice4 && *m_hullSectionUID_choice4 == oldUid) { - m_hullSectionUID_choice4 = newUid; + if (m_sectionUID_choice4 && *m_sectionUID_choice4 == oldUid) { + m_sectionUID_choice4 = newUid; } } diff --git a/src/generated/CPACSWallPosition.h b/src/generated/CPACSWallPosition.h index 23073bcc4e..6548b56e7d 100644 --- a/src/generated/CPACSWallPosition.h +++ b/src/generated/CPACSWallPosition.h @@ -70,8 +70,8 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetFuselageSectionUID_choice3() const; TIGL_EXPORT virtual void SetFuselageSectionUID_choice3(const boost::optional& value); - TIGL_EXPORT virtual const boost::optional& GetHullSectionUID_choice4() const; - TIGL_EXPORT virtual void SetHullSectionUID_choice4(const boost::optional& value); + TIGL_EXPORT virtual const boost::optional& GetSectionUID_choice4() const; + TIGL_EXPORT virtual void SetSectionUID_choice4(const boost::optional& value); TIGL_EXPORT virtual const boost::optional& GetX_choice5() const; TIGL_EXPORT virtual void SetX_choice5(const boost::optional& value); @@ -99,15 +99,16 @@ namespace generated /// y- and z-coordinates. boost::optional m_wallSegmentUID_choice2; + /// DEPRECATED: use sectionUID instead. /// UID of a fuselage section determining the /// x-coordinate of the position with the given /// y- and z-coordinates. boost::optional m_fuselageSectionUID_choice3; - /// UID of a tank hull section determining the - /// x-coordinate of the position with the given - /// y- and z-coordinates. - boost::optional m_hullSectionUID_choice4; + /// UID of a section determining the + /// x-coordinate of the position with + /// the given y- and z-coordinates. + boost::optional m_sectionUID_choice4; /// Absolute x-coordinate of wall position in fuselage coordinate system. boost::optional m_x_choice5; diff --git a/src/generated/CPACSWallPositionUIDs.cpp b/src/generated/CPACSWallPositionUIDs.cpp index 6609a12bbe..fd7b691517 100644 --- a/src/generated/CPACSWallPositionUIDs.cpp +++ b/src/generated/CPACSWallPositionUIDs.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CCPACSFuselageWallSegment.h" +#include "CCPACSWallSegment.h" #include "CPACSWallPositionUIDs.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -28,7 +28,7 @@ namespace tigl { namespace generated { - CPACSWallPositionUIDs::CPACSWallPositionUIDs(CCPACSFuselageWallSegment* parent, CTiglUIDManager* uidMgr) + CPACSWallPositionUIDs::CPACSWallPositionUIDs(CCPACSWallSegment* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); @@ -44,12 +44,12 @@ namespace generated } } - const CCPACSFuselageWallSegment* CPACSWallPositionUIDs::GetParent() const + const CCPACSWallSegment* CPACSWallPositionUIDs::GetParent() const { return m_parent; } - CCPACSFuselageWallSegment* CPACSWallPositionUIDs::GetParent() + CCPACSWallSegment* CPACSWallPositionUIDs::GetParent() { return m_parent; } diff --git a/src/generated/CPACSWallPositionUIDs.h b/src/generated/CPACSWallPositionUIDs.h index d8f8df2bd4..6a3d5402a4 100644 --- a/src/generated/CPACSWallPositionUIDs.h +++ b/src/generated/CPACSWallPositionUIDs.h @@ -27,7 +27,7 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSFuselageWallSegment; +class CCPACSWallSegment; namespace generated { @@ -37,13 +37,13 @@ namespace generated class CPACSWallPositionUIDs : public ITiglUIDRefObject { public: - TIGL_EXPORT CPACSWallPositionUIDs(CCPACSFuselageWallSegment* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSWallPositionUIDs(CCPACSWallSegment* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSWallPositionUIDs(); - TIGL_EXPORT CCPACSFuselageWallSegment* GetParent(); + TIGL_EXPORT CCPACSWallSegment* GetParent(); - TIGL_EXPORT const CCPACSFuselageWallSegment* GetParent() const; + TIGL_EXPORT const CCPACSWallSegment* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -59,7 +59,7 @@ namespace generated TIGL_EXPORT virtual bool RemoveFromWallPositionUIDs(const std::string& value); protected: - CCPACSFuselageWallSegment* m_parent; + CCPACSWallSegment* m_parent; CTiglUIDManager* m_uidMgr; diff --git a/src/generated/CPACSWallSegment.cpp b/src/generated/CPACSWallSegment.cpp index b9f775f3cb..95b125ae7d 100644 --- a/src/generated/CPACSWallSegment.cpp +++ b/src/generated/CPACSWallSegment.cpp @@ -30,7 +30,7 @@ namespace generated CPACSWallSegment::CPACSWallSegment(CPACSWallSegments* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_phi(0.0) - , m_wallPositionUIDs(reinterpret_cast(this), m_uidMgr) + , m_wallPositionUIDs(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; @@ -121,7 +121,7 @@ namespace generated // read element boundingElementUIDs if (tixi::TixiCheckElement(tixiHandle, xpath + "/boundingElementUIDs")) { - m_boundingElementUIDs = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_boundingElementUIDs = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_boundingElementUIDs->ReadCPACS(tixiHandle, xpath + "/boundingElementUIDs"); } catch(const std::exception& e) { @@ -325,7 +325,7 @@ namespace generated CPACSBoundingElementUIDs& CPACSWallSegment::GetBoundingElementUIDs(CreateIfNotExistsTag) { if (!m_boundingElementUIDs) - m_boundingElementUIDs = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_boundingElementUIDs = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_boundingElementUIDs; } diff --git a/src/generated/CPACSWallSegment.h b/src/generated/CPACSWallSegment.h index 219c1e1608..ebc4a17410 100644 --- a/src/generated/CPACSWallSegment.h +++ b/src/generated/CPACSWallSegment.h @@ -147,7 +147,7 @@ namespace generated }; } // namespace generated -// CPACSWallSegment is customized, use type CCPACSFuselageWallSegment directly +// CPACSWallSegment is customized, use type CCPACSWallSegment directly // Aliases in tigl namespace using CCPACSWallSegments = generated::CPACSWallSegments; diff --git a/src/generated/CPACSWallSegments.cpp b/src/generated/CPACSWallSegments.cpp index 014688e6a1..9f53321881 100644 --- a/src/generated/CPACSWallSegments.cpp +++ b/src/generated/CPACSWallSegments.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include +#include #include "CCPACSWalls.h" #include "CPACSWallSegments.h" #include "CTiglError.h" @@ -98,23 +98,23 @@ namespace generated } - const std::vector>& CPACSWallSegments::GetWallSegments() const + const std::vector>& CPACSWallSegments::GetWallSegments() const { return m_wallSegments; } - std::vector>& CPACSWallSegments::GetWallSegments() + std::vector>& CPACSWallSegments::GetWallSegments() { return m_wallSegments; } - CCPACSFuselageWallSegment& CPACSWallSegments::AddWallSegment() + CCPACSWallSegment& CPACSWallSegments::AddWallSegment() { - m_wallSegments.push_back(make_unique(this, m_uidMgr)); + m_wallSegments.push_back(make_unique(this, m_uidMgr)); return *m_wallSegments.back(); } - void CPACSWallSegments::RemoveWallSegment(CCPACSFuselageWallSegment& ref) + void CPACSWallSegments::RemoveWallSegment(CCPACSWallSegment& ref) { for (std::size_t i = 0; i < m_wallSegments.size(); i++) { if (m_wallSegments[i].get() == &ref) { diff --git a/src/generated/CPACSWallSegments.h b/src/generated/CPACSWallSegments.h index 008fc22264..a983868bd2 100644 --- a/src/generated/CPACSWallSegments.h +++ b/src/generated/CPACSWallSegments.h @@ -27,7 +27,7 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSFuselageWallSegment; +class CCPACSWallSegment; class CCPACSWalls; namespace generated @@ -55,11 +55,11 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const std::vector>& GetWallSegments() const; - TIGL_EXPORT virtual std::vector>& GetWallSegments(); + TIGL_EXPORT virtual const std::vector>& GetWallSegments() const; + TIGL_EXPORT virtual std::vector>& GetWallSegments(); - TIGL_EXPORT virtual CCPACSFuselageWallSegment& AddWallSegment(); - TIGL_EXPORT virtual void RemoveWallSegment(CCPACSFuselageWallSegment& ref); + TIGL_EXPORT virtual CCPACSWallSegment& AddWallSegment(); + TIGL_EXPORT virtual void RemoveWallSegment(CCPACSWallSegment& ref); protected: CCPACSWalls* m_parent; @@ -67,7 +67,7 @@ namespace generated CTiglUIDManager* m_uidMgr; /// Wall segment definition. - std::vector> m_wallSegments; + std::vector> m_wallSegments; private: CPACSWallSegments(const CPACSWallSegments&) = delete; diff --git a/src/structural_elements/CCPACSWallPosition.cpp b/src/structural_elements/CCPACSWallPosition.cpp index 893b3acc30..31bd92fad7 100644 --- a/src/structural_elements/CCPACSWallPosition.cpp +++ b/src/structural_elements/CCPACSWallPosition.cpp @@ -1,228 +1,296 @@ -/* -* Copyright (C) 2019 German Aerospace Center (DLR/SC) -* -* Created: 2019-10-16 Jan Kleinert -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "CNamedShape.h" -#include "CTiglUIDManager.h" -#include "CCPACSWallPosition.h" -#include "CCPACSFuselageWallSegment.h" -#include "CCPACSFuselageStructure.h" -#include "CCPACSFuselage.h" -#include "CTiglError.h" -#include "Bnd_Box.hxx" -#include "BRepBndLib.hxx" -#include "gp_Lin.hxx" -#include "IntCurvesFace_ShapeIntersector.hxx" -#include "Debugging.h" -#include - -namespace { - -// Computes the intersection point of a shape with a line -gp_Pnt GetIntersectionPoint(const TopoDS_Shape& shape, gp_Pnt basePoint, gp_Vec xDir, double bboxSize) -{ - gp_Pnt xy_pnt = basePoint; - gp_Lin x_line (xy_pnt, xDir.XYZ()); - IntCurvesFace_ShapeIntersector intersector; - intersector.Load(shape,1e-5); - // ToDo: not sure if I interpret PInf and PSup correctly: - intersector.Perform(x_line, -bboxSize, bboxSize); - int NbPnt = intersector.NbPnt(); - if (NbPnt == 1) { - return intersector.Pnt(1); - } - else { - DEBUG_SCOPE(onError); - onError.addShape(shape, "shape"); - onError.addShape(BRepBuilderAPI_MakeEdge(x_line, -bboxSize, bboxSize), "line"); - - throw tigl::CTiglError("Number of intersection points in GetIntersectionPoint is not 1. Instead it is " + tigl::std_to_string(NbPnt)); - } -} - -} - -namespace tigl -{ - -CCPACSWallPosition::CCPACSWallPosition(CCPACSWallPositions* parent, CTiglUIDManager* uidMgr) - : generated::CPACSWallPosition(parent, uidMgr) -{} - -void CCPACSWallPosition::CalcBasePointAndShape() const -{ - Bnd_Box boundingBox; - CCPACSFuselage const& fuselage = GetFuselage(); - TopoDS_Shape fuselageShape = fuselage.GetLoft()->Shape(); - BRepBndLib::Add(fuselageShape, boundingBox); - double bboxSize = sqrt(boundingBox.SquareExtent()); - - // calculate base point and optional shape - gp_Pnt basePointTmp(0., GetY(), GetZ()); - if (GetX_choice5()) { - basePointTmp.SetX(GetX_choice5().value()); - } - basePointTmp = fuselage.GetTransformationMatrix().Transform(basePointTmp); - - if (!GetX_choice5()) { - if (GetBulkheadUID_choice1()) { - shape = GetUIDManager().GetGeometricComponent(GetBulkheadUID_choice1().value()).GetLoft()->Shape(); - } - else if(GetWallSegmentUID_choice2()) { - const CCPACSFuselageWallSegment& wall = GetUIDManager().ResolveObject(GetWallSegmentUID_choice2().value()); - if ( wall.GetDefaultedUID() == GetWallSegmentUID_choice2().value() ){ - throw CTiglError("Fuselage wall references itself"); - } - shape = wall.GetLoft()->Shape(); - } - else if (GetFuselageSectionUID_choice3()) { - shape = fuselage.GetSectionFace(GetFuselageSectionUID_choice3().value()); - } - else { - throw CTiglError("Cannot determine wall position."); - } - // Compute the base point by intersecting the shape with the line - gp_Vec xDirGlobal = fuselage.GetTransformationMatrix().Transform(gp_Vec(1., 0., 0.)); - basePointTmp = GetIntersectionPoint(*shape, basePointTmp, xDirGlobal, bboxSize); - - } - base_point = basePointTmp; - isBuilt = true; -} - -gp_Pnt& CCPACSWallPosition::GetBasePoint() -{ - return const_cast(const_cast(this)->GetBasePoint()); -} - - -gp_Pnt const& CCPACSWallPosition::GetBasePoint() const -{ - if (!isBuilt) { - CalcBasePointAndShape(); - } - return base_point; -} - -boost::optional& CCPACSWallPosition::GetShape() -{ - return const_cast&>(const_cast(this)->GetShape()); -} - -boost::optional const& CCPACSWallPosition::GetShape() const -{ - if (!isBuilt) { - CalcBasePointAndShape(); - } - return shape; -} - -void CCPACSWallPosition::SetBulkheadUID_choice1(const boost::optional& value) -{ - CPACSWallPosition::SetBulkheadUID_choice1(value); - - CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); - CPACSWallPosition::SetFuselageSectionUID_choice3(boost::none); - CPACSWallPosition::SetX_choice5(boost::none); - - Invalidate(); -} - -void CCPACSWallPosition::SetWallSegmentUID_choice2(const boost::optional& value) -{ - CPACSWallPosition::SetWallSegmentUID_choice2(value); - - CPACSWallPosition::SetBulkheadUID_choice1(boost::none); - CPACSWallPosition::SetFuselageSectionUID_choice3(boost::none); - CPACSWallPosition::SetX_choice5(boost::none); - - Invalidate(); -} - -void CCPACSWallPosition::SetFuselageSectionUID_choice3(const boost::optional& value) -{ - CPACSWallPosition::SetFuselageSectionUID_choice3(value); - - CPACSWallPosition::SetBulkheadUID_choice1(boost::none); - CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); - CPACSWallPosition::SetX_choice5(boost::none); - - Invalidate(); -} - -void CCPACSWallPosition::SetX_choice5(const boost::optional& value) -{ - CPACSWallPosition::SetX_choice5(value); - - CPACSWallPosition::SetBulkheadUID_choice1(boost::none); - CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); - CPACSWallPosition::SetFuselageSectionUID_choice3(boost::none); - - Invalidate(); -} - -void CCPACSWallPosition::SetY(const double& value) -{ - CPACSWallPosition::SetY(value); - Invalidate(); -} - -void CCPACSWallPosition::SetZ(const double& value) -{ - CPACSWallPosition::SetZ(value); - Invalidate(); -} - -void CCPACSWallPosition::InvalidateImpl(const boost::optional& source) const -{ - isBuilt = false; - shape = boost::none; -} - -const CCPACSWalls& CCPACSWallPosition::GetWalls() const -{ - const CCPACSWallPositions* wallPositions = GetParent(); - if (!wallPositions) { - throw CTiglError("Error in CCPACSWallPosition::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); - } - - const CCPACSWalls* walls = wallPositions->GetParent(); - if (!walls) { - throw CTiglError("Error in CCPACSWallPosition::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); - } - - return *walls; -} - -const CCPACSFuselage &CCPACSWallPosition::GetFuselage() const -{ - const CCPACSWalls& walls = GetWalls(); - - const CCPACSFuselageStructure* fuselageStructure = walls.GetParent(); - if (!fuselageStructure) { - throw CTiglError("Cannot get fuselage in CCPACSWallPosition::GetFuselage. Null pointer parent.", TIGL_NULL_POINTER); - } - - const CCPACSFuselage* fuselage = fuselageStructure->GetParent(); - if (!fuselageStructure) { - throw CTiglError("Cannot get fuselage in CCPACSWallPosition::GetFuselage. Null pointer parent.", TIGL_NULL_POINTER); - } - - return *fuselage; -} - -} +/* +* Copyright (C) 2019 German Aerospace Center (DLR/SC) +* +* Created: 2019-10-16 Jan Kleinert +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "CNamedShape.h" +#include "CTiglUIDManager.h" +#include "CCPACSWallPosition.h" +#include "CCPACSWallSegment.h" +#include "CCPACSHull.h" +#include "CCPACSHullStructure.h" +#include "CCPACSWalls.h" +#include "CCPACSFuselageStructure.h" +#include "CCPACSFuselage.h" +#include "CTiglError.h" +#include "Bnd_Box.hxx" +#include "BRepBndLib.hxx" +#include "gp_Lin.hxx" +#include "IntCurvesFace_ShapeIntersector.hxx" +#include "Debugging.h" +#include + +namespace +{ + +// Computes the intersection point of a shape with a line +gp_Pnt GetIntersectionPoint(const TopoDS_Shape& shape, gp_Pnt basePoint, gp_Vec xDir, double bboxSize) +{ + gp_Pnt xyPoint = basePoint; + gp_Lin xLine(xyPoint, xDir.XYZ()); + IntCurvesFace_ShapeIntersector intersector; + intersector.Load(shape, 1e-5); + // ToDo: not sure if I interpret PInf and PSup correctly: + intersector.Perform(xLine, -bboxSize, bboxSize); + int NbPnt = intersector.NbPnt(); + if (NbPnt == 1) { + return intersector.Pnt(1); + } + else { + DEBUG_SCOPE(onError); + onError.addShape(shape, "shape"); + onError.addShape(BRepBuilderAPI_MakeEdge(xLine, -bboxSize, bboxSize), "line"); + + throw tigl::CTiglError("Number of intersection points in GetIntersectionPoint is not 1. Instead it is " + + tigl::std_to_string(NbPnt)); + } +} + +} // namespace + +namespace tigl +{ + +CCPACSWallPosition::CCPACSWallPosition(CCPACSWallPositions* parent, CTiglUIDManager* uidMgr) + : generated::CPACSWallPosition(parent, uidMgr) +{ +} + +void CCPACSWallPosition::CalcBasePointAndShape() const +{ + Bnd_Box boundingBox; + TopoDS_Shape parentShape; + CTiglTransformation transformationMatrix; + + bool isFuselage = GetParent()->GetParent()->IsParent(); + bool isHull = GetParent()->GetParent()->IsParent(); + + if (isFuselage) { + const CCPACSFuselage& fuselage = GetFuselage(); + parentShape = fuselage.GetLoft()->Shape(); + transformationMatrix = fuselage.GetTransformationMatrix(); + } + else if (isHull) { + const CCPACSHull& hull = GetHull(); + parentShape = hull.GetLoft()->Shape(); + transformationMatrix = hull.GetTransformationMatrix(); + } + else { + throw CTiglError("Parent of CCPACSWallPosition is neither a fuselage nor a hull."); + } + + BRepBndLib::Add(parentShape, boundingBox); + double bboxSize = sqrt(boundingBox.SquareExtent()); + + // Calculate base point and optional shape + gp_Pnt basePointTmp(0., GetY(), GetZ()); + if (GetX_choice5()) { + basePointTmp.SetX(GetX_choice5().value()); + } + basePointTmp = transformationMatrix.Transform(basePointTmp); + + if (!GetX_choice5()) { + if (GetBulkheadUID_choice1()) { + _shape = GetUIDManager().GetGeometricComponent(GetBulkheadUID_choice1().value()).GetLoft()->Shape(); + } + else if (GetWallSegmentUID_choice2()) { + const CCPACSWallSegment& wall = + GetUIDManager().ResolveObject(GetWallSegmentUID_choice2().value()); + if (wall.GetDefaultedUID() == GetWallSegmentUID_choice2().value()) { + throw CTiglError("Fuselage wall references itself"); + } + _shape = wall.GetLoft()->Shape(); + } + else if (GetFuselageSectionUID_choice3()) { + LOG(WARNING) << "DEPRECATED CPACS node: Use instead."; + _shape = GetFuselage().GetSectionFace(GetFuselageSectionUID_choice3().value()); + } + else if (GetSectionUID_choice4()) { + if (isFuselage) { + _shape = GetFuselage().GetSectionFace(GetSectionUID_choice4().value()); + } + else if (isHull) { + _shape = GetHull().GetSectionFace(GetSectionUID_choice4().value()); + } + } + else { + throw CTiglError("Cannot determine wall position."); + } + // Compute the base point by intersecting the shape with the line + gp_Vec xDirGlobal = transformationMatrix.Transform(gp_Vec(1., 0., 0.)); + basePointTmp = GetIntersectionPoint(*_shape, basePointTmp, xDirGlobal, bboxSize); + } + _basePoint = basePointTmp; + _isBuilt = true; +} + +gp_Pnt& CCPACSWallPosition::GetBasePoint() +{ + return const_cast(const_cast(this)->GetBasePoint()); +} + +gp_Pnt const& CCPACSWallPosition::GetBasePoint() const +{ + if (!_isBuilt) { + CalcBasePointAndShape(); + } + return _basePoint; +} + +boost::optional& CCPACSWallPosition::GetShape() +{ + return const_cast&>(const_cast(this)->GetShape()); +} + +boost::optional const& CCPACSWallPosition::GetShape() const +{ + if (!_isBuilt) { + CalcBasePointAndShape(); + } + return _shape; +} + +void CCPACSWallPosition::SetBulkheadUID_choice1(const boost::optional& value) +{ + CPACSWallPosition::SetBulkheadUID_choice1(value); + + CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); + CPACSWallPosition::SetFuselageSectionUID_choice3(boost::none); + CPACSWallPosition::SetSectionUID_choice4(boost::none); + CPACSWallPosition::SetX_choice5(boost::none); + + Invalidate(); +} + +void CCPACSWallPosition::SetWallSegmentUID_choice2(const boost::optional& value) +{ + CPACSWallPosition::SetWallSegmentUID_choice2(value); + + CPACSWallPosition::SetBulkheadUID_choice1(boost::none); + CPACSWallPosition::SetFuselageSectionUID_choice3(boost::none); + CPACSWallPosition::SetSectionUID_choice4(boost::none); + CPACSWallPosition::SetX_choice5(boost::none); + + Invalidate(); +} + +void CCPACSWallPosition::SetFuselageSectionUID_choice3(const boost::optional& value) +{ + CPACSWallPosition::SetFuselageSectionUID_choice3(value); + + CPACSWallPosition::SetBulkheadUID_choice1(boost::none); + CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); + CPACSWallPosition::SetSectionUID_choice4(boost::none); + CPACSWallPosition::SetX_choice5(boost::none); + + Invalidate(); +} + +void CCPACSWallPosition::SetSectionUID_choice4(const boost::optional& value) +{ + CPACSWallPosition::SetSectionUID_choice4(value); + + CPACSWallPosition::SetBulkheadUID_choice1(boost::none); + CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); + CPACSWallPosition::SetFuselageSectionUID_choice3(boost::none); + CPACSWallPosition::SetX_choice5(boost::none); + + Invalidate(); +} + +void CCPACSWallPosition::SetX_choice5(const boost::optional& value) +{ + CPACSWallPosition::SetX_choice5(value); + + CPACSWallPosition::SetBulkheadUID_choice1(boost::none); + CPACSWallPosition::SetWallSegmentUID_choice2(boost::none); + CPACSWallPosition::SetFuselageSectionUID_choice3(boost::none); + CPACSWallPosition::SetSectionUID_choice4(boost::none); + + Invalidate(); +} + +void CCPACSWallPosition::SetY(const double& value) +{ + CPACSWallPosition::SetY(value); + Invalidate(); +} + +void CCPACSWallPosition::SetZ(const double& value) +{ + CPACSWallPosition::SetZ(value); + Invalidate(); +} + +void CCPACSWallPosition::InvalidateImpl(const boost::optional& source) const +{ + _isBuilt = false; + _shape = boost::none; +} + +const CCPACSWalls& CCPACSWallPosition::GetWalls() const +{ + const CCPACSWallPositions* wallPositions = GetParent(); + if (!wallPositions) { + throw CTiglError("Error in CCPACSWallPosition::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); + } + + const CCPACSWalls* walls = wallPositions->GetParent(); + if (!walls) { + throw CTiglError("Error in CCPACSWallPosition::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); + } + + return *walls; +} + +const CCPACSFuselage& CCPACSWallPosition::GetFuselage() const +{ + const CCPACSWalls& walls = GetWalls(); + + const CCPACSFuselageStructure* fuselageStructure = walls.GetParent(); + if (!fuselageStructure) { + throw CTiglError("Cannot get fuselage structure in CCPACSWallPosition::GetFuselage. Null pointer parent.", + TIGL_NULL_POINTER); + } + + const CCPACSFuselage* fuselage = fuselageStructure->GetParent(); + if (!fuselage) { + throw CTiglError("Cannot get fuselage in CCPACSWallPosition::GetFuselage. Null pointer parent.", + TIGL_NULL_POINTER); + } + + return *fuselage; +} + +const CCPACSHull& CCPACSWallPosition::GetHull() const +{ + const CCPACSWalls& walls = GetWalls(); + + const CCPACSHullStructure* hullStructure = walls.GetParent(); + if (!hullStructure) { + throw CTiglError("Cannot get hull structure in CCPACSWallPosition::GetHull. Null pointer parent.", + TIGL_NULL_POINTER); + } + + const CCPACSHull* hull = hullStructure->GetParent(); + if (!hull) { + throw CTiglError("Cannot get hull in CCPACSWallPosition::GetHull. Null pointer parent.", TIGL_NULL_POINTER); + } + + return *hull; +} + +} // namespace tigl diff --git a/src/structural_elements/CCPACSWallPosition.h b/src/structural_elements/CCPACSWallPosition.h index 687ce28349..e40b72df72 100644 --- a/src/structural_elements/CCPACSWallPosition.h +++ b/src/structural_elements/CCPACSWallPosition.h @@ -1,62 +1,65 @@ -/* -* Copyright (C) 2019 German Aerospace Center (DLR/SC) -* -* Created: 2019-10-16 Jan Kleinert -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#pragma once - -#include "generated/CPACSWallPosition.h" -#include "gp_Pnt.hxx" -#include "TopoDS_Shape.hxx" - -namespace tigl -{ - -class CCPACSWalls; -class CCPACSFuselage; - -class CCPACSWallPosition : public generated::CPACSWallPosition -{ -public: - TIGL_EXPORT CCPACSWallPosition(CCPACSWallPositions* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT gp_Pnt& GetBasePoint(); - TIGL_EXPORT gp_Pnt const& GetBasePoint() const; - - TIGL_EXPORT boost::optional& GetShape(); - TIGL_EXPORT boost::optional const& GetShape() const; - - // overriding setters for invalidation - TIGL_EXPORT void SetBulkheadUID_choice1(const boost::optional& value) override; - TIGL_EXPORT void SetWallSegmentUID_choice2(const boost::optional& value) override; - TIGL_EXPORT void SetFuselageSectionUID_choice3(const boost::optional& value) override; - TIGL_EXPORT void SetX_choice5(const boost::optional& value) override; - TIGL_EXPORT void SetY(const double& value) override; - TIGL_EXPORT void SetZ(const double& value) override; - -private: - void InvalidateImpl(const boost::optional& source) const override; - - void CalcBasePointAndShape() const; - const CCPACSWalls& GetWalls() const; - const CCPACSFuselage& GetFuselage() const; - - mutable bool isBuilt {false}; - mutable gp_Pnt base_point; - mutable boost::optional shape; -}; - -} +/* +* Copyright (C) 2019 German Aerospace Center (DLR/SC) +* +* Created: 2019-10-16 Jan Kleinert +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#pragma once + +#include "generated/CPACSWallPosition.h" +#include "gp_Pnt.hxx" +#include "TopoDS_Shape.hxx" + +namespace tigl +{ + +class CCPACSWalls; +class CCPACSFuselage; +class CCPACSHull; + +class CCPACSWallPosition : public generated::CPACSWallPosition +{ +public: + TIGL_EXPORT CCPACSWallPosition(CCPACSWallPositions* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT gp_Pnt& GetBasePoint(); + TIGL_EXPORT gp_Pnt const& GetBasePoint() const; + + TIGL_EXPORT boost::optional& GetShape(); + TIGL_EXPORT boost::optional const& GetShape() const; + + // overriding setters for invalidation + TIGL_EXPORT void SetBulkheadUID_choice1(const boost::optional& value) override; + TIGL_EXPORT void SetWallSegmentUID_choice2(const boost::optional& value) override; + TIGL_EXPORT void SetFuselageSectionUID_choice3(const boost::optional& value) override; + TIGL_EXPORT void SetSectionUID_choice4(const boost::optional& value) override; + TIGL_EXPORT void SetX_choice5(const boost::optional& value) override; + TIGL_EXPORT void SetY(const double& value) override; + TIGL_EXPORT void SetZ(const double& value) override; + +private: + void InvalidateImpl(const boost::optional& source) const override; + + void CalcBasePointAndShape() const; + const CCPACSWalls& GetWalls() const; + const CCPACSFuselage& GetFuselage() const; + const CCPACSHull& GetHull() const; + + mutable bool _isBuilt{false}; + mutable gp_Pnt _basePoint; + mutable boost::optional _shape; +}; + +} // namespace tigl diff --git a/src/structural_elements/CCPACSFuselageWallSegment.cpp b/src/structural_elements/CCPACSWallSegment.cpp similarity index 100% rename from src/structural_elements/CCPACSFuselageWallSegment.cpp rename to src/structural_elements/CCPACSWallSegment.cpp diff --git a/src/structural_elements/CCPACSFuselageWallSegment.h b/src/structural_elements/CCPACSWallSegment.h similarity index 100% rename from src/structural_elements/CCPACSFuselageWallSegment.h rename to src/structural_elements/CCPACSWallSegment.h diff --git a/src/structural_elements/CCPACSWalls.cpp b/src/structural_elements/CCPACSWalls.cpp index d6a76758df..96285c1bc9 100644 --- a/src/structural_elements/CCPACSWalls.cpp +++ b/src/structural_elements/CCPACSWalls.cpp @@ -26,11 +26,16 @@ CCPACSWalls::CCPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMg { } -const CCPACSFuselageWallSegment& CCPACSWalls::GetWallSegment(const std::string &uid) const +CCPACSWalls::CCPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + : generated::CPACSWalls (parent, uidMgr) +{ +} + +const CCPACSWallSegment& CCPACSWalls::GetWallSegment(const std::string &uid) const { const auto& wallSegmentsVector = GetWallSegments().GetWallSegments(); - for (const std::unique_ptr& current : wallSegmentsVector) { + for (const std::unique_ptr& current : wallSegmentsVector) { if (current->GetUID().value_or("") == uid) { return *current.get(); } diff --git a/src/structural_elements/CCPACSWalls.h b/src/structural_elements/CCPACSWalls.h index 8f685b579e..71ce2edadc 100644 --- a/src/structural_elements/CCPACSWalls.h +++ b/src/structural_elements/CCPACSWalls.h @@ -23,7 +23,7 @@ #include #include "generated/CPACSWalls.h" -#include "CCPACSFuselageWallSegment.h" +#include "CCPACSWallSegment.h" #include "CCPACSWallPosition.h" namespace tigl @@ -33,8 +33,9 @@ class CCPACSWalls : public generated::CPACSWalls { public: CCPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); + CCPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); - const CCPACSFuselageWallSegment& GetWallSegment(const std::string& uid) const; + const CCPACSWallSegment& GetWallSegment(const std::string& uid) const; const CCPACSWallPosition& GetWallPosition(const std::string& uid) const; void Invalidate(const boost::optional& source = boost::none) const; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 779c8fda40..c399caebe8 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -32,77 +32,103 @@ -

+
Fuselage Section 1 - + Fuselage Section 1 - fuselageCircleProfileuID + fuselageCircleProfile
-
+
Fuselage Section 2 - + Fuselage Section 2 - fuselageCircleProfileuID + fuselageCircleProfile
-
+
Fuselage Section 3 - + Fuselage Section 3 - fuselageCircleProfileuID + fuselageCircleProfile
- + Fuselage Positioning 1 0. 90 0 - fuselage_1Section1ID + fuselage_Section1 - + Fuselage Positioning 2 2. 90 0 - fuselage_1Section1ID - fuselage_1Section2ID + fuselage_Section1 + fuselage_section2 - + Fuselage Positioning 3 15. 90 0 - fuselage_1Section2ID - fuselage_1Section3ID + fuselage_section2 + fuselage_section3 - + Fuselage Segment 2 - fuselage_1Section1IDElement1 - fuselage_1Section2IDElement1 + fuselage_section1_element1 + fuselage_section2_element1 - + Fuselage Segment 3 - fuselage_1Section2IDElement1 - fuselage_1Section3IDElement1 + fuselage_section2_element1 + fuselage_section3_element1 + + + + + fuselage_Section1 + 0 + -0.8 + + + fuselage_section3 + 0 + -0.8 + + + + + 90 + true + + wall_fuselage_pos1 + wall_fuselage_pos2 + + + + + @@ -242,7 +268,7 @@ Section 1 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile @@ -257,7 +283,7 @@ Section 2 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile @@ -272,7 +298,7 @@ Section 3 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile @@ -327,7 +353,7 @@ Section 1 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile @@ -342,7 +368,7 @@ Section 2 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile @@ -357,7 +383,7 @@ Section 3 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile @@ -408,7 +434,7 @@ Section 1 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile 0.01 @@ -428,7 +454,7 @@ Section 2 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile @@ -443,7 +469,7 @@ Section 3 Element 1 - fuselageCircleProfileuID + fuselageCircleProfile 0.01 @@ -716,7 +742,7 @@ - + Circle Profile build up from set of Points on Circle where may Dimensions are 1..-1 diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 076370c61c..28c846325d 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -100,6 +100,8 @@ class FuselageTank : public ::testing::Test tigl::CCPACSHull* hull_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); tigl::CCPACSHull* hull_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); + tigl::CCPACSWallSegment* wall_in_fuselage = &uidMgr.ResolveObject("wall_fuselage"); + const char* tankTypeExceptionString = "This method is only available for hulls with segments. No segment found."; }; @@ -279,4 +281,10 @@ TEST_F(FuselageTank, structure) EXPECT_EQ(structure->GetFrames()->GetFrames().size(), 1); EXPECT_EQ(structure->GetUID(), "outerHullStructure"); -} \ No newline at end of file +} + +TEST_F(FuselageTank, walls) +{ + EXPECT_EQ(wall_in_fuselage->GetUID().get(), "wall_fuselage"); + auto loft = wall_in_fuselage->GetLoft(); +} From 6b45fdf6f9d2aaad07eb44f742a324997d71378a Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sun, 9 Jun 2024 21:33:13 +0200 Subject: [PATCH 051/122] walls part2: implement wall segments --- src/structural_elements/CCPACSWallSegment.cpp | 236 ++++++++++-------- src/structural_elements/CCPACSWallSegment.h | 8 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 59 +++++ 3 files changed, 202 insertions(+), 101 deletions(-) diff --git a/src/structural_elements/CCPACSWallSegment.cpp b/src/structural_elements/CCPACSWallSegment.cpp index 35a99fdf3c..4c5c7a44ca 100644 --- a/src/structural_elements/CCPACSWallSegment.cpp +++ b/src/structural_elements/CCPACSWallSegment.cpp @@ -16,11 +16,13 @@ * limitations under the License. */ -#include "CCPACSFuselageWallSegment.h" +#include "CCPACSWallSegment.h" #include "generated/CPACSWallSegments.h" #include "generated/CPACSWalls.h" #include "CCPACSFuselageStructure.h" #include "CCPACSFuselage.h" +#include "CCPACSHull.h" +#include "CCPACSHullStructure.h" #include "CCPACSFuselageSegment.h" #include "CNamedShape.h" #include "CCPACSWallPosition.h" @@ -46,7 +48,8 @@ #include -namespace { +namespace +{ // Given a CCPACSWallposition with a defined shape, project the point pnt along the direction dir onto the // plane, in which the shape lies. The shape must be convertable to a planar TopoDS_Face. @@ -56,7 +59,7 @@ void FlushPointAlongVec(tigl::CCPACSWallPosition const& p, gp_Vec const dir, dou throw tigl::CTiglError("Cannot flush point for wall position without shape definition."); } gp_Pln pln; - TopoDS_Shape shape = *p.GetShape(); + TopoDS_Shape shape = *p.GetShape(); Handle(Geom_Surface) surf = BRep_Tool::Surface(TopoDS::Face(*p.GetShape())); GeomLib_IsPlanarSurface surf_check(surf); if (surf_check.IsPlanar()) { @@ -68,231 +71,268 @@ void FlushPointAlongVec(tigl::CCPACSWallPosition const& p, gp_Vec const dir, dou pln.SetLocation(p.GetBasePoint()); TopoDS_Face face = BRepBuilderAPI_MakeFace(pln); - TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(pnt.Translated( dir*extents), - pnt.Translated(-dir*extents)).Edge(); + TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(pnt.Translated(dir * extents), pnt.Translated(-dir * extents)).Edge(); GetIntersectionPoint(face, edge, pnt); } -} +} // namespace namespace tigl { -CCPACSFuselageWallSegment::CCPACSFuselageWallSegment(CCPACSWallSegments* parent, tigl::CTiglUIDManager *uidMgr) +CCPACSWallSegment::CCPACSWallSegment(CCPACSWallSegments* parent, tigl::CTiglUIDManager* uidMgr) : generated::CPACSWallSegment(parent, uidMgr) { } -TopoDS_Compound CCPACSFuselageWallSegment::GetCutPlanes() const +TopoDS_Compound CCPACSWallSegment::GetCutPlanes() const { // Makes sure, that the cut planes are already computed - if (m_cutPlanes.IsNull()) { + if (_cutPlanes.IsNull()) { BuildLoft(); } - return m_cutPlanes; + return _cutPlanes; } -void CCPACSFuselageWallSegment::SetPhi(const double& value) +void CCPACSWallSegment::SetPhi(const double& value) { CPACSWallSegment::SetPhi(value); Invalidate(); } -void CCPACSFuselageWallSegment::SetDoubleSidedExtrusion(const boost::optional& value) +void CCPACSWallSegment::SetDoubleSidedExtrusion(const boost::optional& value) { CPACSWallSegment::SetDoubleSidedExtrusion(value); Invalidate(); } -void CCPACSFuselageWallSegment::InvalidateImpl(const boost::optional& source) const +void CCPACSWallSegment::InvalidateImpl(const boost::optional& source) const { loft.clear(); } -const CCPACSWalls& CCPACSFuselageWallSegment::GetWalls() const +const CCPACSWalls& CCPACSWallSegment::GetWalls() const { const CCPACSWallSegments* wallSegments = GetParent(); if (!wallSegments) { - throw CTiglError("Error in CCPACSFuselageWallSegment::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); + throw CTiglError("Error in CCPACSWallSegment::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); } - + const CCPACSWalls* walls = wallSegments->GetParent(); if (!walls) { - throw CTiglError("Error in CCPACSFuselageWallSegment::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); + throw CTiglError("Error in CCPACSWallSegment::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); } - + return *walls; } -const CCPACSFuselage &CCPACSFuselageWallSegment::GetFuselage() const +const CCPACSFuselage& CCPACSWallSegment::GetFuselage() const { const CCPACSWalls& walls = GetWalls(); - - const CCPACSFuselageStructure* fuselageStructure = walls.GetParent(); + + const CCPACSFuselageStructure* fuselageStructure = walls.GetParent(); if (!fuselageStructure) { - throw CTiglError("Cannot get fuselage in CCPACSFuselageWallSegment::GetFuselage. Null pointer parent.", TIGL_NULL_POINTER); + throw CTiglError("Cannot get fuselage structure in CCPACSWallPosition::GetFuselage. Null pointer parent.", + TIGL_NULL_POINTER); } const CCPACSFuselage* fuselage = fuselageStructure->GetParent(); if (!fuselage) { - throw CTiglError("Cannot get fuselage in CCPACSFuselageWallSegment::GetFuselage. Null pointer parent.", TIGL_NULL_POINTER); + throw CTiglError("Cannot get fuselage in CCPACSWallPosition::GetFuselage. Null pointer parent.", + TIGL_NULL_POINTER); } return *fuselage; } -PNamedShape CCPACSFuselageWallSegment::BuildLoft() const -{ +const CCPACSHull& CCPACSWallSegment::GetHull() const +{ + const CCPACSWalls& walls = GetWalls(); + + const CCPACSHullStructure* hullStructure = walls.GetParent(); + if (!hullStructure) { + throw CTiglError("Cannot get hull structure in CCPACSWallPosition::GetHull. Null pointer parent.", + TIGL_NULL_POINTER); + } + + const CCPACSHull* hull = hullStructure->GetParent(); + if (!hull) { + throw CTiglError("Cannot get hull in CCPACSWallPosition::GetHull. Null pointer parent.", TIGL_NULL_POINTER); + } + + return *hull; +} + +PNamedShape CCPACSWallSegment::BuildLoft() const +{ // A bounding box is created to use its diagonal as reference for the // extrusion length (edge length). This ensures that these always go // beyond the model, but do not reach into infinity. Bnd_Box boundingBox; - const CCPACSFuselage& fuselage = GetFuselage(); - TopoDS_Shape fuselageShape = fuselage.GetLoft()->Shape(); - BRepBndLib::Add(fuselageShape, boundingBox); + TopoDS_Shape parentShape; + CTiglTransformation transformationMatrix; + + bool isFuselage = GetParent()->GetParent()->IsParent(); + bool isHull = GetParent()->GetParent()->IsParent(); + + if (isFuselage) { + const CCPACSFuselage& fuselage = GetFuselage(); + parentShape = fuselage.GetLoft()->Shape(); + transformationMatrix = fuselage.GetTransformationMatrix(); + } + else if (isHull) { + const CCPACSHull& hull = GetHull(); + parentShape = hull.GetLoft()->Shape(); + transformationMatrix = hull.GetTransformationMatrix(); + } + else { + throw CTiglError("Parent of CCPACSWallSegment is neither a fuselage nor a hull."); + } + + BRepBndLib::Add(parentShape, boundingBox); double bboxSize = sqrt(boundingBox.SquareExtent()); - + size_t nWallPositions = GetWallPositionUIDs().GetWallPositionUIDs().size(); // list with base points: - std::vector base_pnts; - base_pnts.reserve(nWallPositions); + std::vector basePoints; + basePoints.reserve(nWallPositions); - // extrusion in negative direction is realized by setting u_neg to + // extrusion in negative direction is realized by setting uNeg to // -bboxSize: bool negativeExtrusion = GetDoubleSidedExtrusion().value_or(false); - double u_pos = bboxSize; - double u_neg = 0.; + double uPositive = bboxSize; + double uNegative = 0.; if (negativeExtrusion) { - u_neg = -bboxSize; + uNegative = -bboxSize; } - gp_Pnt upper, lower; // upper and lower extrusion points for each base point - gp_Vec x_vec; // vector from one base point to the next + gp_Pnt upper, lower; // upper and lower extrusion points for each base point + gp_Vec xVector; // vector from one base point to the next // build for untrimmed wall - TopoDS_Builder builder_wall, builder_cutter; + TopoDS_Builder builderWall, builderCutter; TopoDS_Compound wall; - builder_wall.MakeCompound(wall); - builder_cutter.MakeCompound(m_cutPlanes); + builderWall.MakeCompound(wall); + builderCutter.MakeCompound(_cutPlanes); - size_t count = 0; + size_t count = 0; const auto& walls = GetWalls(); for (auto wallPositionUID : GetWallPositionUIDs().GetWallPositionUIDs()) { const CCPACSWallPosition& p = walls.GetWallPosition(wallPositionUID); // get current base point and x_vec pointing from previous base point to current gp_Pnt base_point = p.GetBasePoint(); - if ( count > 0 ) { - x_vec = gp_Vec(base_pnts.back(), base_point); + if (count > 0) { + xVector = gp_Vec(basePoints.back(), base_point); } // extrusion vector double phiRad = Radians(GetPhi()); - gp_Vec ext_vec(0., -sin(phiRad), cos(phiRad)); - ext_vec = GetFuselage().GetTransformationMatrix().Transform(ext_vec); + gp_Vec extVec(0., -sin(phiRad), cos(phiRad)); + extVec = transformationMatrix.Transform(extVec); - if (count==1) { + if (count == 1) { // flush first position to shape - if( p.GetShape() && GetFlushConnectionStart().value_or(false) ) { - std::string uid_prev = GetWallPositionUIDs().GetWallPositionUIDs().front(); - const CCPACSWallPosition& p_prev = walls.GetWallPosition(uid_prev); - FlushPointAlongVec(p_prev, x_vec, bboxSize, upper); - FlushPointAlongVec(p_prev, x_vec, bboxSize, lower); + if (p.GetShape() && GetFlushConnectionStart().value_or(false)) { + std::string uidPrev = GetWallPositionUIDs().GetWallPositionUIDs().front(); + const CCPACSWallPosition& pPrev = walls.GetWallPosition(uidPrev); + FlushPointAlongVec(pPrev, xVector, bboxSize, upper); + FlushPointAlongVec(pPrev, xVector, bboxSize, lower); } } - gp_Pnt upper_new = base_point.Translated(u_pos*ext_vec); - gp_Pnt lower_new = base_point.Translated(u_neg*ext_vec); + gp_Pnt upperNew = base_point.Translated(uPositive * extVec); + gp_Pnt lowerNew = base_point.Translated(uNegative * extVec); - if (count==nWallPositions-1) { + if (count == nWallPositions - 1) { // flush last position to shape - if( p.GetShape() && GetFlushConnectionEnd().value_or(false) ) { - FlushPointAlongVec(p, x_vec, bboxSize, upper_new); - FlushPointAlongVec(p, x_vec, bboxSize, lower_new); + if (p.GetShape() && GetFlushConnectionEnd().value_or(false)) { + FlushPointAlongVec(p, xVector, bboxSize, upperNew); + FlushPointAlongVec(p, xVector, bboxSize, lowerNew); } } // create the wall segment from the four corner points lower, upper, lower_new, upper_new - if (count > 0 ) { - TopoDS_Face face = BuildFace(lower, lower_new, upper, upper_new); - builder_wall.Add(wall, face); + if (count > 0) { + TopoDS_Face face = BuildFace(lower, lowerNew, upper, upperNew); + builderWall.Add(wall, face); //first and last face are enlarged for the cutting tool - gp_Pnt lower_cut = lower; - gp_Pnt upper_cut = upper; - gp_Pnt lower_new_cut = lower_new; - gp_Pnt upper_new_cut = upper_new; - if (count==1) { - lower_cut = lower.Translated(-bboxSize*x_vec); - upper_cut = upper.Translated(-bboxSize*x_vec); + gp_Pnt lowerCut = lower; + gp_Pnt upperCut = upper; + gp_Pnt lowerNewCut = lowerNew; + gp_Pnt upperNewCut = upperNew; + if (count == 1) { + lowerCut = lower.Translated(-bboxSize * xVector); + upperCut = upper.Translated(-bboxSize * xVector); } - if (count==nWallPositions-1) { - lower_new_cut = lower_new.Translated(bboxSize*x_vec); - upper_new_cut = upper_new.Translated(bboxSize*x_vec); + if (count == nWallPositions - 1) { + lowerNewCut = lowerNew.Translated(bboxSize * xVector); + upperNewCut = upperNew.Translated(bboxSize * xVector); } - face = BuildFace(lower_cut, lower_new_cut, upper_cut, upper_new_cut); - builder_cutter.Add(m_cutPlanes, face); + face = BuildFace(lowerCut, lowerNewCut, upperCut, upperNewCut); + builderCutter.Add(_cutPlanes, face); } // store base_pnts and remember current lower and upper point for next position - base_pnts.push_back(base_point); - upper = upper_new; - lower = lower_new; + basePoints.push_back(base_point); + upper = upperNew; + lower = lowerNew; ++count; } // trim the wall - // Step 1/2: Trim the wall by the fuselage + // Step 1/2: Trim the wall by the fuselage / hull { - TopoDS_Compound cut_wall; - builder_wall.MakeCompound(cut_wall); + TopoDS_Compound cutWall; + builderWall.MakeCompound(cutWall); - TopoDS_Shape result = SplitShape(wall, fuselageShape); + TopoDS_Shape result = SplitShape(wall, parentShape); TopTools_IndexedMapOfShape faceMap; TopExp::MapShapes(result, TopAbs_FACE, faceMap); for (int i = 0; i < faceMap.Extent(); ++i) { - // check if face center is on the interior of the fuselage - TopoDS_Face face = TopoDS::Face(faceMap(i+1)); + // check if face center is on the interior of the fuselage / hull + TopoDS_Face face = TopoDS::Face(faceMap(i + 1)); gp_Pnt faceCenter = GetCentralFacePoint(face); - BRepClass3d_SolidClassifier clas3d(fuselageShape); + BRepClass3d_SolidClassifier clas3d(parentShape); clas3d.Perform(faceCenter, Precision::Confusion()); if (clas3d.State() == TopAbs_IN) { - builder_wall.Add(cut_wall, face); + builderWall.Add(cutWall, face); } } - wall = cut_wall; + wall = cutWall; } // Step 2/2: Cut the wall with bounding elements: if (GetBoundingElementUIDs()) { - for (std::string bounding_element_uid : GetBoundingElementUIDs()->GetBoundingElementUIDs()) { - const CCPACSFuselageWallSegment& bounding_element = GetWalls().GetWallSegment(bounding_element_uid); - TopoDS_Compound bounding_cutPlane = bounding_element.GetCutPlanes(); - TopoDS_Shape result = SplitShape(wall, bounding_cutPlane); - - TopoDS_Compound cut_wall; - builder_wall.MakeCompound(cut_wall); + for (std::string boundingElementUid : GetBoundingElementUIDs()->GetBoundingElementUIDs()) { + const CCPACSWallSegment& boundingElement = GetWalls().GetWallSegment(boundingElementUid); + TopoDS_Compound boundingCutPlane = boundingElement.GetCutPlanes(); + TopoDS_Shape result = SplitShape(wall, boundingCutPlane); + + TopoDS_Compound cutWall; + builderWall.MakeCompound(cutWall); TopTools_IndexedMapOfShape faceMap; TopExp::MapShapes(result, TopAbs_FACE, faceMap); // Loop over the split faces and check weather one of the // base points belongs to the face. - for (int i = 0; i 0.1 + + + + + 1 + -1 + -0.2 + + + 1 + 1 + -0.2 + + + 1.5 + -1 + 0.2 + + + 1.5 + 1 + 0.2 + + + 2 + -1 + -0.2 + + + 2 + 1 + -0.2 + + + + + 180 + + tank5_wall_p1 + tank5_wall_p2 + + + + 0 + + tank5_wall_p3 + tank5_wall_p4 + + + + 180 + + tank5_wall_p5 + tank5_wall_p6 + + + + + From 9efac8edb89673f2d136f72e9ddb06f8c1baf2b9 Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 13 Jun 2024 10:38:12 +0200 Subject: [PATCH 052/122] sort out redundant code into ITiglWallUtils.h --- src/fuelTanks/CCPACSFuelTanks.h | 2 +- .../CCPACSWallPosition.cpp | 44 ++----------- src/structural_elements/CCPACSWallSegment.cpp | 44 ++----------- src/structural_elements/ITiglWallUtils.h | 64 +++++++++++++++++++ 4 files changed, 73 insertions(+), 81 deletions(-) create mode 100644 src/structural_elements/ITiglWallUtils.h diff --git a/src/fuelTanks/CCPACSFuelTanks.h b/src/fuelTanks/CCPACSFuelTanks.h index 7fa81fcbfe..b1ec278f48 100644 --- a/src/fuelTanks/CCPACSFuelTanks.h +++ b/src/fuelTanks/CCPACSFuelTanks.h @@ -39,7 +39,7 @@ class CCPACSFuelTanks : public generated::CPACSFuelTanks TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index) const; // Returns the fuel tank index for a given uID. - TIGL_EXPORT int GetFuelTankIndex(const std::string& uID) const; + TIGL_EXPORT int GetFuelTankIndex(std::string const& uID) const; // Returns the total count of fuel tank in a configuration TIGL_EXPORT int GetFuelTanksCount() const; diff --git a/src/structural_elements/CCPACSWallPosition.cpp b/src/structural_elements/CCPACSWallPosition.cpp index 31bd92fad7..b7586f56ff 100644 --- a/src/structural_elements/CCPACSWallPosition.cpp +++ b/src/structural_elements/CCPACSWallPosition.cpp @@ -25,6 +25,7 @@ #include "CCPACSWalls.h" #include "CCPACSFuselageStructure.h" #include "CCPACSFuselage.h" +#include "ITiglWallUtils.h" #include "CTiglError.h" #include "Bnd_Box.hxx" #include "BRepBndLib.hxx" @@ -243,54 +244,17 @@ void CCPACSWallPosition::InvalidateImpl(const boost::optional& sour const CCPACSWalls& CCPACSWallPosition::GetWalls() const { - const CCPACSWallPositions* wallPositions = GetParent(); - if (!wallPositions) { - throw CTiglError("Error in CCPACSWallPosition::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); - } - - const CCPACSWalls* walls = wallPositions->GetParent(); - if (!walls) { - throw CTiglError("Error in CCPACSWallPosition::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); - } - - return *walls; + return tigl::GetWalls(this); } const CCPACSFuselage& CCPACSWallPosition::GetFuselage() const { - const CCPACSWalls& walls = GetWalls(); - - const CCPACSFuselageStructure* fuselageStructure = walls.GetParent(); - if (!fuselageStructure) { - throw CTiglError("Cannot get fuselage structure in CCPACSWallPosition::GetFuselage. Null pointer parent.", - TIGL_NULL_POINTER); - } - - const CCPACSFuselage* fuselage = fuselageStructure->GetParent(); - if (!fuselage) { - throw CTiglError("Cannot get fuselage in CCPACSWallPosition::GetFuselage. Null pointer parent.", - TIGL_NULL_POINTER); - } - - return *fuselage; + return tigl::GetFuselage(this); } const CCPACSHull& CCPACSWallPosition::GetHull() const { - const CCPACSWalls& walls = GetWalls(); - - const CCPACSHullStructure* hullStructure = walls.GetParent(); - if (!hullStructure) { - throw CTiglError("Cannot get hull structure in CCPACSWallPosition::GetHull. Null pointer parent.", - TIGL_NULL_POINTER); - } - - const CCPACSHull* hull = hullStructure->GetParent(); - if (!hull) { - throw CTiglError("Cannot get hull in CCPACSWallPosition::GetHull. Null pointer parent.", TIGL_NULL_POINTER); - } - - return *hull; + return tigl::GetHull(this); } } // namespace tigl diff --git a/src/structural_elements/CCPACSWallSegment.cpp b/src/structural_elements/CCPACSWallSegment.cpp index 4c5c7a44ca..28ed2310e0 100644 --- a/src/structural_elements/CCPACSWallSegment.cpp +++ b/src/structural_elements/CCPACSWallSegment.cpp @@ -24,6 +24,7 @@ #include "CCPACSHull.h" #include "CCPACSHullStructure.h" #include "CCPACSFuselageSegment.h" +#include "ITiglWallUtils.h" #include "CNamedShape.h" #include "CCPACSWallPosition.h" #include "CTiglUIDManager.h" @@ -113,54 +114,17 @@ void CCPACSWallSegment::InvalidateImpl(const boost::optional& sourc const CCPACSWalls& CCPACSWallSegment::GetWalls() const { - const CCPACSWallSegments* wallSegments = GetParent(); - if (!wallSegments) { - throw CTiglError("Error in CCPACSWallSegment::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); - } - - const CCPACSWalls* walls = wallSegments->GetParent(); - if (!walls) { - throw CTiglError("Error in CCPACSWallSegment::GetWalls. Null pointer returned.", TIGL_NULL_POINTER); - } - - return *walls; + return tigl::GetWalls(this); } const CCPACSFuselage& CCPACSWallSegment::GetFuselage() const { - const CCPACSWalls& walls = GetWalls(); - - const CCPACSFuselageStructure* fuselageStructure = walls.GetParent(); - if (!fuselageStructure) { - throw CTiglError("Cannot get fuselage structure in CCPACSWallPosition::GetFuselage. Null pointer parent.", - TIGL_NULL_POINTER); - } - - const CCPACSFuselage* fuselage = fuselageStructure->GetParent(); - if (!fuselage) { - throw CTiglError("Cannot get fuselage in CCPACSWallPosition::GetFuselage. Null pointer parent.", - TIGL_NULL_POINTER); - } - - return *fuselage; + return tigl::GetFuselage(this); } const CCPACSHull& CCPACSWallSegment::GetHull() const { - const CCPACSWalls& walls = GetWalls(); - - const CCPACSHullStructure* hullStructure = walls.GetParent(); - if (!hullStructure) { - throw CTiglError("Cannot get hull structure in CCPACSWallPosition::GetHull. Null pointer parent.", - TIGL_NULL_POINTER); - } - - const CCPACSHull* hull = hullStructure->GetParent(); - if (!hull) { - throw CTiglError("Cannot get hull in CCPACSWallPosition::GetHull. Null pointer parent.", TIGL_NULL_POINTER); - } - - return *hull; + return tigl::GetHull(this); } PNamedShape CCPACSWallSegment::BuildLoft() const diff --git a/src/structural_elements/ITiglWallUtils.h b/src/structural_elements/ITiglWallUtils.h new file mode 100644 index 0000000000..d3c40f0916 --- /dev/null +++ b/src/structural_elements/ITiglWallUtils.h @@ -0,0 +1,64 @@ +// ITiglWallUtils.h + +#pragma once + +#include "CCPACSFuselage.h" +#include "CCPACSFuselageStructure.h" +#include "CCPACSHull.h" +#include "CCPACSHullStructure.h" +#include "CCPACSWalls.h" +#include "CTiglError.h" + +namespace tigl +{ + +template const CCPACSWalls& GetWalls(const T* wallObject) +{ + const auto* wallSegments = wallObject->GetParent(); + if (!wallSegments) { + throw CTiglError("Error in GetWalls. Null pointer returned.", TIGL_NULL_POINTER); + } + + const auto* walls = wallSegments->GetParent(); + if (!walls) { + throw CTiglError("Error in GetWalls. Null pointer returned.", TIGL_NULL_POINTER); + } + + return *walls; +} + +template const CCPACSFuselage& GetFuselage(const T* wallObject) +{ + const CCPACSWalls& walls = GetWalls(wallObject); + + const auto* fuselageStructure = walls.GetParent(); + if (!fuselageStructure) { + throw CTiglError("Cannot get fuselage structure in GetFuselage. Null pointer parent.", TIGL_NULL_POINTER); + } + + const auto* fuselage = fuselageStructure->GetParent(); + if (!fuselage) { + throw CTiglError("Cannot get fuselage in GetFuselage. Null pointer parent.", TIGL_NULL_POINTER); + } + + return *fuselage; +} + +template const CCPACSHull& GetHull(const T* wallObject) +{ + const CCPACSWalls& walls = GetWalls(wallObject); + + const auto* hullStructure = walls.GetParent(); + if (!hullStructure) { + throw CTiglError("Cannot get hull structure in GetHull. Null pointer parent.", TIGL_NULL_POINTER); + } + + const auto* hull = hullStructure->GetParent(); + if (!hull) { + throw CTiglError("Cannot get hull in GetHull. Null pointer parent.", TIGL_NULL_POINTER); + } + + return *hull; +} + +} // namespace tigl From 4e4b139887262289c1dcae240f30920f13f4dd1f Mon Sep 17 00:00:00 2001 From: Alder Date: Sat, 23 Nov 2024 11:00:46 +0100 Subject: [PATCH 053/122] fix how to get instance of CCPACSConfigurationManager in fuelTanks test --- tests/unittests/test_fuelTanks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index f47722b7ad..51fb12c7c4 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -15,7 +15,7 @@ def setUp(self): self.assertIsNone(self.tixi.open("TestData/simpletest-fuelTanks.cpacs.xml")) self.assertIsNone(self.tigl.open(self.tixi, "")) - mgr = configuration.CCPACSConfigurationManager_get_instance() + mgr = configuration.CCPACSConfigurationManager.get_instance() self.config = mgr.get_configuration(self.tigl._handle.value) uid_mgr = self.config.get_uidmanager() From e99653c3ef5c8117c0a551cb6eb9c9214346413e Mon Sep 17 00:00:00 2001 From: Alder Date: Sat, 23 Nov 2024 22:47:19 +0100 Subject: [PATCH 054/122] rename hulls -> vessels; do some xsd restructuring --- bindings/python_internal/configuration.i | 30 +- cpacs_gen_input/CustomTypes.txt | 6 +- cpacs_gen_input/cpacs_schema.xsd | 65 +- src/api/tigl.h | 2 +- src/fuelTanks/CCPACSFuelTank.cpp | 8 +- src/fuelTanks/CCPACSHulls.cpp | 75 - .../{CCPACSHull.cpp => CCPACSVessel.cpp} | 1384 ++++++++--------- .../{CCPACSHull.h => CCPACSVessel.h} | 274 ++-- ...tructure.cpp => CCPACSVesselStructure.cpp} | 56 +- ...ullStructure.h => CCPACSVesselStructure.h} | 74 +- src/fuelTanks/CCPACSVessels.cpp | 75 + .../{CCPACSHulls.h => CCPACSVessels.h} | 24 +- src/fuselage/CCPACSFramesAssembly.cpp | 4 +- src/fuselage/CCPACSFramesAssembly.h | 2 +- src/fuselage/CCPACSFuselageSections.cpp | 2 +- src/fuselage/CCPACSFuselageSections.h | 2 +- src/fuselage/CCPACSFuselageSegment.cpp | 14 +- src/fuselage/CCPACSFuselageSegments.cpp | 12 +- src/fuselage/CCPACSFuselageSegments.h | 2 +- src/fuselage/CCPACSSkin.cpp | 2 +- src/fuselage/CCPACSSkin.h | 2 +- src/fuselage/CCPACSStringersAssembly.cpp | 2 +- src/fuselage/CCPACSStringersAssembly.h | 2 +- src/fuselage/CTiglFuselageConnection.cpp | 10 +- src/fuselage/ITiglFuselageDuctStructure.h | 4 +- src/generated/CPACSDomeType.cpp | 8 +- src/generated/CPACSDomeType.h | 12 +- src/generated/CPACSFramesAssembly.cpp | 14 +- src/generated/CPACSFramesAssembly.h | 10 +- src/generated/CPACSFuelTank.cpp | 96 +- src/generated/CPACSFuelTank.h | 37 +- src/generated/CPACSFuelTankVolume.cpp | 22 +- src/generated/CPACSFuelTankVolume.h | 10 +- src/generated/CPACSFuselageSections.cpp | 14 +- src/generated/CPACSFuselageSections.h | 10 +- src/generated/CPACSFuselageSegments.cpp | 14 +- src/generated/CPACSFuselageSegments.h | 10 +- src/generated/CPACSSkin.cpp | 14 +- src/generated/CPACSSkin.h | 12 +- src/generated/CPACSStringersAssembly.cpp | 14 +- src/generated/CPACSStringersAssembly.h | 10 +- src/generated/CPACSTransformation.cpp | 30 +- src/generated/CPACSTransformation.h | 10 +- .../{CPACSHull.cpp => CPACSVessel.cpp} | 172 +- src/generated/{CPACSHull.h => CPACSVessel.h} | 54 +- ...inLayers.cpp => CPACSVesselSkinLayers.cpp} | 32 +- ...llSkinLayers.h => CPACSVesselSkinLayers.h} | 26 +- ...Structure.cpp => CPACSVesselStructure.cpp} | 164 +- ...HullStructure.h => CPACSVesselStructure.h} | 50 +- .../{CPACSHulls.cpp => CPACSVessels.cpp} | 56 +- .../{CPACSHulls.h => CPACSVessels.h} | 30 +- src/generated/CPACSWalls.cpp | 14 +- src/generated/CPACSWalls.h | 10 +- src/geometry/CCPACSTransformation.cpp | 2 +- src/geometry/CCPACSTransformation.h | 2 +- src/math/CTiglIntersectBSplines.cpp | 8 +- src/math/CTiglIntersectBSplines.h | 2 +- .../CCPACSWallPosition.cpp | 24 +- src/structural_elements/CCPACSWallPosition.h | 4 +- src/structural_elements/CCPACSWallSegment.cpp | 24 +- src/structural_elements/CCPACSWallSegment.h | 4 +- src/structural_elements/CCPACSWalls.cpp | 2 +- src/structural_elements/CCPACSWalls.h | 2 +- src/structural_elements/ITiglWallUtils.h | 20 +- .../TestData/simpletest-fuelTanks.cpacs.xml | 178 +-- tests/unittests/test_fuelTanks.py | 170 +- tests/unittests/tiglTanks.cpp | 208 +-- 67 files changed, 1828 insertions(+), 1910 deletions(-) delete mode 100644 src/fuelTanks/CCPACSHulls.cpp rename src/fuelTanks/{CCPACSHull.cpp => CCPACSVessel.cpp} (80%) rename src/fuelTanks/{CCPACSHull.h => CCPACSVessel.h} (73%) rename src/fuelTanks/{CCPACSHullStructure.cpp => CCPACSVesselStructure.cpp} (75%) rename src/fuelTanks/{CCPACSHullStructure.h => CCPACSVesselStructure.h} (72%) create mode 100644 src/fuelTanks/CCPACSVessels.cpp rename src/fuelTanks/{CCPACSHulls.h => CCPACSVessels.h} (55%) rename src/generated/{CPACSHull.cpp => CPACSVessel.cpp} (70%) rename src/generated/{CPACSHull.h => CPACSVessel.h} (73%) rename src/generated/{CPACSHullSkinLayers.cpp => CPACSVesselSkinLayers.cpp} (67%) rename src/generated/{CPACSHullSkinLayers.h => CPACSVesselSkinLayers.h} (73%) rename src/generated/{CPACSHullStructure.cpp => CPACSVesselStructure.cpp} (53%) rename src/generated/{CPACSHullStructure.h => CPACSVesselStructure.h} (62%) rename src/generated/{CPACSHulls.cpp => CPACSVessels.cpp} (50%) rename src/generated/{CPACSHulls.h => CPACSVessels.h} (70%) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index e3dfc736b0..c436ef68bc 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -101,12 +101,12 @@ #include "generated/CPACSFuelTankVolume.h" #include "CCPACSFuelTanks.h" #include "CCPACSFuelTank.h" -#include "generated/CPACSHulls.h" -#include "CCPACSHulls.h" -#include "generated/CPACSHull.h" -#include "CCPACSHull.h" -#include "generated/CPACSHullStructure.h" -#include "CCPACSHullStructure.h" +#include "generated/CPACSVessels.h" +#include "CCPACSVessels.h" +#include "generated/CPACSVessel.h" +#include "CCPACSVessel.h" +#include "generated/CPACSVesselStructure.h" +#include "CCPACSVesselStructure.h" #include "CCPACSFrame.h" @@ -344,19 +344,19 @@ namespace tigl %boost_optional(tigl::CCPACSFuelTanks) %boost_optional(tigl::generated::CPACSFuelTanks) %boost_optional(tigl::generated::CPACSFuelTankVolume) -%boost_optional(tigl::CCPACSHullStructure) +%boost_optional(tigl::CCPACSVesselStructure) namespace tigl { class CCPACSFuselageSegments; -class CCPACSHulls; +class CCPACSVessels; } %include "generated/CPACSIsotensoidDome.h" %include "generated/CPACSTorisphericalDome.h" %include "generated/CPACSEllipsoidDome.h" %include "generated/CPACSDomeType.h" -%include "generated/CPACSHullStructure.h" -%include "CCPACSHullStructure.h" +%include "generated/CPACSVesselStructure.h" +%include "CCPACSVesselStructure.h" %include "generated/CPACSFuelTanks.h" %include "generated/CPACSFuelTankVolume.h" %include "generated/CPACSFuelTank.h" @@ -365,10 +365,10 @@ class CCPACSHulls; %include "CCPACSFuselageSegments.h" %include "CCPACSFuelTanks.h" %include "CCPACSFuelTank.h" -%include "generated/CPACSHulls.h" -%include "CCPACSHulls.h" -%include "generated/CPACSHull.h" -%include "CCPACSHull.h" +%include "generated/CPACSVessels.h" +%include "CCPACSVessels.h" +%include "generated/CPACSVessel.h" +%include "CCPACSVessel.h" %include "generated/CPACSFuselageFuelTanks.h" // -------------------- Wing Structure -------------------// @@ -584,7 +584,7 @@ class CCPACSWingRibsPositioning; tigl::CCPACSDuct, tigl::CCPACSDuctAssembly, tigl::CCPACSFuelTank, - tigl::CCPACSHull + tigl::CCPACSVessel ); namespace tigl diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index a76b33495e..01eb5a96d0 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -151,8 +151,8 @@ CPACSDuctAssembly CCPACSDuctAssembly CPACSDucts CCPACSDucts // Tanks -CPACSHull CCPACSHull -CPACSHulls CCPACSHulls +CPACSVessel CCPACSVessel +CPACSVessels CCPACSVessels CPACSFuelTank CCPACSFuelTank CPACSFuelTanks CCPACSFuelTanks -CPACSHullStructure CCPACSHullStructure \ No newline at end of file +CPACSVesselStructure CCPACSVesselStructure \ No newline at end of file diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index 118f5366c9..aa1d38e45c 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -36194,17 +36194,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - Volume - - - - - Burst pressure - - + @@ -36212,12 +36202,12 @@ The fuel tank volume type should also be used for the wing fuel tank - + - Hulls + Vessels @@ -36225,18 +36215,18 @@ The fuel tank volume type should also be used for the wing fuel tank - + - + - Hulls + Vessel @@ -36276,8 +36266,19 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + + + Volume + + + + + Burst pressure + + @@ -36382,7 +36383,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -36397,9 +36398,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - + @@ -36407,7 +36406,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -36429,4 +36428,26 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + + Structural mounts + + + + + + + + + + + + + + + + diff --git a/src/api/tigl.h b/src/api/tigl.h index 5dbcd676ea..9e8194698d 100644 --- a/src/api/tigl.h +++ b/src/api/tigl.h @@ -234,7 +234,7 @@ TIGL_COMPONENT_FUSELAGE_WALL, /**< The Component is a fuselage wall */ TIGL_COMPONENT_CONTROL_SURFACE_DEVICE, /**< The component is a control surface device (flap) */ TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ TIGL_COMPONENT_FUSELAGE_TANK, /**< The Component is a fuselage tank */ -TIGL_COMPONENT_FUSELAGE_TANK_HULL, /**< The Component is a hull of a fuselage tank */ +TIGL_COMPONENT_FUSELAGE_TANK_HULL, /**< The Component is a vessel of a fuselage tank */ TIGL_COMPONENT_OTHER }; diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 3bb0e0b0f2..4a61aa81b8 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -20,7 +20,7 @@ */ #include "CCPACSFuelTank.h" -#include "CCPACSHull.h" +#include "CCPACSVessel.h" #include "CTiglError.h" #include "CGroupShapes.h" @@ -56,11 +56,11 @@ TiglGeometricComponentIntent CCPACSFuelTank::GetComponentIntent() const PNamedShape CCPACSFuelTank::BuildLoft() const { - const auto& hulls = GetHulls().GetHulls(); + const auto& vessels = GetVessels().GetVessels(); ListPNamedShape shapes; - for (const auto& hull : hulls) { - auto loft = hull->GetLoft(); + for (const auto& vessel : vessels) { + auto loft = vessel->GetLoft(); shapes.push_back(loft); } diff --git a/src/fuelTanks/CCPACSHulls.cpp b/src/fuelTanks/CCPACSHulls.cpp deleted file mode 100644 index 656da8b12a..0000000000 --- a/src/fuelTanks/CCPACSHulls.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS hulls handling routines. -*/ - -#include "CCPACSHulls.h" -#include "CCPACSHull.h" -#include "CTiglError.h" - -namespace tigl -{ - -CCPACSHulls::CCPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) - : generated::CPACSHulls(parent, uidMgr) -{ -} - -int CCPACSHulls::GetHullsCount() const -{ - return static_cast(m_hulls.size()); -} - -CCPACSHull const& CCPACSHulls::GetHull(std::string const& uID) const -{ - return const_cast(*this).GetHull(uID); -} - -CCPACSHull& CCPACSHulls::GetHull(std::string const& uID) -{ - auto it = std::find_if(m_hulls.begin(), m_hulls.end(), - [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); - - if (it != std::end(m_hulls)) { - return **it; - } - throw CTiglError("Could not find hull with uid" + uID); -} - -CCPACSHull& CCPACSHulls::GetHull(int index) const -{ - index--; - if (index < 0 || index >= GetHullsCount()) { - throw CTiglError("Invalid index in CCPACSHulls::GetHull", TIGL_INDEX_ERROR); - } - return *m_hulls[index]; -} - -int CCPACSHulls::GetHullIndex(const std::string& uID) const -{ - for (int i = 0; i < GetHullsCount(); i++) { - const std::string tmpUID(m_hulls[i]->GetUID()); - if (tmpUID == uID) { - return i + 1; - } - } - throw CTiglError("Invalid UID in CCPACSHulls::GetHullIndex", TIGL_UID_ERROR); -} - -} //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.cpp b/src/fuelTanks/CCPACSVessel.cpp similarity index 80% rename from src/fuelTanks/CCPACSHull.cpp rename to src/fuelTanks/CCPACSVessel.cpp index 3f145f1e83..4967922c50 100644 --- a/src/fuelTanks/CCPACSHull.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -1,692 +1,692 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-03-15 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS duct handling routines. -*/ - -#include "CCPACSHull.h" -#include "CCPACSHulls.h" -#include "CCPACSFuselageSegment.h" -#include "CTiglMakeLoft.h" -#include "CNamedShape.h" -#include "CTiglTopoAlgorithms.h" -#include "tiglcommonfunctions.h" -#include "CCPACSFuelTank.h" -#include "CCPACSFuelTanks.h" -#include "generated/CPACSDomeType.h" -#include "generated/CPACSEllipsoidDome.h" -#include "generated/CPACSTorisphericalDome.h" - -#include "GProp_GProps.hxx" -#include "BRepGProp.hxx" -#include "TopTools_IndexedMapOfShape.hxx" -#include "TopExp.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace tigl -{ - -CCPACSHull::CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) - : generated::CPACSHull(parent, uidMgr) - , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation, true, true) -{ -} - -CCPACSConfiguration& CCPACSHull::GetConfiguration() const -{ - return GetParent()->GetParent()->GetConfiguration(); -} - -std::string CCPACSHull::GetDefaultedUID() const -{ - return generated::CPACSHull::GetUID(); -} - -TiglGeometricComponentType CCPACSHull::GetComponentType() const -{ - return TIGL_COMPONENT_FUSELAGE_TANK_HULL; -} - -TiglGeometricComponentIntent CCPACSHull::GetComponentIntent() const -{ - // needs to be physical, so that transformation relative to parent works - return TIGL_INTENT_PHYSICAL; -} - -int CCPACSHull::GetSectionCount() const -{ - if (m_sections_choice1) { - return m_sections_choice1.get_ptr()->GetSectionCount(); - } - else { - return 0; - } -} - -CCPACSFuselageSection& CCPACSHull::GetSection(int index) const -{ - if (m_sections_choice1) { - return m_sections_choice1.get().GetSection(index); - } - else { - throw CTiglError(_hullTypeException); - } -} - -TopoDS_Shape CCPACSHull::GetSectionFace(const std::string sectionUID) const -{ - const int segmentCount = GetSegmentCount(); - - // Search for the section in all segments - for (int n = 0; n < segmentCount; ++n) { - const CCPACSFuselageSegment& segment = GetSegment(n + 1); - - if (sectionUID == segment.GetStartSectionUID()) { - return BuildFace(segment.GetStartWire()); - } - else if (sectionUID == segment.GetEndSectionUID()) { - return BuildFace(segment.GetEndWire()); - } - } - m_sections_choice1 ? throw CTiglError("GetSectionFace: Could not find a fuselage section for the given UID") - : throw CTiglError(_hullTypeException); - return TopoDS_Shape(); -} - -int CCPACSHull::GetSegmentCount() const -{ - if (m_segments_choice1) { - return m_segments_choice1.get_ptr()->GetSegmentCount(); - } - else { - return 0; - } -} - -CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) -{ - if (m_segments_choice1) { - return m_segments_choice1.get().GetSegment(index); - } - else { - throw CTiglError(_hullTypeException); - } -} - -const CCPACSFuselageSegment& CCPACSHull::GetSegment(const int index) const -{ - if (m_segments_choice1) { - return m_segments_choice1.get().GetSegment(index); - } - else { - throw CTiglError(_hullTypeException); - } -} - -CCPACSFuselageSegment& CCPACSHull::GetSegment(std::string uid) -{ - if (m_segments_choice1) { - return m_segments_choice1.get().GetSegment(uid); - } - else { - throw CTiglError(_hullTypeException); - } -} - -double CCPACSHull::GetVolume() -{ - const TopoDS_Shape& shape = GetLoft()->Shape(); - GProp_GProps shapeProps; - BRepGProp::VolumeProperties(shape, shapeProps); - - return shapeProps.Mass(); -} - -double CCPACSHull::GetSurfaceArea() -{ - const PNamedShape& shape = GetLoft(); - - // Loop over all faces that are not symmetry, front or rear - double area = 0.; - - TopTools_IndexedMapOfShape shapeMap; - TopExp::MapShapes(shape->Shape(), TopAbs_FACE, shapeMap); - for (int i = 1; i <= shapeMap.Extent(); ++i) { - const std::string& faceName = shape->GetFaceTraits(i - 1).Name(); - if (GetUID() == faceName) { - const TopoDS_Face& face = TopoDS::Face(shapeMap(i)); - GProp_GProps shapeProps; - BRepGProp::SurfaceProperties(face, shapeProps); - area += shapeProps.Mass(); - } - } - - return area; -} - -double CCPACSHull::GetCircumference(const int segmentIndex, const double eta) -{ - if (m_segments_choice1) { - return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); - } - else { - throw CTiglError(_hullTypeException); - } -} - -bool CCPACSHull::IsHullViaSegments() const -{ - if (m_segments_choice1) { - return true; - } - else if (m_domeType_choice2) { - return false; - } - else { - throw CTiglError("Hull type could not be determined."); - } -} - -bool CCPACSHull::IsHullViaDesignParameters() const -{ - if (m_segments_choice1) { - return false; - } - else if (m_domeType_choice2) { - return true; - } - else { - throw CTiglError("Hull type could not be determined."); - } -} - -bool CCPACSHull::HasSphericalDome() const -{ - EvaluateDome(); - if (_ellipsoidPtr && _ellipsoidPtr->GetHalfAxisFraction() == 1) { - return true; - } - else { - return false; - } -} - -bool CCPACSHull::HasEllipsoidDome() const -{ - EvaluateDome(); - if (_ellipsoidPtr) { - return true; - } - else { - return false; - } -} - -bool CCPACSHull::HasIsotensoidDome() const -{ - EvaluateDome(); - if (_isotensoidPtr) { - return true; - } - else { - return false; - } -} - -bool CCPACSHull::HasTorisphericalDome() const -{ - EvaluateDome(); - if (_torisphericalPtr) { - return true; - } - else { - return false; - } -} - -void CCPACSHull::EvaluateDome() const -{ - if (!_isEvaluated) { - if (m_domeType_choice2) { - _ellipsoidPtr = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); - _torisphericalPtr = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); - _isotensoidPtr = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); - } - _isEvaluated = true; - } -} - -void CCPACSHull::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, - std::vector& r) const -{ - double dPhi = 1.0 / nodeNumber; - - r.push_back(rCyl); - x.push_back(0.0); - - double phi = 0.0; - double alpha = std::asin(rPolarOpening / rCyl); - - while (std::tan(alpha) * std::tan(alpha) < 2 && r.back() > 1.22 * rPolarOpening) { - phi += dPhi; - alpha = std::asin(rPolarOpening / r.back()); - double rm = r.back() / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); - double dr = rm * dPhi * std::sin(phi); - r.push_back(r.back() - dr); - double dx = rm * dPhi * std::cos(phi); - x.push_back(x.back() + dx); - } - - double slope = (r.back() - r[r.size() - 2]) / (x.back() - x[x.size() - 2]); - for (int i = 0; i < 5; ++i) { - x.push_back(x.back() + (rPolarOpening - r.back()) / slope); - r.push_back(r.back() + slope * (x.back() - x[x.size() - 2])); - } - - double dx = x.back() - x.front(); - for (auto& val : x) { - val -= dx; - } -} - -void CCPACSHull::BuildShapeFromSegments(TopoDS_Shape& loftShape) const -{ - const auto& segments = m_segments_choice1.get(); - TiglContinuity cont = segments.GetSegment(1).GetContinuity(); - Standard_Boolean smooth = (cont == ::C0 ? false : true); - - CTiglMakeLoft lofter; - // add profiles - for (int i = 1; i <= segments.GetSegmentCount(); i++) { - lofter.addProfiles(segments.GetSegment(i).GetStartWire()); - } - lofter.addProfiles(segments.GetSegment(segments.GetSegmentCount()).GetEndWire()); - - // add guides - lofter.addGuides(segments.GetGuideCurveWires()); - - lofter.setMakeSolid(true); - lofter.setMakeSmooth(smooth); - - loftShape = lofter.Shape(); -} - -void CCPACSHull::BuildHullWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const -{ - for (const auto& edge : edges) { - wire.Add(edge); - } - - TopoDS_Vertex v2 = GetLastVertex(edges.back()); - gp_Pnt mirror_point(BRep_Tool::Pnt(v2).X(), 0, 0); - gp_Trsf mirror; - mirror.SetMirror(gp_Ax2(mirror_point, gp_Dir(1, 0, 0))); - - for (auto it = edges.rbegin(); it != edges.rend(); ++it) { - TopoDS_Shape mirrored_edge = BRepBuilderAPI_Transform(*it, mirror).Shape(); - wire.Add(TopoDS::Edge(mirrored_edge)); - } -} - -void CCPACSHull::BuildHullWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const -{ - double cylinderRadius = m_cylinderRadius_choice2.get(); - double cylinderLength = m_cylinderLength_choice2.get(); - - double axRatio = _ellipsoidPtr->GetHalfAxisFraction(); - if (axRatio < 0.0) { - throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of hull \"" + GetName() + "\" (uID=\"" + - GetUID() + "\") must be a positive value!"); - } - - double R = cylinderRadius; - double h = R * axRatio; - - gp_Dir dir(0.0, 1.0, 0.0); - gp_Pnt p(h, 0.0, 0.0); - - double majorAxis = R; - double minorAxis = R * axRatio; - double rotAngle = 0; - double startAngle = -M_PI / 2; - double endAngle = 0.0; - - if (axRatio > 1) { - majorAxis = R * axRatio; - minorAxis = R; - rotAngle = 0.5 * M_PI; - startAngle = -M_PI; - endAngle = -M_PI / 2; - } - - gp_Elips ellips(gp_Ax2(p, dir), majorAxis, minorAxis); - ellips.Rotate(gp_Ax1(p, dir), rotAngle); - GC_MakeArcOfEllipse arc(ellips, startAngle, endAngle, Standard_True); - - TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(arc.Value()).Edge(); - - std::vector edges = {domeEdge}; - - if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetLastVertex(domeEdge); - TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); - - TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); - edges.push_back(cylinderEdge); - } - - BuildHullWire(edges, wire); -} - -void CCPACSHull::BuildHullWireTorispherical(BRepBuilderAPI_MakeWire& wire) const -{ - double cylinderRadius = m_cylinderRadius_choice2.get(); - double cylinderLength = m_cylinderLength_choice2.get(); - - double R = _torisphericalPtr->GetDishRadius(); // Radius of the sphere (crown radius) - double r = _torisphericalPtr->GetKnuckleRadius(); // Radius of the torus (knuckle radius) - - if (R <= cylinderRadius) { - throw CTiglError("The dish radius (" + std::to_string(R) + ") of hull \"" + GetName() + "\" (uID=\"" + - GetUID() + "\") must be larger than the cylinder radius (" + std::to_string(cylinderRadius) + - ")!"); - } - if (r <= 0. || r >= cylinderRadius) { - throw CTiglError("The knuckle radius (" + std::to_string(r) + ") of hull \"" + GetName() + "\" (uID=\"" + - GetUID() + "\") must be larger than 0 and smaller than the cylinder Radius (" + - std::to_string(cylinderRadius) + ")!"); - } - - double c = cylinderRadius - r; // Distance from the center to the center of the torus tube - double h = R - sqrt((r + c - R) * (r - c - R)); // Height from the base of the dome to the top - double rt = c * (1.0 + pow((R / r - 1), -1.0)); // Radius where the transition from sphere to torus occurs - double alpha = acos((rt - c) / r); // Angle under which the transition from sphere to torus occurs - - gp_Dir dir(0.0, 1.0, 0.0); - - gp_Pnt p1(R, 0.0, 0.0); - gp_Pnt p2(h, 0.0, cylinderRadius - r); - - gp_Circ circ1(gp_Ax2(p1, dir), R); - gp_Circ circ2(gp_Ax2(p2, dir), r); - - GC_MakeArcOfCircle arc1(circ1, -M_PI / 2, -alpha, Standard_True); - GC_MakeArcOfCircle arc2(circ2, -alpha, 0, Standard_True); - - TopoDS_Edge domeEdge1 = BRepBuilderAPI_MakeEdge(arc1.Value()).Edge(); - TopoDS_Edge domeEdge2 = BRepBuilderAPI_MakeEdge(arc2.Value()).Edge(); - - std::vector edges = {domeEdge1, domeEdge2}; - - if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetLastVertex(domeEdge2); - TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); - - TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); - edges.push_back(cylinderEdge); - } - - BuildHullWire(edges, wire); -} - -void CCPACSHull::BuildHullWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const -{ - double cylinderRadius = m_cylinderRadius_choice2.get(); - double cylinderLength = m_cylinderLength_choice2.get(); - - double polarOpeningRadius = _isotensoidPtr->GetPolarOpeningRadius(); - if (polarOpeningRadius <= 0 || polarOpeningRadius >= cylinderRadius) { - throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of hull \"" + - GetName() + "\" (uID=\"" + GetUID() + - "\") must be larger than 0 and smaller than the cylinder radius (" + - std::to_string(cylinderRadius) + ")!"); - } - - std::vector x, r; - IsotensoidContour(cylinderRadius, polarOpeningRadius, 50, x, r); - double h = x.back() - x.front(); - - TColgp_Array1OfPnt array(1, x.size()); - for (size_t i = 0; i < x.size(); ++i) { - array.SetValue(i + 1, gp_Pnt(-x[i], 0.0, r[i])); - } - Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); - TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(bspline); - - TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-x.back(), 0.0, 0.0)); - TopoDS_Vertex v2 = GetLastVertex(domeEdge); - TopoDS_Edge lidEdge = BRepBuilderAPI_MakeEdge(v1, v2); - - std::vector edges = {lidEdge, domeEdge}; - - if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetFirstVertex(domeEdge); - TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); - - TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); - edges.push_back(cylinderEdge); - } - - BuildHullWire(edges, wire); -} - -void CCPACSHull::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const -{ - BRepBuilderAPI_MakeWire wire; - - if (m_cylinderRadius_choice2.get() <= 0) { - throw CTiglError("The cylinder radius (" + std::to_string(m_cylinderRadius_choice2.get()) + ") of hull \"" + - GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than 0!"); - } - if (m_cylinderLength_choice2.get() < 0) { - throw CTiglError("The cylinder length (" + std::to_string(m_cylinderLength_choice2.get()) + ") of hull \"" + - GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than or equal to 0!"); - } - - if (_ellipsoidPtr) { - BuildHullWireEllipsoid(wire); - } - else if (_torisphericalPtr) { - BuildHullWireTorispherical(wire); - } - else if (_isotensoidPtr) { - BuildHullWireIsotensoid(wire); - } - - gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); - loftShape = BRepPrimAPI_MakeRevol(wire, ax).Shape(); - - tigl::CTiglTransformation transform = this->GetTransformationMatrix(); - TopoDS_Shape TransformedShape = transform.Transform(loftShape); - - loftShape = TransformedShape; -} - -PNamedShape CCPACSHull::BuildLoft() const -{ - TopoDS_Shape loftShape; - std::string loftName = GetUID(); - std::string loftShortName = GetShortShapeName(); - - if (m_sections_choice1) { - BuildShapeFromSegments(loftShape); - PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); - SetFaceTraits(loft); - return loft; - } - else if (m_domeType_choice2) { - EvaluateDome(); - BuildShapeFromSimpleParameters(loftShape); - PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); - return loft; - } - else { - throw CTiglError("No valid combination of segments and sections or parametric specification for lofting of " - "tank hull available.", - TIGL_ERROR); - } -} - -gp_Pnt CCPACSHull::GetPoint(int segmentIndex, double eta, double zeta) -{ - // ToDo: This functionality could also be implemented for parametric hulls, if needed - if (m_segments_choice1) { - return ((CCPACSFuselageSegment&)GetSegment(segmentIndex)).GetPoint(eta, zeta, _getPointBehavior); - } - else { - throw CTiglError(_hullTypeException); - } -} - -// Sets the GetPoint behavior to asParameterOnSurface or onLinearLoft -void CCPACSHull::SetGetPointBehavior(TiglGetPointBehavior behavior) -{ - _getPointBehavior = behavior; -} - -TiglGetPointBehavior CCPACSHull::GetGetPointBehavior() const -{ - return _getPointBehavior; -} - -CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) -{ - return const_cast(static_cast(*this).GetGuideCurveSegment(uid)); -} - -const CCPACSGuideCurve& CCPACSHull::GetGuideCurveSegment(std::string uid) const -{ - if (m_segments_choice1) { - for (int i = 1; i <= m_segments_choice1.get().GetSegmentCount(); i++) { - const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(i); - - if (!segment.GetGuideCurves()) { - continue; - } - - if (segment.GetGuideCurves()->GuideCurveExists(uid)) { - return segment.GetGuideCurves()->GetGuideCurve(uid); - } - } - throw tigl::CTiglError("Guide Curve with UID " + uid + " does not exists", TIGL_ERROR); - } - else { - throw CTiglError(_hullTypeException); - } -} - -std::vector CCPACSHull::GetGuideCurvePoints() const -{ - if (m_segments_choice1) { - std::vector points; - - // connect the belonging guide curve segments - for (int isegment = 1; isegment <= GetSegmentCount(); ++isegment) { - const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(isegment); - - if (!segment.GetGuideCurves()) { - continue; - } - - const CCPACSGuideCurves& segmentCurves = *segment.GetGuideCurves(); - for (int iguide = 1; iguide <= segmentCurves.GetGuideCurveCount(); ++iguide) { - const CCPACSGuideCurve& curve = segmentCurves.GetGuideCurve(iguide); - std::vector curPoints = curve.GetCurvePoints(); - points.insert(points.end(), curPoints.begin(), curPoints.end()); - } - } - return points; - } - else { - throw CTiglError(_hullTypeException); - } -} - -// get short name for loft -std::string CCPACSHull::GetShortShapeName() const -{ - unsigned int findex = 0; - unsigned int i = 0; - - for (auto& h : GetParent()->GetHulls()) { - ++i; - if (GetUID() == h->GetUID()) { - findex = i; - std::stringstream shortName; - shortName << "H" << findex; - return shortName.str(); - } - } - return "UNKNOWN"; -} - -void CCPACSHull::SetFaceTraits(PNamedShape loft) const -{ - int nFacesTotal = GetNumberOfFaces(loft->Shape()); - int nFacesAero = nFacesTotal; - bool hasSymmetryPlane = GetNumberOfEdges(m_segments_choice1.get().GetSegment(1).GetEndWire()) > 1; - - std::vector names; - names.push_back(loft->Name()); - names.push_back("symmetry"); - names.push_back("Front"); - names.push_back("Rear"); - - if (!CTiglTopoAlgorithms::IsDegenerated(m_segments_choice1.get().GetSegment(1).GetStartWire())) { - nFacesAero -= 1; - } - if (!CTiglTopoAlgorithms::IsDegenerated( - m_segments_choice1.get().GetSegment(m_segments_choice1.get().GetSegmentCount()).GetEndWire())) { - nFacesAero -= 1; - } - - // if we have a smooth surface, the whole fuslage is treatet as one segment - int nSegments = m_segments_choice1.get().GetSegmentCount(); - - int facesPerSegment = nFacesAero / nSegments; - - int iFaceTotal = 0; - int nSymmetryFaces = (int)hasSymmetryPlane; - for (int iSegment = 0; iSegment < nSegments; ++iSegment) { - for (int iFace = 0; iFace < facesPerSegment - nSymmetryFaces; ++iFace) { - loft->FaceTraits(iFaceTotal++).SetName(names[0].c_str()); - } - for (int iFace = 0; iFace < nSymmetryFaces; ++iFace) { - loft->FaceTraits(iFaceTotal++).SetName(names[1].c_str()); - } - } - - // set the caps - int iFace = 2; - for (; iFaceTotal < nFacesTotal; ++iFaceTotal) { - loft->FaceTraits(iFaceTotal).SetName(names[iFace++].c_str()); - } -} - -} //namespace tigl +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-03-15 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS duct handling routines. +*/ + +#include "CCPACSVessel.h" +#include "CCPACSVessels.h" +#include "CCPACSFuselageSegment.h" +#include "CTiglMakeLoft.h" +#include "CNamedShape.h" +#include "CTiglTopoAlgorithms.h" +#include "tiglcommonfunctions.h" +#include "CCPACSFuelTank.h" +#include "CCPACSFuelTanks.h" +#include "generated/CPACSDomeType.h" +#include "generated/CPACSEllipsoidDome.h" +#include "generated/CPACSTorisphericalDome.h" + +#include "GProp_GProps.hxx" +#include "BRepGProp.hxx" +#include "TopTools_IndexedMapOfShape.hxx" +#include "TopExp.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace tigl +{ + +CCPACSVessel::CCPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr) + : generated::CPACSVessel(parent, uidMgr) + , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation, true, true) +{ +} + +CCPACSConfiguration& CCPACSVessel::GetConfiguration() const +{ + return GetParent()->GetParent()->GetConfiguration(); +} + +std::string CCPACSVessel::GetDefaultedUID() const +{ + return generated::CPACSVessel::GetUID(); +} + +TiglGeometricComponentType CCPACSVessel::GetComponentType() const +{ + return TIGL_COMPONENT_FUSELAGE_TANK_HULL; +} + +TiglGeometricComponentIntent CCPACSVessel::GetComponentIntent() const +{ + // needs to be physical, so that transformation relative to parent works + return TIGL_INTENT_PHYSICAL; +} + +int CCPACSVessel::GetSectionCount() const +{ + if (m_sections_choice1) { + return m_sections_choice1.get_ptr()->GetSectionCount(); + } + else { + return 0; + } +} + +CCPACSFuselageSection& CCPACSVessel::GetSection(int index) const +{ + if (m_sections_choice1) { + return m_sections_choice1.get().GetSection(index); + } + else { + throw CTiglError(_vesselTypeException); + } +} + +TopoDS_Shape CCPACSVessel::GetSectionFace(const std::string sectionUID) const +{ + const int segmentCount = GetSegmentCount(); + + // Search for the section in all segments + for (int n = 0; n < segmentCount; ++n) { + const CCPACSFuselageSegment& segment = GetSegment(n + 1); + + if (sectionUID == segment.GetStartSectionUID()) { + return BuildFace(segment.GetStartWire()); + } + else if (sectionUID == segment.GetEndSectionUID()) { + return BuildFace(segment.GetEndWire()); + } + } + m_sections_choice1 ? throw CTiglError("GetSectionFace: Could not find a fuselage section for the given UID") + : throw CTiglError(_vesselTypeException); + return TopoDS_Shape(); +} + +int CCPACSVessel::GetSegmentCount() const +{ + if (m_segments_choice1) { + return m_segments_choice1.get_ptr()->GetSegmentCount(); + } + else { + return 0; + } +} + +CCPACSFuselageSegment& CCPACSVessel::GetSegment(const int index) +{ + if (m_segments_choice1) { + return m_segments_choice1.get().GetSegment(index); + } + else { + throw CTiglError(_vesselTypeException); + } +} + +const CCPACSFuselageSegment& CCPACSVessel::GetSegment(const int index) const +{ + if (m_segments_choice1) { + return m_segments_choice1.get().GetSegment(index); + } + else { + throw CTiglError(_vesselTypeException); + } +} + +CCPACSFuselageSegment& CCPACSVessel::GetSegment(std::string uid) +{ + if (m_segments_choice1) { + return m_segments_choice1.get().GetSegment(uid); + } + else { + throw CTiglError(_vesselTypeException); + } +} + +double CCPACSVessel::GetGeometricVolume() +{ + const TopoDS_Shape& shape = GetLoft()->Shape(); + GProp_GProps shapeProps; + BRepGProp::VolumeProperties(shape, shapeProps); + + return shapeProps.Mass(); +} + +double CCPACSVessel::GetSurfaceArea() +{ + const PNamedShape& shape = GetLoft(); + + // Loop over all faces that are not symmetry, front or rear + double area = 0.; + + TopTools_IndexedMapOfShape shapeMap; + TopExp::MapShapes(shape->Shape(), TopAbs_FACE, shapeMap); + for (int i = 1; i <= shapeMap.Extent(); ++i) { + const std::string& faceName = shape->GetFaceTraits(i - 1).Name(); + if (GetUID() == faceName) { + const TopoDS_Face& face = TopoDS::Face(shapeMap(i)); + GProp_GProps shapeProps; + BRepGProp::SurfaceProperties(face, shapeProps); + area += shapeProps.Mass(); + } + } + + return area; +} + +double CCPACSVessel::GetCircumference(const int segmentIndex, const double eta) +{ + if (m_segments_choice1) { + return static_cast(GetSegment(segmentIndex)).GetCircumference(eta); + } + else { + throw CTiglError(_vesselTypeException); + } +} + +bool CCPACSVessel::IsVesselViaSegments() const +{ + if (m_segments_choice1) { + return true; + } + else if (m_domeType_choice2) { + return false; + } + else { + throw CTiglError("Vessel type could not be determined."); + } +} + +bool CCPACSVessel::IsVesselViaDesignParameters() const +{ + if (m_segments_choice1) { + return false; + } + else if (m_domeType_choice2) { + return true; + } + else { + throw CTiglError("Vessel type could not be determined."); + } +} + +bool CCPACSVessel::HasSphericalDome() const +{ + EvaluateDome(); + if (_ellipsoidPtr && _ellipsoidPtr->GetHalfAxisFraction() == 1) { + return true; + } + else { + return false; + } +} + +bool CCPACSVessel::HasEllipsoidDome() const +{ + EvaluateDome(); + if (_ellipsoidPtr) { + return true; + } + else { + return false; + } +} + +bool CCPACSVessel::HasIsotensoidDome() const +{ + EvaluateDome(); + if (_isotensoidPtr) { + return true; + } + else { + return false; + } +} + +bool CCPACSVessel::HasTorisphericalDome() const +{ + EvaluateDome(); + if (_torisphericalPtr) { + return true; + } + else { + return false; + } +} + +void CCPACSVessel::EvaluateDome() const +{ + if (!_isEvaluated) { + if (m_domeType_choice2) { + _ellipsoidPtr = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); + _torisphericalPtr = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); + _isotensoidPtr = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); + } + _isEvaluated = true; + } +} + +void CCPACSVessel::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, + std::vector& r) const +{ + double dPhi = 1.0 / nodeNumber; + + r.push_back(rCyl); + x.push_back(0.0); + + double phi = 0.0; + double alpha = std::asin(rPolarOpening / rCyl); + + while (std::tan(alpha) * std::tan(alpha) < 2 && r.back() > 1.22 * rPolarOpening) { + phi += dPhi; + alpha = std::asin(rPolarOpening / r.back()); + double rm = r.back() / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); + double dr = rm * dPhi * std::sin(phi); + r.push_back(r.back() - dr); + double dx = rm * dPhi * std::cos(phi); + x.push_back(x.back() + dx); + } + + double slope = (r.back() - r[r.size() - 2]) / (x.back() - x[x.size() - 2]); + for (int i = 0; i < 5; ++i) { + x.push_back(x.back() + (rPolarOpening - r.back()) / slope); + r.push_back(r.back() + slope * (x.back() - x[x.size() - 2])); + } + + double dx = x.back() - x.front(); + for (auto& val : x) { + val -= dx; + } +} + +void CCPACSVessel::BuildShapeFromSegments(TopoDS_Shape& loftShape) const +{ + const auto& segments = m_segments_choice1.get(); + TiglContinuity cont = segments.GetSegment(1).GetContinuity(); + Standard_Boolean smooth = (cont == ::C0 ? false : true); + + CTiglMakeLoft lofter; + // add profiles + for (int i = 1; i <= segments.GetSegmentCount(); i++) { + lofter.addProfiles(segments.GetSegment(i).GetStartWire()); + } + lofter.addProfiles(segments.GetSegment(segments.GetSegmentCount()).GetEndWire()); + + // add guides + lofter.addGuides(segments.GetGuideCurveWires()); + + lofter.setMakeSolid(true); + lofter.setMakeSmooth(smooth); + + loftShape = lofter.Shape(); +} + +void CCPACSVessel::BuildVesselWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const +{ + for (const auto& edge : edges) { + wire.Add(edge); + } + + TopoDS_Vertex v2 = GetLastVertex(edges.back()); + gp_Pnt mirror_point(BRep_Tool::Pnt(v2).X(), 0, 0); + gp_Trsf mirror; + mirror.SetMirror(gp_Ax2(mirror_point, gp_Dir(1, 0, 0))); + + for (auto it = edges.rbegin(); it != edges.rend(); ++it) { + TopoDS_Shape mirrored_edge = BRepBuilderAPI_Transform(*it, mirror).Shape(); + wire.Add(TopoDS::Edge(mirrored_edge)); + } +} + +void CCPACSVessel::BuildVesselWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const +{ + double cylinderRadius = m_cylinderRadius_choice2.get(); + double cylinderLength = m_cylinderLength_choice2.get(); + + double axRatio = _ellipsoidPtr->GetHalfAxisFraction(); + if (axRatio < 0.0) { + throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of vessel \"" + GetName() + "\" (uID=\"" + + GetUID() + "\") must be a positive value!"); + } + + double R = cylinderRadius; + double h = R * axRatio; + + gp_Dir dir(0.0, 1.0, 0.0); + gp_Pnt p(h, 0.0, 0.0); + + double majorAxis = R; + double minorAxis = R * axRatio; + double rotAngle = 0; + double startAngle = -M_PI / 2; + double endAngle = 0.0; + + if (axRatio > 1) { + majorAxis = R * axRatio; + minorAxis = R; + rotAngle = 0.5 * M_PI; + startAngle = -M_PI; + endAngle = -M_PI / 2; + } + + gp_Elips ellips(gp_Ax2(p, dir), majorAxis, minorAxis); + ellips.Rotate(gp_Ax1(p, dir), rotAngle); + GC_MakeArcOfEllipse arc(ellips, startAngle, endAngle, Standard_True); + + TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(arc.Value()).Edge(); + + std::vector edges = {domeEdge}; + + if (cylinderLength > 0.0) { + TopoDS_Vertex v1 = GetLastVertex(domeEdge); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinderEdge); + } + + BuildVesselWire(edges, wire); +} + +void CCPACSVessel::BuildVesselWireTorispherical(BRepBuilderAPI_MakeWire& wire) const +{ + double cylinderRadius = m_cylinderRadius_choice2.get(); + double cylinderLength = m_cylinderLength_choice2.get(); + + double R = _torisphericalPtr->GetDishRadius(); // Radius of the sphere (crown radius) + double r = _torisphericalPtr->GetKnuckleRadius(); // Radius of the torus (knuckle radius) + + if (R <= cylinderRadius) { + throw CTiglError("The dish radius (" + std::to_string(R) + ") of vessel \"" + GetName() + "\" (uID=\"" + + GetUID() + "\") must be larger than the cylinder radius (" + std::to_string(cylinderRadius) + + ")!"); + } + if (r <= 0. || r >= cylinderRadius) { + throw CTiglError("The knuckle radius (" + std::to_string(r) + ") of vessel \"" + GetName() + "\" (uID=\"" + + GetUID() + "\") must be larger than 0 and smaller than the cylinder Radius (" + + std::to_string(cylinderRadius) + ")!"); + } + + double c = cylinderRadius - r; // Distance from the center to the center of the torus tube + double h = R - sqrt((r + c - R) * (r - c - R)); // Height from the base of the dome to the top + double rt = c * (1.0 + pow((R / r - 1), -1.0)); // Radius where the transition from sphere to torus occurs + double alpha = acos((rt - c) / r); // Angle under which the transition from sphere to torus occurs + + gp_Dir dir(0.0, 1.0, 0.0); + + gp_Pnt p1(R, 0.0, 0.0); + gp_Pnt p2(h, 0.0, cylinderRadius - r); + + gp_Circ circ1(gp_Ax2(p1, dir), R); + gp_Circ circ2(gp_Ax2(p2, dir), r); + + GC_MakeArcOfCircle arc1(circ1, -M_PI / 2, -alpha, Standard_True); + GC_MakeArcOfCircle arc2(circ2, -alpha, 0, Standard_True); + + TopoDS_Edge domeEdge1 = BRepBuilderAPI_MakeEdge(arc1.Value()).Edge(); + TopoDS_Edge domeEdge2 = BRepBuilderAPI_MakeEdge(arc2.Value()).Edge(); + + std::vector edges = {domeEdge1, domeEdge2}; + + if (cylinderLength > 0.0) { + TopoDS_Vertex v1 = GetLastVertex(domeEdge2); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinderEdge); + } + + BuildVesselWire(edges, wire); +} + +void CCPACSVessel::BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const +{ + double cylinderRadius = m_cylinderRadius_choice2.get(); + double cylinderLength = m_cylinderLength_choice2.get(); + + double polarOpeningRadius = _isotensoidPtr->GetPolarOpeningRadius(); + if (polarOpeningRadius <= 0 || polarOpeningRadius >= cylinderRadius) { + throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of vessel \"" + + GetName() + "\" (uID=\"" + GetUID() + + "\") must be larger than 0 and smaller than the cylinder radius (" + + std::to_string(cylinderRadius) + ")!"); + } + + std::vector x, r; + IsotensoidContour(cylinderRadius, polarOpeningRadius, 50, x, r); + double h = x.back() - x.front(); + + TColgp_Array1OfPnt array(1, x.size()); + for (size_t i = 0; i < x.size(); ++i) { + array.SetValue(i + 1, gp_Pnt(-x[i], 0.0, r[i])); + } + Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); + TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(bspline); + + TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-x.back(), 0.0, 0.0)); + TopoDS_Vertex v2 = GetLastVertex(domeEdge); + TopoDS_Edge lidEdge = BRepBuilderAPI_MakeEdge(v1, v2); + + std::vector edges = {lidEdge, domeEdge}; + + if (cylinderLength > 0.0) { + TopoDS_Vertex v1 = GetFirstVertex(domeEdge); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); + + TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); + edges.push_back(cylinderEdge); + } + + BuildVesselWire(edges, wire); +} + +void CCPACSVessel::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const +{ + BRepBuilderAPI_MakeWire wire; + + if (m_cylinderRadius_choice2.get() <= 0) { + throw CTiglError("The cylinder radius (" + std::to_string(m_cylinderRadius_choice2.get()) + ") of vessel \"" + + GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than 0!"); + } + if (m_cylinderLength_choice2.get() < 0) { + throw CTiglError("The cylinder length (" + std::to_string(m_cylinderLength_choice2.get()) + ") of vessel \"" + + GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than or equal to 0!"); + } + + if (_ellipsoidPtr) { + BuildVesselWireEllipsoid(wire); + } + else if (_torisphericalPtr) { + BuildVesselWireTorispherical(wire); + } + else if (_isotensoidPtr) { + BuildVesselWireIsotensoid(wire); + } + + gp_Ax1 ax(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); + loftShape = BRepPrimAPI_MakeRevol(wire, ax).Shape(); + + tigl::CTiglTransformation transform = this->GetTransformationMatrix(); + TopoDS_Shape TransformedShape = transform.Transform(loftShape); + + loftShape = TransformedShape; +} + +PNamedShape CCPACSVessel::BuildLoft() const +{ + TopoDS_Shape loftShape; + std::string loftName = GetUID(); + std::string loftShortName = GetShortShapeName(); + + if (m_sections_choice1) { + BuildShapeFromSegments(loftShape); + PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + SetFaceTraits(loft); + return loft; + } + else if (m_domeType_choice2) { + EvaluateDome(); + BuildShapeFromSimpleParameters(loftShape); + PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + return loft; + } + else { + throw CTiglError("No valid combination of segments and sections or parametric specification for lofting of " + "tank vessel available.", + TIGL_ERROR); + } +} + +gp_Pnt CCPACSVessel::GetPoint(int segmentIndex, double eta, double zeta) +{ + // ToDo: This functionality could also be implemented for parametric vessels, if needed + if (m_segments_choice1) { + return ((CCPACSFuselageSegment&)GetSegment(segmentIndex)).GetPoint(eta, zeta, _getPointBehavior); + } + else { + throw CTiglError(_vesselTypeException); + } +} + +// Sets the GetPoint behavior to asParameterOnSurface or onLinearLoft +void CCPACSVessel::SetGetPointBehavior(TiglGetPointBehavior behavior) +{ + _getPointBehavior = behavior; +} + +TiglGetPointBehavior CCPACSVessel::GetGetPointBehavior() const +{ + return _getPointBehavior; +} + +CCPACSGuideCurve& CCPACSVessel::GetGuideCurveSegment(std::string uid) +{ + return const_cast(static_cast(*this).GetGuideCurveSegment(uid)); +} + +const CCPACSGuideCurve& CCPACSVessel::GetGuideCurveSegment(std::string uid) const +{ + if (m_segments_choice1) { + for (int i = 1; i <= m_segments_choice1.get().GetSegmentCount(); i++) { + const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(i); + + if (!segment.GetGuideCurves()) { + continue; + } + + if (segment.GetGuideCurves()->GuideCurveExists(uid)) { + return segment.GetGuideCurves()->GetGuideCurve(uid); + } + } + throw tigl::CTiglError("Guide Curve with UID " + uid + " does not exists", TIGL_ERROR); + } + else { + throw CTiglError(_vesselTypeException); + } +} + +std::vector CCPACSVessel::GetGuideCurvePoints() const +{ + if (m_segments_choice1) { + std::vector points; + + // connect the belonging guide curve segments + for (int isegment = 1; isegment <= GetSegmentCount(); ++isegment) { + const CCPACSFuselageSegment& segment = m_segments_choice1.get().GetSegment(isegment); + + if (!segment.GetGuideCurves()) { + continue; + } + + const CCPACSGuideCurves& segmentCurves = *segment.GetGuideCurves(); + for (int iguide = 1; iguide <= segmentCurves.GetGuideCurveCount(); ++iguide) { + const CCPACSGuideCurve& curve = segmentCurves.GetGuideCurve(iguide); + std::vector curPoints = curve.GetCurvePoints(); + points.insert(points.end(), curPoints.begin(), curPoints.end()); + } + } + return points; + } + else { + throw CTiglError(_vesselTypeException); + } +} + +// get short name for loft +std::string CCPACSVessel::GetShortShapeName() const +{ + unsigned int findex = 0; + unsigned int i = 0; + + for (auto& h : GetParent()->GetVessels()) { + ++i; + if (GetUID() == h->GetUID()) { + findex = i; + std::stringstream shortName; + shortName << "H" << findex; + return shortName.str(); + } + } + return "UNKNOWN"; +} + +void CCPACSVessel::SetFaceTraits(PNamedShape loft) const +{ + int nFacesTotal = GetNumberOfFaces(loft->Shape()); + int nFacesAero = nFacesTotal; + bool hasSymmetryPlane = GetNumberOfEdges(m_segments_choice1.get().GetSegment(1).GetEndWire()) > 1; + + std::vector names; + names.push_back(loft->Name()); + names.push_back("symmetry"); + names.push_back("Front"); + names.push_back("Rear"); + + if (!CTiglTopoAlgorithms::IsDegenerated(m_segments_choice1.get().GetSegment(1).GetStartWire())) { + nFacesAero -= 1; + } + if (!CTiglTopoAlgorithms::IsDegenerated( + m_segments_choice1.get().GetSegment(m_segments_choice1.get().GetSegmentCount()).GetEndWire())) { + nFacesAero -= 1; + } + + // if we have a smooth surface, the whole fuslage is treatet as one segment + int nSegments = m_segments_choice1.get().GetSegmentCount(); + + int facesPerSegment = nFacesAero / nSegments; + + int iFaceTotal = 0; + int nSymmetryFaces = (int)hasSymmetryPlane; + for (int iSegment = 0; iSegment < nSegments; ++iSegment) { + for (int iFace = 0; iFace < facesPerSegment - nSymmetryFaces; ++iFace) { + loft->FaceTraits(iFaceTotal++).SetName(names[0].c_str()); + } + for (int iFace = 0; iFace < nSymmetryFaces; ++iFace) { + loft->FaceTraits(iFaceTotal++).SetName(names[1].c_str()); + } + } + + // set the caps + int iFace = 2; + for (; iFaceTotal < nFacesTotal; ++iFaceTotal) { + loft->FaceTraits(iFaceTotal).SetName(names[iFace++].c_str()); + } +} + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSHull.h b/src/fuelTanks/CCPACSVessel.h similarity index 73% rename from src/fuelTanks/CCPACSHull.h rename to src/fuelTanks/CCPACSVessel.h index d0ed283e5b..34edd85648 100644 --- a/src/fuelTanks/CCPACSHull.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -1,137 +1,137 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-03-15 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS hull handling routines. -*/ - -#ifndef CCPACSHULL_H -#define CCPACSHULL_H - -#include "generated/CPACSHull.h" -#include "CTiglRelativelyPositionedComponent.h" -#include "CCPACSConfiguration.h" - -#include - -namespace tigl -{ -class CCPACSHull : public generated::CPACSHull, public CTiglRelativelyPositionedComponent -{ -public: - // Constructor - TIGL_EXPORT explicit CCPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); - - // Get the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; - - // Get the default uID - TIGL_EXPORT std::string GetDefaultedUID() const override; - - // Get the component type: TIGL_COMPONENT_FUSELAGE_TANK_HULL - TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; - // Get the component intent: TIGL_INTENT_PHYSICAL - TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; - - // Get number of sections - TIGL_EXPORT int GetSectionCount() const; - // Get a specific section - TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; - // Get a section face - TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string section_uid) const; - - // Get number of segments - TIGL_EXPORT int GetSegmentCount() const; - // Get a specific segment via its index - TIGL_EXPORT CCPACSFuselageSegment& GetSegment(const int index); - TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(const int index) const; - // Get a specific segment via its uID - TIGL_EXPORT CCPACSFuselageSegment& GetSegment(std::string uid); - - // Get the volume of the hull - TIGL_EXPORT double GetVolume(); - - // Get the surface area of the hull - TIGL_EXPORT double GetSurfaceArea(); - - // Get the circumference of the hull - TIGL_EXPORT double GetCircumference(int segmentIndex, double eta); - - // Get a point on the given hull segment in dependence of a parameters eta and zeta with - // 0.0 <= eta <= 1.0 and 0.0 <= zeta <= 1.0. For eta = 0.0 the point lies on the start - // profile of the segment, for eta = 1.0 on the end profile of the segment. For zeta = 0.0 - // the point is the start point of the profile wire, for zeta = 1.0 the last profile wire point. - TIGL_EXPORT gp_Pnt GetPoint(int segmentIndex, double eta, double zeta); - // Set the _getPointBehavior to asParameterOnSurface or onLinearLoft - TIGL_EXPORT void SetGetPointBehavior(TiglGetPointBehavior behavior = asParameterOnSurface); - // Get the _getPointBehavior - TIGL_EXPORT TiglGetPointBehavior GetGetPointBehavior() const; - - // Get the guide curve segment (partial guide curve) with a given uID - TIGL_EXPORT CCPACSGuideCurve& GetGuideCurveSegment(std::string uid); - TIGL_EXPORT const CCPACSGuideCurve& GetGuideCurveSegment(std::string uid) const; - // Returns all guide curve points - TIGL_EXPORT std::vector GetGuideCurvePoints() const; - - // Check whether the hull is defined using segments - TIGL_EXPORT bool IsHullViaSegments() const; - // Check whether the hull is defined using design parameters - TIGL_EXPORT bool IsHullViaDesignParameters() const; - // Check whether the hull has spherical dome - TIGL_EXPORT bool HasSphericalDome() const; - // Check whether the hull has ellipsoid dome - TIGL_EXPORT bool HasEllipsoidDome() const; - // Check whether the hull has spherical dome - TIGL_EXPORT bool HasTorisphericalDome() const; - // Check whether the hull has isotensoid dome - TIGL_EXPORT bool HasIsotensoidDome() const; - -protected: - // Build the loft - PNamedShape BuildLoft() const override; - - // Set the face traits - void SetFaceTraits(PNamedShape loft) const; - -private: - const std::string _hullTypeException = "This method is only available for hulls with segments. No segment found."; - - mutable const tigl::generated::CPACSEllipsoidDome* _ellipsoidPtr = NULL; - mutable const tigl::generated::CPACSTorisphericalDome* _torisphericalPtr = NULL; - mutable const tigl::generated::CPACSIsotensoidDome* _isotensoidPtr = NULL; - mutable bool _isEvaluated = false; - void EvaluateDome() const; - - // Get short name for loft - std::string GetShortShapeName() const; - - TiglGetPointBehavior _getPointBehavior{asParameterOnSurface}; - void IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, - std::vector& r) const; - - void BuildShapeFromSegments(TopoDS_Shape& loftShape) const; - void BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const; - - void BuildHullWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const; - void BuildHullWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const; - void BuildHullWireTorispherical(BRepBuilderAPI_MakeWire& wire) const; - void BuildHullWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const; -}; - -} // namespace tigl - -#endif // CCPACSFUSELAGE_H +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-03-15 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS vessel handling routines. +*/ + +#ifndef CCPACSVessel_H +#define CCPACSVessel_H + +#include "generated/CPACSVessel.h" +#include "CTiglRelativelyPositionedComponent.h" +#include "CCPACSConfiguration.h" + +#include + +namespace tigl +{ +class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositionedComponent +{ +public: + // Constructor + TIGL_EXPORT explicit CCPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr); + + // Get the parent configuration + TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + + // Get the default uID + TIGL_EXPORT std::string GetDefaultedUID() const override; + + // Get the component type: TIGL_COMPONENT_FUSELAGE_TANK_HULL + TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; + // Get the component intent: TIGL_INTENT_PHYSICAL + TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; + + // Get number of sections + TIGL_EXPORT int GetSectionCount() const; + // Get a specific section + TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; + // Get a section face + TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string section_uid) const; + + // Get number of segments + TIGL_EXPORT int GetSegmentCount() const; + // Get a specific segment via its index + TIGL_EXPORT CCPACSFuselageSegment& GetSegment(const int index); + TIGL_EXPORT const CCPACSFuselageSegment& GetSegment(const int index) const; + // Get a specific segment via its uID + TIGL_EXPORT CCPACSFuselageSegment& GetSegment(std::string uid); + + // Get the geometric volume of the vessel + TIGL_EXPORT double GetGeometricVolume(); + + // Get the surface area of the vessel + TIGL_EXPORT double GetSurfaceArea(); + + // Get the circumference of the vessel + TIGL_EXPORT double GetCircumference(int segmentIndex, double eta); + + // Get a point on the given vessel segment in dependence of a parameters eta and zeta with + // 0.0 <= eta <= 1.0 and 0.0 <= zeta <= 1.0. For eta = 0.0 the point lies on the start + // profile of the segment, for eta = 1.0 on the end profile of the segment. For zeta = 0.0 + // the point is the start point of the profile wire, for zeta = 1.0 the last profile wire point. + TIGL_EXPORT gp_Pnt GetPoint(int segmentIndex, double eta, double zeta); + // Set the _getPointBehavior to asParameterOnSurface or onLinearLoft + TIGL_EXPORT void SetGetPointBehavior(TiglGetPointBehavior behavior = asParameterOnSurface); + // Get the _getPointBehavior + TIGL_EXPORT TiglGetPointBehavior GetGetPointBehavior() const; + + // Get the guide curve segment (partial guide curve) with a given uID + TIGL_EXPORT CCPACSGuideCurve& GetGuideCurveSegment(std::string uid); + TIGL_EXPORT const CCPACSGuideCurve& GetGuideCurveSegment(std::string uid) const; + // Returns all guide curve points + TIGL_EXPORT std::vector GetGuideCurvePoints() const; + + // Check whether the vessel is defined using segments + TIGL_EXPORT bool IsVesselViaSegments() const; + // Check whether the vessel is defined using design parameters + TIGL_EXPORT bool IsVesselViaDesignParameters() const; + // Check whether the vessel has spherical dome + TIGL_EXPORT bool HasSphericalDome() const; + // Check whether the vessel has ellipsoid dome + TIGL_EXPORT bool HasEllipsoidDome() const; + // Check whether the vessel has spherical dome + TIGL_EXPORT bool HasTorisphericalDome() const; + // Check whether the vessel has isotensoid dome + TIGL_EXPORT bool HasIsotensoidDome() const; + +protected: + // Build the loft + PNamedShape BuildLoft() const override; + + // Set the face traits + void SetFaceTraits(PNamedShape loft) const; + +private: + const std::string _vesselTypeException = "This method is only available for vessels with segments. No segment found."; + + mutable const tigl::generated::CPACSEllipsoidDome* _ellipsoidPtr = NULL; + mutable const tigl::generated::CPACSTorisphericalDome* _torisphericalPtr = NULL; + mutable const tigl::generated::CPACSIsotensoidDome* _isotensoidPtr = NULL; + mutable bool _isEvaluated = false; + void EvaluateDome() const; + + // Get short name for loft + std::string GetShortShapeName() const; + + TiglGetPointBehavior _getPointBehavior{asParameterOnSurface}; + void IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, + std::vector& r) const; + + void BuildShapeFromSegments(TopoDS_Shape& loftShape) const; + void BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const; + + void BuildVesselWire(std::vector& edges, BRepBuilderAPI_MakeWire& wire) const; + void BuildVesselWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const; + void BuildVesselWireTorispherical(BRepBuilderAPI_MakeWire& wire) const; + void BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const; +}; + +} // namespace tigl + +#endif // CCPACSFUSELAGE_H diff --git a/src/fuelTanks/CCPACSHullStructure.cpp b/src/fuelTanks/CCPACSVesselStructure.cpp similarity index 75% rename from src/fuelTanks/CCPACSHullStructure.cpp rename to src/fuelTanks/CCPACSVesselStructure.cpp index 7646e94a92..d114ec5d83 100644 --- a/src/fuelTanks/CCPACSHullStructure.cpp +++ b/src/fuelTanks/CCPACSVesselStructure.cpp @@ -1,28 +1,28 @@ -/* -* Copyright (c) 2018 RISC Software GmbH -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "CCPACSHullStructure.h" -#include "CCPACSHull.h" - -namespace tigl -{ -CCPACSHullStructure::CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr) - : generated::CPACSHullStructure(parent, uidMgr) - , ITiglFuselageDuctStructure(parent) -{ -} - -} // namespace tigl +/* +* Copyright (c) 2018 RISC Software GmbH +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "CCPACSVesselStructure.h" +#include "CCPACSVessel.h" + +namespace tigl +{ +CCPACSVesselStructure::CCPACSVesselStructure(CCPACSVessel* parent, CTiglUIDManager* uidMgr) + : generated::CPACSVesselStructure(parent, uidMgr) + , ITiglFuselageDuctStructure(parent) +{ +} + +} // namespace tigl diff --git a/src/fuelTanks/CCPACSHullStructure.h b/src/fuelTanks/CCPACSVesselStructure.h similarity index 72% rename from src/fuelTanks/CCPACSHullStructure.h rename to src/fuelTanks/CCPACSVesselStructure.h index b7d6b0b690..3fd4fcd2cc 100644 --- a/src/fuelTanks/CCPACSHullStructure.h +++ b/src/fuelTanks/CCPACSVesselStructure.h @@ -1,37 +1,37 @@ -/* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) -* -* Created: 2022-04-06 Anton Reiswich -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/** -* @file -* @brief Implementation of CPACS hulls handling routines. -*/ - -#pragma once - -#include "generated/CPACSHullStructure.h" -#include "CTiglRelativelyPositionedComponent.h" -#include "ITiglFuselageDuctStructure.h" - -namespace tigl -{ - -class CCPACSHullStructure : public generated::CPACSHullStructure, public ITiglFuselageDuctStructure -{ -public: - TIGL_EXPORT CCPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr); -}; - -} //namespace tigl +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS vessels handling routines. +*/ + +#pragma once + +#include "generated/CPACSVesselStructure.h" +#include "CTiglRelativelyPositionedComponent.h" +#include "ITiglFuselageDuctStructure.h" + +namespace tigl +{ + +class CCPACSVesselStructure : public generated::CPACSVesselStructure, public ITiglFuselageDuctStructure +{ +public: + TIGL_EXPORT CCPACSVesselStructure(CCPACSVessel* parent, CTiglUIDManager* uidMgr); +}; + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSVessels.cpp b/src/fuelTanks/CCPACSVessels.cpp new file mode 100644 index 0000000000..58e89cdf38 --- /dev/null +++ b/src/fuelTanks/CCPACSVessels.cpp @@ -0,0 +1,75 @@ +/* +* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* +* Created: 2022-04-06 Anton Reiswich +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** +* @file +* @brief Implementation of CPACS vessels handling routines. +*/ + +#include "CCPACSVessels.h" +#include "CCPACSVessel.h" +#include "CTiglError.h" + +namespace tigl +{ + +CCPACSVessels::CCPACSVessels(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) + : generated::CPACSVessels(parent, uidMgr) +{ +} + +int CCPACSVessels::GetVesselsCount() const +{ + return static_cast(m_vessels.size()); +} + +CCPACSVessel const& CCPACSVessels::GetVessel(std::string const& uID) const +{ + return const_cast(*this).GetVessel(uID); +} + +CCPACSVessel& CCPACSVessels::GetVessel(std::string const& uID) +{ + auto it = std::find_if(m_vessels.begin(), m_vessels.end(), + [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); + + if (it != std::end(m_vessels)) { + return **it; + } + throw CTiglError("Could not find vessel with uid" + uID); +} + +CCPACSVessel& CCPACSVessels::GetVessel(int index) const +{ + index--; + if (index < 0 || index >= GetVesselsCount()) { + throw CTiglError("Invalid index in CCPACSVessels::GetVessel", TIGL_INDEX_ERROR); + } + return *m_vessels[index]; +} + +int CCPACSVessels::GetVesselIndex(const std::string& uID) const +{ + for (int i = 0; i < GetVesselsCount(); i++) { + const std::string tmpUID(m_vessels[i]->GetUID()); + if (tmpUID == uID) { + return i + 1; + } + } + throw CTiglError("Invalid UID in CCPACSVessels::GetVesselIndex", TIGL_UID_ERROR); +} + +} //namespace tigl diff --git a/src/fuelTanks/CCPACSHulls.h b/src/fuelTanks/CCPACSVessels.h similarity index 55% rename from src/fuelTanks/CCPACSHulls.h rename to src/fuelTanks/CCPACSVessels.h index b666e010da..6068831053 100644 --- a/src/fuelTanks/CCPACSHulls.h +++ b/src/fuelTanks/CCPACSVessels.h @@ -16,34 +16,34 @@ */ /** * @file -* @brief Implementation of CPACS hulls handling routines. +* @brief Implementation of CPACS vessels handling routines. */ #pragma once -#include "generated/CPACSHulls.h" +#include "generated/CPACSVessels.h" #include namespace tigl { -class CCPACSHulls : public generated::CPACSHulls +class CCPACSVessels : public generated::CPACSVessels { public: - TIGL_EXPORT CCPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSVessels(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); - // Get a specific hull for a given uID - TIGL_EXPORT CCPACSHull const& GetHull(std::string const& uID) const; - TIGL_EXPORT CCPACSHull& GetHull(std::string const& uID); + // Get a specific vessel for a given uID + TIGL_EXPORT CCPACSVessel const& GetVessel(std::string const& uID) const; + TIGL_EXPORT CCPACSVessel& GetVessel(std::string const& uID); - // Get a specific hull for a given index. - TIGL_EXPORT CCPACSHull& GetHull(int index) const; + // Get a specific vessel for a given index. + TIGL_EXPORT CCPACSVessel& GetVessel(int index) const; - // Returns the hull index for a given uID. - TIGL_EXPORT int GetHullIndex(const std::string& uID) const; + // Returns the vessel index for a given uID. + TIGL_EXPORT int GetVesselIndex(const std::string& uID) const; // Returns the total count of fuselages in a configuration - TIGL_EXPORT int GetHullsCount() const; + TIGL_EXPORT int GetVesselsCount() const; private: }; diff --git a/src/fuselage/CCPACSFramesAssembly.cpp b/src/fuselage/CCPACSFramesAssembly.cpp index d3ab3917bf..b88fdc8a8a 100644 --- a/src/fuselage/CCPACSFramesAssembly.cpp +++ b/src/fuselage/CCPACSFramesAssembly.cpp @@ -33,7 +33,7 @@ CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUID { } -CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) +CCPACSFramesAssembly::CCPACSFramesAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr) : generated::CPACSFramesAssembly(parent, uidMgr) { } @@ -44,7 +44,7 @@ void CCPACSFramesAssembly::Invalidate(const boost::optional& source m_frames[i]->Invalidate(source); } -// ToDo: Add hulls +// ToDo: Add vessels CTiglRelativelyPositionedComponent const* CCPACSFramesAssembly::GetParentComponent() const { if (IsParent()) { diff --git a/src/fuselage/CCPACSFramesAssembly.h b/src/fuselage/CCPACSFramesAssembly.h index a97936d208..28bc841177 100644 --- a/src/fuselage/CCPACSFramesAssembly.h +++ b/src/fuselage/CCPACSFramesAssembly.h @@ -32,7 +32,7 @@ class CCPACSFramesAssembly : public generated::CPACSFramesAssembly public: TIGL_EXPORT CCPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFramesAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; diff --git a/src/fuselage/CCPACSFuselageSections.cpp b/src/fuselage/CCPACSFuselageSections.cpp index ab30fff703..9756290bbe 100644 --- a/src/fuselage/CCPACSFuselageSections.cpp +++ b/src/fuselage/CCPACSFuselageSections.cpp @@ -32,7 +32,7 @@ CCPACSFuselageSections::CCPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDM CCPACSFuselageSections::CCPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr) : generated::CPACSFuselageSections(parent, uidMgr) {} -CCPACSFuselageSections::CCPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr) +CCPACSFuselageSections::CCPACSFuselageSections(CCPACSVessel* parent, CTiglUIDManager* uidMgr) : generated::CPACSFuselageSections(parent, uidMgr) {} int CCPACSFuselageSections::GetSectionCount() const diff --git a/src/fuselage/CCPACSFuselageSections.h b/src/fuselage/CCPACSFuselageSections.h index cc69247840..b629fba7c2 100644 --- a/src/fuselage/CCPACSFuselageSections.h +++ b/src/fuselage/CCPACSFuselageSections.h @@ -38,7 +38,7 @@ class CCPACSFuselageSections : public generated::CPACSFuselageSections public: TIGL_EXPORT CCPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFuselageSections(CCPACSVessel* parent, CTiglUIDManager* uidMgr); // Get section count TIGL_EXPORT int GetSectionCount() const; diff --git a/src/fuselage/CCPACSFuselageSegment.cpp b/src/fuselage/CCPACSFuselageSegment.cpp index 1d72cf70f8..3e69e5667f 100644 --- a/src/fuselage/CCPACSFuselageSegment.cpp +++ b/src/fuselage/CCPACSFuselageSegment.cpp @@ -25,8 +25,8 @@ #include "CTiglFuselageSegmentGuidecurveBuilder.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" -#include "CCPACSHull.h" -#include "CCPACSHulls.h" +#include "CCPACSVessel.h" +#include "CCPACSVessels.h" #include "CCPACSFuselageProfile.h" #include "CCPACSConfiguration.h" @@ -268,14 +268,14 @@ std::string CCPACSFuselageSegment::GetShortShapeName() const } } } - else if (m_parent->IsParent()) { + else if (m_parent->IsParent()) { prefix = "H"; - auto* hull = m_parent->GetParent(); + auto* vessel = m_parent->GetParent(); unsigned int i = 0; - for (auto& h: hull->GetParent()->GetHulls()) { + for (auto& h: vessel->GetParent()->GetVessels()) { ++i; - if (hull->GetUID() == h->GetUID()) { + if (vessel->GetUID() == h->GetUID()) { findex = i; break; } @@ -415,7 +415,7 @@ void CCPACSFuselageSegment::UpdateSurfaceProperties(SurfacePropertiesCache& cach GProp_GProps AreaSystem; - // The first face is the outer hull. We ignore symmetry planes and the front / back caps + // The first face is the outer vessel. We ignore symmetry planes and the front / back caps BRepGProp::SurfaceProperties(faceExplorer.Current(), AreaSystem); cache.mySurfaceArea = AreaSystem.Mass(); } diff --git a/src/fuselage/CCPACSFuselageSegments.cpp b/src/fuselage/CCPACSFuselageSegments.cpp index 952dafcd15..2bea74b252 100644 --- a/src/fuselage/CCPACSFuselageSegments.cpp +++ b/src/fuselage/CCPACSFuselageSegments.cpp @@ -28,7 +28,7 @@ #include "CCPACSFuselageSegment.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" -#include "CCPACSHull.h" +#include "CCPACSVessel.h" #include "CTiglError.h" #include "sorting.h" #include "CTiglLogging.h" @@ -61,7 +61,7 @@ CCPACSFuselageSegments::CCPACSFuselageSegments(CCPACSFuselage* parent, CTiglUIDM , guideCurves(*this, &CCPACSFuselageSegments::BuildGuideCurves) {} -CCPACSFuselageSegments::CCPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr) +CCPACSFuselageSegments::CCPACSFuselageSegments(CCPACSVessel* parent, CTiglUIDManager* uidMgr) : generated::CPACSFuselageSegments(parent, uidMgr) , guideCurves(*this, &CCPACSFuselageSegments::BuildGuideCurves) {} @@ -74,8 +74,8 @@ CCPACSConfiguration const& CCPACSFuselageSegments::GetConfiguration() const else if (IsParent()) { return GetParent()->GetConfiguration(); } - else if (IsParent()) { - return GetParent()->GetConfiguration(); + else if (IsParent()) { + return GetParent()->GetConfiguration(); } else { @@ -133,8 +133,8 @@ CTiglRelativelyPositionedComponent const* CCPACSFuselageSegments::GetParentCompo else if (IsParent()) { return GetParent(); } - else if (IsParent()) { - return GetParent(); + else if (IsParent()) { + return GetParent(); } else { throw CTiglError("Unknown parent type for CCPACSFuselageSegments."); diff --git a/src/fuselage/CCPACSFuselageSegments.h b/src/fuselage/CCPACSFuselageSegments.h index 4da18a436f..ff461ae57b 100644 --- a/src/fuselage/CCPACSFuselageSegments.h +++ b/src/fuselage/CCPACSFuselageSegments.h @@ -39,7 +39,7 @@ class CCPACSFuselageSegments : public generated::CPACSFuselageSegments public: TIGL_EXPORT CCPACSFuselageSegments(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSFuselageSegments(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSFuselageSegments(CCPACSVessel* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSConfiguration const& GetConfiguration() const; diff --git a/src/fuselage/CCPACSSkin.cpp b/src/fuselage/CCPACSSkin.cpp index faaefcfca3..65c29d20f8 100644 --- a/src/fuselage/CCPACSSkin.cpp +++ b/src/fuselage/CCPACSSkin.cpp @@ -32,7 +32,7 @@ CCPACSSkin::CCPACSSkin(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr) CCPACSSkin::CCPACSSkin(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr) : generated::CPACSSkin(parent, uidMgr) {} -CCPACSSkin::CCPACSSkin(CCPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr) +CCPACSSkin::CCPACSSkin(CCPACSVesselSkinLayers* parent, CTiglUIDManager* uidMgr) : generated::CPACSSkin(parent, uidMgr) {} diff --git a/src/fuselage/CCPACSSkin.h b/src/fuselage/CCPACSSkin.h index 1ac507c361..0b1f0e5cec 100644 --- a/src/fuselage/CCPACSSkin.h +++ b/src/fuselage/CCPACSSkin.h @@ -29,7 +29,7 @@ class CCPACSSkin : public generated::CPACSSkin public: TIGL_EXPORT CCPACSSkin(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSSkin(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSSkin(CCPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSSkin(CCPACSVesselSkinLayers* parent, CTiglUIDManager* uidMgr); // returns the parent as abstract geometric component TIGL_EXPORT CTiglRelativelyPositionedComponent const* GetParentComponent() const; diff --git a/src/fuselage/CCPACSStringersAssembly.cpp b/src/fuselage/CCPACSStringersAssembly.cpp index 42adc8b231..facc32434d 100644 --- a/src/fuselage/CCPACSStringersAssembly.cpp +++ b/src/fuselage/CCPACSStringersAssembly.cpp @@ -32,7 +32,7 @@ CCPACSStringersAssembly::CCPACSStringersAssembly(CCPACSDuctStructure* parent, CT { } -CCPACSStringersAssembly::CCPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) +CCPACSStringersAssembly::CCPACSStringersAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr) : generated::CPACSStringersAssembly(parent, uidMgr) { } diff --git a/src/fuselage/CCPACSStringersAssembly.h b/src/fuselage/CCPACSStringersAssembly.h index 9e0585beca..f3f82e40b0 100644 --- a/src/fuselage/CCPACSStringersAssembly.h +++ b/src/fuselage/CCPACSStringersAssembly.h @@ -32,7 +32,7 @@ class CCPACSStringersAssembly : public generated::CPACSStringersAssembly public: TIGL_EXPORT CCPACSStringersAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSStringersAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSStringersAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT void Invalidate(const boost::optional& source = boost::none) const; diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index ad5160233a..fa3ba8d450 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -27,8 +27,8 @@ #include "CTiglError.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" -#include "CCPACSHull.h" -#include "CCPACSHulls.h" +#include "CCPACSVessel.h" +#include "CCPACSVessels.h" #include "CCPACSFuelTank.h" #include "CCPACSFuselageSections.h" #include "CCPACSFuselageSection.h" @@ -163,8 +163,8 @@ CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSection return segment->GetParent()->GetParent()->GetSections(); } // ToDo: add exception handling - else if (segment->GetParent()->IsParent()) { - return segment->GetParent()->GetParent()->GetSections_choice1().get(); + else if (segment->GetParent()->IsParent()) { + return segment->GetParent()->GetParent()->GetSections_choice1().get(); } else { throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); @@ -182,7 +182,7 @@ boost::optional& CTiglFuselageConnection::GetParentComponent else if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetPositionings(); } - else if (segment->GetParent()->IsParent()) { + else if (segment->GetParent()->IsParent()) { return dummyPositionings; } else { diff --git a/src/fuselage/ITiglFuselageDuctStructure.h b/src/fuselage/ITiglFuselageDuctStructure.h index 167d19a997..1c869b6993 100644 --- a/src/fuselage/ITiglFuselageDuctStructure.h +++ b/src/fuselage/ITiglFuselageDuctStructure.h @@ -34,7 +34,7 @@ class CCPACSFuselageStringerFramePosition; /** * @brief The ITiglFuselageDuctStructure class provides some common * geometric functionality needed by structural elements of - * ducts, fuselages, and hulls + * ducts, fuselages, and vessels */ class ITiglFuselageDuctStructure { @@ -45,7 +45,7 @@ class ITiglFuselageDuctStructure TIGL_EXPORT TopoDS_Shape const& GetLoft() const; - // calculates the intersection of the stringer frame position with the parent loft (duct/fuselage/hull) + // calculates the intersection of the stringer frame position with the parent loft (duct/fuselage/vessel) TIGL_EXPORT gp_Lin Intersection(CCPACSFuselageStringerFramePosition const& pos) const; TIGL_EXPORT gp_Lin Intersection(gp_Pnt pRef, double angleRef) const; diff --git a/src/generated/CPACSDomeType.cpp b/src/generated/CPACSDomeType.cpp index 1f58c168c5..e4c9906f6e 100644 --- a/src/generated/CPACSDomeType.cpp +++ b/src/generated/CPACSDomeType.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CCPACSHull.h" +#include "CCPACSVessel.h" #include "CPACSDomeType.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -27,7 +27,7 @@ namespace tigl { namespace generated { - CPACSDomeType::CPACSDomeType(CCPACSHull* parent) + CPACSDomeType::CPACSDomeType(CCPACSVessel* parent) { //assert(parent != NULL); m_parent = parent; @@ -37,12 +37,12 @@ namespace generated { } - const CCPACSHull* CPACSDomeType::GetParent() const + const CCPACSVessel* CPACSDomeType::GetParent() const { return m_parent; } - CCPACSHull* CPACSDomeType::GetParent() + CCPACSVessel* CPACSDomeType::GetParent() { return m_parent; } diff --git a/src/generated/CPACSDomeType.h b/src/generated/CPACSDomeType.h index de6063dea3..9375bb5515 100644 --- a/src/generated/CPACSDomeType.h +++ b/src/generated/CPACSDomeType.h @@ -30,12 +30,12 @@ namespace tigl { class CTiglUIDObject; -class CCPACSHull; +class CCPACSVessel; namespace generated { // This class is used in: - // CPACSHull + // CPACSVessel /// @brief Dome Type /// @@ -44,13 +44,13 @@ namespace generated class CPACSDomeType { public: - TIGL_EXPORT CPACSDomeType(CCPACSHull* parent); + TIGL_EXPORT CPACSDomeType(CCPACSVessel* parent); TIGL_EXPORT virtual ~CPACSDomeType(); - TIGL_EXPORT CCPACSHull* GetParent(); + TIGL_EXPORT CCPACSVessel* GetParent(); - TIGL_EXPORT const CCPACSHull* GetParent() const; + TIGL_EXPORT const CCPACSVessel* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -79,7 +79,7 @@ namespace generated TIGL_EXPORT virtual void RemoveIsotensoid_choice3(); protected: - CCPACSHull* m_parent; + CCPACSVessel* m_parent; boost::optional m_ellipsoid_choice1; boost::optional m_torispherical_choice2; diff --git a/src/generated/CPACSFramesAssembly.cpp b/src/generated/CPACSFramesAssembly.cpp index e65d2630d8..2871f7726e 100644 --- a/src/generated/CPACSFramesAssembly.cpp +++ b/src/generated/CPACSFramesAssembly.cpp @@ -19,7 +19,7 @@ #include #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" -#include "CCPACSHullStructure.h" +#include "CCPACSVesselStructure.h" #include "CPACSFramesAssembly.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } - CPACSFramesAssembly::CPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + CPACSFramesAssembly::CPACSFramesAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSHullStructure); + m_parentType = &typeid(CCPACSVesselStructure); } CPACSFramesAssembly::~CPACSFramesAssembly() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSFramesAssembly.h b/src/generated/CPACSFramesAssembly.h index c96de805f2..2849ea2669 100644 --- a/src/generated/CPACSFramesAssembly.h +++ b/src/generated/CPACSFramesAssembly.h @@ -32,14 +32,14 @@ class CTiglUIDObject; class CCPACSFrame; class CCPACSDuctStructure; class CCPACSFuselageStructure; -class CCPACSHullStructure; +class CCPACSVesselStructure; namespace generated { // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure - // CPACSHullStructure + // CPACSVesselStructure /// @brief framesAssemblyType /// @@ -50,7 +50,7 @@ namespace generated public: TIGL_EXPORT CPACSFramesAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFramesAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSFramesAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFramesAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFramesAssembly(); @@ -63,7 +63,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -73,7 +73,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFramesAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/generated/CPACSFuelTank.cpp b/src/generated/CPACSFuelTank.cpp index c3c816e1de..9285bb4510 100644 --- a/src/generated/CPACSFuelTank.cpp +++ b/src/generated/CPACSFuelTank.cpp @@ -30,7 +30,7 @@ namespace generated CPACSFuelTank::CPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_transformation(reinterpret_cast(this), m_uidMgr) - , m_hulls(reinterpret_cast(this), m_uidMgr) + , m_vessels(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; @@ -140,28 +140,12 @@ namespace generated LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; } - // read element hulls - if (tixi::TixiCheckElement(tixiHandle, xpath + "/hulls")) { - m_hulls.ReadCPACS(tixiHandle, xpath + "/hulls"); + // read element vessels + if (tixi::TixiCheckElement(tixiHandle, xpath + "/vessels")) { + m_vessels.ReadCPACS(tixiHandle, xpath + "/vessels"); } else { - LOG(ERROR) << "Required element hulls is missing at xpath " << xpath; - } - - // read element volume - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - m_volume = boost::in_place(reinterpret_cast(this)); - try { - m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); - m_volume = boost::none; - } - } - - // read element burstPressure - if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { - m_burstPressure = tixi::TixiGetElement(tixiHandle, xpath + "/burstPressure"); + LOG(ERROR) << "Required element vessels is missing at xpath " << xpath; } if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); @@ -169,7 +153,7 @@ namespace generated void CPACSFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "name", "description", "parentUID", "transformation", "hulls", "volume", "burstPressure" }; + const std::vector childElemOrder = { "name", "description", "parentUID", "transformation", "vessels" }; // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); @@ -214,31 +198,9 @@ namespace generated tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/transformation", childElemOrder); m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); - // write element hulls - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/hulls", childElemOrder); - m_hulls.WriteCPACS(tixiHandle, xpath + "/hulls"); - - // write element volume - if (m_volume) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); - m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); - } - } - - // write element burstPressure - if (m_burstPressure) { - tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/burstPressure", childElemOrder); - tixi::TixiSaveElement(tixiHandle, xpath + "/burstPressure", *m_burstPressure); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/burstPressure"); - } - } + // write element vessels + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/vessels", childElemOrder); + m_vessels.WriteCPACS(tixiHandle, xpath + "/vessels"); } @@ -314,46 +276,14 @@ namespace generated return m_transformation; } - const CCPACSHulls& CPACSFuelTank::GetHulls() const - { - return m_hulls; - } - - CCPACSHulls& CPACSFuelTank::GetHulls() - { - return m_hulls; - } - - const boost::optional& CPACSFuelTank::GetVolume() const - { - return m_volume; - } - - boost::optional& CPACSFuelTank::GetVolume() - { - return m_volume; - } - - const boost::optional& CPACSFuelTank::GetBurstPressure() const - { - return m_burstPressure; - } - - void CPACSFuelTank::SetBurstPressure(const boost::optional& value) - { - m_burstPressure = value; - } - - CPACSFuelTankVolume& CPACSFuelTank::GetVolume(CreateIfNotExistsTag) + const CCPACSVessels& CPACSFuelTank::GetVessels() const { - if (!m_volume) - m_volume = boost::in_place(reinterpret_cast(this)); - return *m_volume; + return m_vessels; } - void CPACSFuelTank::RemoveVolume() + CCPACSVessels& CPACSFuelTank::GetVessels() { - m_volume = boost::none; + return m_vessels; } const CTiglUIDObject* CPACSFuelTank::GetNextUIDObject() const diff --git a/src/generated/CPACSFuelTank.h b/src/generated/CPACSFuelTank.h index d061b03c70..a49fd649eb 100644 --- a/src/generated/CPACSFuelTank.h +++ b/src/generated/CPACSFuelTank.h @@ -19,13 +19,11 @@ #include #include -#include #include +#include #include #include #include -#include "CPACSFuelTankVolume.h" -#include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "ITiglUIDRefObject.h" #include "tigl_internal.h" @@ -81,45 +79,30 @@ namespace generated TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); - TIGL_EXPORT virtual const CCPACSHulls& GetHulls() const; - TIGL_EXPORT virtual CCPACSHulls& GetHulls(); - - TIGL_EXPORT virtual const boost::optional& GetVolume() const; - TIGL_EXPORT virtual boost::optional& GetVolume(); - - TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; - TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); - - TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveVolume(); + TIGL_EXPORT virtual const CCPACSVessels& GetVessels() const; + TIGL_EXPORT virtual CCPACSVessels& GetVessels(); protected: CCPACSFuelTanks* m_parent; CTiglUIDManager* m_uidMgr; - std::string m_uID; + std::string m_uID; - boost::optional m_symmetry; + boost::optional m_symmetry; /// Name - std::string m_name; + std::string m_name; /// Description - boost::optional m_description; + boost::optional m_description; /// Parent component - boost::optional m_parentUID; - - CCPACSTransformation m_transformation; - - CCPACSHulls m_hulls; + boost::optional m_parentUID; - /// Volume - boost::optional m_volume; + CCPACSTransformation m_transformation; - /// Burst pressure - boost::optional m_burstPressure; + CCPACSVessels m_vessels; private: TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; diff --git a/src/generated/CPACSFuelTankVolume.cpp b/src/generated/CPACSFuelTankVolume.cpp index c2a338e1f7..5cfdecceaf 100644 --- a/src/generated/CPACSFuelTankVolume.cpp +++ b/src/generated/CPACSFuelTankVolume.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CCPACSFuelTank.h" +#include "CCPACSVessel.h" #include "CPACSFuelTankVolume.h" #include "CPACSFuselageFuelTank.h" #include "CTiglError.h" @@ -28,20 +28,20 @@ namespace tigl { namespace generated { - CPACSFuelTankVolume::CPACSFuelTankVolume(CCPACSFuelTank* parent) + CPACSFuelTankVolume::CPACSFuelTankVolume(CPACSFuselageFuelTank* parent) : m_optimalVolume(0) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSFuelTank); + m_parentType = &typeid(CPACSFuselageFuelTank); } - CPACSFuelTankVolume::CPACSFuelTankVolume(CPACSFuselageFuelTank* parent) + CPACSFuelTankVolume::CPACSFuelTankVolume(CCPACSVessel* parent) : m_optimalVolume(0) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSFuselageFuelTank); + m_parentType = &typeid(CCPACSVessel); } CPACSFuelTankVolume::~CPACSFuelTankVolume() @@ -51,12 +51,12 @@ namespace generated const CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() const { if (m_parent) { - if (IsParent()) { - return GetParent(); - } if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } @@ -64,12 +64,12 @@ namespace generated CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() { if (m_parent) { - if (IsParent()) { - return GetParent(); - } if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } } return nullptr; } diff --git a/src/generated/CPACSFuelTankVolume.h b/src/generated/CPACSFuelTankVolume.h index 88038b81c8..0bc2137c95 100644 --- a/src/generated/CPACSFuelTankVolume.h +++ b/src/generated/CPACSFuelTankVolume.h @@ -28,15 +28,15 @@ namespace tigl { class CTiglUIDObject; -class CCPACSFuelTank; +class CCPACSVessel; namespace generated { class CPACSFuselageFuelTank; // This class is used in: - // CPACSFuelTank // CPACSFuselageFuelTank + // CPACSVessel /// @brief Definition of different volumes of the fuel tank. /// @@ -45,8 +45,8 @@ namespace generated class CPACSFuelTankVolume { public: - TIGL_EXPORT CPACSFuelTankVolume(CCPACSFuelTank* parent); TIGL_EXPORT CPACSFuelTankVolume(CPACSFuselageFuelTank* parent); + TIGL_EXPORT CPACSFuelTankVolume(CCPACSVessel* parent); TIGL_EXPORT virtual ~CPACSFuelTankVolume(); @@ -59,7 +59,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -69,7 +69,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/generated/CPACSFuselageSections.cpp b/src/generated/CPACSFuselageSections.cpp index 787d2a3663..d01cd2b324 100644 --- a/src/generated/CPACSFuselageSections.cpp +++ b/src/generated/CPACSFuselageSections.cpp @@ -19,7 +19,7 @@ #include #include "CCPACSDuct.h" #include "CCPACSFuselage.h" -#include "CCPACSHull.h" +#include "CCPACSVessel.h" #include "CPACSFuselageSections.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselage); } - CPACSFuselageSections::CPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr) + CPACSFuselageSections::CPACSFuselageSections(CCPACSVessel* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSHull); + m_parentType = &typeid(CCPACSVessel); } CPACSFuselageSections::~CPACSFuselageSections() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSFuselageSections.h b/src/generated/CPACSFuselageSections.h index 77526e5687..72c5987fff 100644 --- a/src/generated/CPACSFuselageSections.h +++ b/src/generated/CPACSFuselageSections.h @@ -32,14 +32,14 @@ class CTiglUIDObject; class CCPACSFuselageSection; class CCPACSDuct; class CCPACSFuselage; -class CCPACSHull; +class CCPACSVessel; namespace generated { // This class is used in: // CPACSDuct // CPACSFuselage - // CPACSHull + // CPACSVessel /// @brief fuselageSectionsType /// @@ -50,7 +50,7 @@ namespace generated public: TIGL_EXPORT CPACSFuselageSections(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFuselageSections(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSFuselageSections(CCPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageSections(CCPACSVessel* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageSections(); @@ -63,7 +63,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -73,7 +73,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSections"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/generated/CPACSFuselageSegments.cpp b/src/generated/CPACSFuselageSegments.cpp index 69077216cb..07c5faeaa2 100644 --- a/src/generated/CPACSFuselageSegments.cpp +++ b/src/generated/CPACSFuselageSegments.cpp @@ -19,7 +19,7 @@ #include #include "CCPACSDuct.h" #include "CCPACSFuselage.h" -#include "CCPACSHull.h" +#include "CCPACSVessel.h" #include "CPACSFuselageSegments.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselage); } - CPACSFuselageSegments::CPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr) + CPACSFuselageSegments::CPACSFuselageSegments(CCPACSVessel* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSHull); + m_parentType = &typeid(CCPACSVessel); } CPACSFuselageSegments::~CPACSFuselageSegments() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSFuselageSegments.h b/src/generated/CPACSFuselageSegments.h index e7dece2dd1..74a8a54dda 100644 --- a/src/generated/CPACSFuselageSegments.h +++ b/src/generated/CPACSFuselageSegments.h @@ -32,14 +32,14 @@ class CTiglUIDObject; class CCPACSFuselageSegment; class CCPACSDuct; class CCPACSFuselage; -class CCPACSHull; +class CCPACSVessel; namespace generated { // This class is used in: // CPACSDuct // CPACSFuselage - // CPACSHull + // CPACSVessel /// @brief fuselageSegmentsType /// @@ -51,7 +51,7 @@ namespace generated public: TIGL_EXPORT CPACSFuselageSegments(CCPACSDuct* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSFuselageSegments(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSFuselageSegments(CCPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSFuselageSegments(CCPACSVessel* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSFuselageSegments(); @@ -64,7 +64,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -74,7 +74,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuselageSegments"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/generated/CPACSSkin.cpp b/src/generated/CPACSSkin.cpp index 2dc026de97..0a3c99f71c 100644 --- a/src/generated/CPACSSkin.cpp +++ b/src/generated/CPACSSkin.cpp @@ -18,8 +18,8 @@ #include #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" -#include "CPACSHullSkinLayers.h" #include "CPACSSkin.h" +#include "CPACSVesselSkinLayers.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -46,12 +46,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } - CPACSSkin::CPACSSkin(CPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr) + CPACSSkin::CPACSSkin(CPACSVesselSkinLayers* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSHullSkinLayers); + m_parentType = &typeid(CPACSVesselSkinLayers); } CPACSSkin::~CPACSSkin() @@ -70,8 +70,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); + if (IsParent()) { + return GetParent()->GetNextUIDParent(); } } return nullptr; @@ -86,8 +86,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent()->GetNextUIDParent(); + if (IsParent()) { + return GetParent()->GetNextUIDParent(); } } return nullptr; diff --git a/src/generated/CPACSSkin.h b/src/generated/CPACSSkin.h index abae4969f0..cd7bc76bae 100644 --- a/src/generated/CPACSSkin.h +++ b/src/generated/CPACSSkin.h @@ -37,12 +37,12 @@ class CCPACSFuselageStructure; namespace generated { - class CPACSHullSkinLayers; + class CPACSVesselSkinLayers; // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure - // CPACSHullSkinLayers + // CPACSVesselSkinLayers /// @brief skinType /// @@ -53,7 +53,7 @@ namespace generated public: TIGL_EXPORT CPACSSkin(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSSkin(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSSkin(CPACSHullSkinLayers* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSSkin(CPACSVesselSkinLayers* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSSkin(); @@ -66,7 +66,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -76,7 +76,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSSkin"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -128,5 +128,5 @@ namespace generated // CPACSSkin is customized, use type CCPACSSkin directly // Aliases in tigl namespace -using CCPACSHullSkinLayers = generated::CPACSHullSkinLayers; +using CCPACSVesselSkinLayers = generated::CPACSVesselSkinLayers; } // namespace tigl diff --git a/src/generated/CPACSStringersAssembly.cpp b/src/generated/CPACSStringersAssembly.cpp index 8b202c13ee..806144c942 100644 --- a/src/generated/CPACSStringersAssembly.cpp +++ b/src/generated/CPACSStringersAssembly.cpp @@ -19,7 +19,7 @@ #include #include "CCPACSDuctStructure.h" #include "CCPACSFuselageStructure.h" -#include "CCPACSHullStructure.h" +#include "CCPACSVesselStructure.h" #include "CPACSStringersAssembly.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -47,12 +47,12 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } - CPACSStringersAssembly::CPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + CPACSStringersAssembly::CPACSStringersAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSHullStructure); + m_parentType = &typeid(CCPACSVesselStructure); } CPACSStringersAssembly::~CPACSStringersAssembly() @@ -68,8 +68,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -84,8 +84,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSStringersAssembly.h b/src/generated/CPACSStringersAssembly.h index fb8be9549a..5b7526bfec 100644 --- a/src/generated/CPACSStringersAssembly.h +++ b/src/generated/CPACSStringersAssembly.h @@ -32,14 +32,14 @@ class CTiglUIDObject; class CCPACSFuselageStringer; class CCPACSDuctStructure; class CCPACSFuselageStructure; -class CCPACSHullStructure; +class CCPACSVesselStructure; namespace generated { // This class is used in: // CPACSDuctStructure // CPACSFuselageStructure - // CPACSHullStructure + // CPACSVesselStructure /// @brief stringersAssemblyType /// @@ -51,7 +51,7 @@ namespace generated public: TIGL_EXPORT CPACSStringersAssembly(CCPACSDuctStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSStringersAssembly(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSStringersAssembly(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSStringersAssembly(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSStringersAssembly(); @@ -64,7 +64,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -74,7 +74,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSStringersAssembly"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/generated/CPACSTransformation.cpp b/src/generated/CPACSTransformation.cpp index 7b284449d7..54d2cd0fca 100644 --- a/src/generated/CPACSTransformation.cpp +++ b/src/generated/CPACSTransformation.cpp @@ -26,10 +26,10 @@ #include "CCPACSFuselageSection.h" #include "CCPACSFuselageSectionElement.h" #include "CCPACSGenericSystem.h" -#include "CCPACSHull.h" #include "CCPACSNacelleSection.h" #include "CCPACSRotor.h" #include "CCPACSRotorHinge.h" +#include "CCPACSVessel.h" #include "CCPACSWing.h" #include "CCPACSWingSection.h" #include "CCPACSWingSectionElement.h" @@ -133,14 +133,6 @@ namespace generated m_parentType = &typeid(CCPACSGenericSystem); } - CPACSTransformation::CPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CCPACSHull); - } - CPACSTransformation::CPACSTransformation(CPACSLandingGearBase* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -173,6 +165,14 @@ namespace generated m_parentType = &typeid(CCPACSRotorHinge); } + CPACSTransformation::CPACSTransformation(CCPACSVessel* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CCPACSVessel); + } + CPACSTransformation::CPACSTransformation(CCPACSWing* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -238,9 +238,6 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); - } if (IsParent()) { return GetParent(); } @@ -253,6 +250,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent(); } @@ -302,9 +302,6 @@ namespace generated if (IsParent()) { return GetParent(); } - if (IsParent()) { - return GetParent(); - } if (IsParent()) { return GetParent(); } @@ -317,6 +314,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent(); } diff --git a/src/generated/CPACSTransformation.h b/src/generated/CPACSTransformation.h index e9846d3c3b..b1f2976e60 100644 --- a/src/generated/CPACSTransformation.h +++ b/src/generated/CPACSTransformation.h @@ -42,10 +42,10 @@ class CCPACSFuselageSectionElement; class CCPACSFuselageSection; class CCPACSExternalObject; class CCPACSGenericSystem; -class CCPACSHull; class CCPACSNacelleSection; class CCPACSRotor; class CCPACSRotorHinge; +class CCPACSVessel; class CCPACSWing; class CCPACSWingSectionElement; class CCPACSWingSection; @@ -67,11 +67,11 @@ namespace generated // CPACSGenericGeometricComponent // CPACSGenericGeometryComponent // CPACSGenericSystem - // CPACSHull // CPACSLandingGearBase // CPACSNacelleSection // CPACSRotor // CPACSRotorHubHinge + // CPACSVessel // CPACSWing // CPACSWingElement // CPACSWingSection @@ -103,11 +103,11 @@ namespace generated TIGL_EXPORT CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CPACSGenericGeometryComponent* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSRotor* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSRotorHinge* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTransformation(CCPACSVessel* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSWing* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSWingSectionElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSWingSection* parent, CTiglUIDManager* uidMgr); @@ -123,7 +123,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -133,7 +133,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/generated/CPACSHull.cpp b/src/generated/CPACSVessel.cpp similarity index 70% rename from src/generated/CPACSHull.cpp rename to src/generated/CPACSVessel.cpp index 36c1075005..eeceb39b2a 100644 --- a/src/generated/CPACSHull.cpp +++ b/src/generated/CPACSVessel.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSHulls.h" -#include "CPACSHull.h" +#include "CCPACSVessels.h" +#include "CPACSVessel.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,30 +27,30 @@ namespace tigl { namespace generated { - CPACSHull::CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr) + CPACSVessel::CPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) - , m_transformation(reinterpret_cast(this), m_uidMgr) + , m_transformation(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; } - CPACSHull::~CPACSHull() + CPACSVessel::~CPACSVessel() { if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSHulls* CPACSHull::GetParent() const + const CCPACSVessels* CPACSVessel::GetParent() const { return m_parent; } - CCPACSHulls* CPACSHull::GetParent() + CCPACSVessels* CPACSVessel::GetParent() { return m_parent; } - const CTiglUIDObject* CPACSHull::GetNextUIDParent() const + const CTiglUIDObject* CPACSVessel::GetNextUIDParent() const { if (m_parent) { return m_parent->GetNextUIDParent(); @@ -58,7 +58,7 @@ namespace generated return nullptr; } - CTiglUIDObject* CPACSHull::GetNextUIDParent() + CTiglUIDObject* CPACSVessel::GetNextUIDParent() { if (m_parent) { return m_parent->GetNextUIDParent(); @@ -66,7 +66,7 @@ namespace generated return nullptr; } - CTiglUIDManager& CPACSHull::GetUIDManager() + CTiglUIDManager& CPACSVessel::GetUIDManager() { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -74,7 +74,7 @@ namespace generated return *m_uidMgr; } - const CTiglUIDManager& CPACSHull::GetUIDManager() const + const CTiglUIDManager& CPACSVessel::GetUIDManager() const { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -82,7 +82,7 @@ namespace generated return *m_uidMgr; } - void CPACSHull::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + void CPACSVessel::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { // read attribute uID if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { @@ -124,7 +124,7 @@ namespace generated // read element sections if (tixi::TixiCheckElement(tixiHandle, xpath + "/sections")) { - m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_sections_choice1->ReadCPACS(tixiHandle, xpath + "/sections"); } catch(const std::exception& e) { @@ -135,7 +135,7 @@ namespace generated // read element segments if (tixi::TixiCheckElement(tixiHandle, xpath + "/segments")) { - m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_segments_choice1->ReadCPACS(tixiHandle, xpath + "/segments"); } catch(const std::exception& e) { @@ -156,7 +156,7 @@ namespace generated // read element domeType if (tixi::TixiCheckElement(tixiHandle, xpath + "/domeType")) { - m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); try { m_domeType_choice2->ReadCPACS(tixiHandle, xpath + "/domeType"); } catch(const std::exception& e) { @@ -167,7 +167,7 @@ namespace generated // read element structure if (tixi::TixiCheckElement(tixiHandle, xpath + "/structure")) { - m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_structure->ReadCPACS(tixiHandle, xpath + "/structure"); } catch(const std::exception& e) { @@ -176,15 +176,31 @@ namespace generated } } + // read element volume + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + m_volume = boost::in_place(reinterpret_cast(this)); + try { + m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); + m_volume = boost::none; + } + } + + // read element burstPressure + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + m_burstPressure = tixi::TixiGetElement(tixiHandle, xpath + "/burstPressure"); + } + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); if (!ValidateChoices()) { LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; } } - void CPACSHull::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + void CPACSVessel::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure" }; + const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure", "volume", "burstPressure" }; // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); @@ -274,9 +290,31 @@ namespace generated } } + // write element volume + if (m_volume) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); + m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); + } + } + + // write element burstPressure + if (m_burstPressure) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/burstPressure", childElemOrder); + tixi::TixiSaveElement(tixiHandle, xpath + "/burstPressure", *m_burstPressure); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/burstPressure")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/burstPressure"); + } + } + } - bool CPACSHull::ValidateChoices() const + bool CPACSVessel::ValidateChoices() const { return ( @@ -318,12 +356,12 @@ namespace generated ; } - const std::string& CPACSHull::GetUID() const + const std::string& CPACSVessel::GetUID() const { return m_uID; } - void CPACSHull::SetUID(const std::string& value) + void CPACSVessel::SetUID(const std::string& value) { if (m_uidMgr && value != m_uID) { if (m_uID.empty()) { @@ -336,143 +374,175 @@ namespace generated m_uID = value; } - const std::string& CPACSHull::GetName() const + const std::string& CPACSVessel::GetName() const { return m_name; } - void CPACSHull::SetName(const std::string& value) + void CPACSVessel::SetName(const std::string& value) { m_name = value; } - const boost::optional& CPACSHull::GetDescription() const + const boost::optional& CPACSVessel::GetDescription() const { return m_description; } - void CPACSHull::SetDescription(const boost::optional& value) + void CPACSVessel::SetDescription(const boost::optional& value) { m_description = value; } - const CCPACSTransformation& CPACSHull::GetTransformation() const + const CCPACSTransformation& CPACSVessel::GetTransformation() const { return m_transformation; } - CCPACSTransformation& CPACSHull::GetTransformation() + CCPACSTransformation& CPACSVessel::GetTransformation() { return m_transformation; } - const boost::optional& CPACSHull::GetSections_choice1() const + const boost::optional& CPACSVessel::GetSections_choice1() const { return m_sections_choice1; } - boost::optional& CPACSHull::GetSections_choice1() + boost::optional& CPACSVessel::GetSections_choice1() { return m_sections_choice1; } - const boost::optional& CPACSHull::GetSegments_choice1() const + const boost::optional& CPACSVessel::GetSegments_choice1() const { return m_segments_choice1; } - boost::optional& CPACSHull::GetSegments_choice1() + boost::optional& CPACSVessel::GetSegments_choice1() { return m_segments_choice1; } - const boost::optional& CPACSHull::GetCylinderRadius_choice2() const + const boost::optional& CPACSVessel::GetCylinderRadius_choice2() const { return m_cylinderRadius_choice2; } - void CPACSHull::SetCylinderRadius_choice2(const boost::optional& value) + void CPACSVessel::SetCylinderRadius_choice2(const boost::optional& value) { m_cylinderRadius_choice2 = value; } - const boost::optional& CPACSHull::GetCylinderLength_choice2() const + const boost::optional& CPACSVessel::GetCylinderLength_choice2() const { return m_cylinderLength_choice2; } - void CPACSHull::SetCylinderLength_choice2(const boost::optional& value) + void CPACSVessel::SetCylinderLength_choice2(const boost::optional& value) { m_cylinderLength_choice2 = value; } - const boost::optional& CPACSHull::GetDomeType_choice2() const + const boost::optional& CPACSVessel::GetDomeType_choice2() const { return m_domeType_choice2; } - boost::optional& CPACSHull::GetDomeType_choice2() + boost::optional& CPACSVessel::GetDomeType_choice2() { return m_domeType_choice2; } - const boost::optional& CPACSHull::GetStructure() const + const boost::optional& CPACSVessel::GetStructure() const { return m_structure; } - boost::optional& CPACSHull::GetStructure() + boost::optional& CPACSVessel::GetStructure() { return m_structure; } - CCPACSFuselageSections& CPACSHull::GetSections_choice1(CreateIfNotExistsTag) + const boost::optional& CPACSVessel::GetVolume() const + { + return m_volume; + } + + boost::optional& CPACSVessel::GetVolume() + { + return m_volume; + } + + const boost::optional& CPACSVessel::GetBurstPressure() const + { + return m_burstPressure; + } + + void CPACSVessel::SetBurstPressure(const boost::optional& value) + { + m_burstPressure = value; + } + + CCPACSFuselageSections& CPACSVessel::GetSections_choice1(CreateIfNotExistsTag) { if (!m_sections_choice1) - m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_sections_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_sections_choice1; } - void CPACSHull::RemoveSections_choice1() + void CPACSVessel::RemoveSections_choice1() { m_sections_choice1 = boost::none; } - CCPACSFuselageSegments& CPACSHull::GetSegments_choice1(CreateIfNotExistsTag) + CCPACSFuselageSegments& CPACSVessel::GetSegments_choice1(CreateIfNotExistsTag) { if (!m_segments_choice1) - m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_segments_choice1 = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_segments_choice1; } - void CPACSHull::RemoveSegments_choice1() + void CPACSVessel::RemoveSegments_choice1() { m_segments_choice1 = boost::none; } - CPACSDomeType& CPACSHull::GetDomeType_choice2(CreateIfNotExistsTag) + CPACSDomeType& CPACSVessel::GetDomeType_choice2(CreateIfNotExistsTag) { if (!m_domeType_choice2) - m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); + m_domeType_choice2 = boost::in_place(reinterpret_cast(this)); return *m_domeType_choice2; } - void CPACSHull::RemoveDomeType_choice2() + void CPACSVessel::RemoveDomeType_choice2() { m_domeType_choice2 = boost::none; } - CCPACSHullStructure& CPACSHull::GetStructure(CreateIfNotExistsTag) + CCPACSVesselStructure& CPACSVessel::GetStructure(CreateIfNotExistsTag) { if (!m_structure) - m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_structure = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_structure; } - void CPACSHull::RemoveStructure() + void CPACSVessel::RemoveStructure() { m_structure = boost::none; } + CPACSFuelTankVolume& CPACSVessel::GetVolume(CreateIfNotExistsTag) + { + if (!m_volume) + m_volume = boost::in_place(reinterpret_cast(this)); + return *m_volume; + } + + void CPACSVessel::RemoveVolume() + { + m_volume = boost::none; + } + } // namespace generated } // namespace tigl diff --git a/src/generated/CPACSHull.h b/src/generated/CPACSVessel.h similarity index 73% rename from src/generated/CPACSHull.h rename to src/generated/CPACSVessel.h index 00ea512d72..3d340772b1 100644 --- a/src/generated/CPACSHull.h +++ b/src/generated/CPACSVessel.h @@ -21,11 +21,12 @@ #include #include #include -#include #include +#include #include #include #include "CPACSDomeType.h" +#include "CPACSFuelTankVolume.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -33,26 +34,26 @@ namespace tigl { class CTiglUIDManager; -class CCPACSHulls; +class CCPACSVessels; namespace generated { // This class is used in: - // CPACSHulls + // CPACSVessels - /// @brief Hulls + /// @brief Vessel /// /// - class CPACSHull : public CTiglReqUIDObject + class CPACSVessel : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSHull(CCPACSHulls* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT virtual ~CPACSHull(); + TIGL_EXPORT virtual ~CPACSVessel(); - TIGL_EXPORT CCPACSHulls* GetParent(); + TIGL_EXPORT CCPACSVessels* GetParent(); - TIGL_EXPORT const CCPACSHulls* GetParent() const; + TIGL_EXPORT const CCPACSVessels* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -92,8 +93,14 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetDomeType_choice2() const; TIGL_EXPORT virtual boost::optional& GetDomeType_choice2(); - TIGL_EXPORT virtual const boost::optional& GetStructure() const; - TIGL_EXPORT virtual boost::optional& GetStructure(); + TIGL_EXPORT virtual const boost::optional& GetStructure() const; + TIGL_EXPORT virtual boost::optional& GetStructure(); + + TIGL_EXPORT virtual const boost::optional& GetVolume() const; + TIGL_EXPORT virtual boost::optional& GetVolume(); + + TIGL_EXPORT virtual const boost::optional& GetBurstPressure() const; + TIGL_EXPORT virtual void SetBurstPressure(const boost::optional& value); TIGL_EXPORT virtual CCPACSFuselageSections& GetSections_choice1(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveSections_choice1(); @@ -104,11 +111,14 @@ namespace generated TIGL_EXPORT virtual CPACSDomeType& GetDomeType_choice2(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveDomeType_choice2(); - TIGL_EXPORT virtual CCPACSHullStructure& GetStructure(CreateIfNotExistsTag); + TIGL_EXPORT virtual CCPACSVesselStructure& GetStructure(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStructure(); + TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveVolume(); + protected: - CCPACSHulls* m_parent; + CCPACSVessels* m_parent; CTiglUIDManager* m_uidMgr; @@ -134,16 +144,22 @@ namespace generated boost::optional m_domeType_choice2; - boost::optional m_structure; + boost::optional m_structure; + + /// Volume + boost::optional m_volume; + + /// Burst pressure + boost::optional m_burstPressure; private: - CPACSHull(const CPACSHull&) = delete; - CPACSHull& operator=(const CPACSHull&) = delete; + CPACSVessel(const CPACSVessel&) = delete; + CPACSVessel& operator=(const CPACSVessel&) = delete; - CPACSHull(CPACSHull&&) = delete; - CPACSHull& operator=(CPACSHull&&) = delete; + CPACSVessel(CPACSVessel&&) = delete; + CPACSVessel& operator=(CPACSVessel&&) = delete; }; } // namespace generated -// CPACSHull is customized, use type CCPACSHull directly +// CPACSVessel is customized, use type CCPACSVessel directly } // namespace tigl diff --git a/src/generated/CPACSHullSkinLayers.cpp b/src/generated/CPACSVesselSkinLayers.cpp similarity index 67% rename from src/generated/CPACSHullSkinLayers.cpp rename to src/generated/CPACSVesselSkinLayers.cpp index b8fcf56532..88fc79d9e0 100644 --- a/src/generated/CPACSHullSkinLayers.cpp +++ b/src/generated/CPACSVesselSkinLayers.cpp @@ -17,8 +17,8 @@ #include #include -#include "CCPACSHullStructure.h" -#include "CPACSHullSkinLayers.h" +#include "CCPACSVesselStructure.h" +#include "CPACSVesselSkinLayers.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -29,38 +29,38 @@ namespace tigl { namespace generated { - CPACSHullSkinLayers::CPACSHullSkinLayers(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + CPACSVesselSkinLayers::CPACSVesselSkinLayers(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; } - CPACSHullSkinLayers::~CPACSHullSkinLayers() + CPACSVesselSkinLayers::~CPACSVesselSkinLayers() { } - const CCPACSHullStructure* CPACSHullSkinLayers::GetParent() const + const CCPACSVesselStructure* CPACSVesselSkinLayers::GetParent() const { return m_parent; } - CCPACSHullStructure* CPACSHullSkinLayers::GetParent() + CCPACSVesselStructure* CPACSVesselSkinLayers::GetParent() { return m_parent; } - const CTiglUIDObject* CPACSHullSkinLayers::GetNextUIDParent() const + const CTiglUIDObject* CPACSVesselSkinLayers::GetNextUIDParent() const { return m_parent; } - CTiglUIDObject* CPACSHullSkinLayers::GetNextUIDParent() + CTiglUIDObject* CPACSVesselSkinLayers::GetNextUIDParent() { return m_parent; } - CTiglUIDManager& CPACSHullSkinLayers::GetUIDManager() + CTiglUIDManager& CPACSVesselSkinLayers::GetUIDManager() { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -68,7 +68,7 @@ namespace generated return *m_uidMgr; } - const CTiglUIDManager& CPACSHullSkinLayers::GetUIDManager() const + const CTiglUIDManager& CPACSVesselSkinLayers::GetUIDManager() const { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -76,7 +76,7 @@ namespace generated return *m_uidMgr; } - void CPACSHullSkinLayers::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + void CPACSVesselSkinLayers::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { // read element skinLayer if (tixi::TixiCheckElement(tixiHandle, xpath + "/skinLayer")) { @@ -85,30 +85,30 @@ namespace generated } - void CPACSHullSkinLayers::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + void CPACSVesselSkinLayers::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { // write element skinLayer tixi::TixiSaveElements(tixiHandle, xpath + "/skinLayer", m_skinLayers); } - const std::vector>& CPACSHullSkinLayers::GetSkinLayers() const + const std::vector>& CPACSVesselSkinLayers::GetSkinLayers() const { return m_skinLayers; } - std::vector>& CPACSHullSkinLayers::GetSkinLayers() + std::vector>& CPACSVesselSkinLayers::GetSkinLayers() { return m_skinLayers; } - CCPACSSkin& CPACSHullSkinLayers::AddSkinLayer() + CCPACSSkin& CPACSVesselSkinLayers::AddSkinLayer() { m_skinLayers.push_back(make_unique(this, m_uidMgr)); return *m_skinLayers.back(); } - void CPACSHullSkinLayers::RemoveSkinLayer(CCPACSSkin& ref) + void CPACSVesselSkinLayers::RemoveSkinLayer(CCPACSSkin& ref) { for (std::size_t i = 0; i < m_skinLayers.size(); i++) { if (m_skinLayers[i].get() == &ref) { diff --git a/src/generated/CPACSHullSkinLayers.h b/src/generated/CPACSVesselSkinLayers.h similarity index 73% rename from src/generated/CPACSHullSkinLayers.h rename to src/generated/CPACSVesselSkinLayers.h index 365b75134e..a714eefb29 100644 --- a/src/generated/CPACSHullSkinLayers.h +++ b/src/generated/CPACSVesselSkinLayers.h @@ -28,27 +28,27 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSSkin; -class CCPACSHullStructure; +class CCPACSVesselStructure; namespace generated { // This class is used in: - // CPACSHullStructure + // CPACSVesselStructure /// @brief Skin Layers /// /// /// - class CPACSHullSkinLayers + class CPACSVesselSkinLayers { public: - TIGL_EXPORT CPACSHullSkinLayers(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSVesselSkinLayers(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT virtual ~CPACSHullSkinLayers(); + TIGL_EXPORT virtual ~CPACSVesselSkinLayers(); - TIGL_EXPORT CCPACSHullStructure* GetParent(); + TIGL_EXPORT CCPACSVesselStructure* GetParent(); - TIGL_EXPORT const CCPACSHullStructure* GetParent() const; + TIGL_EXPORT const CCPACSVesselStructure* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -66,21 +66,21 @@ namespace generated TIGL_EXPORT virtual void RemoveSkinLayer(CCPACSSkin& ref); protected: - CCPACSHullStructure* m_parent; + CCPACSVesselStructure* m_parent; CTiglUIDManager* m_uidMgr; std::vector> m_skinLayers; private: - CPACSHullSkinLayers(const CPACSHullSkinLayers&) = delete; - CPACSHullSkinLayers& operator=(const CPACSHullSkinLayers&) = delete; + CPACSVesselSkinLayers(const CPACSVesselSkinLayers&) = delete; + CPACSVesselSkinLayers& operator=(const CPACSVesselSkinLayers&) = delete; - CPACSHullSkinLayers(CPACSHullSkinLayers&&) = delete; - CPACSHullSkinLayers& operator=(CPACSHullSkinLayers&&) = delete; + CPACSVesselSkinLayers(CPACSVesselSkinLayers&&) = delete; + CPACSVesselSkinLayers& operator=(CPACSVesselSkinLayers&&) = delete; }; } // namespace generated // Aliases in tigl namespace -using CCPACSHullSkinLayers = generated::CPACSHullSkinLayers; +using CCPACSVesselSkinLayers = generated::CPACSVesselSkinLayers; } // namespace tigl diff --git a/src/generated/CPACSHullStructure.cpp b/src/generated/CPACSVesselStructure.cpp similarity index 53% rename from src/generated/CPACSHullStructure.cpp rename to src/generated/CPACSVesselStructure.cpp index 70662bbc6d..a7f69ea13c 100644 --- a/src/generated/CPACSHullStructure.cpp +++ b/src/generated/CPACSVesselStructure.cpp @@ -16,8 +16,8 @@ // limitations under the License. #include -#include "CCPACSHull.h" -#include "CPACSHullStructure.h" +#include "CCPACSVessel.h" +#include "CPACSVesselStructure.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -27,39 +27,39 @@ namespace tigl { namespace generated { - CPACSHullStructure::CPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr) + CPACSVesselStructure::CPACSVesselStructure(CCPACSVessel* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; } - CPACSHullStructure::~CPACSHullStructure() + CPACSVesselStructure::~CPACSVesselStructure() { if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } - const CCPACSHull* CPACSHullStructure::GetParent() const + const CCPACSVessel* CPACSVesselStructure::GetParent() const { return m_parent; } - CCPACSHull* CPACSHullStructure::GetParent() + CCPACSVessel* CPACSVesselStructure::GetParent() { return m_parent; } - const CTiglUIDObject* CPACSHullStructure::GetNextUIDParent() const + const CTiglUIDObject* CPACSVesselStructure::GetNextUIDParent() const { return m_parent; } - CTiglUIDObject* CPACSHullStructure::GetNextUIDParent() + CTiglUIDObject* CPACSVesselStructure::GetNextUIDParent() { return m_parent; } - CTiglUIDManager& CPACSHullStructure::GetUIDManager() + CTiglUIDManager& CPACSVesselStructure::GetUIDManager() { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -67,7 +67,7 @@ namespace generated return *m_uidMgr; } - const CTiglUIDManager& CPACSHullStructure::GetUIDManager() const + const CTiglUIDManager& CPACSVesselStructure::GetUIDManager() const { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -75,7 +75,7 @@ namespace generated return *m_uidMgr; } - void CPACSHullStructure::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + void CPACSVesselStructure::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { // read attribute uID if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { @@ -90,7 +90,7 @@ namespace generated // read element stringers if (tixi::TixiCheckElement(tixiHandle, xpath + "/stringers")) { - m_stringers = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_stringers = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_stringers->ReadCPACS(tixiHandle, xpath + "/stringers"); } catch(const std::exception& e) { @@ -101,7 +101,7 @@ namespace generated // read element frames if (tixi::TixiCheckElement(tixiHandle, xpath + "/frames")) { - m_frames = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_frames = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_frames->ReadCPACS(tixiHandle, xpath + "/frames"); } catch(const std::exception& e) { @@ -110,31 +110,9 @@ namespace generated } } - // read element virtualStringers - if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualStringers")) { - m_virtualStringers = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_virtualStringers->ReadCPACS(tixiHandle, xpath + "/virtualStringers"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read virtualStringers at xpath " << xpath << ": " << e.what(); - m_virtualStringers = boost::none; - } - } - - // read element virtualFrames - if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualFrames")) { - m_virtualFrames = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_virtualFrames->ReadCPACS(tixiHandle, xpath + "/virtualFrames"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read virtualFrames at xpath " << xpath << ": " << e.what(); - m_virtualFrames = boost::none; - } - } - // read element skinLayers if (tixi::TixiCheckElement(tixiHandle, xpath + "/skinLayers")) { - m_skinLayers = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_skinLayers = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_skinLayers->ReadCPACS(tixiHandle, xpath + "/skinLayers"); } catch(const std::exception& e) { @@ -145,7 +123,7 @@ namespace generated // read element walls if (tixi::TixiCheckElement(tixiHandle, xpath + "/walls")) { - m_walls = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_walls = boost::in_place(reinterpret_cast(this), m_uidMgr); try { m_walls->ReadCPACS(tixiHandle, xpath + "/walls"); } catch(const std::exception& e) { @@ -157,7 +135,7 @@ namespace generated if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); } - void CPACSHullStructure::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + void CPACSVesselStructure::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); @@ -184,28 +162,6 @@ namespace generated } } - // write element virtualStringers - if (m_virtualStringers) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/virtualStringers"); - m_virtualStringers->WriteCPACS(tixiHandle, xpath + "/virtualStringers"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualStringers")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/virtualStringers"); - } - } - - // write element virtualFrames - if (m_virtualFrames) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/virtualFrames"); - m_virtualFrames->WriteCPACS(tixiHandle, xpath + "/virtualFrames"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/virtualFrames")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/virtualFrames"); - } - } - // write element skinLayers if (m_skinLayers) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/skinLayers"); @@ -230,12 +186,12 @@ namespace generated } - const std::string& CPACSHullStructure::GetUID() const + const std::string& CPACSVesselStructure::GetUID() const { return m_uID; } - void CPACSHullStructure::SetUID(const std::string& value) + void CPACSVesselStructure::SetUID(const std::string& value) { if (m_uidMgr && value != m_uID) { if (m_uID.empty()) { @@ -248,134 +204,90 @@ namespace generated m_uID = value; } - const boost::optional& CPACSHullStructure::GetStringers() const + const boost::optional& CPACSVesselStructure::GetStringers() const { return m_stringers; } - boost::optional& CPACSHullStructure::GetStringers() + boost::optional& CPACSVesselStructure::GetStringers() { return m_stringers; } - const boost::optional& CPACSHullStructure::GetFrames() const + const boost::optional& CPACSVesselStructure::GetFrames() const { return m_frames; } - boost::optional& CPACSHullStructure::GetFrames() + boost::optional& CPACSVesselStructure::GetFrames() { return m_frames; } - const boost::optional& CPACSHullStructure::GetVirtualStringers() const - { - return m_virtualStringers; - } - - boost::optional& CPACSHullStructure::GetVirtualStringers() - { - return m_virtualStringers; - } - - const boost::optional& CPACSHullStructure::GetVirtualFrames() const - { - return m_virtualFrames; - } - - boost::optional& CPACSHullStructure::GetVirtualFrames() - { - return m_virtualFrames; - } - - const boost::optional& CPACSHullStructure::GetSkinLayers() const + const boost::optional& CPACSVesselStructure::GetSkinLayers() const { return m_skinLayers; } - boost::optional& CPACSHullStructure::GetSkinLayers() + boost::optional& CPACSVesselStructure::GetSkinLayers() { return m_skinLayers; } - const boost::optional& CPACSHullStructure::GetWalls() const + const boost::optional& CPACSVesselStructure::GetWalls() const { return m_walls; } - boost::optional& CPACSHullStructure::GetWalls() + boost::optional& CPACSVesselStructure::GetWalls() { return m_walls; } - CCPACSStringersAssembly& CPACSHullStructure::GetStringers(CreateIfNotExistsTag) + CCPACSStringersAssembly& CPACSVesselStructure::GetStringers(CreateIfNotExistsTag) { if (!m_stringers) - m_stringers = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_stringers = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_stringers; } - void CPACSHullStructure::RemoveStringers() + void CPACSVesselStructure::RemoveStringers() { m_stringers = boost::none; } - CCPACSFramesAssembly& CPACSHullStructure::GetFrames(CreateIfNotExistsTag) + CCPACSFramesAssembly& CPACSVesselStructure::GetFrames(CreateIfNotExistsTag) { if (!m_frames) - m_frames = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_frames = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_frames; } - void CPACSHullStructure::RemoveFrames() + void CPACSVesselStructure::RemoveFrames() { m_frames = boost::none; } - CCPACSStringersAssembly& CPACSHullStructure::GetVirtualStringers(CreateIfNotExistsTag) - { - if (!m_virtualStringers) - m_virtualStringers = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_virtualStringers; - } - - void CPACSHullStructure::RemoveVirtualStringers() - { - m_virtualStringers = boost::none; - } - - CCPACSFramesAssembly& CPACSHullStructure::GetVirtualFrames(CreateIfNotExistsTag) - { - if (!m_virtualFrames) - m_virtualFrames = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_virtualFrames; - } - - void CPACSHullStructure::RemoveVirtualFrames() - { - m_virtualFrames = boost::none; - } - - CPACSHullSkinLayers& CPACSHullStructure::GetSkinLayers(CreateIfNotExistsTag) + CPACSVesselSkinLayers& CPACSVesselStructure::GetSkinLayers(CreateIfNotExistsTag) { if (!m_skinLayers) - m_skinLayers = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_skinLayers = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_skinLayers; } - void CPACSHullStructure::RemoveSkinLayers() + void CPACSVesselStructure::RemoveSkinLayers() { m_skinLayers = boost::none; } - CCPACSWalls& CPACSHullStructure::GetWalls(CreateIfNotExistsTag) + CCPACSWalls& CPACSVesselStructure::GetWalls(CreateIfNotExistsTag) { if (!m_walls) - m_walls = boost::in_place(reinterpret_cast(this), m_uidMgr); + m_walls = boost::in_place(reinterpret_cast(this), m_uidMgr); return *m_walls; } - void CPACSHullStructure::RemoveWalls() + void CPACSVesselStructure::RemoveWalls() { m_walls = boost::none; } diff --git a/src/generated/CPACSHullStructure.h b/src/generated/CPACSVesselStructure.h similarity index 62% rename from src/generated/CPACSHullStructure.h rename to src/generated/CPACSVesselStructure.h index 381dad40c1..077fede0d8 100644 --- a/src/generated/CPACSHullStructure.h +++ b/src/generated/CPACSVesselStructure.h @@ -24,7 +24,7 @@ #include #include #include -#include "CPACSHullSkinLayers.h" +#include "CPACSVesselSkinLayers.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -32,26 +32,26 @@ namespace tigl { class CTiglUIDManager; -class CCPACSHull; +class CCPACSVessel; namespace generated { // This class is used in: - // CPACSHull + // CPACSVessel /// @brief Structure /// /// - class CPACSHullStructure : public CTiglReqUIDObject + class CPACSVesselStructure : public CTiglReqUIDObject { public: - TIGL_EXPORT CPACSHullStructure(CCPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSVesselStructure(CCPACSVessel* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT virtual ~CPACSHullStructure(); + TIGL_EXPORT virtual ~CPACSVesselStructure(); - TIGL_EXPORT CCPACSHull* GetParent(); + TIGL_EXPORT CCPACSVessel* GetParent(); - TIGL_EXPORT const CCPACSHull* GetParent() const; + TIGL_EXPORT const CCPACSVessel* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -71,14 +71,8 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetFrames() const; TIGL_EXPORT virtual boost::optional& GetFrames(); - TIGL_EXPORT virtual const boost::optional& GetVirtualStringers() const; - TIGL_EXPORT virtual boost::optional& GetVirtualStringers(); - - TIGL_EXPORT virtual const boost::optional& GetVirtualFrames() const; - TIGL_EXPORT virtual boost::optional& GetVirtualFrames(); - - TIGL_EXPORT virtual const boost::optional& GetSkinLayers() const; - TIGL_EXPORT virtual boost::optional& GetSkinLayers(); + TIGL_EXPORT virtual const boost::optional& GetSkinLayers() const; + TIGL_EXPORT virtual boost::optional& GetSkinLayers(); TIGL_EXPORT virtual const boost::optional& GetWalls() const; TIGL_EXPORT virtual boost::optional& GetWalls(); @@ -89,39 +83,31 @@ namespace generated TIGL_EXPORT virtual CCPACSFramesAssembly& GetFrames(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveFrames(); - TIGL_EXPORT virtual CCPACSStringersAssembly& GetVirtualStringers(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveVirtualStringers(); - - TIGL_EXPORT virtual CCPACSFramesAssembly& GetVirtualFrames(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveVirtualFrames(); - - TIGL_EXPORT virtual CPACSHullSkinLayers& GetSkinLayers(CreateIfNotExistsTag); + TIGL_EXPORT virtual CPACSVesselSkinLayers& GetSkinLayers(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveSkinLayers(); TIGL_EXPORT virtual CCPACSWalls& GetWalls(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveWalls(); protected: - CCPACSHull* m_parent; + CCPACSVessel* m_parent; CTiglUIDManager* m_uidMgr; std::string m_uID; boost::optional m_stringers; boost::optional m_frames; - boost::optional m_virtualStringers; - boost::optional m_virtualFrames; - boost::optional m_skinLayers; + boost::optional m_skinLayers; boost::optional m_walls; private: - CPACSHullStructure(const CPACSHullStructure&) = delete; - CPACSHullStructure& operator=(const CPACSHullStructure&) = delete; + CPACSVesselStructure(const CPACSVesselStructure&) = delete; + CPACSVesselStructure& operator=(const CPACSVesselStructure&) = delete; - CPACSHullStructure(CPACSHullStructure&&) = delete; - CPACSHullStructure& operator=(CPACSHullStructure&&) = delete; + CPACSVesselStructure(CPACSVesselStructure&&) = delete; + CPACSVesselStructure& operator=(CPACSVesselStructure&&) = delete; }; } // namespace generated -// CPACSHullStructure is customized, use type CCPACSHullStructure directly +// CPACSVesselStructure is customized, use type CCPACSVesselStructure directly } // namespace tigl diff --git a/src/generated/CPACSHulls.cpp b/src/generated/CPACSVessels.cpp similarity index 50% rename from src/generated/CPACSHulls.cpp rename to src/generated/CPACSVessels.cpp index 28858fa931..79eaccf36e 100644 --- a/src/generated/CPACSHulls.cpp +++ b/src/generated/CPACSVessels.cpp @@ -16,9 +16,9 @@ // limitations under the License. #include -#include +#include #include "CCPACSFuelTank.h" -#include "CPACSHulls.h" +#include "CPACSVessels.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -29,38 +29,38 @@ namespace tigl { namespace generated { - CPACSHulls::CPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) + CPACSVessels::CPACSVessels(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; } - CPACSHulls::~CPACSHulls() + CPACSVessels::~CPACSVessels() { } - const CCPACSFuelTank* CPACSHulls::GetParent() const + const CCPACSFuelTank* CPACSVessels::GetParent() const { return m_parent; } - CCPACSFuelTank* CPACSHulls::GetParent() + CCPACSFuelTank* CPACSVessels::GetParent() { return m_parent; } - const CTiglUIDObject* CPACSHulls::GetNextUIDParent() const + const CTiglUIDObject* CPACSVessels::GetNextUIDParent() const { return m_parent; } - CTiglUIDObject* CPACSHulls::GetNextUIDParent() + CTiglUIDObject* CPACSVessels::GetNextUIDParent() { return m_parent; } - CTiglUIDManager& CPACSHulls::GetUIDManager() + CTiglUIDManager& CPACSVessels::GetUIDManager() { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -68,7 +68,7 @@ namespace generated return *m_uidMgr; } - const CTiglUIDManager& CPACSHulls::GetUIDManager() const + const CTiglUIDManager& CPACSVessels::GetUIDManager() const { if (!m_uidMgr) { throw CTiglError("UIDManager is null"); @@ -76,43 +76,43 @@ namespace generated return *m_uidMgr; } - void CPACSHulls::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + void CPACSVessels::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { - // read element hull - if (tixi::TixiCheckElement(tixiHandle, xpath + "/hull")) { - tixi::TixiReadElements(tixiHandle, xpath + "/hull", m_hulls, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); + // read element vessel + if (tixi::TixiCheckElement(tixiHandle, xpath + "/vessel")) { + tixi::TixiReadElements(tixiHandle, xpath + "/vessel", m_vessels, 1, tixi::xsdUnbounded, reinterpret_cast(this), m_uidMgr); } } - void CPACSHulls::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + void CPACSVessels::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - // write element hull - tixi::TixiSaveElements(tixiHandle, xpath + "/hull", m_hulls); + // write element vessel + tixi::TixiSaveElements(tixiHandle, xpath + "/vessel", m_vessels); } - const std::vector>& CPACSHulls::GetHulls() const + const std::vector>& CPACSVessels::GetVessels() const { - return m_hulls; + return m_vessels; } - std::vector>& CPACSHulls::GetHulls() + std::vector>& CPACSVessels::GetVessels() { - return m_hulls; + return m_vessels; } - CCPACSHull& CPACSHulls::AddHull() + CCPACSVessel& CPACSVessels::AddVessel() { - m_hulls.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); - return *m_hulls.back(); + m_vessels.push_back(make_unique(reinterpret_cast(this), m_uidMgr)); + return *m_vessels.back(); } - void CPACSHulls::RemoveHull(CCPACSHull& ref) + void CPACSVessels::RemoveVessel(CCPACSVessel& ref) { - for (std::size_t i = 0; i < m_hulls.size(); i++) { - if (m_hulls[i].get() == &ref) { - m_hulls.erase(m_hulls.begin() + i); + for (std::size_t i = 0; i < m_vessels.size(); i++) { + if (m_vessels[i].get() == &ref) { + m_vessels.erase(m_vessels.begin() + i); return; } } diff --git a/src/generated/CPACSHulls.h b/src/generated/CPACSVessels.h similarity index 70% rename from src/generated/CPACSHulls.h rename to src/generated/CPACSVessels.h index c408554cd7..2c36573925 100644 --- a/src/generated/CPACSHulls.h +++ b/src/generated/CPACSVessels.h @@ -27,7 +27,7 @@ namespace tigl { class CTiglUIDManager; class CTiglUIDObject; -class CCPACSHull; +class CCPACSVessel; class CCPACSFuelTank; namespace generated @@ -35,15 +35,15 @@ namespace generated // This class is used in: // CPACSFuelTank - /// @brief Hulls + /// @brief Vessels /// /// - class CPACSHulls + class CPACSVessels { public: - TIGL_EXPORT CPACSHulls(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSVessels(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT virtual ~CPACSHulls(); + TIGL_EXPORT virtual ~CPACSVessels(); TIGL_EXPORT CCPACSFuelTank* GetParent(); @@ -58,27 +58,27 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const std::vector>& GetHulls() const; - TIGL_EXPORT virtual std::vector>& GetHulls(); + TIGL_EXPORT virtual const std::vector>& GetVessels() const; + TIGL_EXPORT virtual std::vector>& GetVessels(); - TIGL_EXPORT virtual CCPACSHull& AddHull(); - TIGL_EXPORT virtual void RemoveHull(CCPACSHull& ref); + TIGL_EXPORT virtual CCPACSVessel& AddVessel(); + TIGL_EXPORT virtual void RemoveVessel(CCPACSVessel& ref); protected: CCPACSFuelTank* m_parent; CTiglUIDManager* m_uidMgr; - std::vector> m_hulls; + std::vector> m_vessels; private: - CPACSHulls(const CPACSHulls&) = delete; - CPACSHulls& operator=(const CPACSHulls&) = delete; + CPACSVessels(const CPACSVessels&) = delete; + CPACSVessels& operator=(const CPACSVessels&) = delete; - CPACSHulls(CPACSHulls&&) = delete; - CPACSHulls& operator=(CPACSHulls&&) = delete; + CPACSVessels(CPACSVessels&&) = delete; + CPACSVessels& operator=(CPACSVessels&&) = delete; }; } // namespace generated -// CPACSHulls is customized, use type CCPACSHulls directly +// CPACSVessels is customized, use type CCPACSVessels directly } // namespace tigl diff --git a/src/generated/CPACSWalls.cpp b/src/generated/CPACSWalls.cpp index dba0719a87..5fad863132 100644 --- a/src/generated/CPACSWalls.cpp +++ b/src/generated/CPACSWalls.cpp @@ -17,7 +17,7 @@ #include #include "CCPACSFuselageStructure.h" -#include "CCPACSHullStructure.h" +#include "CCPACSVesselStructure.h" #include "CPACSWalls.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -39,14 +39,14 @@ namespace generated m_parentType = &typeid(CCPACSFuselageStructure); } - CPACSWalls::CPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) + CPACSWalls::CPACSWalls(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) , m_wallPositions(reinterpret_cast(this), m_uidMgr) , m_wallSegments(reinterpret_cast(this), m_uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CCPACSHullStructure); + m_parentType = &typeid(CCPACSVesselStructure); } CPACSWalls::~CPACSWalls() @@ -59,8 +59,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; @@ -72,8 +72,8 @@ namespace generated if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); + if (IsParent()) { + return GetParent(); } } return nullptr; diff --git a/src/generated/CPACSWalls.h b/src/generated/CPACSWalls.h index 6a5afa94d1..efa1e7a15a 100644 --- a/src/generated/CPACSWalls.h +++ b/src/generated/CPACSWalls.h @@ -30,19 +30,19 @@ namespace tigl class CTiglUIDManager; class CTiglUIDObject; class CCPACSFuselageStructure; -class CCPACSHullStructure; +class CCPACSVesselStructure; namespace generated { // This class is used in: // CPACSFuselageStructure - // CPACSHullStructure + // CPACSVesselStructure class CPACSWalls { public: TIGL_EXPORT CPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSWalls(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSWalls(); @@ -55,7 +55,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSWalls"); + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSWalls"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -65,7 +65,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSWalls"); + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSWalls"); if (!IsParent

()) { throw CTiglError("bad parent"); } diff --git a/src/geometry/CCPACSTransformation.cpp b/src/geometry/CCPACSTransformation.cpp index 6b73950d60..d4e745b10f 100644 --- a/src/geometry/CCPACSTransformation.cpp +++ b/src/geometry/CCPACSTransformation.cpp @@ -89,7 +89,7 @@ CCPACSTransformation::CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglU { } -CCPACSTransformation::CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr) +CCPACSTransformation::CCPACSTransformation(CCPACSVessel* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) { diff --git a/src/geometry/CCPACSTransformation.h b/src/geometry/CCPACSTransformation.h index d28b594355..34b6e49c8b 100644 --- a/src/geometry/CCPACSTransformation.h +++ b/src/geometry/CCPACSTransformation.h @@ -41,7 +41,7 @@ class CCPACSTransformation : public generated::CPACSTransformation TIGL_EXPORT CCPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSTransformation(CCPACSHull* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSTransformation(CCPACSVessel* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSFuelTank* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSGenericGeometryComponent* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); diff --git a/src/math/CTiglIntersectBSplines.cpp b/src/math/CTiglIntersectBSplines.cpp index cc8e644ba2..40700af85a 100644 --- a/src/math/CTiglIntersectBSplines.cpp +++ b/src/math/CTiglIntersectBSplines.cpp @@ -319,12 +319,12 @@ namespace tigl std::vector IntersectBSplines(const Handle(Geom_BSplineCurve) curve1, const Handle(Geom_BSplineCurve) curve2, double tolerance) { - auto hulls = getRangesOfIntersection(curve1, curve2, tolerance); + auto vessels = getRangesOfIntersection(curve1, curve2, tolerance); std::list curve1_ints, curve2_ints; - for (const auto& hull : hulls) { - curve1_ints.push_back(hull.b1); - curve2_ints.push_back(hull.b2); + for (const auto& vessel : vessels) { + curve1_ints.push_back(vessel.b1); + curve2_ints.push_back(vessel.b2); } auto compare = [](const BoundingBox& b1, const BoundingBox& b2) { diff --git a/src/math/CTiglIntersectBSplines.h b/src/math/CTiglIntersectBSplines.h index 8799280b6c..e1b2325907 100644 --- a/src/math/CTiglIntersectBSplines.h +++ b/src/math/CTiglIntersectBSplines.h @@ -40,7 +40,7 @@ struct CurveIntersectionResult * An intersection is counted, whenever the two curves come closer than tolerance. * If a whole interval is closes than tolerance, the nearest point in the interval is searched. * - * The function divides the input curves and checks, if their bounding boxes (convex hulls) + * The function divides the input curves and checks, if their bounding boxes (convex vessels) * intersect each other. If so, this process is repeated until the curve segment is almost a line segment. * This result is used to locally optimize into a true minimum. */ diff --git a/src/structural_elements/CCPACSWallPosition.cpp b/src/structural_elements/CCPACSWallPosition.cpp index b7586f56ff..1ca79d6362 100644 --- a/src/structural_elements/CCPACSWallPosition.cpp +++ b/src/structural_elements/CCPACSWallPosition.cpp @@ -20,8 +20,8 @@ #include "CTiglUIDManager.h" #include "CCPACSWallPosition.h" #include "CCPACSWallSegment.h" -#include "CCPACSHull.h" -#include "CCPACSHullStructure.h" +#include "CCPACSVessel.h" +#include "CCPACSVesselStructure.h" #include "CCPACSWalls.h" #include "CCPACSFuselageStructure.h" #include "CCPACSFuselage.h" @@ -77,20 +77,20 @@ void CCPACSWallPosition::CalcBasePointAndShape() const CTiglTransformation transformationMatrix; bool isFuselage = GetParent()->GetParent()->IsParent(); - bool isHull = GetParent()->GetParent()->IsParent(); + bool isVessel = GetParent()->GetParent()->IsParent(); if (isFuselage) { const CCPACSFuselage& fuselage = GetFuselage(); parentShape = fuselage.GetLoft()->Shape(); transformationMatrix = fuselage.GetTransformationMatrix(); } - else if (isHull) { - const CCPACSHull& hull = GetHull(); - parentShape = hull.GetLoft()->Shape(); - transformationMatrix = hull.GetTransformationMatrix(); + else if (isVessel) { + const CCPACSVessel& vessel = GetVessel(); + parentShape = vessel.GetLoft()->Shape(); + transformationMatrix = vessel.GetTransformationMatrix(); } else { - throw CTiglError("Parent of CCPACSWallPosition is neither a fuselage nor a hull."); + throw CTiglError("Parent of CCPACSWallPosition is neither a fuselage nor a vessel."); } BRepBndLib::Add(parentShape, boundingBox); @@ -123,8 +123,8 @@ void CCPACSWallPosition::CalcBasePointAndShape() const if (isFuselage) { _shape = GetFuselage().GetSectionFace(GetSectionUID_choice4().value()); } - else if (isHull) { - _shape = GetHull().GetSectionFace(GetSectionUID_choice4().value()); + else if (isVessel) { + _shape = GetVessel().GetSectionFace(GetSectionUID_choice4().value()); } } else { @@ -252,9 +252,9 @@ const CCPACSFuselage& CCPACSWallPosition::GetFuselage() const return tigl::GetFuselage(this); } -const CCPACSHull& CCPACSWallPosition::GetHull() const +const CCPACSVessel& CCPACSWallPosition::GetVessel() const { - return tigl::GetHull(this); + return tigl::GetVessel(this); } } // namespace tigl diff --git a/src/structural_elements/CCPACSWallPosition.h b/src/structural_elements/CCPACSWallPosition.h index e40b72df72..6915434c24 100644 --- a/src/structural_elements/CCPACSWallPosition.h +++ b/src/structural_elements/CCPACSWallPosition.h @@ -27,7 +27,7 @@ namespace tigl class CCPACSWalls; class CCPACSFuselage; -class CCPACSHull; +class CCPACSVessel; class CCPACSWallPosition : public generated::CPACSWallPosition { @@ -55,7 +55,7 @@ class CCPACSWallPosition : public generated::CPACSWallPosition void CalcBasePointAndShape() const; const CCPACSWalls& GetWalls() const; const CCPACSFuselage& GetFuselage() const; - const CCPACSHull& GetHull() const; + const CCPACSVessel& GetVessel() const; mutable bool _isBuilt{false}; mutable gp_Pnt _basePoint; diff --git a/src/structural_elements/CCPACSWallSegment.cpp b/src/structural_elements/CCPACSWallSegment.cpp index 28ed2310e0..33a1c45d78 100644 --- a/src/structural_elements/CCPACSWallSegment.cpp +++ b/src/structural_elements/CCPACSWallSegment.cpp @@ -21,8 +21,8 @@ #include "generated/CPACSWalls.h" #include "CCPACSFuselageStructure.h" #include "CCPACSFuselage.h" -#include "CCPACSHull.h" -#include "CCPACSHullStructure.h" +#include "CCPACSVessel.h" +#include "CCPACSVesselStructure.h" #include "CCPACSFuselageSegment.h" #include "ITiglWallUtils.h" #include "CNamedShape.h" @@ -122,9 +122,9 @@ const CCPACSFuselage& CCPACSWallSegment::GetFuselage() const return tigl::GetFuselage(this); } -const CCPACSHull& CCPACSWallSegment::GetHull() const +const CCPACSVessel& CCPACSWallSegment::GetVessel() const { - return tigl::GetHull(this); + return tigl::GetVessel(this); } PNamedShape CCPACSWallSegment::BuildLoft() const @@ -137,20 +137,20 @@ PNamedShape CCPACSWallSegment::BuildLoft() const CTiglTransformation transformationMatrix; bool isFuselage = GetParent()->GetParent()->IsParent(); - bool isHull = GetParent()->GetParent()->IsParent(); + bool isVessel = GetParent()->GetParent()->IsParent(); if (isFuselage) { const CCPACSFuselage& fuselage = GetFuselage(); parentShape = fuselage.GetLoft()->Shape(); transformationMatrix = fuselage.GetTransformationMatrix(); } - else if (isHull) { - const CCPACSHull& hull = GetHull(); - parentShape = hull.GetLoft()->Shape(); - transformationMatrix = hull.GetTransformationMatrix(); + else if (isVessel) { + const CCPACSVessel& vessel = GetVessel(); + parentShape = vessel.GetLoft()->Shape(); + transformationMatrix = vessel.GetTransformationMatrix(); } else { - throw CTiglError("Parent of CCPACSWallSegment is neither a fuselage nor a hull."); + throw CTiglError("Parent of CCPACSWallSegment is neither a fuselage nor a vessel."); } BRepBndLib::Add(parentShape, boundingBox); @@ -247,7 +247,7 @@ PNamedShape CCPACSWallSegment::BuildLoft() const } // trim the wall - // Step 1/2: Trim the wall by the fuselage / hull + // Step 1/2: Trim the wall by the fuselage / vessel { TopoDS_Compound cutWall; builderWall.MakeCompound(cutWall); @@ -256,7 +256,7 @@ PNamedShape CCPACSWallSegment::BuildLoft() const TopTools_IndexedMapOfShape faceMap; TopExp::MapShapes(result, TopAbs_FACE, faceMap); for (int i = 0; i < faceMap.Extent(); ++i) { - // check if face center is on the interior of the fuselage / hull + // check if face center is on the interior of the fuselage / vessel TopoDS_Face face = TopoDS::Face(faceMap(i + 1)); gp_Pnt faceCenter = GetCentralFacePoint(face); diff --git a/src/structural_elements/CCPACSWallSegment.h b/src/structural_elements/CCPACSWallSegment.h index 917917323c..1f6ec3b887 100644 --- a/src/structural_elements/CCPACSWallSegment.h +++ b/src/structural_elements/CCPACSWallSegment.h @@ -28,7 +28,7 @@ namespace tigl { class CCPACSFuselage; -class CCPACSHull; +class CCPACSVessel; class CCPACSWalls; class CCPACSWallPosition; @@ -62,7 +62,7 @@ class CCPACSWallSegment : public generated::CPACSWallSegment, public CTiglAbstra const CCPACSWalls& GetWalls() const; const CCPACSFuselage& GetFuselage() const; - const CCPACSHull& GetHull() const; + const CCPACSVessel& GetVessel() const; PNamedShape BuildLoft() const override; diff --git a/src/structural_elements/CCPACSWalls.cpp b/src/structural_elements/CCPACSWalls.cpp index 96285c1bc9..1a221ee9a9 100644 --- a/src/structural_elements/CCPACSWalls.cpp +++ b/src/structural_elements/CCPACSWalls.cpp @@ -26,7 +26,7 @@ CCPACSWalls::CCPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMg { } -CCPACSWalls::CCPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr) +CCPACSWalls::CCPACSWalls(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr) : generated::CPACSWalls (parent, uidMgr) { } diff --git a/src/structural_elements/CCPACSWalls.h b/src/structural_elements/CCPACSWalls.h index 71ce2edadc..a1016eb896 100644 --- a/src/structural_elements/CCPACSWalls.h +++ b/src/structural_elements/CCPACSWalls.h @@ -33,7 +33,7 @@ class CCPACSWalls : public generated::CPACSWalls { public: CCPACSWalls(CCPACSFuselageStructure* parent, CTiglUIDManager* uidMgr); - CCPACSWalls(CCPACSHullStructure* parent, CTiglUIDManager* uidMgr); + CCPACSWalls(CCPACSVesselStructure* parent, CTiglUIDManager* uidMgr); const CCPACSWallSegment& GetWallSegment(const std::string& uid) const; const CCPACSWallPosition& GetWallPosition(const std::string& uid) const; diff --git a/src/structural_elements/ITiglWallUtils.h b/src/structural_elements/ITiglWallUtils.h index d3c40f0916..fef3ae96b4 100644 --- a/src/structural_elements/ITiglWallUtils.h +++ b/src/structural_elements/ITiglWallUtils.h @@ -4,8 +4,8 @@ #include "CCPACSFuselage.h" #include "CCPACSFuselageStructure.h" -#include "CCPACSHull.h" -#include "CCPACSHullStructure.h" +#include "CCPACSVessel.h" +#include "CCPACSVesselStructure.h" #include "CCPACSWalls.h" #include "CTiglError.h" @@ -44,21 +44,21 @@ template const CCPACSFuselage& GetFuselage(const T* wallObject) return *fuselage; } -template const CCPACSHull& GetHull(const T* wallObject) +template const CCPACSVessel& GetVessel(const T* wallObject) { const CCPACSWalls& walls = GetWalls(wallObject); - const auto* hullStructure = walls.GetParent(); - if (!hullStructure) { - throw CTiglError("Cannot get hull structure in GetHull. Null pointer parent.", TIGL_NULL_POINTER); + const auto* vesselStructure = walls.GetParent(); + if (!vesselStructure) { + throw CTiglError("Cannot get vessel structure in GetVessel. Null pointer parent.", TIGL_NULL_POINTER); } - const auto* hull = hullStructure->GetParent(); - if (!hull) { - throw CTiglError("Cannot get hull in GetHull. Null pointer parent.", TIGL_NULL_POINTER); + const auto* vessel = vesselStructure->GetParent(); + if (!vessel) { + throw CTiglError("Cannot get vessel in GetVessel. Null pointer parent.", TIGL_NULL_POINTER); } - return *hull; + return *vessel; } } // namespace tigl diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 4b0d60a97b..0a9708fdc0 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -7,7 +7,7 @@ 1.0.0 - First test set with different tank and hull types + First test set with different tank and vessel types Marko Alder 2023-12-28T12:00:00 3.5 @@ -247,9 +247,9 @@ 0.5 - - - Outer hull + + + Outer vessel 1 @@ -258,7 +258,7 @@ -

+
Section 1 @@ -266,14 +266,14 @@ - + Section 1 Element 1 fuselageCircleProfile
-
+
Section 2 @@ -281,14 +281,14 @@ - + Section 2 Element 1 fuselageCircleProfile
-
+
Section 3 @@ -296,7 +296,7 @@ - + Section 3 Element 1 fuselageCircleProfile @@ -305,23 +305,23 @@
- - Outer hull Segment 1 - outerHull_section1_element1 - outerHull_section2_element1 + + Outer vessel Segment 1 + outerVessel_section1_element1 + outerVessel_section2_element1 - - Outer hull Segment 2 - outerHull_section2_element1 - outerHull_section3_element1 + + Outer vessel Segment 2 + outerVessel_section2_element1 + outerVessel_section3_element1 - + - - + + dummyMaterial - outerHull_section2 + outerVessel_section2 0 0 45 @@ -329,9 +329,9 @@ - - - Inner hull + + + Inner vessel 0.2 @@ -343,7 +343,7 @@ -
+
Section 1 @@ -351,14 +351,14 @@ - + Section 1 Element 1 fuselageCircleProfile
-
+
Section 2 @@ -366,14 +366,14 @@ - + Section 2 Element 1 fuselageCircleProfile
-
+
Section 3 @@ -381,7 +381,7 @@ - + Section 3 Element 1 fuselageCircleProfile @@ -390,19 +390,19 @@
- - Inner hull Segment 1 - innerHull_section1_element1 - innerHull_section2_element1 + + Inner vessel Segment 1 + innerVessel_section1_element1 + innerVessel_section2_element1 - - Inner hull Segment 2 - innerHull_section2_element1 - innerHull_section3_element1 + + Inner vessel Segment 2 + innerVessel_section2_element1 + innerVessel_section3_element1 - - + + Simple tank 2 @@ -413,9 +413,9 @@ 2.5 - - - Outer hull + + + Outer vessel 1 @@ -424,7 +424,7 @@ -
+
Section 1 @@ -432,7 +432,7 @@ - + Section 1 Element 1 fuselageCircleProfile @@ -444,7 +444,7 @@
-
+
Section 2 @@ -452,14 +452,14 @@ - + Section 2 Element 1 fuselageCircleProfile
-
+
Section 3 @@ -467,7 +467,7 @@ - + Section 3 Element 1 fuselageCircleProfile @@ -481,10 +481,10 @@
- - Outer hull Segment 1 - tank2_outerHull_section1_element1 - tank2_outerHull_section2_element1 + + Outer vessel Segment 1 + tank2_outerVessel_section1_element1 + tank2_outerVessel_section2_element1 Guide Segment 1 Upper @@ -512,10 +512,10 @@ - - Outer hull Segment 2 - tank2_outerHull_section2_element1 - tank2_outerHull_section3_element1 + + Outer vessel Segment 2 + tank2_outerVessel_section2_element1 + tank2_outerVessel_section3_element1 Guide Segment 2 Upper @@ -544,8 +544,8 @@ - - + + Simple tank 3 @@ -556,9 +556,9 @@ 5. - - - Hull with spherical dome + + + Vessel with spherical dome 0. @@ -576,9 +576,9 @@ 1 - - - Hull with ellipsoid dome + + + Vessel with ellipsoid dome 0.5 @@ -596,9 +596,9 @@ 0.5 - - - Hull with cylindrical dome + + + Vessel with cylindrical dome 1 @@ -616,9 +616,9 @@ 0 - - - Hull as pure sphere + + + Vessel as pure sphere 1.5 @@ -636,8 +636,8 @@ 1 - - + + Simple tank 4 @@ -652,9 +652,9 @@ 90 - - - Hull with torispherical dome + + + Vessel with torispherical dome 0. @@ -668,8 +668,8 @@ 0.2 - - + + Simple tank 5 @@ -680,9 +680,9 @@ 13. - - - Hull with isotensoid dome + + + Vessel with isotensoid dome 0. @@ -754,8 +754,8 @@ - - + + Simple tank 6 @@ -767,9 +767,9 @@ 10. - - - Hull with ellipsoid dome for wing tank + + + Vessel with ellipsoid dome for wing tank -1.1 @@ -782,8 +782,8 @@ 5 - - + + diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 51fb12c7c4..80f457a073 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -7,7 +7,7 @@ from OCC.Core.TopoDS import TopoDS_Face -class Tank(unittest.TestCase): +class FuelTanks(unittest.TestCase): def setUp(self): self.tixi = Tixi3() @@ -20,17 +20,17 @@ def setUp(self): uid_mgr = self.config.get_uidmanager() self.fuelTank = uid_mgr.get_geometric_component("tank1") - self.hull_segments = uid_mgr.get_geometric_component("tank1_outerHull") - self.hull_guides = uid_mgr.get_geometric_component("tank2_outerHull") - self.hull_spherical = uid_mgr.get_geometric_component("tank3_sphericalDome") - self.hull_ellipsoid = uid_mgr.get_geometric_component("tank3_ellipsoidDome") - self.hull_torispherical = uid_mgr.get_geometric_component( + self.vessel_segments = uid_mgr.get_geometric_component("tank1_outerVessel") + self.vessel_guides = uid_mgr.get_geometric_component("tank2_outerVessel") + self.vessel_spherical = uid_mgr.get_geometric_component("tank3_sphericalDome") + self.vessel_ellipsoid = uid_mgr.get_geometric_component("tank3_ellipsoidDome") + self.vessel_torispherical = uid_mgr.get_geometric_component( "tank4_torisphericalDome" ) - self.hull_isotensoid = uid_mgr.get_geometric_component("tank5_isotensoidDome") + self.vessel_isotensoid = uid_mgr.get_geometric_component("tank5_isotensoidDome") self.tank_type_exception_msg = ( - "This method is only available for hulls with segments. No segment found." + "This method is only available for vessels with segments. No segment found." ) def tearDown(self): @@ -79,173 +79,173 @@ def test_fuelTanks(self): def test_genericFuelTank(self): # Test custom class methods: - self.assertIsInstance(self.fuelTank.get_hulls(), configuration.CCPACSHulls) + self.assertIsInstance(self.fuelTank.get_vessels(), configuration.CCPACSVessels) # Test availability of generated class: self.assertEqual(self.fuelTank.get_name(), "Simple tank 1") - def test_hulls(self): + def test_vessels(self): # Test custom class methods: - hulls = self.hull_segments.get_parent() - hull1_uID = "tank1_outerHull" + vessels = self.vessel_segments.get_parent() + vessel1_uID = "tank1_outerVessel" ## Test accessability of childs: - self.assertIsInstance(hulls.get_hull(1), configuration.CCPACSHull) - self.assertEqual(hulls.get_hull(1).get_defaulted_uid(), hull1_uID) - self.assertIsInstance(hulls.get_hull(hull1_uID), configuration.CCPACSHull) + self.assertIsInstance(vessels.get_vessel(1), configuration.CCPACSVessel) + self.assertEqual(vessels.get_vessel(1).get_defaulted_uid(), vessel1_uID) + self.assertIsInstance(vessels.get_vessel(vessel1_uID), configuration.CCPACSVessel) self.assertEqual( - hulls.get_hull_index(hull1_uID), + vessels.get_vessel_index(vessel1_uID), 1, ) - self.assertEqual(hulls.get_hulls_count(), 2) + self.assertEqual(vessels.get_vessels_count(), 2) # Test availability of generated class: - self.assertIsInstance(hulls.get_parent(), configuration.CCPACSFuelTank) + self.assertIsInstance(vessels.get_parent(), configuration.CCPACSFuelTank) - def test_hull_general(self): + def test_vessel_general(self): # Custom class methods self.assertEqual( - self.hull_segments.get_configuration().get_uid(), "testAircraft" + self.vessel_segments.get_configuration().get_uid(), "testAircraft" ) - self.assertEqual(self.hull_segments.get_defaulted_uid(), "tank1_outerHull") + self.assertEqual(self.vessel_segments.get_defaulted_uid(), "tank1_outerVessel") # Generated class methods self.assertIsInstance( - self.hull_segments.get_configuration(), + self.vessel_segments.get_configuration(), configuration.CCPACSConfiguration, ) - self.assertEqual(self.hull_segments.get_name(), "Outer hull") + self.assertEqual(self.vessel_segments.get_name(), "Outer vessel") - def test_hull_type_info(self): + def test_vessel_type_info(self): - self.assertTrue(self.hull_segments.is_hull_via_segments()) - self.assertFalse(self.hull_segments.is_hull_via_design_parameters()) - self.assertFalse(self.hull_spherical.is_hull_via_segments()) - self.assertTrue(self.hull_spherical.is_hull_via_design_parameters()) + self.assertTrue(self.vessel_segments.is_vessel_via_segments()) + self.assertFalse(self.vessel_segments.is_vessel_via_design_parameters()) + self.assertFalse(self.vessel_spherical.is_vessel_via_segments()) + self.assertTrue(self.vessel_spherical.is_vessel_via_design_parameters()) - self.assertFalse(self.hull_segments.has_spherical_dome()) - self.assertFalse(self.hull_segments.has_ellipsoid_dome()) - self.assertFalse(self.hull_segments.has_torispherical_dome()) - self.assertFalse(self.hull_segments.has_isotensoid_dome()) + self.assertFalse(self.vessel_segments.has_spherical_dome()) + self.assertFalse(self.vessel_segments.has_ellipsoid_dome()) + self.assertFalse(self.vessel_segments.has_torispherical_dome()) + self.assertFalse(self.vessel_segments.has_isotensoid_dome()) - self.assertTrue(self.hull_spherical.has_spherical_dome()) - self.assertTrue(self.hull_spherical.has_ellipsoid_dome()) - self.assertFalse(self.hull_spherical.has_torispherical_dome()) - self.assertFalse(self.hull_spherical.has_isotensoid_dome()) + self.assertTrue(self.vessel_spherical.has_spherical_dome()) + self.assertTrue(self.vessel_spherical.has_ellipsoid_dome()) + self.assertFalse(self.vessel_spherical.has_torispherical_dome()) + self.assertFalse(self.vessel_spherical.has_isotensoid_dome()) - self.assertFalse(self.hull_ellipsoid.has_spherical_dome()) - self.assertTrue(self.hull_ellipsoid.has_ellipsoid_dome()) - self.assertFalse(self.hull_ellipsoid.has_torispherical_dome()) - self.assertFalse(self.hull_ellipsoid.has_isotensoid_dome()) + self.assertFalse(self.vessel_ellipsoid.has_spherical_dome()) + self.assertTrue(self.vessel_ellipsoid.has_ellipsoid_dome()) + self.assertFalse(self.vessel_ellipsoid.has_torispherical_dome()) + self.assertFalse(self.vessel_ellipsoid.has_isotensoid_dome()) - self.assertFalse(self.hull_torispherical.has_spherical_dome()) - self.assertFalse(self.hull_torispherical.has_ellipsoid_dome()) - self.assertTrue(self.hull_torispherical.has_torispherical_dome()) - self.assertFalse(self.hull_torispherical.has_isotensoid_dome()) + self.assertFalse(self.vessel_torispherical.has_spherical_dome()) + self.assertFalse(self.vessel_torispherical.has_ellipsoid_dome()) + self.assertTrue(self.vessel_torispherical.has_torispherical_dome()) + self.assertFalse(self.vessel_torispherical.has_isotensoid_dome()) - self.assertFalse(self.hull_isotensoid.has_spherical_dome()) - self.assertFalse(self.hull_isotensoid.has_ellipsoid_dome()) - self.assertFalse(self.hull_isotensoid.has_torispherical_dome()) - self.assertTrue(self.hull_isotensoid.has_isotensoid_dome()) + self.assertFalse(self.vessel_isotensoid.has_spherical_dome()) + self.assertFalse(self.vessel_isotensoid.has_ellipsoid_dome()) + self.assertFalse(self.vessel_isotensoid.has_torispherical_dome()) + self.assertTrue(self.vessel_isotensoid.has_isotensoid_dome()) - def test_hull_sections(self): - hull_segments = self.hull_segments - hull_parametric = self.hull_spherical + def test_vessel_sections(self): + vessel_segments = self.vessel_segments + vessel_parametric = self.vessel_spherical - self.assertEqual(hull_segments.get_section_count(), 3) - self.assertEqual(hull_parametric.get_section_count(), 0) + self.assertEqual(vessel_segments.get_section_count(), 3) + self.assertEqual(vessel_parametric.get_section_count(), 0) self.assertIsInstance( - hull_segments.get_section(1), configuration.CCPACSFuselageSection + vessel_segments.get_section(1), configuration.CCPACSFuselageSection ) with self.assertRaises(RuntimeError) as context: - hull_parametric.get_section(1) + vessel_parametric.get_section(1) self.assertEqual(str(context.exception), self.tank_type_exception_msg) self.assertIsInstance( - hull_segments.get_section_face("outerHull_section3"), TopoDS_Face + vessel_segments.get_section_face("outerVessel_section3"), TopoDS_Face ) with self.assertRaises(RuntimeError) as context: - hull_parametric.get_section_face("outerHull_section3") + vessel_parametric.get_section_face("outerVessel_section3") self.assertEqual(str(context.exception), self.tank_type_exception_msg) - def test_hull_segments(self): - hull_segments = self.hull_segments - hull_parametric = self.hull_spherical + def test_vessel_segments(self): + vessel_segments = self.vessel_segments + vessel_parametric = self.vessel_spherical - self.assertEqual(hull_segments.get_segment_count(), 2) - self.assertEqual(hull_parametric.get_segment_count(), 0) + self.assertEqual(vessel_segments.get_segment_count(), 2) + self.assertEqual(vessel_parametric.get_segment_count(), 0) self.assertIsInstance( - hull_segments.get_segment(1), configuration.CCPACSFuselageSegment + vessel_segments.get_segment(1), configuration.CCPACSFuselageSegment ) with self.assertRaises(RuntimeError) as context: - hull_parametric.get_segment(1) + vessel_parametric.get_segment(1) self.assertEqual(str(context.exception), self.tank_type_exception_msg) - def test_hull_guide_curves(self): - point = self.hull_guides.get_guide_curve_points()[1] + def test_vessel_guide_curves(self): + point = self.vessel_guides.get_guide_curve_points()[1] self.assertAlmostEqual(round(point.X(), 2), 3.5, 1e-2) self.assertAlmostEqual(round(point.Y(), 2), 0.0, 1e-5) self.assertAlmostEqual(round(point.Z(), 2), -0.65, 1e-2) with self.assertRaises(RuntimeError) as context: - self.hull_spherical.get_guide_curve_points()[1] + self.vessel_spherical.get_guide_curve_points()[1] self.assertEqual(str(context.exception), self.tank_type_exception_msg) self.assertEqual( - self.hull_guides.get_guide_curve_segment( + self.vessel_guides.get_guide_curve_segment( "tank2_seg1_upper" ).get_guide_curve_profile_uid(), "gc_upper", ) with self.assertRaises(RuntimeError) as context: - self.hull_spherical.get_guide_curve_segment("tank2_seg1_upper") + self.vessel_spherical.get_guide_curve_segment("tank2_seg1_upper") self.assertEqual(str(context.exception), self.tank_type_exception_msg) - def test_hull_loft_evaluation(self): - hull_segments = self.hull_segments - hull_parametric = self.hull_spherical + def test_vessel_loft_evaluation(self): + vessel_segments = self.vessel_segments + vessel_parametric = self.vessel_spherical - self.assertAlmostEqual(round(hull_segments.get_volume(), 2), 6.57) - self.assertAlmostEqual(round(hull_parametric.get_volume(), 2), 18.1) + self.assertAlmostEqual(round(vessel_segments.get_geometric_volume(), 2), 6.57) + self.assertAlmostEqual(round(vessel_parametric.get_geometric_volume(), 2), 18.1) - self.assertAlmostEqual(round(hull_segments.get_surface_area(), 2), 11.15) - self.assertAlmostEqual(round(hull_parametric.get_surface_area(), 2), 36.19) + self.assertAlmostEqual(round(vessel_segments.get_surface_area(), 2), 11.15) + self.assertAlmostEqual(round(vessel_parametric.get_surface_area(), 2), 36.19) - self.assertAlmostEqual(round(hull_segments.get_circumference(1, 0.5), 2), 7.43) + self.assertAlmostEqual(round(vessel_segments.get_circumference(1, 0.5), 2), 7.43) with self.assertRaises(RuntimeError) as context: - hull_parametric.get_circumference(1, 0.5) + vessel_parametric.get_circumference(1, 0.5) self.assertEqual(str(context.exception), self.tank_type_exception_msg) - point = hull_segments.get_point(1, 0.5, 0.5) + point = vessel_segments.get_point(1, 0.5, 0.5) self.assertAlmostEqual(round(point.X(), 2), 1.54) self.assertAlmostEqual(round(point.Y(), 2), 0.0) self.assertAlmostEqual(round(point.Z(), 2), -1.2) with self.assertRaises(RuntimeError) as context: - hull_parametric.get_point(1, 0.5, 0.5) + vessel_parametric.get_point(1, 0.5, 0.5) self.assertEqual(str(context.exception), self.tank_type_exception_msg) self.assertEqual( - hull_segments.get_get_point_behavior(), configuration.asParameterOnSurface + vessel_segments.get_get_point_behavior(), configuration.asParameterOnSurface ) self.assertIsNone( - hull_segments.set_get_point_behavior(configuration.onLinearLoft) + vessel_segments.set_get_point_behavior(configuration.onLinearLoft) ) self.assertEqual( - hull_segments.get_get_point_behavior(), configuration.onLinearLoft + vessel_segments.get_get_point_behavior(), configuration.onLinearLoft ) def test_structure(self): - structure = self.hull_segments.get_structure() + structure = self.vessel_segments.get_structure() # Test custom class methods: self.assertIsInstance( structure.get_frames(), configuration.CCPACSFramesAssembly ) # Test availability of generated class: - self.assertEqual(structure.get_uid(), "outerHullStructure") + self.assertEqual(structure.get_uid(), "outerVesselStructure") if __name__ == "__main__": diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 28c846325d..b3b5def81b 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -28,10 +28,10 @@ #include "CCPACSConfigurationManager.h" #include "CTiglUIDManager.h" -#include "CCPACSHull.h" +#include "CCPACSVessel.h" -// #include "generated/CPACSHulls.h" -// #include "generated/CPACSHull.h" +// #include "generated/CPACSVessels.h" +// #include "generated/CPACSVessel.h" // #include "CNamedShape.h" // #include "tiglcommonfunctions.h" @@ -47,7 +47,7 @@ // #include -class FuselageTank : public ::testing::Test +class FuelTanks : public ::testing::Test { protected: static void SetUpTestCase() @@ -84,29 +84,29 @@ class FuselageTank : public ::testing::Test static TiglCPACSConfigurationHandle tiglHandle; tigl::CTiglUIDManager& uidMgr = - tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuselageTank::tiglHandle).GetUIDManager(); + tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuelTanks::tiglHandle).GetUIDManager(); // tank tigl::CCPACSFuelTank const* fuelTank = &uidMgr.ResolveObject("tank1"); - // hulls - const tigl::CCPACSHulls& hulls = fuelTank->GetHulls(); - tigl::CCPACSHull* hull_segments = &uidMgr.ResolveObject("tank1_outerHull"); - tigl::CCPACSHull* hull_guides = &uidMgr.ResolveObject("tank2_outerHull"); - tigl::CCPACSHull* hull_parametric = &uidMgr.ResolveObject("tank3_sphericalDome"); + // vessels + const tigl::CCPACSVessels& vessels = fuelTank->GetVessels(); + tigl::CCPACSVessel* vessel_segments = &uidMgr.ResolveObject("tank1_outerVessel"); + tigl::CCPACSVessel* vessel_guides = &uidMgr.ResolveObject("tank2_outerVessel"); + tigl::CCPACSVessel* vessel_parametric = &uidMgr.ResolveObject("tank3_sphericalDome"); - tigl::CCPACSHull* hull_spherical = &uidMgr.ResolveObject("tank3_sphericalDome"); - tigl::CCPACSHull* hull_ellipsoid = &uidMgr.ResolveObject("tank3_ellipsoidDome"); - tigl::CCPACSHull* hull_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); - tigl::CCPACSHull* hull_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); + tigl::CCPACSVessel* vessel_spherical = &uidMgr.ResolveObject("tank3_sphericalDome"); + tigl::CCPACSVessel* vessel_ellipsoid = &uidMgr.ResolveObject("tank3_ellipsoidDome"); + tigl::CCPACSVessel* vessel_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); + tigl::CCPACSVessel* vessel_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); tigl::CCPACSWallSegment* wall_in_fuselage = &uidMgr.ResolveObject("wall_fuselage"); - const char* tankTypeExceptionString = "This method is only available for hulls with segments. No segment found."; + const char* tankTypeExceptionString = "This method is only available for vessels with segments. No segment found."; }; -TixiDocumentHandle FuselageTank::tixiHandle = 0; -TiglCPACSConfigurationHandle FuselageTank::tiglHandle = 0; +TixiDocumentHandle FuelTanks::tixiHandle = 0; +TiglCPACSConfigurationHandle FuelTanks::tiglHandle = 0; void CheckExceptionMessage(std::function func, const char* expectedMessage) { @@ -122,7 +122,7 @@ void CheckExceptionMessage(std::function func, const char* expectedMessa } } -TEST_F(FuselageTank, configuration) +TEST_F(FuelTanks, configuration) { auto& config = fuelTank->GetConfiguration(); std::string uID = "tank1"; @@ -132,7 +132,7 @@ TEST_F(FuselageTank, configuration) EXPECT_EQ(config.GetFuelTankIndex(uID), 1); } -TEST_F(FuselageTank, fuelTanks) +TEST_F(FuelTanks, fuelTanks) { std::string uID = "tank1"; const tigl::CCPACSFuelTanks* fuelTanks = fuelTank->GetParent(); @@ -142,148 +142,148 @@ TEST_F(FuselageTank, fuelTanks) EXPECT_EQ(fuelTanks->GetFuelTanksCount(), 6); } -TEST_F(FuselageTank, fuelTank) +TEST_F(FuelTanks, fuelTank) { - EXPECT_NO_THROW(fuelTank->GetHulls()); + EXPECT_NO_THROW(fuelTank->GetVessels()); const std::string name = fuelTank->GetName(); EXPECT_EQ(name, "Simple tank 1"); } // ToDo: Check how to use pointer -> -TEST_F(FuselageTank, hulls) +TEST_F(FuelTanks, vessels) { - EXPECT_EQ(hulls.GetHullsCount(), 2); - EXPECT_EQ(hulls.GetHull(1).GetDefaultedUID(), "tank1_outerHull"); - EXPECT_EQ(hulls.GetHull("tank1_outerHull").GetDefaultedUID(), "tank1_outerHull"); - EXPECT_EQ(hulls.GetHullIndex("tank1_outerHull"), 1); - EXPECT_EQ(hulls.GetHulls().at(0)->GetDefaultedUID(), "tank1_outerHull"); + EXPECT_EQ(vessels.GetVesselsCount(), 2); + EXPECT_EQ(vessels.GetVessel(1).GetDefaultedUID(), "tank1_outerVessel"); + EXPECT_EQ(vessels.GetVessel("tank1_outerVessel").GetDefaultedUID(), "tank1_outerVessel"); + EXPECT_EQ(vessels.GetVesselIndex("tank1_outerVessel"), 1); + EXPECT_EQ(vessels.GetVessels().at(0)->GetDefaultedUID(), "tank1_outerVessel"); } -TEST_F(FuselageTank, hull_general) +TEST_F(FuelTanks, vessel_general) { - EXPECT_EQ(hull_segments->GetConfiguration().GetUID(), "testAircraft"); - EXPECT_EQ(hull_segments->GetDefaultedUID(), "tank1_outerHull"); + EXPECT_EQ(vessel_segments->GetConfiguration().GetUID(), "testAircraft"); + EXPECT_EQ(vessel_segments->GetDefaultedUID(), "tank1_outerVessel"); } -TEST_F(FuselageTank, hull_component_info) +TEST_F(FuelTanks, vessel_component_info) { - EXPECT_EQ(hull_segments->GetComponentType(), TIGL_COMPONENT_FUSELAGE_TANK_HULL); - EXPECT_EQ(hull_segments->GetComponentIntent(), TIGL_INTENT_PHYSICAL); + EXPECT_EQ(vessel_segments->GetComponentType(), TIGL_COMPONENT_FUSELAGE_TANK_HULL); + EXPECT_EQ(vessel_segments->GetComponentIntent(), TIGL_INTENT_PHYSICAL); } -TEST_F(FuselageTank, hull_type_info) +TEST_F(FuelTanks, vessel_type_info) { - EXPECT_TRUE(hull_segments->IsHullViaSegments()); - EXPECT_FALSE(hull_segments->IsHullViaDesignParameters()); - EXPECT_FALSE(hull_spherical->IsHullViaSegments()); - EXPECT_TRUE(hull_spherical->IsHullViaDesignParameters()); - - EXPECT_FALSE(hull_segments->HasSphericalDome()); - EXPECT_FALSE(hull_segments->HasEllipsoidDome()); - EXPECT_FALSE(hull_segments->HasTorisphericalDome()); - EXPECT_FALSE(hull_segments->HasIsotensoidDome()); - - EXPECT_TRUE(hull_spherical->HasSphericalDome()); - EXPECT_TRUE(hull_spherical->HasEllipsoidDome()); - EXPECT_FALSE(hull_spherical->HasTorisphericalDome()); - EXPECT_FALSE(hull_spherical->HasIsotensoidDome()); - - EXPECT_FALSE(hull_ellipsoid->HasSphericalDome()); - EXPECT_TRUE(hull_ellipsoid->HasEllipsoidDome()); - EXPECT_FALSE(hull_ellipsoid->HasTorisphericalDome()); - EXPECT_FALSE(hull_ellipsoid->HasIsotensoidDome()); - - EXPECT_FALSE(hull_torispherical->HasSphericalDome()); - EXPECT_FALSE(hull_torispherical->HasEllipsoidDome()); - EXPECT_TRUE(hull_torispherical->HasTorisphericalDome()); - EXPECT_FALSE(hull_torispherical->HasIsotensoidDome()); - - EXPECT_FALSE(hull_isotensoid->HasSphericalDome()); - EXPECT_FALSE(hull_isotensoid->HasEllipsoidDome()); - EXPECT_FALSE(hull_isotensoid->HasTorisphericalDome()); - EXPECT_TRUE(hull_isotensoid->HasIsotensoidDome()); + EXPECT_TRUE(vessel_segments->IsVesselViaSegments()); + EXPECT_FALSE(vessel_segments->IsVesselViaDesignParameters()); + EXPECT_FALSE(vessel_spherical->IsVesselViaSegments()); + EXPECT_TRUE(vessel_spherical->IsVesselViaDesignParameters()); + + EXPECT_FALSE(vessel_segments->HasSphericalDome()); + EXPECT_FALSE(vessel_segments->HasEllipsoidDome()); + EXPECT_FALSE(vessel_segments->HasTorisphericalDome()); + EXPECT_FALSE(vessel_segments->HasIsotensoidDome()); + + EXPECT_TRUE(vessel_spherical->HasSphericalDome()); + EXPECT_TRUE(vessel_spherical->HasEllipsoidDome()); + EXPECT_FALSE(vessel_spherical->HasTorisphericalDome()); + EXPECT_FALSE(vessel_spherical->HasIsotensoidDome()); + + EXPECT_FALSE(vessel_ellipsoid->HasSphericalDome()); + EXPECT_TRUE(vessel_ellipsoid->HasEllipsoidDome()); + EXPECT_FALSE(vessel_ellipsoid->HasTorisphericalDome()); + EXPECT_FALSE(vessel_ellipsoid->HasIsotensoidDome()); + + EXPECT_FALSE(vessel_torispherical->HasSphericalDome()); + EXPECT_FALSE(vessel_torispherical->HasEllipsoidDome()); + EXPECT_TRUE(vessel_torispherical->HasTorisphericalDome()); + EXPECT_FALSE(vessel_torispherical->HasIsotensoidDome()); + + EXPECT_FALSE(vessel_isotensoid->HasSphericalDome()); + EXPECT_FALSE(vessel_isotensoid->HasEllipsoidDome()); + EXPECT_FALSE(vessel_isotensoid->HasTorisphericalDome()); + EXPECT_TRUE(vessel_isotensoid->HasIsotensoidDome()); } -TEST_F(FuselageTank, hull_sections) +TEST_F(FuelTanks, vessel_sections) { const char* invalidIndexMessage = "Invalid index in CCPACSFuselageSections::GetSection"; const char* wrongSectionUIDMessage = "GetSectionFace: Could not find a fuselage section for the given UID"; - EXPECT_EQ(hull_segments->GetSectionCount(), 3); - EXPECT_EQ(hull_parametric->GetSectionCount(), 0); + EXPECT_EQ(vessel_segments->GetSectionCount(), 3); + EXPECT_EQ(vessel_parametric->GetSectionCount(), 0); - EXPECT_NO_THROW(hull_segments->GetSection(1)); - CheckExceptionMessage([&]() { hull_segments->GetSection(4); }, invalidIndexMessage); - CheckExceptionMessage([&]() { hull_parametric->GetSection(2); }, tankTypeExceptionString); + EXPECT_NO_THROW(vessel_segments->GetSection(1)); + CheckExceptionMessage([&]() { vessel_segments->GetSection(4); }, invalidIndexMessage); + CheckExceptionMessage([&]() { vessel_parametric->GetSection(2); }, tankTypeExceptionString); - EXPECT_NO_THROW(hull_segments->GetSectionFace("outerHull_section3")); - CheckExceptionMessage([&]() { hull_segments->GetSectionFace("wrongSectionUID"); }, wrongSectionUIDMessage); - CheckExceptionMessage([&]() { hull_parametric->GetSectionFace("outerHull_section3"); }, tankTypeExceptionString); + EXPECT_NO_THROW(vessel_segments->GetSectionFace("outerVessel_section3")); + CheckExceptionMessage([&]() { vessel_segments->GetSectionFace("wrongSectionUID"); }, wrongSectionUIDMessage); + CheckExceptionMessage([&]() { vessel_parametric->GetSectionFace("outerVessel_section3"); }, tankTypeExceptionString); } -TEST_F(FuselageTank, hull_segments) +TEST_F(FuelTanks, vessel_segments) { - EXPECT_EQ(hull_segments->GetSegmentCount(), 2); - EXPECT_EQ(hull_parametric->GetSegmentCount(), 0); + EXPECT_EQ(vessel_segments->GetSegmentCount(), 2); + EXPECT_EQ(vessel_parametric->GetSegmentCount(), 0); - EXPECT_NO_THROW(hull_segments->GetSegment(1)); - CheckExceptionMessage([&]() { hull_parametric->GetSegment(1); }, tankTypeExceptionString); + EXPECT_NO_THROW(vessel_segments->GetSegment(1)); + CheckExceptionMessage([&]() { vessel_parametric->GetSegment(1); }, tankTypeExceptionString); - EXPECT_NO_THROW(hull_segments->GetSegment("outerHull_segment1")); - CheckExceptionMessage([&]() { hull_segments->GetSegment(3); }, + EXPECT_NO_THROW(vessel_segments->GetSegment("outerVessel_segment1")); + CheckExceptionMessage([&]() { vessel_segments->GetSegment(3); }, "Invalid index value in CCPACSFuselageSegments::GetSegment"); } -TEST_F(FuselageTank, hull_guide_curves) +TEST_F(FuelTanks, vessel_guide_curves) { - auto points = hull_guides->GetGuideCurvePoints(); + auto points = vessel_guides->GetGuideCurvePoints(); EXPECT_EQ(points.size(), 24); EXPECT_NEAR(points.at(1).X(), 3.5, 1e-2); EXPECT_NEAR(points.at(1).Y(), 0, 1e-5); EXPECT_NEAR(points.at(1).Z(), -0.65, 1e-2); - CheckExceptionMessage([&]() { hull_parametric->GetGuideCurvePoints(); }, tankTypeExceptionString); + CheckExceptionMessage([&]() { vessel_parametric->GetGuideCurvePoints(); }, tankTypeExceptionString); - EXPECT_EQ(hull_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); - CheckExceptionMessage([&]() { hull_parametric->GetGuideCurveSegment("tank2_seg1_upper"); }, + EXPECT_EQ(vessel_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); + CheckExceptionMessage([&]() { vessel_parametric->GetGuideCurveSegment("tank2_seg1_upper"); }, tankTypeExceptionString); } -TEST_F(FuselageTank, hull_loft_evaluation) +TEST_F(FuelTanks, vessel_loft_evaluation) { - EXPECT_NEAR(hull_segments->GetVolume(), 6.57, 1e-2); - EXPECT_NEAR(hull_parametric->GetVolume(), 18.1, 1e-2); + EXPECT_NEAR(vessel_segments->GetGeometricVolume(), 6.57, 1e-2); + EXPECT_NEAR(vessel_parametric->GetGeometricVolume(), 18.1, 1e-2); - EXPECT_NEAR(hull_segments->GetSurfaceArea(), 11.15, 1e-2); - EXPECT_NEAR(hull_parametric->GetSurfaceArea(), 36.19, 1e-2); + EXPECT_NEAR(vessel_segments->GetSurfaceArea(), 11.15, 1e-2); + EXPECT_NEAR(vessel_parametric->GetSurfaceArea(), 36.19, 1e-2); - EXPECT_NEAR(hull_segments->GetCircumference(1, 0.5), 7.43, 1e-2); - CheckExceptionMessage([&]() { hull_parametric->GetCircumference(1, 0.5); }, tankTypeExceptionString); + EXPECT_NEAR(vessel_segments->GetCircumference(1, 0.5), 7.43, 1e-2); + CheckExceptionMessage([&]() { vessel_parametric->GetCircumference(1, 0.5); }, tankTypeExceptionString); - EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); - EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); - EXPECT_NEAR(hull_segments->GetPoint(1, 0.5, 0.5).Z(), -1.2, 1e-1); - CheckExceptionMessage([&]() { hull_parametric->GetPoint(1, 0.5, 0.5); }, tankTypeExceptionString); + EXPECT_NEAR(vessel_segments->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); + EXPECT_NEAR(vessel_segments->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); + EXPECT_NEAR(vessel_segments->GetPoint(1, 0.5, 0.5).Z(), -1.2, 1e-1); + CheckExceptionMessage([&]() { vessel_parametric->GetPoint(1, 0.5, 0.5); }, tankTypeExceptionString); - EXPECT_EQ(hull_segments->GetGetPointBehavior(), asParameterOnSurface); - EXPECT_NO_THROW(hull_segments->SetGetPointBehavior(onLinearLoft)); - EXPECT_EQ(hull_segments->GetGetPointBehavior(), onLinearLoft); + EXPECT_EQ(vessel_segments->GetGetPointBehavior(), asParameterOnSurface); + EXPECT_NO_THROW(vessel_segments->SetGetPointBehavior(onLinearLoft)); + EXPECT_EQ(vessel_segments->GetGetPointBehavior(), onLinearLoft); } -TEST_F(FuselageTank, parametric_hull) +TEST_F(FuelTanks, parametric_vessel) { - auto& loft = hull_parametric->GetLoft(); + auto& loft = vessel_parametric->GetLoft(); } -TEST_F(FuselageTank, structure) +TEST_F(FuelTanks, structure) { - auto& structure = hull_segments->GetStructure(); + auto& structure = vessel_segments->GetStructure(); EXPECT_EQ(structure->GetFrames()->GetFrames().size(), 1); - EXPECT_EQ(structure->GetUID(), "outerHullStructure"); + EXPECT_EQ(structure->GetUID(), "outerVesselStructure"); } -TEST_F(FuselageTank, walls) +TEST_F(FuelTanks, walls) { EXPECT_EQ(wall_in_fuselage->GetUID().get(), "wall_fuselage"); auto loft = wall_in_fuselage->GetLoft(); From 2c33bad73b2cbadd3368fb97ecbea061d8d40d56 Mon Sep 17 00:00:00 2001 From: Alder Date: Sat, 23 Nov 2024 22:59:33 +0100 Subject: [PATCH 055/122] fix usage of more general structuralMountType --- cpacs_gen_input/cpacs_schema.xsd | 2 +- src/generated/CPACSStructuralMount.cpp | 303 ++++++++++++++++++++++++ src/generated/CPACSStructuralMount.h | 123 ++++++++++ src/generated/CPACSStructuralMounts.cpp | 123 ++++++++++ src/generated/CPACSStructuralMounts.h | 88 +++++++ src/generated/CPACSVessel.cpp | 46 +++- src/generated/CPACSVessel.h | 9 + 7 files changed, 692 insertions(+), 2 deletions(-) create mode 100644 src/generated/CPACSStructuralMount.cpp create mode 100644 src/generated/CPACSStructuralMount.h create mode 100644 src/generated/CPACSStructuralMounts.cpp create mode 100644 src/generated/CPACSStructuralMounts.h diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index aa1d38e45c..8d566ed06c 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -36267,7 +36267,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + diff --git a/src/generated/CPACSStructuralMount.cpp b/src/generated/CPACSStructuralMount.cpp new file mode 100644 index 0000000000..d7a45b2ccc --- /dev/null +++ b/src/generated/CPACSStructuralMount.cpp @@ -0,0 +1,303 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CPACSStructuralMount.h" +#include "CPACSStructuralMounts.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSStructuralMount::CPACSStructuralMount(CPACSStructuralMounts* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_blockedDOF(0) + , m_takeOnlyEndPoints(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSStructuralMount::~CPACSStructuralMount() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + if (m_uidMgr) { + if (!m_fromStructureUID.empty()) m_uidMgr->TryUnregisterReference(m_fromStructureUID, *this); + if (!m_toStructureUID.empty()) m_uidMgr->TryUnregisterReference(m_toStructureUID, *this); + } + } + + const CPACSStructuralMounts* CPACSStructuralMount::GetParent() const + { + return m_parent; + } + + CPACSStructuralMounts* CPACSStructuralMount::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSStructuralMount::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSStructuralMount::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSStructuralMount::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSStructuralMount::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSStructuralMount::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element blockedDOF + if (tixi::TixiCheckElement(tixiHandle, xpath + "/blockedDOF")) { + m_blockedDOF = tixi::TixiGetElement(tixiHandle, xpath + "/blockedDOF"); + } + else { + LOG(ERROR) << "Required element blockedDOF is missing at xpath " << xpath; + } + + // read element takeOnlyEndPoints + if (tixi::TixiCheckElement(tixiHandle, xpath + "/takeOnlyEndPoints")) { + m_takeOnlyEndPoints = tixi::TixiGetElement(tixiHandle, xpath + "/takeOnlyEndPoints"); + } + else { + LOG(ERROR) << "Required element takeOnlyEndPoints is missing at xpath " << xpath; + } + + // read element fromStructureUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fromStructureUID")) { + m_fromStructureUID = tixi::TixiGetElement(tixiHandle, xpath + "/fromStructureUID"); + if (m_fromStructureUID.empty()) { + LOG(WARNING) << "Required element fromStructureUID is empty at xpath " << xpath; + } + if (m_uidMgr && !m_fromStructureUID.empty()) m_uidMgr->RegisterReference(m_fromStructureUID, *this); + } + else { + LOG(ERROR) << "Required element fromStructureUID is missing at xpath " << xpath; + } + + // read element fromStructureCounter + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fromStructureCounter")) { + m_fromStructureCounter = tixi::TixiGetElement(tixiHandle, xpath + "/fromStructureCounter"); + } + + // read element toStructureUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/toStructureUID")) { + m_toStructureUID = tixi::TixiGetElement(tixiHandle, xpath + "/toStructureUID"); + if (m_toStructureUID.empty()) { + LOG(WARNING) << "Required element toStructureUID is empty at xpath " << xpath; + } + if (m_uidMgr && !m_toStructureUID.empty()) m_uidMgr->RegisterReference(m_toStructureUID, *this); + } + else { + LOG(ERROR) << "Required element toStructureUID is missing at xpath " << xpath; + } + + // read element toStructureCounter + if (tixi::TixiCheckElement(tixiHandle, xpath + "/toStructureCounter")) { + m_toStructureCounter = tixi::TixiGetElement(tixiHandle, xpath + "/toStructureCounter"); + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSStructuralMount::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element blockedDOF + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/blockedDOF"); + tixi::TixiSaveElement(tixiHandle, xpath + "/blockedDOF", m_blockedDOF); + + // write element takeOnlyEndPoints + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/takeOnlyEndPoints"); + tixi::TixiSaveElement(tixiHandle, xpath + "/takeOnlyEndPoints", m_takeOnlyEndPoints); + + // write element fromStructureUID + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/fromStructureUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/fromStructureUID", m_fromStructureUID); + + // write element fromStructureCounter + if (m_fromStructureCounter) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/fromStructureCounter"); + tixi::TixiSaveElement(tixiHandle, xpath + "/fromStructureCounter", *m_fromStructureCounter); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/fromStructureCounter")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/fromStructureCounter"); + } + } + + // write element toStructureUID + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/toStructureUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/toStructureUID", m_toStructureUID); + + // write element toStructureCounter + if (m_toStructureCounter) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/toStructureCounter"); + tixi::TixiSaveElement(tixiHandle, xpath + "/toStructureCounter", *m_toStructureCounter); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/toStructureCounter")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/toStructureCounter"); + } + } + + } + + const std::string& CPACSStructuralMount::GetUID() const + { + return m_uID; + } + + void CPACSStructuralMount::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const int& CPACSStructuralMount::GetBlockedDOF() const + { + return m_blockedDOF; + } + + void CPACSStructuralMount::SetBlockedDOF(const int& value) + { + m_blockedDOF = value; + } + + const bool& CPACSStructuralMount::GetTakeOnlyEndPoints() const + { + return m_takeOnlyEndPoints; + } + + void CPACSStructuralMount::SetTakeOnlyEndPoints(const bool& value) + { + m_takeOnlyEndPoints = value; + } + + const std::string& CPACSStructuralMount::GetFromStructureUID() const + { + return m_fromStructureUID; + } + + void CPACSStructuralMount::SetFromStructureUID(const std::string& value) + { + if (m_uidMgr) { + if (!m_fromStructureUID.empty()) m_uidMgr->TryUnregisterReference(m_fromStructureUID, *this); + if (!value.empty()) m_uidMgr->RegisterReference(value, *this); + } + m_fromStructureUID = value; + } + + const boost::optional& CPACSStructuralMount::GetFromStructureCounter() const + { + return m_fromStructureCounter; + } + + void CPACSStructuralMount::SetFromStructureCounter(const boost::optional& value) + { + m_fromStructureCounter = value; + } + + const std::string& CPACSStructuralMount::GetToStructureUID() const + { + return m_toStructureUID; + } + + void CPACSStructuralMount::SetToStructureUID(const std::string& value) + { + if (m_uidMgr) { + if (!m_toStructureUID.empty()) m_uidMgr->TryUnregisterReference(m_toStructureUID, *this); + if (!value.empty()) m_uidMgr->RegisterReference(value, *this); + } + m_toStructureUID = value; + } + + const boost::optional& CPACSStructuralMount::GetToStructureCounter() const + { + return m_toStructureCounter; + } + + void CPACSStructuralMount::SetToStructureCounter(const boost::optional& value) + { + m_toStructureCounter = value; + } + + const CTiglUIDObject* CPACSStructuralMount::GetNextUIDObject() const + { + return this; + } + + void CPACSStructuralMount::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) + { + if (m_fromStructureUID == oldUid) { + m_fromStructureUID = newUid; + } + if (m_toStructureUID == oldUid) { + m_toStructureUID = newUid; + } + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSStructuralMount.h b/src/generated/CPACSStructuralMount.h new file mode 100644 index 0000000000..632afddbbe --- /dev/null +++ b/src/generated/CPACSStructuralMount.h @@ -0,0 +1,123 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "CTiglUIDObject.h" +#include "ITiglUIDRefObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSStructuralMounts; + + // This class is used in: + // CPACSStructuralMounts + + /// @brief structuralMountType + /// + /// + /// + class CPACSStructuralMount : public CTiglReqUIDObject, public ITiglUIDRefObject + { + public: + TIGL_EXPORT CPACSStructuralMount(CPACSStructuralMounts* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSStructuralMount(); + + TIGL_EXPORT CPACSStructuralMounts* GetParent(); + + TIGL_EXPORT const CPACSStructuralMounts* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const int& GetBlockedDOF() const; + TIGL_EXPORT virtual void SetBlockedDOF(const int& value); + + TIGL_EXPORT virtual const bool& GetTakeOnlyEndPoints() const; + TIGL_EXPORT virtual void SetTakeOnlyEndPoints(const bool& value); + + TIGL_EXPORT virtual const std::string& GetFromStructureUID() const; + TIGL_EXPORT virtual void SetFromStructureUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetFromStructureCounter() const; + TIGL_EXPORT virtual void SetFromStructureCounter(const boost::optional& value); + + TIGL_EXPORT virtual const std::string& GetToStructureUID() const; + TIGL_EXPORT virtual void SetToStructureUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetToStructureCounter() const; + TIGL_EXPORT virtual void SetToStructureCounter(const boost::optional& value); + + protected: + CPACSStructuralMounts* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + int m_blockedDOF; + + /// If this value is set to true then only the end points of the intersection shall be included as nodes in the model. + bool m_takeOnlyEndPoints; + + /// The UID for the first connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. + std::string m_fromStructureUID; + + /// Optional counter to specify numbered items, e.g. ribs in a ribSet. + boost::optional m_fromStructureCounter; + + /// The UID for the second connection UID may include for wings: skin, sparUID, ribDefinitionUID, ribNumber, stringerUID, stingerNumber, and for fuselages: skinSegmentUID, frameUID, stringerUID, crossBeamUID, crossBeamStrutUID, longFloorBeamUID. + std::string m_toStructureUID; + + /// Optional counter to specify numbered items, e.g. ribs in a ribSet. + boost::optional m_toStructureCounter; + + private: + TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; + TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; + + CPACSStructuralMount(const CPACSStructuralMount&) = delete; + CPACSStructuralMount& operator=(const CPACSStructuralMount&) = delete; + + CPACSStructuralMount(CPACSStructuralMount&&) = delete; + CPACSStructuralMount& operator=(CPACSStructuralMount&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSStructuralMount = generated::CPACSStructuralMount; +using CCPACSStructuralMounts = generated::CPACSStructuralMounts; +} // namespace tigl diff --git a/src/generated/CPACSStructuralMounts.cpp b/src/generated/CPACSStructuralMounts.cpp new file mode 100644 index 0000000000..5cb57a9510 --- /dev/null +++ b/src/generated/CPACSStructuralMounts.cpp @@ -0,0 +1,123 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include "CCPACSVessel.h" +#include "CPACSStructuralMount.h" +#include "CPACSStructuralMounts.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSStructuralMounts::CPACSStructuralMounts(CCPACSVessel* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSStructuralMounts::~CPACSStructuralMounts() + { + } + + const CCPACSVessel* CPACSStructuralMounts::GetParent() const + { + return m_parent; + } + + CCPACSVessel* CPACSStructuralMounts::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSStructuralMounts::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSStructuralMounts::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSStructuralMounts::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSStructuralMounts::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSStructuralMounts::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element structuralMount + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralMount")) { + tixi::TixiReadElements(tixiHandle, xpath + "/structuralMount", m_structuralMounts, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSStructuralMounts::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element structuralMount + tixi::TixiSaveElements(tixiHandle, xpath + "/structuralMount", m_structuralMounts); + + } + + const std::vector>& CPACSStructuralMounts::GetStructuralMounts() const + { + return m_structuralMounts; + } + + std::vector>& CPACSStructuralMounts::GetStructuralMounts() + { + return m_structuralMounts; + } + + CPACSStructuralMount& CPACSStructuralMounts::AddStructuralMount() + { + m_structuralMounts.push_back(make_unique(this, m_uidMgr)); + return *m_structuralMounts.back(); + } + + void CPACSStructuralMounts::RemoveStructuralMount(CPACSStructuralMount& ref) + { + for (std::size_t i = 0; i < m_structuralMounts.size(); i++) { + if (m_structuralMounts[i].get() == &ref) { + m_structuralMounts.erase(m_structuralMounts.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSStructuralMounts.h b/src/generated/CPACSStructuralMounts.h new file mode 100644 index 0000000000..1e2a140315 --- /dev/null +++ b/src/generated/CPACSStructuralMounts.h @@ -0,0 +1,88 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; +class CCPACSVessel; + +namespace generated +{ + class CPACSStructuralMount; + + // This class is used in: + // CPACSVessel + + /// @brief Structural mounts + /// + /// + /// + class CPACSStructuralMounts + { + public: + TIGL_EXPORT CPACSStructuralMounts(CCPACSVessel* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSStructuralMounts(); + + TIGL_EXPORT CCPACSVessel* GetParent(); + + TIGL_EXPORT const CCPACSVessel* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetStructuralMounts() const; + TIGL_EXPORT virtual std::vector>& GetStructuralMounts(); + + TIGL_EXPORT virtual CPACSStructuralMount& AddStructuralMount(); + TIGL_EXPORT virtual void RemoveStructuralMount(CPACSStructuralMount& ref); + + protected: + CCPACSVessel* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::vector> m_structuralMounts; + + private: + CPACSStructuralMounts(const CPACSStructuralMounts&) = delete; + CPACSStructuralMounts& operator=(const CPACSStructuralMounts&) = delete; + + CPACSStructuralMounts(CPACSStructuralMounts&&) = delete; + CPACSStructuralMounts& operator=(CPACSStructuralMounts&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSStructuralMounts = generated::CPACSStructuralMounts; +using CCPACSStructuralMount = generated::CPACSStructuralMount; +} // namespace tigl diff --git a/src/generated/CPACSVessel.cpp b/src/generated/CPACSVessel.cpp index eeceb39b2a..41ed43eaa4 100644 --- a/src/generated/CPACSVessel.cpp +++ b/src/generated/CPACSVessel.cpp @@ -176,6 +176,17 @@ namespace generated } } + // read element structuralMounts + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralMounts")) { + m_structuralMounts = boost::in_place(reinterpret_cast(this), m_uidMgr); + try { + m_structuralMounts->ReadCPACS(tixiHandle, xpath + "/structuralMounts"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read structuralMounts at xpath " << xpath << ": " << e.what(); + m_structuralMounts = boost::none; + } + } + // read element volume if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { m_volume = boost::in_place(reinterpret_cast(this)); @@ -200,7 +211,7 @@ namespace generated void CPACSVessel::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure", "volume", "burstPressure" }; + const std::vector childElemOrder = { "name", "description", "transformation", "sections", "segments", "cylinderRadius", "cylinderLength", "domeType", "structure", "structuralMounts", "volume", "burstPressure" }; // write attribute uID tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); @@ -290,6 +301,17 @@ namespace generated } } + // write element structuralMounts + if (m_structuralMounts) { + tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/structuralMounts", childElemOrder); + m_structuralMounts->WriteCPACS(tixiHandle, xpath + "/structuralMounts"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralMounts")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/structuralMounts"); + } + } + // write element volume if (m_volume) { tixi::TixiCreateSequenceElementIfNotExists(tixiHandle, xpath + "/volume", childElemOrder); @@ -464,6 +486,16 @@ namespace generated return m_structure; } + const boost::optional& CPACSVessel::GetStructuralMounts() const + { + return m_structuralMounts; + } + + boost::optional& CPACSVessel::GetStructuralMounts() + { + return m_structuralMounts; + } + const boost::optional& CPACSVessel::GetVolume() const { return m_volume; @@ -532,6 +564,18 @@ namespace generated m_structure = boost::none; } + CPACSStructuralMounts& CPACSVessel::GetStructuralMounts(CreateIfNotExistsTag) + { + if (!m_structuralMounts) + m_structuralMounts = boost::in_place(reinterpret_cast(this), m_uidMgr); + return *m_structuralMounts; + } + + void CPACSVessel::RemoveStructuralMounts() + { + m_structuralMounts = boost::none; + } + CPACSFuelTankVolume& CPACSVessel::GetVolume(CreateIfNotExistsTag) { if (!m_volume) diff --git a/src/generated/CPACSVessel.h b/src/generated/CPACSVessel.h index 3d340772b1..695b84c9c4 100644 --- a/src/generated/CPACSVessel.h +++ b/src/generated/CPACSVessel.h @@ -27,6 +27,7 @@ #include #include "CPACSDomeType.h" #include "CPACSFuelTankVolume.h" +#include "CPACSStructuralMounts.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -96,6 +97,9 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetStructure() const; TIGL_EXPORT virtual boost::optional& GetStructure(); + TIGL_EXPORT virtual const boost::optional& GetStructuralMounts() const; + TIGL_EXPORT virtual boost::optional& GetStructuralMounts(); + TIGL_EXPORT virtual const boost::optional& GetVolume() const; TIGL_EXPORT virtual boost::optional& GetVolume(); @@ -114,6 +118,9 @@ namespace generated TIGL_EXPORT virtual CCPACSVesselStructure& GetStructure(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStructure(); + TIGL_EXPORT virtual CPACSStructuralMounts& GetStructuralMounts(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveStructuralMounts(); + TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveVolume(); @@ -146,6 +153,8 @@ namespace generated boost::optional m_structure; + boost::optional m_structuralMounts; + /// Volume boost::optional m_volume; From dd30fb41f75f70e71d8ee924336e02019b824f7a Mon Sep 17 00:00:00 2001 From: alde_ma Date: Mon, 13 Jan 2025 14:41:11 +0100 Subject: [PATCH 056/122] apply clang formatting --- src/fuelTanks/CCPACSVessel.cpp | 6 +++--- src/fuelTanks/CCPACSVessel.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 4967922c50..a654f6e7d2 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -283,7 +283,7 @@ void CCPACSVessel::EvaluateDome() const } void CCPACSVessel::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, - std::vector& r) const + std::vector& r) const { double dPhi = 1.0 / nodeNumber; @@ -361,8 +361,8 @@ void CCPACSVessel::BuildVesselWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const double axRatio = _ellipsoidPtr->GetHalfAxisFraction(); if (axRatio < 0.0) { - throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of vessel \"" + GetName() + "\" (uID=\"" + - GetUID() + "\") must be a positive value!"); + throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of vessel \"" + GetName() + + "\" (uID=\"" + GetUID() + "\") must be a positive value!"); } double R = cylinderRadius; diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 34edd85648..eaea85dbf7 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -108,7 +108,8 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi void SetFaceTraits(PNamedShape loft) const; private: - const std::string _vesselTypeException = "This method is only available for vessels with segments. No segment found."; + const std::string _vesselTypeException = + "This method is only available for vessels with segments. No segment found."; mutable const tigl::generated::CPACSEllipsoidDome* _ellipsoidPtr = NULL; mutable const tigl::generated::CPACSTorisphericalDome* _torisphericalPtr = NULL; From 11c5eba7b7122ac70e457540f362ff9d9449c3e3 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 15:57:00 +0100 Subject: [PATCH 057/122] fix structure tests --- .../TestData/simpletest-fuelTanks.cpacs.xml | 18 ++++++++++++ tests/unittests/test_fuelTanks.py | 28 +++++++++---------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 0a9708fdc0..88c4fa3d80 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -328,6 +328,24 @@ + + + + dummyMaterial + outerVessel_section1 + 0 + 0 + 45 + + + dummyMaterial + outerVessel_section2 + 0 + 0 + 45 + + + diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 1d92018413..72431b97d4 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -92,7 +92,9 @@ def test_vessels(self): ## Test accessability of childs: self.assertIsInstance(vessels.get_vessel(1), configuration.CCPACSVessel) self.assertEqual(vessels.get_vessel(1).get_defaulted_uid(), vessel1_uID) - self.assertIsInstance(vessels.get_vessel(vessel1_uID), configuration.CCPACSVessel) + self.assertIsInstance( + vessels.get_vessel(vessel1_uID), configuration.CCPACSVessel + ) self.assertEqual( vessels.get_vessel_index(vessel1_uID), 1, @@ -214,7 +216,9 @@ def test_vessel_loft_evaluation(self): self.assertAlmostEqual(round(vessel_segments.get_surface_area(), 2), 11.15) self.assertAlmostEqual(round(vessel_parametric.get_surface_area(), 2), 36.19) - self.assertAlmostEqual(round(vessel_segments.get_circumference(1, 0.5), 2), 7.43) + self.assertAlmostEqual( + round(vessel_segments.get_circumference(1, 0.5), 2), 7.43 + ) with self.assertRaises(RuntimeError) as context: vessel_parametric.get_circumference(1, 0.5) self.assertEqual(str(context.exception), self.tank_type_exception_msg) @@ -238,30 +242,26 @@ def test_vessel_loft_evaluation(self): ) def test_structure(self): - structure = self.vessel_segments.get_structure() + structure_with_walls = self.vessel_isotensoid.get_structure() + structure_with_stringer_frames = self.vessel_segments.get_structure() # Test availability of generated class: - self.assertEqual(structure.get_uid(), "outerVesselStructure") + self.assertEqual(structure_with_walls.get_uid(), "tank5_structure") self.assertIsInstance( - structure.get_frames(), configuration.CCPACSFramesAssembly + structure_with_stringer_frames.get_frames(), + configuration.CCPACSFramesAssembly, ) self.assertIsInstance( - structure.get_stringers(), configuration.CCPACSStringersAssembly + structure_with_stringer_frames.get_stringers(), + configuration.CCPACSStringersAssembly, ) self.assertIsInstance( - structure.get_walls(), configuration.CCPACSWalls + structure_with_walls.get_walls(), configuration.CCPACSWalls ) - - - - - - - if __name__ == "__main__": unittest.main() From c194ffc5effb9727d7dd3e9893bca8234763871f Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 17:09:45 +0100 Subject: [PATCH 058/122] add tanks to changelog --- ChangeLog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index f932121fd2..58459e1a4a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,12 @@ Changelog Changes since last release ------------- + +08/02/2025 + +- General changes: + - Implemented the new CPACS fuelTanks. + 10/01/2025 - Fixes From 4b25ff428ad998b0122417f5e4b580e231600fd7 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 17:46:24 +0100 Subject: [PATCH 059/122] delete html test --- cpacs_gen_input/test.html | 92 --------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 cpacs_gen_input/test.html diff --git a/cpacs_gen_input/test.html b/cpacs_gen_input/test.html deleted file mode 100644 index 66cec97287..0000000000 --- a/cpacs_gen_input/test.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - CPACS XSD Baumdiagramm - - - - - - - From 5025679801cac45d9b1451f5848812d5a073e6c7 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 17:55:19 +0100 Subject: [PATCH 060/122] rename entries in enum TiglGeometricComponentType --- src/api/tigl.h | 4 ++-- src/fuelTanks/CCPACSFuelTank.cpp | 2 +- src/fuelTanks/CCPACSVessel.cpp | 2 +- src/fuelTanks/CCPACSVessel.h | 2 +- tests/unittests/tiglTanks.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/tigl.h b/src/api/tigl.h index 9e8194698d..49f2007654 100644 --- a/src/api/tigl.h +++ b/src/api/tigl.h @@ -233,8 +233,8 @@ TIGL_COMPONENT_ENGINE_NACELLE, /**< The Component is a engine nacelle */ TIGL_COMPONENT_FUSELAGE_WALL, /**< The Component is a fuselage wall */ TIGL_COMPONENT_CONTROL_SURFACE_DEVICE, /**< The component is a control surface device (flap) */ TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ -TIGL_COMPONENT_FUSELAGE_TANK, /**< The Component is a fuselage tank */ -TIGL_COMPONENT_FUSELAGE_TANK_HULL, /**< The Component is a vessel of a fuselage tank */ +TIGL_COMPONENT_TANK, /**< The Component is a fuselage tank */ +TIGL_COMPONENT_TANK_HULL, /**< The Component is a vessel of a fuselage tank */ TIGL_COMPONENT_OTHER }; diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 4a61aa81b8..3b9cc64ff8 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -45,7 +45,7 @@ std::string CCPACSFuelTank::GetDefaultedUID() const TiglGeometricComponentType CCPACSFuelTank::GetComponentType() const { - return TIGL_COMPONENT_FUSELAGE_TANK; + return TIGL_COMPONENT_TANK; } TiglGeometricComponentIntent CCPACSFuelTank::GetComponentIntent() const diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index a654f6e7d2..1eac6b2da5 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -70,7 +70,7 @@ std::string CCPACSVessel::GetDefaultedUID() const TiglGeometricComponentType CCPACSVessel::GetComponentType() const { - return TIGL_COMPONENT_FUSELAGE_TANK_HULL; + return TIGL_COMPONENT_TANK_HULL; } TiglGeometricComponentIntent CCPACSVessel::GetComponentIntent() const diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index eaea85dbf7..ce503ca920 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -42,7 +42,7 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi // Get the default uID TIGL_EXPORT std::string GetDefaultedUID() const override; - // Get the component type: TIGL_COMPONENT_FUSELAGE_TANK_HULL + // Get the component type: TIGL_COMPONENT_TANK_HULL TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; // Get the component intent: TIGL_INTENT_PHYSICAL TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index b3b5def81b..a9fc91cbb7 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -168,7 +168,7 @@ TEST_F(FuelTanks, vessel_general) TEST_F(FuelTanks, vessel_component_info) { - EXPECT_EQ(vessel_segments->GetComponentType(), TIGL_COMPONENT_FUSELAGE_TANK_HULL); + EXPECT_EQ(vessel_segments->GetComponentType(), TIGL_COMPONENT_TANK_HULL); EXPECT_EQ(vessel_segments->GetComponentIntent(), TIGL_INTENT_PHYSICAL); } From 80779b673984a084b01e63400751552926489bc7 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 18:06:21 +0100 Subject: [PATCH 061/122] exclude fuselageFuelTanks again --- src/generated/CPACSFuelTankVolume.cpp | 38 +--- src/generated/CPACSFuelTankVolume.h | 38 +--- src/generated/CPACSFuselage.cpp | 44 ---- src/generated/CPACSFuselage.h | 9 - src/generated/CPACSFuselageFuelTank.cpp | 273 ----------------------- src/generated/CPACSFuselageFuelTank.h | 117 ---------- src/generated/CPACSFuselageFuelTanks.cpp | 123 ---------- src/generated/CPACSFuselageFuelTanks.h | 90 -------- 8 files changed, 15 insertions(+), 717 deletions(-) delete mode 100644 src/generated/CPACSFuselageFuelTank.cpp delete mode 100644 src/generated/CPACSFuselageFuelTank.h delete mode 100644 src/generated/CPACSFuselageFuelTanks.cpp delete mode 100644 src/generated/CPACSFuselageFuelTanks.h diff --git a/src/generated/CPACSFuelTankVolume.cpp b/src/generated/CPACSFuelTankVolume.cpp index 5cfdecceaf..c0c81cb9ff 100644 --- a/src/generated/CPACSFuelTankVolume.cpp +++ b/src/generated/CPACSFuelTankVolume.cpp @@ -18,7 +18,6 @@ #include #include "CCPACSVessel.h" #include "CPACSFuelTankVolume.h" -#include "CPACSFuselageFuelTank.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDObject.h" @@ -28,50 +27,35 @@ namespace tigl { namespace generated { - CPACSFuelTankVolume::CPACSFuelTankVolume(CPACSFuselageFuelTank* parent) + CPACSFuelTankVolume::CPACSFuelTankVolume(CCPACSVessel* parent) : m_optimalVolume(0) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSFuselageFuelTank); } - CPACSFuelTankVolume::CPACSFuelTankVolume(CCPACSVessel* parent) - : m_optimalVolume(0) + CPACSFuelTankVolume::~CPACSFuelTankVolume() { - //assert(parent != NULL); - m_parent = parent; - m_parentType = &typeid(CCPACSVessel); } - CPACSFuelTankVolume::~CPACSFuelTankVolume() + const CCPACSVessel* CPACSFuelTankVolume::GetParent() const + { + return m_parent; + } + + CCPACSVessel* CPACSFuelTankVolume::GetParent() { + return m_parent; } const CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() const { - if (m_parent) { - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent(); - } - } - return nullptr; + return m_parent; } CTiglUIDObject* CPACSFuelTankVolume::GetNextUIDParent() { - if (m_parent) { - if (IsParent()) { - return GetParent(); - } - if (IsParent()) { - return GetParent(); - } - } - return nullptr; + return m_parent; } void CPACSFuelTankVolume::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) diff --git a/src/generated/CPACSFuelTankVolume.h b/src/generated/CPACSFuelTankVolume.h index 0bc2137c95..5cbc1e5f23 100644 --- a/src/generated/CPACSFuelTankVolume.h +++ b/src/generated/CPACSFuelTankVolume.h @@ -21,8 +21,6 @@ #include #include #include -#include -#include "CTiglError.h" #include "tigl_internal.h" namespace tigl @@ -32,10 +30,7 @@ class CCPACSVessel; namespace generated { - class CPACSFuselageFuelTank; - // This class is used in: - // CPACSFuselageFuelTank // CPACSVessel /// @brief Definition of different volumes of the fuel tank. @@ -45,36 +40,13 @@ namespace generated class CPACSFuelTankVolume { public: - TIGL_EXPORT CPACSFuelTankVolume(CPACSFuselageFuelTank* parent); TIGL_EXPORT CPACSFuelTankVolume(CCPACSVessel* parent); TIGL_EXPORT virtual ~CPACSFuelTankVolume(); - template - bool IsParent() const - { - return m_parentType != NULL && *m_parentType == typeid(P); - } - - template - P* GetParent() - { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); - if (!IsParent

()) { - throw CTiglError("bad parent"); - } - return static_cast(m_parent); - } - - template - const P* GetParent() const - { - static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSFuelTankVolume"); - if (!IsParent

()) { - throw CTiglError("bad parent"); - } - return static_cast(m_parent); - } + TIGL_EXPORT CCPACSVessel* GetParent(); + + TIGL_EXPORT const CCPACSVessel* GetParent() const; TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -100,8 +72,7 @@ namespace generated TIGL_EXPORT virtual void SetRealVolumeFactor_choice2(const boost::optional& value); protected: - void* m_parent; - const std::type_info* m_parentType; + CCPACSVessel* m_parent; /// Theoretical volume if material thicknesses /// (ribs, spars, skins, stringers) and systems (fuel pumps, @@ -133,5 +104,4 @@ namespace generated // Aliases in tigl namespace using CCPACSFuelTankVolume = generated::CPACSFuelTankVolume; -using CCPACSFuselageFuelTank = generated::CPACSFuselageFuelTank; } // namespace tigl diff --git a/src/generated/CPACSFuselage.cpp b/src/generated/CPACSFuselage.cpp index 69877ae5c8..0c4564c5d6 100644 --- a/src/generated/CPACSFuselage.cpp +++ b/src/generated/CPACSFuselage.cpp @@ -190,17 +190,6 @@ namespace generated } } - // read element fuelTanks - if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTanks")) { - m_fuelTanks = boost::in_place(reinterpret_cast(this), m_uidMgr); - try { - m_fuelTanks->ReadCPACS(tixiHandle, xpath + "/fuelTanks"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read fuelTanks at xpath " << xpath << ": " << e.what(); - m_fuelTanks = boost::none; - } - } - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); } @@ -290,17 +279,6 @@ namespace generated } } - // write element fuelTanks - if (m_fuelTanks) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/fuelTanks"); - m_fuelTanks->WriteCPACS(tixiHandle, xpath + "/fuelTanks"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuelTanks")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/fuelTanks"); - } - } - } const std::string& CPACSFuselage::GetUID() const @@ -425,16 +403,6 @@ namespace generated return m_compartments; } - const boost::optional& CPACSFuselage::GetFuelTanks() const - { - return m_fuelTanks; - } - - boost::optional& CPACSFuselage::GetFuelTanks() - { - return m_fuelTanks; - } - CCPACSPositionings& CPACSFuselage::GetPositionings(CreateIfNotExistsTag) { if (!m_positionings) @@ -471,18 +439,6 @@ namespace generated m_compartments = boost::none; } - CPACSFuselageFuelTanks& CPACSFuselage::GetFuelTanks(CreateIfNotExistsTag) - { - if (!m_fuelTanks) - m_fuelTanks = boost::in_place(reinterpret_cast(this), m_uidMgr); - return *m_fuelTanks; - } - - void CPACSFuselage::RemoveFuelTanks() - { - m_fuelTanks = boost::none; - } - const CTiglUIDObject* CPACSFuselage::GetNextUIDObject() const { return this; diff --git a/src/generated/CPACSFuselage.h b/src/generated/CPACSFuselage.h index f82102e713..5c2511248f 100644 --- a/src/generated/CPACSFuselage.h +++ b/src/generated/CPACSFuselage.h @@ -28,7 +28,6 @@ #include #include #include "CPACSCompartments.h" -#include "CPACSFuselageFuelTanks.h" #include "CreateIfNotExists.h" #include "CTiglUIDObject.h" #include "ITiglUIDRefObject.h" @@ -103,9 +102,6 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetCompartments() const; TIGL_EXPORT virtual boost::optional& GetCompartments(); - TIGL_EXPORT virtual const boost::optional& GetFuelTanks() const; - TIGL_EXPORT virtual boost::optional& GetFuelTanks(); - TIGL_EXPORT virtual CCPACSPositionings& GetPositionings(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemovePositionings(); @@ -115,9 +111,6 @@ namespace generated TIGL_EXPORT virtual CPACSCompartments& GetCompartments(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveCompartments(); - TIGL_EXPORT virtual CPACSFuselageFuelTanks& GetFuelTanks(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveFuelTanks(); - protected: CCPACSFuselages* m_parent; @@ -149,8 +142,6 @@ namespace generated boost::optional m_compartments; - boost::optional m_fuelTanks; - private: TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; diff --git a/src/generated/CPACSFuselageFuelTank.cpp b/src/generated/CPACSFuselageFuelTank.cpp deleted file mode 100644 index a5df59d2f1..0000000000 --- a/src/generated/CPACSFuselageFuelTank.cpp +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CPACSFuselageFuelTank.h" -#include "CPACSFuselageFuelTanks.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSFuselageFuelTank::CPACSFuselageFuelTank(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSFuselageFuelTank::~CPACSFuselageFuelTank() - { - if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); - if (m_uidMgr) { - if (!m_compartmentUID.empty()) m_uidMgr->TryUnregisterReference(m_compartmentUID, *this); - } - } - - const CPACSFuselageFuelTanks* CPACSFuselageFuelTank::GetParent() const - { - return m_parent; - } - - CPACSFuselageFuelTanks* CPACSFuselageFuelTank::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSFuselageFuelTank::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSFuselageFuelTank::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDManager& CPACSFuselageFuelTank::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSFuselageFuelTank::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSFuselageFuelTank::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read attribute uID - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { - m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); - if (m_uID.empty()) { - LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; - } - - // read element name - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); - if (m_name->empty()) { - LOG(WARNING) << "Optional element name is present but empty at xpath " << xpath; - } - } - - // read element description - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); - if (m_description->empty()) { - LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; - } - } - - // read element compartmentUID - if (tixi::TixiCheckElement(tixiHandle, xpath + "/compartmentUID")) { - m_compartmentUID = tixi::TixiGetElement(tixiHandle, xpath + "/compartmentUID"); - if (m_compartmentUID.empty()) { - LOG(WARNING) << "Required element compartmentUID is empty at xpath " << xpath; - } - if (m_uidMgr && !m_compartmentUID.empty()) m_uidMgr->RegisterReference(m_compartmentUID, *this); - } - else { - LOG(ERROR) << "Required element compartmentUID is missing at xpath " << xpath; - } - - // read element volume - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - m_volume = boost::in_place(this); - try { - m_volume->ReadCPACS(tixiHandle, xpath + "/volume"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read volume at xpath " << xpath << ": " << e.what(); - m_volume = boost::none; - } - } - - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); - } - - void CPACSFuselageFuelTank::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write attribute uID - tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); - - // write element name - if (m_name) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name"); - tixi::TixiSaveElement(tixiHandle, xpath + "/name", *m_name); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/name"); - } - } - - // write element description - if (m_description) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); - tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); - } - } - - // write element compartmentUID - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/compartmentUID"); - tixi::TixiSaveElement(tixiHandle, xpath + "/compartmentUID", m_compartmentUID); - - // write element volume - if (m_volume) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/volume"); - m_volume->WriteCPACS(tixiHandle, xpath + "/volume"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/volume")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/volume"); - } - } - - } - - const std::string& CPACSFuselageFuelTank::GetUID() const - { - return m_uID; - } - - void CPACSFuselageFuelTank::SetUID(const std::string& value) - { - if (m_uidMgr && value != m_uID) { - if (m_uID.empty()) { - m_uidMgr->RegisterObject(value, *this); - } - else { - m_uidMgr->UpdateObjectUID(m_uID, value); - } - } - m_uID = value; - } - - const boost::optional& CPACSFuselageFuelTank::GetName() const - { - return m_name; - } - - void CPACSFuselageFuelTank::SetName(const boost::optional& value) - { - m_name = value; - } - - const boost::optional& CPACSFuselageFuelTank::GetDescription() const - { - return m_description; - } - - void CPACSFuselageFuelTank::SetDescription(const boost::optional& value) - { - m_description = value; - } - - const std::string& CPACSFuselageFuelTank::GetCompartmentUID() const - { - return m_compartmentUID; - } - - void CPACSFuselageFuelTank::SetCompartmentUID(const std::string& value) - { - if (m_uidMgr) { - if (!m_compartmentUID.empty()) m_uidMgr->TryUnregisterReference(m_compartmentUID, *this); - if (!value.empty()) m_uidMgr->RegisterReference(value, *this); - } - m_compartmentUID = value; - } - - const boost::optional& CPACSFuselageFuelTank::GetVolume() const - { - return m_volume; - } - - boost::optional& CPACSFuselageFuelTank::GetVolume() - { - return m_volume; - } - - CPACSFuelTankVolume& CPACSFuselageFuelTank::GetVolume(CreateIfNotExistsTag) - { - if (!m_volume) - m_volume = boost::in_place(this); - return *m_volume; - } - - void CPACSFuselageFuelTank::RemoveVolume() - { - m_volume = boost::none; - } - - const CTiglUIDObject* CPACSFuselageFuelTank::GetNextUIDObject() const - { - return this; - } - - void CPACSFuselageFuelTank::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) - { - if (m_compartmentUID == oldUid) { - m_compartmentUID = newUid; - } - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTank.h b/src/generated/CPACSFuselageFuelTank.h deleted file mode 100644 index 2b94823177..0000000000 --- a/src/generated/CPACSFuselageFuelTank.h +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include "CPACSFuelTankVolume.h" -#include "CreateIfNotExists.h" -#include "CTiglUIDObject.h" -#include "ITiglUIDRefObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; - -namespace generated -{ - class CPACSFuselageFuelTanks; - - // This class is used in: - // CPACSFuselageFuelTanks - - /// @brief Definition of one fuselage fuel tank. - /// - /// The definition of fuselage tanks is still preliminary. - /// Currently, there is no link to any structural elements - /// - class CPACSFuselageFuelTank : public CTiglReqUIDObject, public ITiglUIDRefObject - { - public: - TIGL_EXPORT CPACSFuselageFuelTank(CPACSFuselageFuelTanks* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSFuselageFuelTank(); - - TIGL_EXPORT CPACSFuselageFuelTanks* GetParent(); - - TIGL_EXPORT const CPACSFuselageFuelTanks* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT virtual const std::string& GetUID() const; - TIGL_EXPORT virtual void SetUID(const std::string& value); - - TIGL_EXPORT virtual const boost::optional& GetName() const; - TIGL_EXPORT virtual void SetName(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetDescription() const; - TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - - TIGL_EXPORT virtual const std::string& GetCompartmentUID() const; - TIGL_EXPORT virtual void SetCompartmentUID(const std::string& value); - - TIGL_EXPORT virtual const boost::optional& GetVolume() const; - TIGL_EXPORT virtual boost::optional& GetVolume(); - - TIGL_EXPORT virtual CPACSFuelTankVolume& GetVolume(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveVolume(); - - protected: - CPACSFuselageFuelTanks* m_parent; - - CTiglUIDManager* m_uidMgr; - - std::string m_uID; - - /// Name of the fuselage fuel tank. - boost::optional m_name; - - /// Description of the fuselage fuel tank. - boost::optional m_description; - - /// Link to the tank geometry defined by a compartment. - std::string m_compartmentUID; - - boost::optional m_volume; - - private: - TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; - TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; - - CPACSFuselageFuelTank(const CPACSFuselageFuelTank&) = delete; - CPACSFuselageFuelTank& operator=(const CPACSFuselageFuelTank&) = delete; - - CPACSFuselageFuelTank(CPACSFuselageFuelTank&&) = delete; - CPACSFuselageFuelTank& operator=(CPACSFuselageFuelTank&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSFuselageFuelTank = generated::CPACSFuselageFuelTank; -using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; -} // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTanks.cpp b/src/generated/CPACSFuselageFuelTanks.cpp deleted file mode 100644 index 6a92d2568b..0000000000 --- a/src/generated/CPACSFuselageFuelTanks.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "CCPACSFuselage.h" -#include "CPACSFuselageFuelTank.h" -#include "CPACSFuselageFuelTanks.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "CTiglUIDObject.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSFuselageFuelTanks::CPACSFuselageFuelTanks(CCPACSFuselage* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSFuselageFuelTanks::~CPACSFuselageFuelTanks() - { - } - - const CCPACSFuselage* CPACSFuselageFuelTanks::GetParent() const - { - return m_parent; - } - - CCPACSFuselage* CPACSFuselageFuelTanks::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSFuselageFuelTanks::GetNextUIDParent() const - { - return m_parent; - } - - CTiglUIDObject* CPACSFuselageFuelTanks::GetNextUIDParent() - { - return m_parent; - } - - CTiglUIDManager& CPACSFuselageFuelTanks::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSFuselageFuelTanks::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSFuselageFuelTanks::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read element fuselageFuelTank - if (tixi::TixiCheckElement(tixiHandle, xpath + "/fuselageFuelTank")) { - tixi::TixiReadElements(tixiHandle, xpath + "/fuselageFuelTank", m_fuselageFuelTanks, 1, tixi::xsdUnbounded, this, m_uidMgr); - } - - } - - void CPACSFuselageFuelTanks::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write element fuselageFuelTank - tixi::TixiSaveElements(tixiHandle, xpath + "/fuselageFuelTank", m_fuselageFuelTanks); - - } - - const std::vector>& CPACSFuselageFuelTanks::GetFuselageFuelTanks() const - { - return m_fuselageFuelTanks; - } - - std::vector>& CPACSFuselageFuelTanks::GetFuselageFuelTanks() - { - return m_fuselageFuelTanks; - } - - CPACSFuselageFuelTank& CPACSFuselageFuelTanks::AddFuselageFuelTank() - { - m_fuselageFuelTanks.push_back(make_unique(this, m_uidMgr)); - return *m_fuselageFuelTanks.back(); - } - - void CPACSFuselageFuelTanks::RemoveFuselageFuelTank(CPACSFuselageFuelTank& ref) - { - for (std::size_t i = 0; i < m_fuselageFuelTanks.size(); i++) { - if (m_fuselageFuelTanks[i].get() == &ref) { - m_fuselageFuelTanks.erase(m_fuselageFuelTanks.begin() + i); - return; - } - } - throw CTiglError("Element not found"); - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSFuselageFuelTanks.h b/src/generated/CPACSFuselageFuelTanks.h deleted file mode 100644 index fce254e24f..0000000000 --- a/src/generated/CPACSFuselageFuelTanks.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include "tigl_internal.h" -#include "UniquePtr.h" - -namespace tigl -{ -class CTiglUIDManager; -class CTiglUIDObject; -class CCPACSFuselage; - -namespace generated -{ - class CPACSFuselageFuelTank; - - // This class is used in: - // CPACSFuselage - - /// @brief List of fuselage fuel tanks. - /// - /// - /// - class CPACSFuselageFuelTanks - { - public: - TIGL_EXPORT CPACSFuselageFuelTanks(CCPACSFuselage* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSFuselageFuelTanks(); - - TIGL_EXPORT CCPACSFuselage* GetParent(); - - TIGL_EXPORT const CCPACSFuselage* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT virtual const std::vector>& GetFuselageFuelTanks() const; - TIGL_EXPORT virtual std::vector>& GetFuselageFuelTanks(); - - TIGL_EXPORT virtual CPACSFuselageFuelTank& AddFuselageFuelTank(); - TIGL_EXPORT virtual void RemoveFuselageFuelTank(CPACSFuselageFuelTank& ref); - - protected: - CCPACSFuselage* m_parent; - - CTiglUIDManager* m_uidMgr; - - /// The fuselage fuel tank geometry is defined by a link to a fuselage geometry compartment. - /// The fuel tank volume type should also be used for the wing fuel tank - std::vector> m_fuselageFuelTanks; - - private: - CPACSFuselageFuelTanks(const CPACSFuselageFuelTanks&) = delete; - CPACSFuselageFuelTanks& operator=(const CPACSFuselageFuelTanks&) = delete; - - CPACSFuselageFuelTanks(CPACSFuselageFuelTanks&&) = delete; - CPACSFuselageFuelTanks& operator=(CPACSFuselageFuelTanks&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSFuselageFuelTanks = generated::CPACSFuselageFuelTanks; -using CCPACSFuselageFuelTank = generated::CPACSFuselageFuelTank; -} // namespace tigl From 6752aa4e02172513b39336b3546af8e29c20b683 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 18:09:26 +0100 Subject: [PATCH 062/122] exclude fuselageFuelTanks again v2 --- bindings/python_internal/configuration.i | 4 +--- cpacs_gen_input/PruneList.txt | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bindings/python_internal/configuration.i b/bindings/python_internal/configuration.i index 2d2e0874d1..9b1f083865 100644 --- a/bindings/python_internal/configuration.i +++ b/bindings/python_internal/configuration.i @@ -348,9 +348,8 @@ namespace tigl %include "CPACSRotorHubHinge_type.h" // --------------- Fuselage tanks -----------------// -%boost_optional(tigl::generated::CPACSFuselageFuelTanks) -%boost_optional(tigl::CCPACSFuelTanks) %boost_optional(tigl::generated::CPACSFuelTanks) +%boost_optional(tigl::CCPACSFuelTanks) %boost_optional(tigl::generated::CPACSFuelTankVolume) %boost_optional(tigl::CCPACSVesselStructure) @@ -377,7 +376,6 @@ class CCPACSVessels; %include "CCPACSVessels.h" %include "generated/CPACSVessel.h" %include "CCPACSVessel.h" -%include "generated/CPACSFuselageFuelTanks.h" // -------------------- Wing Structure -------------------// diff --git a/cpacs_gen_input/PruneList.txt b/cpacs_gen_input/PruneList.txt index d0ab053c68..5661c93739 100644 --- a/cpacs_gen_input/PruneList.txt +++ b/cpacs_gen_input/PruneList.txt @@ -46,7 +46,7 @@ CPACSReference // in fuselage CPACSDecks CPACSFuselageCutOuts -CPACSIntegralFuelTanks +CPACSFuselageFuelTanks CPACSCenterFuselageAreasAssembly CPACSFloorPanels CPACSGeneralStructuralMembersAssembly From 719d473c76f9dad334338736fab9932fa3cdcfe1 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 18:18:34 +0100 Subject: [PATCH 063/122] revert python-tests which are not part of this issue --- tests/unittests/pythonwrapper-tests.py | 1208 ++++++++++++------------ tests/unittests/runtests.sh.in | 28 +- 2 files changed, 618 insertions(+), 618 deletions(-) diff --git a/tests/unittests/pythonwrapper-tests.py b/tests/unittests/pythonwrapper-tests.py index f65dc5da6a..bb1865999c 100644 --- a/tests/unittests/pythonwrapper-tests.py +++ b/tests/unittests/pythonwrapper-tests.py @@ -1,604 +1,604 @@ -#! /usr/bin/env python -# -*- coding: cp1252 -*- -############################################################################# -# Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -# -# Created: 2013-03-13 Martin Siggel -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -############################################################################# - -import unittest -import subprocess -from tiglwrapper import * -from tixiwrapper import * - -skipSlowFunctions = True # Saves you 14 minutes(if True), but leaves out 8 functions - -class TestSimpleCpacs(unittest.TestCase): - - def setUp(self): - self.tixi = Tixi() - self.tigl = Tigl() - self.tixi.open('TestData/simpletest.cpacs.xml') - self.tigl.open(self.tixi, '') - - def tearDown(self): - self.tigl.close() - self.tixi.close() - - def test_tiglGetVersion(self): - print('TIGL-Version: ' + self.tigl.version) - - def test_objectCount(self): - self.assertEqual(self.tigl.getWingCount(),1) - self.assertEqual(self.tigl.getFuselageCount(),1) - self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) - - ########## Exports are faster in this class - def test_exportIGES(self): - filenamePtr = "TestData/export/export0.igs" - self.tigl.exportIGES(filenamePtr) - - def test_exportFusedWingFuselageIGES(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export.igs" - self.tigl.exportFusedWingFuselageIGES(filenamePtr) - - def test_exportSTEP(self): - filenamePtr = 'TestData/export/export.step' - self.tigl.exportSTEP(filenamePtr) - - def test_exportMeshedWingSTL(self): - if not skipSlowFunctions: - wingIndex = 1 - filenamePtr = "TestData/export/export.stl" - deflection = 0.01 - self.tigl.exportMeshedWingSTL(wingIndex, filenamePtr, deflection) - - def test_exportMeshedGeometrySTL(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export3.stl" - deflection = 0.01 - self.tigl.exportMeshedGeometrySTL(filenamePtr, deflection) - - def test_exportMeshedWingVTKByUID(self): - wingUID = "Wing" - filenamePtr ="TestData/export/export.vtk" - deflection = 0.01 - self.tigl.exportMeshedWingVTKByUID(wingUID, filenamePtr, deflection) - - def test_exportMeshedGeometryVTK(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export4.vtk" - deflection = 0.01 - self.tigl.exportMeshedGeometryVTK(filenamePtr, deflection) - - def test_exportMeshedWingVTKSimpleByUID(self): - wingUID = "Wing" - filenamePtr = "TestData/export/export5.vtk" - deflection = 0.01 - self.tigl.exportMeshedWingVTKSimpleByUID(wingUID, filenamePtr, deflection) - - def test_exportMeshedGeometryVTKSimple(self): - if not skipSlowFunctions: - filenamePtr = "TestData/export/export7.vtk" - deflection = 0.01 - self.tigl.exportMeshedGeometryVTKSimple(filenamePtr, deflection) - - def test_getMaterialUID(self): - compSegmentUID = "WING_CS1" - eta = 0.25 - xsi = 0.9 - nmaterials = self.tigl.wingComponentSegmentGetMaterialCount(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi ) - self.assertEqual(nmaterials, 1) - - material = self.tigl.wingComponentSegmentGetMaterialUID(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi, 1) - self.assertEqual(material, 'MyCellMat') -###### - -# Tests for tigl logging mechanism -class TestTiglLogging(unittest.TestCase): - def get_logs(self, loglevel): - process=subprocess.Popen(['python', 'test_logging.py', "%s" % loglevel], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err=process.communicate() - status=process.returncode - # separate output lines - out=out.decode("UTF-8").rstrip('\n').split('\n') - err=err.decode("UTF-8").rstrip('\n').split('\n') - return (status, out, err) - - def test_test_script(self): - for lev in range(0,4): - self.assertEqual(self.get_logs(lev)[0], 0) - - def test_info(self): - status, out, err = self.get_logs(3) - self.assertTrue(len(out), 1) - self.assertTrue(len(err), 4) - self.assertTrue(out[0].startswith('INF')) - self.assertTrue(out[0].strip().endswith('No far-field defined.')) - self.assertTrue(err[0].startswith('WRN')) - self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) - self.assertTrue(err[1].startswith('WRN')) - self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) - self.assertTrue(err[2].startswith('ERR')) - self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - - def test_warning(self): - status, out, err = self.get_logs(2) - self.assertTrue(len(out), 0) - self.assertTrue(len(err), 4) - self.assertTrue(err[0].startswith('WRN')) - self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) - self.assertTrue(err[1].startswith('WRN')) - self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) - self.assertTrue(err[2].startswith('ERR')) - self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - - def test_error(self): - status, out, err = self.get_logs(1) - self.assertTrue(len(out), 0) - self.assertTrue(len(err), 1) - self.assertTrue(err[0].startswith('ERR')) - self.assertTrue(err[0].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - - def test_silent(self): - status, out, err = self.get_logs(0) - self.assertTrue(len(out), 0) - self.assertTrue(len(err), 0) - - def test_file_logging(self): - status, out, err = self.get_logs(0) - f=open("test_logging.log", 'r') - lines=f.readlines() - f.close() - lout=[line.rstrip('\n') for line in lines] - self.assertTrue(len(lout), 6) - self.assertTrue(lout[0].startswith('TiGL log file created at')) - self.assertTrue(lout[1].startswith('WRN')) - self.assertTrue(lout[1].strip().endswith('CPACS dataset version is higher than TIGL library version!')) - self.assertTrue(lout[2].startswith('WRN')) - self.assertTrue(lout[2].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) - self.assertTrue(lout[3].startswith('INF')) - self.assertTrue(lout[3].strip().endswith('No far-field defined.')) - self.assertTrue(lout[4].startswith('ERR')) - self.assertTrue(lout[4].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) - -# ----------------------------------------------------------------------- # -# The following tests should only check, if the python api is correct. -# Correctness of TIGL functions is not tested here (this is done in the c-tests) -class TestTiglApi(unittest.TestCase): - def setUp(self): - self.tigl = Tigl() - self.tixi = Tixi() - self.tigl.logSetVerbosity(TiglLogLevel.TILOG_SILENT) - self.tixi.open('TestData/CPACS_21_D150.xml') - self.tigl.open(self.tixi, 'D150_VAMP') - - def tearDown(self): - self.tigl.close() - self.tixi.close() - - def test_getWingCount(self): - self.assertEqual(self.tigl.getWingCount(),3) - - def test_getFuselageCount(self): - self.assertEqual(self.tigl.getFuselageCount(),1) - - def test_wingGetSegmentCount(self): - self.assertEqual(self.tigl.wingGetSegmentCount(1),3) - self.assertEqual(self.tigl.wingGetSegmentCount(2),1) - self.assertEqual(self.tigl.wingGetSegmentCount(3),1) - - # check illegal wing index error handling - error = TiglReturnCode.TIGL_SUCCESS - try: - self.tigl.wingGetSegmentCount(-1); - except TiglException as e: - error = e.code - self.assertEqual(error, TiglReturnCode.TIGL_INDEX_ERROR) - - def test_wingGetComponentSegmentCount(self): - self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) - self.assertEqual(self.tigl.wingGetComponentSegmentCount(2),1) - self.assertEqual(self.tigl.wingGetComponentSegmentCount(3),1) - - def test_wingGetComponentSegmentUID(self): - wingCompUID = self.tigl.wingGetComponentSegmentUID(1,1) - self.assertEqual(wingCompUID, 'D150_VAMP_W1_CompSeg1') - wingCompUID = self.tigl.wingGetComponentSegmentUID(2,1) - self.assertEqual(wingCompUID, 'D150_VAMP_HL1_CompSeg1') - wingCompUID = self.tigl.wingGetComponentSegmentUID(3,1) - self.assertEqual(wingCompUID, 'D150_VAMP_SL1_CompSeg1') - - def test_wingGetComponentSegmentIndex(self): - compSegIndex = self.tigl.wingGetComponentSegmentIndex(1,'D150_VAMP_W1_CompSeg1') - self.assertEqual(compSegIndex,1) - - def test_wingGetUpperPoint(self): - (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); - - def test_wingGetLowerPoint(self): - (x, y, z) = self.tigl.wingGetLowerPoint(1,1,0.5,0.5); - - def test_wingGetInnerConnectedSegmentCount(self): - segmentCount = self.tigl.wingGetInnerConnectedSegmentCount(1,1) - self.assertEqual(segmentCount,0) - - def test_wingGetOuterConnectedSegmentCount(self): - segmentCount = self.tigl.wingGetOuterConnectedSegmentCount(1,1) - self.assertEqual(segmentCount,1) - - def test_wingGetInnerConnectedSegmentIndex(self): - try: - segIndex = self.tigl.wingGetInnerConnectedSegmentIndex(1,1,0) - self.assertEqual(True, False) - except TiglException as e: - self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) - - def test_wingGetOuterConnectedSegmentIndex(self): - segIndex = self.tigl.wingGetOuterConnectedSegmentIndex(1,1,1) - self.assertEqual(segIndex,2) - - def test_wingGetInnerSectionAndElementIndex(self): - (secindex, elementindex) = self.tigl.wingGetInnerSectionAndElementIndex(1,1) - self.assertEqual(secindex, 1) - self.assertEqual(elementindex,1) - - def test_wingGetOuterSectionAndElementIndex(self): - (secindex, elementindex) = self.tigl.wingGetOuterSectionAndElementIndex(1,1) - self.assertEqual(secindex, 2) - self.assertEqual(elementindex,1) - - def test_wingGetInnerSectionAndElementUID(self): - (secUID, elementUID) = self.tigl.wingGetInnerSectionAndElementUID(1,1) - self.assertEqual(secUID, 'D150_VAMP_W1_Sec1') - self.assertEqual(elementUID, 'D150_VAMP_W1_Sec1_Elem1') - - def test_wingGetOuterSectionAndElementUID(self): - (secUID, elementUID) = self.tigl.wingGetOuterSectionAndElementUID(1,1) - self.assertEqual(secUID, 'D150_VAMP_W1_Sec2') - self.assertEqual(elementUID, 'D150_VAMP_W1_Sec2_Elem1') - - def test_wingGetProfileName(self): - profileName = self.tigl.wingGetProfileName(1,1,1) - self.assertEqual(profileName, 'NameD150_VAMP_W_SupCritProf1') - - def test_wingGetUID(self): - wingUID = self.tigl.wingGetUID(1) - self.assertEqual(wingUID, 'D150_VAMP_W1') - - def test_wingGetIndex(self): - wingIndex = self.tigl.wingGetIndex('D150_VAMP_W1') - self.assertEqual(wingIndex, 1) - - def test_wingGetSegmentUID(self): - segmentUID = self.tigl.wingGetSegmentUID(1,1) - self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') - - def test_wingGetSegmentIndex(self): - segmentIndex, wingIndex = self.tigl.wingGetSegmentIndex('D150_VAMP_W1_Seg1') - self.assertEqual(segmentIndex, 1) - self.assertEqual(wingIndex, 1) - - def test_wingGetSectionUID(self): - sectionUID = self.tigl.wingGetSectionUID(1,1) - self.assertEqual(sectionUID, 'D150_VAMP_W1_Sec1') - - def test_wingGetSymmetry(self): - symm = self.tigl.wingGetSymmetry(1) - self.assertEqual(symm, TiglSymmetryAxis.TIGL_X_Z_PLANE) - - def test_wingComponentSegmentFindSegment(self): - (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); - (segUID, wingUID) = self.tigl.wingComponentSegmentFindSegment('D150_VAMP_W1_CompSeg1',x,y,z) - self.assertEqual(segUID, 'D150_VAMP_W1_Seg1') - self.assertEqual(wingUID, 'D150_VAMP_W1') - - def test_wingComponentSegmentPointGetSegmentEtaXsi(self): - (wingUID, segmentUID, eta, xsi, errorDist) = self.tigl.wingComponentSegmentPointGetSegmentEtaXsi('D150_VAMP_W1_CompSeg1', 0.0, 0.0) - self.assertEqual(wingUID, 'D150_VAMP_W1') - self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') - self.assertAlmostEqual(eta, 0.0) - self.assertAlmostEqual(xsi, 0.0) - self.assertAlmostEqual(errorDist, 0.0) - - def test_wingSegmentPointGetComponentSegmentEtaXsi(self): - (eta, xsi) = self.tigl.wingSegmentPointGetComponentSegmentEtaXsi('D150_VAMP_W1_Seg1', 'D150_VAMP_W1_CompSeg1', 0.0, 0.0) - self.assertAlmostEqual(eta, 0.0) - self.assertAlmostEqual(xsi, 0.0) - - def test_getFuselageCount(self): - fc = self.tigl.getFuselageCount() - self.assertEqual(fc,1) - - def test_fuselageGetSegmentCount(self): - sc = self.tigl.fuselageGetSegmentCount(1) - self.assertEqual(sc,59) - - def test_fuselageGetPoint(self): - for iseg in range(0,59): - (x,y,z) = self.tigl.fuselageGetPoint(1,iseg+1,0.5,0.5) - #check for illegal index - try: - self.tigl.fuselageGetPoint(1,60,0.5,0.5) - self.assertEqual(False, True) - except TiglException as e: - self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) - - def test_fuselageGetPointAngle(self): - wingIDX = 1 - segIDX = 40 - (x,y,z) = self.tigl.fuselageGetPointAngle(wingIDX, segIDX, 0.5, 90.0) - - def test_fuselageGetPointAngleTranslated(self): - fuselIDX = 1 - segIDX = 40 - ytrans = 0.1; - ztrans = -0.1; - (x,y,z) = self.tigl.fuselageGetPointAngleTranslated(fuselIDX, segIDX, 0.5, 90.0, ytrans, ztrans) - - def test_fuselageGetPointOnXPlane(self): - fuselIDX = 1 - segIDX = 40 - zpos = 0.7 - (x,y,z) = self.tigl.fuselageGetPointOnXPlane(fuselIDX, segIDX, 0.5, zpos, 1) - self.assertAlmostEqual(zpos, z) - - def test_fuselageGetNumPointsOnXPlane(self): - fuselIDX = 1 - segIDX = 40 - zpos = 0.7 - num = self.tigl.fuselageGetNumPointsOnXPlane(fuselIDX, segIDX, 0.5, zpos) - self.assertGreater(num, 0) - - def test_fuselageGetPointOnYPlane(self): - fuselIDY = 1 - segIDY = 40 - zpos = 0.7 - (x,y,z) = self.tigl.fuselageGetPointOnYPlane(fuselIDY, segIDY, 0.5, zpos, 1) - self.assertAlmostEqual(zpos, z) - - def test_fuselageGetNumPointsOnYPlane(self): - fuselIDY = 1 - segIDY = 40 - zpos = 0.7 - num = self.tigl.fuselageGetNumPointsOnYPlane(fuselIDY, segIDY, 0.5, zpos) - self.assertGreater(num, 0) - -############################ ANFANG - def test_fuselageGetCircumference(self): - fuselageIndex = 1 - segmentIndex = 1 - eta = 0.5 - ret = self.tigl.fuselageGetCircumference(fuselageIndex, segmentIndex, eta) - self.assertEqual(isinstance(ret, float),True) - - def test_fuselageGetStartConnectedSegmentCount(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetStartConnectedSegmentCount(fuselageIndex, segmentIndex) - self.assertEqual(ret,0) - - def test_fuselageGetEndConnectedSegmentCount(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetEndConnectedSegmentCount(fuselageIndex, segmentIndex) - self.assertEqual(ret,1) - - def test_fuselageGetStartConnectedSegmentIndex(self): - fuselageIndex = 1 - segmentIndex = 2 - n = 1 - ret = self.tigl.fuselageGetStartConnectedSegmentIndex(fuselageIndex, segmentIndex, n) - self.assertEqual(ret,1) - - def test_fuselageGetEndConnectedSegmentIndex(self): - fuselageIndex = 1 - segmentIndex = 1 - n = 1 - ret = self.tigl.fuselageGetEndConnectedSegmentIndex(fuselageIndex, segmentIndex, n) - self.assertEqual(ret,2) - - def test_fuselageGetStartSectionAndElementUID(self): - fuselageIndex = 1 - segmentIndex = 1 - n = 1 - ret = self.tigl.fuselageGetStartSectionAndElementUID(fuselageIndex, segmentIndex) - self.assertEqual(ret,('D150_VAMP_FL1_Sec1', 'D150_VAMP_FL1_Sec1_Elem1')) - - def test_fuselageGetEndSectionAndElementUID(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetEndSectionAndElementUID(fuselageIndex, segmentIndex) - self.assertEqual(ret,('D150_VAMP_FL1_Sec2', 'D150_VAMP_FL1_Sec2_Elem1')) - - def test_fuselageGetStartSectionAndElementIndex(self): - fuselageIndex = 1 - segmentIndex = 2 - ret = self.tigl.fuselageGetStartSectionAndElementIndex(fuselageIndex, segmentIndex) - self.assertEqual(ret,(2,1)) - - def test_fuselageGetEndSectionAndElementIndex(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetEndSectionAndElementIndex(fuselageIndex, segmentIndex) - self.assertEqual(ret,(2,1)) - - def test_fuselageGetProfileName(self): - fuselageIndex = 1 - sectionIndex = 1 - elementIndex = 1 - ret = self.tigl.fuselageGetProfileName(fuselageIndex, sectionIndex, elementIndex) - self.assertEqual(ret,"Circle") - - def test_fuselageGetUID(self): - fuselageIndex = 1 - ret = self.tigl.fuselageGetUID(fuselageIndex) - self.assertEqual(ret,'D150_VAMP_FL1') - - def test_fuselageGetSegmentUID(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetSegmentUID(fuselageIndex, segmentIndex) - self.assertEqual(ret,'D150_VAMP_FL1_Seg1') - - def test_fuselageGetSectionUID(self): - fuselageIndex = 1 - sectionIndex = 1 - ret = self.tigl.fuselageGetSectionUID(fuselageIndex, sectionIndex) - self.assertEqual(isinstance(ret,str),True) - - def test_fuselageGetSymmetry(self): - fuselageIndex = 1 - ret = self.tigl.fuselageGetSymmetry(fuselageIndex) - self.assertEqual(ret,0) - -## Raises TiglException: TIGL_ERROR (1) (both give the same Error) -## def test_componentIntersectionPoint(self): -## print("IntersectionPoint") -## componentUidOne = self.tigl.fuselageGetUID(1) -## componentUidTwo = self.tigl.wingGetUID(1) -## lineID = 1 -## eta = 0.5 -## ret = self.tigl.componentIntersectionPoint(componentUidOne, componentUidTwo, lineID, eta) -## self.assertEqual((len(ret)==3),True) -## -## def test_componentIntersectionLineCount(self): -## print("IntersectionLine") -## componentUidOne = self.tigl.fuselageGetUID(1) -## componentUidTwo = self.tigl.wingGetUID(1) -## ret = self.tigl.componentIntersectionLineCount(componentUidOne, componentUidTwo) - - - def test_wingGetVolume(self): - wingIndex = 1 - ret = self.tigl.wingGetVolume(wingIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSegmentVolume(self): - wingIndex = 1 - segmentIndex = 1 - ret = self.tigl.wingGetSegmentVolume(wingIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_fuselageGetSegmentVolume(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetSegmentVolume(fuselageIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSurfaceArea(self): - wingIndex = 1 - ret = self.tigl.wingGetSurfaceArea(wingIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSegmentSurfaceArea(self): - wingIndex = 1 - segmentIndex = 1 - ret = self.tigl.wingGetSegmentSurfaceArea(wingIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_fuselageGetSegmentSurfaceArea(self): - fuselageIndex = 1 - segmentIndex = 1 - ret = self.tigl.fuselageGetSegmentSurfaceArea(fuselageIndex, segmentIndex) - self.assertEqual(isinstance(ret,float),True) - - def test_componentGetHashCode(self): - componentUID = self.tigl.wingGetUID(1) - ret = self.tigl.componentGetHashCode(componentUID) - self.assertEqual(isinstance(ret,int),True) - - def test_configurationGetLength(self): - ret = self.tigl.configurationGetLength() - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSpan(self): - wingUID = self.tigl.wingGetUID(1) - ret = self.tigl.wingGetSpan(wingUID) - self.assertEqual(isinstance(ret,float),True) - - def test_wingGetSurfaceArea(self): - area = self.tigl.wingGetSurfaceArea(1); - self.assertGreater(area, 125.) - self.assertLess(area, 135.) - - def test_wingGetReferenceArea(self): - area = self.tigl.wingGetReferenceArea(1, TiglSymmetryAxis.TIGL_X_Y_PLANE); - self.assertGreater(area, 60.) - self.assertLess(area, 70.) - - def test_exportMeshedWingVTKByIndex(self): - self.tigl.exportMeshedWingVTKByIndex(1, 'TestData/export/D150modelID_wing1_python.vtp', 0.01) - -###### SLOW Function, basically fuselage based due to complex fuselage geometry - def test_MergedTests(self): - if skipSlowFunctions: - return - print( "Slow Functions (14min)") - - #exportMeshedFuselageSTL - fuselageIndex = 1 - filenamePtr = "TestData/export/export2.stl" - deflection = 0.01 - self.tigl.exportMeshedFuselageSTL(fuselageIndex, filenamePtr, deflection) - - # Fuselage VTK by Index - fuselageIndex = 1 - filenamePtr = "TestData/export/export2.vtk" - deflection = 0.01 - self.tigl.exportMeshedFuselageVTKByIndex(fuselageIndex, filenamePtr, deflection) - - # Fuselage VTk by UID - fuselageUID = "D150_VAMP_FL1" - filenamePtr = "TestData/export/export3.vtk" - deflection = 0.01 - self.tigl.exportMeshedFuselageVTKByUID(fuselageUID, filenamePtr, deflection) - - # Fuselage Simple-VTK by UID - fuselageUID = "D150_VAMP_FL1" - filenamePtr ="TestData/export/export6.vtk" - deflection = 0.01 - self.tigl.exportMeshedFuselageVTKSimpleByUID(fuselageUID, filenamePtr, deflection) - - # Distance to ground - fuselageUID = self.tigl.fuselageGetUID(1) - axisPntX = 0 - axisPntY = 0 - axisPntZ = 10 - axisDirX = 0 - axisDirY = 0 - axisDirZ = 1 - angle = 0 - ret = self.tigl.fuselageGetMinumumDistanceToGround(fuselageUID, axisPntX, axisPntY, axisPntZ, axisDirX, axisDirY, axisDirZ, angle) - - # Volume - ret = self.tigl.fuselageGetVolume(fuselageIndex) - self.assertEqual(isinstance(ret,float),True) - - # Wetted Area - print("50%") - wingUID = self.tigl.wingGetUID(1) - ret = self.tigl.wingGetWettedArea(wingUID) - self.assertEqual(isinstance(ret,float),True) - - # Fuselage Surface Area - fuselageIndex = 1 - ret = self.tigl.fuselageGetSurfaceArea(fuselageIndex) - self.assertEqual(isinstance(ret,float),True) - print("100%") -# ----------------------------------------------------------------------- # -if __name__ == '__main__': - unittest.main() +#! /usr/bin/env python +# -*- coding: cp1252 -*- +############################################################################# +# Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +# +# Created: 2013-03-13 Martin Siggel +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################# + +import unittest +import subprocess +from tiglwrapper import * +from tixiwrapper import * + +skipSlowFunctions = True # Saves you 14 minutes(if True), but leaves out 8 functions + +class TestSimpleCpacs(unittest.TestCase): + + def setUp(self): + self.tixi = Tixi() + self.tigl = Tigl() + self.tixi.open('TestData/simpletest.cpacs.xml') + self.tigl.open(self.tixi, '') + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_tiglGetVersion(self): + print('TIGL-Version: ' + self.tigl.version) + + def test_objectCount(self): + self.assertEqual(self.tigl.getWingCount(),1) + self.assertEqual(self.tigl.getFuselageCount(),1) + self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) + + ########## Exports are faster in this class + def test_exportIGES(self): + filenamePtr = "TestData/export/export0.igs" + self.tigl.exportIGES(filenamePtr) + + def test_exportFusedWingFuselageIGES(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export.igs" + self.tigl.exportFusedWingFuselageIGES(filenamePtr) + + def test_exportSTEP(self): + filenamePtr = 'TestData/export/export.step' + self.tigl.exportSTEP(filenamePtr) + + def test_exportMeshedWingSTL(self): + if not skipSlowFunctions: + wingIndex = 1 + filenamePtr = "TestData/export/export.stl" + deflection = 0.01 + self.tigl.exportMeshedWingSTL(wingIndex, filenamePtr, deflection) + + def test_exportMeshedGeometrySTL(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export3.stl" + deflection = 0.01 + self.tigl.exportMeshedGeometrySTL(filenamePtr, deflection) + + def test_exportMeshedWingVTKByUID(self): + wingUID = "Wing" + filenamePtr ="TestData/export/export.vtk" + deflection = 0.01 + self.tigl.exportMeshedWingVTKByUID(wingUID, filenamePtr, deflection) + + def test_exportMeshedGeometryVTK(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export4.vtk" + deflection = 0.01 + self.tigl.exportMeshedGeometryVTK(filenamePtr, deflection) + + def test_exportMeshedWingVTKSimpleByUID(self): + wingUID = "Wing" + filenamePtr = "TestData/export/export5.vtk" + deflection = 0.01 + self.tigl.exportMeshedWingVTKSimpleByUID(wingUID, filenamePtr, deflection) + + def test_exportMeshedGeometryVTKSimple(self): + if not skipSlowFunctions: + filenamePtr = "TestData/export/export7.vtk" + deflection = 0.01 + self.tigl.exportMeshedGeometryVTKSimple(filenamePtr, deflection) + + def test_getMaterialUID(self): + compSegmentUID = "WING_CS1" + eta = 0.25 + xsi = 0.9 + nmaterials = self.tigl.wingComponentSegmentGetMaterialCount(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi ) + self.assertEqual(nmaterials, 1) + + material = self.tigl.wingComponentSegmentGetMaterialUID(compSegmentUID, TiglStructureType.UPPER_SHELL, eta, xsi, 1) + self.assertEqual(material, 'MyCellMat') +###### + +# Tests for tigl logging mechanism +class TestTiglLogging(unittest.TestCase): + def get_logs(self, loglevel): + process=subprocess.Popen(['python', 'test_logging.py', "%s" % loglevel], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err=process.communicate() + status=process.returncode + # separate output lines + out=out.decode("UTF-8").rstrip('\n').split('\n') + err=err.decode("UTF-8").rstrip('\n').split('\n') + return (status, out, err) + + def test_test_script(self): + for lev in range(0,4): + self.assertEqual(self.get_logs(lev)[0], 0) + + def test_info(self): + status, out, err = self.get_logs(3) + self.assertTrue(len(out), 1) + self.assertTrue(len(err), 4) + self.assertTrue(out[0].startswith('INF')) + self.assertTrue(out[0].strip().endswith('No far-field defined.')) + self.assertTrue(err[0].startswith('WRN')) + self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) + self.assertTrue(err[1].startswith('WRN')) + self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) + self.assertTrue(err[2].startswith('ERR')) + self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + + def test_warning(self): + status, out, err = self.get_logs(2) + self.assertTrue(len(out), 0) + self.assertTrue(len(err), 4) + self.assertTrue(err[0].startswith('WRN')) + self.assertTrue(err[0].strip().endswith('CPACS dataset version is higher than TIGL library version!')) + self.assertTrue(err[1].startswith('WRN')) + self.assertTrue(err[1].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) + self.assertTrue(err[2].startswith('ERR')) + self.assertTrue(err[2].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + + def test_error(self): + status, out, err = self.get_logs(1) + self.assertTrue(len(out), 0) + self.assertTrue(len(err), 1) + self.assertTrue(err[0].startswith('ERR')) + self.assertTrue(err[0].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + + def test_silent(self): + status, out, err = self.get_logs(0) + self.assertTrue(len(out), 0) + self.assertTrue(len(err), 0) + + def test_file_logging(self): + status, out, err = self.get_logs(0) + f=open("test_logging.log", 'r') + lines=f.readlines() + f.close() + lout=[line.rstrip('\n') for line in lines] + self.assertTrue(len(lout), 6) + self.assertTrue(lout[0].startswith('TiGL log file created at')) + self.assertTrue(lout[1].startswith('WRN')) + self.assertTrue(lout[1].strip().endswith('CPACS dataset version is higher than TIGL library version!')) + self.assertTrue(lout[2].startswith('WRN')) + self.assertTrue(lout[2].strip().endswith("The points in profile PointListExampleAirfoil don't seem to be ordered in a mathematical positive sense.")) + self.assertTrue(lout[3].startswith('INF')) + self.assertTrue(lout[3].strip().endswith('No far-field defined.')) + self.assertTrue(lout[4].startswith('ERR')) + self.assertTrue(lout[4].strip().endswith('Error: Invalid uid in tiglWingComponentSegmentPointGetSegmentEtaXsi')) + +# ----------------------------------------------------------------------- # +# The following tests should only check, if the python api is correct. +# Correctness of TIGL functions is not tested here (this is done in the c-tests) +class TestTiglApi(unittest.TestCase): + def setUp(self): + self.tigl = Tigl() + self.tixi = Tixi() + self.tigl.logSetVerbosity(TiglLogLevel.TILOG_SILENT) + self.tixi.open('TestData/CPACS_21_D150.xml') + self.tigl.open(self.tixi, 'D150_VAMP') + + def tearDown(self): + self.tigl.close() + self.tixi.close() + + def test_getWingCount(self): + self.assertEqual(self.tigl.getWingCount(),3) + + def test_getFuselageCount(self): + self.assertEqual(self.tigl.getFuselageCount(),1) + + def test_wingGetSegmentCount(self): + self.assertEqual(self.tigl.wingGetSegmentCount(1),3) + self.assertEqual(self.tigl.wingGetSegmentCount(2),1) + self.assertEqual(self.tigl.wingGetSegmentCount(3),1) + + # check illegal wing index error handling + error = TiglReturnCode.TIGL_SUCCESS + try: + self.tigl.wingGetSegmentCount(-1); + except TiglException as e: + error = e.code + self.assertEqual(error, TiglReturnCode.TIGL_INDEX_ERROR) + + def test_wingGetComponentSegmentCount(self): + self.assertEqual(self.tigl.wingGetComponentSegmentCount(1),1) + self.assertEqual(self.tigl.wingGetComponentSegmentCount(2),1) + self.assertEqual(self.tigl.wingGetComponentSegmentCount(3),1) + + def test_wingGetComponentSegmentUID(self): + wingCompUID = self.tigl.wingGetComponentSegmentUID(1,1) + self.assertEqual(wingCompUID, 'D150_VAMP_W1_CompSeg1') + wingCompUID = self.tigl.wingGetComponentSegmentUID(2,1) + self.assertEqual(wingCompUID, 'D150_VAMP_HL1_CompSeg1') + wingCompUID = self.tigl.wingGetComponentSegmentUID(3,1) + self.assertEqual(wingCompUID, 'D150_VAMP_SL1_CompSeg1') + + def test_wingGetComponentSegmentIndex(self): + compSegIndex = self.tigl.wingGetComponentSegmentIndex(1,'D150_VAMP_W1_CompSeg1') + self.assertEqual(compSegIndex,1) + + def test_wingGetUpperPoint(self): + (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); + + def test_wingGetLowerPoint(self): + (x, y, z) = self.tigl.wingGetLowerPoint(1,1,0.5,0.5); + + def test_wingGetInnerConnectedSegmentCount(self): + segmentCount = self.tigl.wingGetInnerConnectedSegmentCount(1,1) + self.assertEqual(segmentCount,0) + + def test_wingGetOuterConnectedSegmentCount(self): + segmentCount = self.tigl.wingGetOuterConnectedSegmentCount(1,1) + self.assertEqual(segmentCount,1) + + def test_wingGetInnerConnectedSegmentIndex(self): + try: + segIndex = self.tigl.wingGetInnerConnectedSegmentIndex(1,1,0) + self.assertEqual(True, False) + except TiglException as e: + self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) + + def test_wingGetOuterConnectedSegmentIndex(self): + segIndex = self.tigl.wingGetOuterConnectedSegmentIndex(1,1,1) + self.assertEqual(segIndex,2) + + def test_wingGetInnerSectionAndElementIndex(self): + (secindex, elementindex) = self.tigl.wingGetInnerSectionAndElementIndex(1,1) + self.assertEqual(secindex, 1) + self.assertEqual(elementindex,1) + + def test_wingGetOuterSectionAndElementIndex(self): + (secindex, elementindex) = self.tigl.wingGetOuterSectionAndElementIndex(1,1) + self.assertEqual(secindex, 2) + self.assertEqual(elementindex,1) + + def test_wingGetInnerSectionAndElementUID(self): + (secUID, elementUID) = self.tigl.wingGetInnerSectionAndElementUID(1,1) + self.assertEqual(secUID, 'D150_VAMP_W1_Sec1') + self.assertEqual(elementUID, 'D150_VAMP_W1_Sec1_Elem1') + + def test_wingGetOuterSectionAndElementUID(self): + (secUID, elementUID) = self.tigl.wingGetOuterSectionAndElementUID(1,1) + self.assertEqual(secUID, 'D150_VAMP_W1_Sec2') + self.assertEqual(elementUID, 'D150_VAMP_W1_Sec2_Elem1') + + def test_wingGetProfileName(self): + profileName = self.tigl.wingGetProfileName(1,1,1) + self.assertEqual(profileName, 'NameD150_VAMP_W_SupCritProf1') + + def test_wingGetUID(self): + wingUID = self.tigl.wingGetUID(1) + self.assertEqual(wingUID, 'D150_VAMP_W1') + + def test_wingGetIndex(self): + wingIndex = self.tigl.wingGetIndex('D150_VAMP_W1') + self.assertEqual(wingIndex, 1) + + def test_wingGetSegmentUID(self): + segmentUID = self.tigl.wingGetSegmentUID(1,1) + self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') + + def test_wingGetSegmentIndex(self): + segmentIndex, wingIndex = self.tigl.wingGetSegmentIndex('D150_VAMP_W1_Seg1') + self.assertEqual(segmentIndex, 1) + self.assertEqual(wingIndex, 1) + + def test_wingGetSectionUID(self): + sectionUID = self.tigl.wingGetSectionUID(1,1) + self.assertEqual(sectionUID, 'D150_VAMP_W1_Sec1') + + def test_wingGetSymmetry(self): + symm = self.tigl.wingGetSymmetry(1) + self.assertEqual(symm, TiglSymmetryAxis.TIGL_X_Z_PLANE) + + def test_wingComponentSegmentFindSegment(self): + (x, y, z) = self.tigl.wingGetUpperPoint(1,1,0.5,0.5); + (segUID, wingUID) = self.tigl.wingComponentSegmentFindSegment('D150_VAMP_W1_CompSeg1',x,y,z) + self.assertEqual(segUID, 'D150_VAMP_W1_Seg1') + self.assertEqual(wingUID, 'D150_VAMP_W1') + + def test_wingComponentSegmentPointGetSegmentEtaXsi(self): + (wingUID, segmentUID, eta, xsi, errorDist) = self.tigl.wingComponentSegmentPointGetSegmentEtaXsi('D150_VAMP_W1_CompSeg1', 0.0, 0.0) + self.assertEqual(wingUID, 'D150_VAMP_W1') + self.assertEqual(segmentUID, 'D150_VAMP_W1_Seg1') + self.assertAlmostEqual(eta, 0.0) + self.assertAlmostEqual(xsi, 0.0) + self.assertAlmostEqual(errorDist, 0.0) + + def test_wingSegmentPointGetComponentSegmentEtaXsi(self): + (eta, xsi) = self.tigl.wingSegmentPointGetComponentSegmentEtaXsi('D150_VAMP_W1_Seg1', 'D150_VAMP_W1_CompSeg1', 0.0, 0.0) + self.assertAlmostEqual(eta, 0.0) + self.assertAlmostEqual(xsi, 0.0) + + def test_getFuselageCount(self): + fc = self.tigl.getFuselageCount() + self.assertEqual(fc,1) + + def test_fuselageGetSegmentCount(self): + sc = self.tigl.fuselageGetSegmentCount(1) + self.assertEqual(sc,59) + + def test_fuselageGetPoint(self): + for iseg in range(0,59): + (x,y,z) = self.tigl.fuselageGetPoint(1,iseg+1,0.5,0.5) + #check for illegal index + try: + self.tigl.fuselageGetPoint(1,60,0.5,0.5) + self.assertEqual(False, True) + except TiglException as e: + self.assertEqual(e.code, TiglReturnCode.TIGL_INDEX_ERROR) + + def test_fuselageGetPointAngle(self): + wingIDX = 1 + segIDX = 40 + (x,y,z) = self.tigl.fuselageGetPointAngle(wingIDX, segIDX, 0.5, 90.0) + + def test_fuselageGetPointAngleTranslated(self): + fuselIDX = 1 + segIDX = 40 + ytrans = 0.1; + ztrans = -0.1; + (x,y,z) = self.tigl.fuselageGetPointAngleTranslated(fuselIDX, segIDX, 0.5, 90.0, ytrans, ztrans) + + def test_fuselageGetPointOnXPlane(self): + fuselIDX = 1 + segIDX = 40 + zpos = 0.7 + (x,y,z) = self.tigl.fuselageGetPointOnXPlane(fuselIDX, segIDX, 0.5, zpos, 1) + self.assertAlmostEqual(zpos, z) + + def test_fuselageGetNumPointsOnXPlane(self): + fuselIDX = 1 + segIDX = 40 + zpos = 0.7 + num = self.tigl.fuselageGetNumPointsOnXPlane(fuselIDX, segIDX, 0.5, zpos) + self.assertGreater(num, 0) + + def test_fuselageGetPointOnYPlane(self): + fuselIDY = 1 + segIDY = 40 + zpos = 0.7 + (x,y,z) = self.tigl.fuselageGetPointOnYPlane(fuselIDY, segIDY, 0.5, zpos, 1) + self.assertAlmostEqual(zpos, z) + + def test_fuselageGetNumPointsOnYPlane(self): + fuselIDY = 1 + segIDY = 40 + zpos = 0.7 + num = self.tigl.fuselageGetNumPointsOnYPlane(fuselIDY, segIDY, 0.5, zpos) + self.assertGreater(num, 0) + +############################ ANFANG + def test_fuselageGetCircumference(self): + fuselageIndex = 1 + segmentIndex = 1 + eta = 0.5 + ret = self.tigl.fuselageGetCircumference(fuselageIndex, segmentIndex, eta) + self.assertEqual(isinstance(ret, float),True) + + def test_fuselageGetStartConnectedSegmentCount(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetStartConnectedSegmentCount(fuselageIndex, segmentIndex) + self.assertEqual(ret,0) + + def test_fuselageGetEndConnectedSegmentCount(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetEndConnectedSegmentCount(fuselageIndex, segmentIndex) + self.assertEqual(ret,1) + + def test_fuselageGetStartConnectedSegmentIndex(self): + fuselageIndex = 1 + segmentIndex = 2 + n = 1 + ret = self.tigl.fuselageGetStartConnectedSegmentIndex(fuselageIndex, segmentIndex, n) + self.assertEqual(ret,1) + + def test_fuselageGetEndConnectedSegmentIndex(self): + fuselageIndex = 1 + segmentIndex = 1 + n = 1 + ret = self.tigl.fuselageGetEndConnectedSegmentIndex(fuselageIndex, segmentIndex, n) + self.assertEqual(ret,2) + + def test_fuselageGetStartSectionAndElementUID(self): + fuselageIndex = 1 + segmentIndex = 1 + n = 1 + ret = self.tigl.fuselageGetStartSectionAndElementUID(fuselageIndex, segmentIndex) + self.assertEqual(ret,('D150_VAMP_FL1_Sec1', 'D150_VAMP_FL1_Sec1_Elem1')) + + def test_fuselageGetEndSectionAndElementUID(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetEndSectionAndElementUID(fuselageIndex, segmentIndex) + self.assertEqual(ret,('D150_VAMP_FL1_Sec2', 'D150_VAMP_FL1_Sec2_Elem1')) + + def test_fuselageGetStartSectionAndElementIndex(self): + fuselageIndex = 1 + segmentIndex = 2 + ret = self.tigl.fuselageGetStartSectionAndElementIndex(fuselageIndex, segmentIndex) + self.assertEqual(ret,(2,1)) + + def test_fuselageGetEndSectionAndElementIndex(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetEndSectionAndElementIndex(fuselageIndex, segmentIndex) + self.assertEqual(ret,(2,1)) + + def test_fuselageGetProfileName(self): + fuselageIndex = 1 + sectionIndex = 1 + elementIndex = 1 + ret = self.tigl.fuselageGetProfileName(fuselageIndex, sectionIndex, elementIndex) + self.assertEqual(ret,"Circle") + + def test_fuselageGetUID(self): + fuselageIndex = 1 + ret = self.tigl.fuselageGetUID(fuselageIndex) + self.assertEqual(ret,'D150_VAMP_FL1') + + def test_fuselageGetSegmentUID(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetSegmentUID(fuselageIndex, segmentIndex) + self.assertEqual(ret,'D150_VAMP_FL1_Seg1') + + def test_fuselageGetSectionUID(self): + fuselageIndex = 1 + sectionIndex = 1 + ret = self.tigl.fuselageGetSectionUID(fuselageIndex, sectionIndex) + self.assertEqual(isinstance(ret,str),True) + + def test_fuselageGetSymmetry(self): + fuselageIndex = 1 + ret = self.tigl.fuselageGetSymmetry(fuselageIndex) + self.assertEqual(ret,0) + +## Raises TiglException: TIGL_ERROR (1) (both give the same Error) +## def test_componentIntersectionPoint(self): +## print("IntersectionPoint") +## componentUidOne = self.tigl.fuselageGetUID(1) +## componentUidTwo = self.tigl.wingGetUID(1) +## lineID = 1 +## eta = 0.5 +## ret = self.tigl.componentIntersectionPoint(componentUidOne, componentUidTwo, lineID, eta) +## self.assertEqual((len(ret)==3),True) +## +## def test_componentIntersectionLineCount(self): +## print("IntersectionLine") +## componentUidOne = self.tigl.fuselageGetUID(1) +## componentUidTwo = self.tigl.wingGetUID(1) +## ret = self.tigl.componentIntersectionLineCount(componentUidOne, componentUidTwo) + + + def test_wingGetVolume(self): + wingIndex = 1 + ret = self.tigl.wingGetVolume(wingIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSegmentVolume(self): + wingIndex = 1 + segmentIndex = 1 + ret = self.tigl.wingGetSegmentVolume(wingIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_fuselageGetSegmentVolume(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetSegmentVolume(fuselageIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSurfaceArea(self): + wingIndex = 1 + ret = self.tigl.wingGetSurfaceArea(wingIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSegmentSurfaceArea(self): + wingIndex = 1 + segmentIndex = 1 + ret = self.tigl.wingGetSegmentSurfaceArea(wingIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_fuselageGetSegmentSurfaceArea(self): + fuselageIndex = 1 + segmentIndex = 1 + ret = self.tigl.fuselageGetSegmentSurfaceArea(fuselageIndex, segmentIndex) + self.assertEqual(isinstance(ret,float),True) + + def test_componentGetHashCode(self): + componentUID = self.tigl.wingGetUID(1) + ret = self.tigl.componentGetHashCode(componentUID) + self.assertEqual(isinstance(ret,int),True) + + def test_configurationGetLength(self): + ret = self.tigl.configurationGetLength() + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSpan(self): + wingUID = self.tigl.wingGetUID(1) + ret = self.tigl.wingGetSpan(wingUID) + self.assertEqual(isinstance(ret,float),True) + + def test_wingGetSurfaceArea(self): + area = self.tigl.wingGetSurfaceArea(1); + self.assertGreater(area, 125.) + self.assertLess(area, 135.) + + def test_wingGetReferenceArea(self): + area = self.tigl.wingGetReferenceArea(1, TiglSymmetryAxis.TIGL_X_Y_PLANE); + self.assertGreater(area, 60.) + self.assertLess(area, 70.) + + def test_exportMeshedWingVTKByIndex(self): + self.tigl.exportMeshedWingVTKByIndex(1, 'TestData/export/D150modelID_wing1_python.vtp', 0.01) + +###### SLOW Function, basically fuselage based due to complex fuselage geometry + def test_MergedTests(self): + if skipSlowFunctions: + return + print( "Slow Functions (14min)") + + #exportMeshedFuselageSTL + fuselageIndex = 1 + filenamePtr = "TestData/export/export2.stl" + deflection = 0.01 + self.tigl.exportMeshedFuselageSTL(fuselageIndex, filenamePtr, deflection) + + # Fuselage VTK by Index + fuselageIndex = 1 + filenamePtr = "TestData/export/export2.vtk" + deflection = 0.01 + self.tigl.exportMeshedFuselageVTKByIndex(fuselageIndex, filenamePtr, deflection) + + # Fuselage VTk by UID + fuselageUID = "D150_VAMP_FL1" + filenamePtr = "TestData/export/export3.vtk" + deflection = 0.01 + self.tigl.exportMeshedFuselageVTKByUID(fuselageUID, filenamePtr, deflection) + + # Fuselage Simple-VTK by UID + fuselageUID = "D150_VAMP_FL1" + filenamePtr ="TestData/export/export6.vtk" + deflection = 0.01 + self.tigl.exportMeshedFuselageVTKSimpleByUID(fuselageUID, filenamePtr, deflection) + + # Distance to ground + fuselageUID = self.tigl.fuselageGetUID(1) + axisPntX = 0 + axisPntY = 0 + axisPntZ = 10 + axisDirX = 0 + axisDirY = 0 + axisDirZ = 1 + angle = 0 + ret = self.tigl.fuselageGetMinumumDistanceToGround(fuselageUID, axisPntX, axisPntY, axisPntZ, axisDirX, axisDirY, axisDirZ, angle) + + # Volume + ret = self.tigl.fuselageGetVolume(fuselageIndex) + self.assertEqual(isinstance(ret,float),True) + + # Wetted Area + print("50%") + wingUID = self.tigl.wingGetUID(1) + ret = self.tigl.wingGetWettedArea(wingUID) + self.assertEqual(isinstance(ret,float),True) + + # Fuselage Surface Area + fuselageIndex = 1 + ret = self.tigl.fuselageGetSurfaceArea(fuselageIndex) + self.assertEqual(isinstance(ret,float),True) + print("100%") +# ----------------------------------------------------------------------- # +if __name__ == '__main__': + unittest.main() diff --git a/tests/unittests/runtests.sh.in b/tests/unittests/runtests.sh.in index 3c38f302db..bc45c7f072 100644 --- a/tests/unittests/runtests.sh.in +++ b/tests/unittests/runtests.sh.in @@ -1,14 +1,14 @@ -#!/bin/bash - -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ -export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ - -echo "Running unit tests..." -./TIGL-unittests - -# now run the python tests -echo $DYLD_LIBRARY_PATH -echo "Running python API tests..." -export PYTHONPATH=$PYTHONPATH:@LIBRARY_OUTPUT_PATH@:@TIXI_INCLUDE_DIRS@../share/tixi/python - -python pythonwrapper-tests.py +#!/bin/bash + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ +export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:@LIBRARY_OUTPUT_PATH@:@TIXI_LIB_PATH@ + +echo "Running unit tests..." +./TIGL-unittests + +# now run the python tests +echo $DYLD_LIBRARY_PATH +echo "Running python API tests..." +export PYTHONPATH=$PYTHONPATH:@LIBRARY_OUTPUT_PATH@:@TIXI_INCLUDE_DIRS@../share/tixi/python + +python pythonwrapper-tests.py From 15208bee562db7549c4167ec6be011136b8aff3f Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 18:26:30 +0100 Subject: [PATCH 064/122] revert stuff which where not intended to be changed in this issue --- src/cpacs_other/CCPACSAircraftModel.cpp | 2 +- src/math/CTiglIntersectBSplines.cpp | 8 ++++---- src/math/CTiglIntersectBSplines.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpacs_other/CCPACSAircraftModel.cpp b/src/cpacs_other/CCPACSAircraftModel.cpp index a40d4c9a3b..e80663a3ec 100644 --- a/src/cpacs_other/CCPACSAircraftModel.cpp +++ b/src/cpacs_other/CCPACSAircraftModel.cpp @@ -8,7 +8,7 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. -* You may obtain a copy of the License at +* You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/src/math/CTiglIntersectBSplines.cpp b/src/math/CTiglIntersectBSplines.cpp index 40700af85a..cc8e644ba2 100644 --- a/src/math/CTiglIntersectBSplines.cpp +++ b/src/math/CTiglIntersectBSplines.cpp @@ -319,12 +319,12 @@ namespace tigl std::vector IntersectBSplines(const Handle(Geom_BSplineCurve) curve1, const Handle(Geom_BSplineCurve) curve2, double tolerance) { - auto vessels = getRangesOfIntersection(curve1, curve2, tolerance); + auto hulls = getRangesOfIntersection(curve1, curve2, tolerance); std::list curve1_ints, curve2_ints; - for (const auto& vessel : vessels) { - curve1_ints.push_back(vessel.b1); - curve2_ints.push_back(vessel.b2); + for (const auto& hull : hulls) { + curve1_ints.push_back(hull.b1); + curve2_ints.push_back(hull.b2); } auto compare = [](const BoundingBox& b1, const BoundingBox& b2) { diff --git a/src/math/CTiglIntersectBSplines.h b/src/math/CTiglIntersectBSplines.h index e1b2325907..8799280b6c 100644 --- a/src/math/CTiglIntersectBSplines.h +++ b/src/math/CTiglIntersectBSplines.h @@ -40,7 +40,7 @@ struct CurveIntersectionResult * An intersection is counted, whenever the two curves come closer than tolerance. * If a whole interval is closes than tolerance, the nearest point in the interval is searched. * - * The function divides the input curves and checks, if their bounding boxes (convex vessels) + * The function divides the input curves and checks, if their bounding boxes (convex hulls) * intersect each other. If so, this process is repeated until the curve segment is almost a line segment. * This result is used to locally optimize into a true minimum. */ From 64b6cb78c0b3261324137a0d7f6a3b64f3bd9296 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 18:29:10 +0100 Subject: [PATCH 065/122] revert stuff which where not intended to be changed in this issue (v2) --- src/api/tigl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/tigl.h b/src/api/tigl.h index 49f2007654..87cca60ed4 100644 --- a/src/api/tigl.h +++ b/src/api/tigl.h @@ -232,9 +232,9 @@ TIGL_COMPONENT_ENGINE_PYLON, /**< The Component is a engine pylon */ TIGL_COMPONENT_ENGINE_NACELLE, /**< The Component is a engine nacelle */ TIGL_COMPONENT_FUSELAGE_WALL, /**< The Component is a fuselage wall */ TIGL_COMPONENT_CONTROL_SURFACE_DEVICE, /**< The component is a control surface device (flap) */ -TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ -TIGL_COMPONENT_TANK, /**< The Component is a fuselage tank */ -TIGL_COMPONENT_TANK_HULL, /**< The Component is a vessel of a fuselage tank */ +TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ +TIGL_COMPONENT_TANK, /**< The Component is a fuselage tank */ +TIGL_COMPONENT_TANK_HULL, /**< The Component is a vessel of a fuselage tank */ TIGL_COMPONENT_OTHER }; From bfd195b6bf3493f511abf6aab63ab275d45a69fa Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 18:32:17 +0100 Subject: [PATCH 066/122] revert stuff which where not intended to be changed in this issue (v3) --- src/cpacs_other/CCPACSMaterialDefinition.cpp | 124 +++++++++---------- src/cpacs_other/CCPACSMaterialDefinition.h | 104 ++++++++-------- 2 files changed, 114 insertions(+), 114 deletions(-) diff --git a/src/cpacs_other/CCPACSMaterialDefinition.cpp b/src/cpacs_other/CCPACSMaterialDefinition.cpp index 34befce0d7..db0f743b40 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.cpp +++ b/src/cpacs_other/CCPACSMaterialDefinition.cpp @@ -1,62 +1,62 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2013-05-28 Martin Siggel -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include "CCPACSMaterialDefinition.h" - -#include "CTiglError.h" - -namespace tigl -{ -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} -CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} - - -bool CCPACSMaterialDefinition::isComposite() const -{ - if (m_compositeUID_choice1) { - return true; - } else if (m_materialUID_choice2) { - return false; - } else { - throw CTiglError("Neither materialUID nor compositeUID specified", TIGL_ERROR); - } -} - -const std::string& CCPACSMaterialDefinition::GetUID() const -{ - if (isComposite()) - return *GetCompositeUID_choice1(); - else - return *GetMaterialUID_choice2(); -} - -void CCPACSMaterialDefinition::SetUID(const std::string& uid) -{ - if (isComposite()) - return SetCompositeUID_choice1(uid); - else - return SetMaterialUID_choice2(uid); -} - -} // namespace tigl +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2013-05-28 Martin Siggel +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "CCPACSMaterialDefinition.h" + +#include "CTiglError.h" + +namespace tigl +{ +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} +CCPACSMaterialDefinition::CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr) : generated::CPACSMaterialDefinition(parent, uidMgr) {} + + +bool CCPACSMaterialDefinition::isComposite() const +{ + if (m_compositeUID_choice1) { + return true; + } else if (m_materialUID_choice2) { + return false; + } else { + throw CTiglError("Neither materialUID nor compositeUID specified", TIGL_ERROR); + } +} + +const std::string& CCPACSMaterialDefinition::GetUID() const +{ + if (isComposite()) + return *GetCompositeUID_choice1(); + else + return *GetMaterialUID_choice2(); +} + +void CCPACSMaterialDefinition::SetUID(const std::string& uid) +{ + if (isComposite()) + return SetCompositeUID_choice1(uid); + else + return SetMaterialUID_choice2(uid); +} + +} // namespace tigl diff --git a/src/cpacs_other/CCPACSMaterialDefinition.h b/src/cpacs_other/CCPACSMaterialDefinition.h index 173260dfaf..58de1219df 100644 --- a/src/cpacs_other/CCPACSMaterialDefinition.h +++ b/src/cpacs_other/CCPACSMaterialDefinition.h @@ -1,52 +1,52 @@ -/* -* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) -* -* Created: 2013-05-28 Martin Siggel -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef CCPACSMATERIAL_H -#define CCPACSMATERIAL_H - -#include "generated/CPACSMaterialDefinition.h" -#include -#include "tixi.h" -#include "tigl_internal.h" -#include "CTiglPoint.h" - -namespace tigl -{ - -class CCPACSMaterialDefinition : public generated::CPACSMaterialDefinition -{ -public: - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT bool isComposite() const; - - TIGL_EXPORT const std::string& GetUID() const; - - TIGL_EXPORT void SetUID(const std::string& uid); -}; - -} // namespace tigl - -#endif // CCPACSMATERIAL_H +/* +* Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) +* +* Created: 2013-05-28 Martin Siggel +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef CCPACSMATERIAL_H +#define CCPACSMATERIAL_H + +#include "generated/CPACSMaterialDefinition.h" +#include +#include "tixi.h" +#include "tigl_internal.h" +#include "CTiglPoint.h" + +namespace tigl +{ + +class CCPACSMaterialDefinition : public generated::CPACSMaterialDefinition +{ +public: + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSLateralCap* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSSheetBasedStructuralElement* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSTrackActuator* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWeb* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCell* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingRibCrossSection* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSMaterialDefinition(CCPACSWingSkin* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT bool isComposite() const; + + TIGL_EXPORT const std::string& GetUID() const; + + TIGL_EXPORT void SetUID(const std::string& uid); +}; + +} // namespace tigl + +#endif // CCPACSMATERIAL_H From 550edea3fe91ed34cba66b846cf7fed7e7717ba4 Mon Sep 17 00:00:00 2001 From: alde_ma Date: Sat, 8 Feb 2025 18:54:57 +0100 Subject: [PATCH 067/122] extend framesAssembly by vessels --- src/fuselage/CCPACSFramesAssembly.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fuselage/CCPACSFramesAssembly.cpp b/src/fuselage/CCPACSFramesAssembly.cpp index b88fdc8a8a..229df8466c 100644 --- a/src/fuselage/CCPACSFramesAssembly.cpp +++ b/src/fuselage/CCPACSFramesAssembly.cpp @@ -19,6 +19,7 @@ #include "CCPACSFrame.h" #include "CCPACSFuselage.h" #include "CCPACSDuct.h" +#include "CCPACSVessel.h" #include "ITiglFuselageDuctStructure.h" namespace tigl @@ -44,9 +45,12 @@ void CCPACSFramesAssembly::Invalidate(const boost::optional& source m_frames[i]->Invalidate(source); } -// ToDo: Add vessels + CTiglRelativelyPositionedComponent const* CCPACSFramesAssembly::GetParentComponent() const { + if (IsParent()) { + return GetParent()->GetParent(); + } if (IsParent()) { return GetParent()->GetParent(); } From 0f762f74ee52b2d7ddb28a4a29e53cacaac78b9c Mon Sep 17 00:00:00 2001 From: alde_ma Date: Mon, 10 Feb 2025 23:21:53 +0100 Subject: [PATCH 068/122] remove incomplete test artifacts --- tests/unittests/tiglTanks.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index a9fc91cbb7..cbe572e269 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -270,11 +270,6 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_EQ(vessel_segments->GetGetPointBehavior(), onLinearLoft); } -TEST_F(FuelTanks, parametric_vessel) -{ - auto& loft = vessel_parametric->GetLoft(); -} - TEST_F(FuelTanks, structure) { auto& structure = vessel_segments->GetStructure(); @@ -286,5 +281,4 @@ TEST_F(FuelTanks, structure) TEST_F(FuelTanks, walls) { EXPECT_EQ(wall_in_fuselage->GetUID().get(), "wall_fuselage"); - auto loft = wall_in_fuselage->GetLoft(); } From 4dd4bfa75c36e66e2cf01bfff8379a5d788a4c3b Mon Sep 17 00:00:00 2001 From: alde_ma Date: Mon, 10 Feb 2025 23:33:58 +0100 Subject: [PATCH 069/122] add more meaningful structure tests --- tests/unittests/tiglTanks.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index cbe572e269..b9bec82d1e 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -100,8 +100,6 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); tigl::CCPACSVessel* vessel_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); - tigl::CCPACSWallSegment* wall_in_fuselage = &uidMgr.ResolveObject("wall_fuselage"); - const char* tankTypeExceptionString = "This method is only available for vessels with segments. No segment found."; }; @@ -272,13 +270,12 @@ TEST_F(FuelTanks, vessel_loft_evaluation) TEST_F(FuelTanks, structure) { - auto& structure = vessel_segments->GetStructure(); + auto& structure_with_walls = vessel_isotensoid->GetStructure(); + auto& structure_with_stringer_frames = vessel_segments->GetStructure(); - EXPECT_EQ(structure->GetFrames()->GetFrames().size(), 1); - EXPECT_EQ(structure->GetUID(), "outerVesselStructure"); -} + EXPECT_EQ(structure_with_stringer_frames->GetFrames()->GetFrames().size(), 1); + EXPECT_EQ(structure_with_stringer_frames->GetStringers()->GetStringers().size(), 1); -TEST_F(FuelTanks, walls) -{ - EXPECT_EQ(wall_in_fuselage->GetUID().get(), "wall_fuselage"); + EXPECT_EQ(structure_with_walls->GetUID(), "tank5_structure"); + EXPECT_EQ(structure_with_walls->GetWalls()->GetWallSegments().GetWallSegments().size(), 3); } From 1f6fc5e67446190454390eee41fb1590d4ea7bb2 Mon Sep 17 00:00:00 2001 From: Alder Date: Sat, 15 Feb 2025 18:19:17 +0100 Subject: [PATCH 070/122] remove commeted includes which where not used --- tests/unittests/tiglTanks.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index b9bec82d1e..8042fae16a 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -30,23 +30,6 @@ #include "CCPACSVessel.h" -// #include "generated/CPACSVessels.h" -// #include "generated/CPACSVessel.h" - -// #include "CNamedShape.h" -// #include "tiglcommonfunctions.h" - -// #include -// #include -// #include - -// #include - -// #include -// #include - -// #include - class FuelTanks : public ::testing::Test { protected: From e37ca94fe349ecce1206115f9ef97358a94ad842 Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 23 Mar 2025 15:44:54 +0100 Subject: [PATCH 071/122] add test for BuildFace(segment.GetStartWire) --- tests/unittests/tiglTanks.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 8042fae16a..75fa818b1b 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -198,6 +198,7 @@ TEST_F(FuelTanks, vessel_sections) CheckExceptionMessage([&]() { vessel_segments->GetSection(4); }, invalidIndexMessage); CheckExceptionMessage([&]() { vessel_parametric->GetSection(2); }, tankTypeExceptionString); + EXPECT_NO_THROW(vessel_segments->GetSectionFace("outerVessel_section1")); EXPECT_NO_THROW(vessel_segments->GetSectionFace("outerVessel_section3")); CheckExceptionMessage([&]() { vessel_segments->GetSectionFace("wrongSectionUID"); }, wrongSectionUIDMessage); CheckExceptionMessage([&]() { vessel_parametric->GetSectionFace("outerVessel_section3"); }, tankTypeExceptionString); From cea6a1acefd63a9503bfbde80449639b2cc64203 Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 23 Mar 2025 17:21:28 +0100 Subject: [PATCH 072/122] add tests for GetSegment --- tests/unittests/tiglTanks.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 75fa818b1b..9a927f9262 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -201,7 +201,8 @@ TEST_F(FuelTanks, vessel_sections) EXPECT_NO_THROW(vessel_segments->GetSectionFace("outerVessel_section1")); EXPECT_NO_THROW(vessel_segments->GetSectionFace("outerVessel_section3")); CheckExceptionMessage([&]() { vessel_segments->GetSectionFace("wrongSectionUID"); }, wrongSectionUIDMessage); - CheckExceptionMessage([&]() { vessel_parametric->GetSectionFace("outerVessel_section3"); }, tankTypeExceptionString); + CheckExceptionMessage([&]() { vessel_parametric->GetSectionFace("outerVessel_section3"); }, + tankTypeExceptionString); } TEST_F(FuelTanks, vessel_segments) @@ -209,8 +210,12 @@ TEST_F(FuelTanks, vessel_segments) EXPECT_EQ(vessel_segments->GetSegmentCount(), 2); EXPECT_EQ(vessel_parametric->GetSegmentCount(), 0); + const tigl::CCPACSVessel* const_vessel_parametric = vessel_parametric; + EXPECT_NO_THROW(vessel_segments->GetSegment(1)); CheckExceptionMessage([&]() { vessel_parametric->GetSegment(1); }, tankTypeExceptionString); + CheckExceptionMessage([&]() { const_vessel_parametric->GetSegment(1); }, tankTypeExceptionString); + CheckExceptionMessage([&]() { vessel_parametric->GetSegment("outerVessel_segment1"); }, tankTypeExceptionString); EXPECT_NO_THROW(vessel_segments->GetSegment("outerVessel_segment1")); CheckExceptionMessage([&]() { vessel_segments->GetSegment(3); }, @@ -254,7 +259,7 @@ TEST_F(FuelTanks, vessel_loft_evaluation) TEST_F(FuelTanks, structure) { - auto& structure_with_walls = vessel_isotensoid->GetStructure(); + auto& structure_with_walls = vessel_isotensoid->GetStructure(); auto& structure_with_stringer_frames = vessel_segments->GetStructure(); EXPECT_EQ(structure_with_stringer_frames->GetFrames()->GetFrames().size(), 1); From 822121665bb33e6690d87c6a103c6c2d1145c665 Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 23 Mar 2025 20:02:22 +0100 Subject: [PATCH 073/122] add tests for vessel exception handling --- .../TestData/simpletest-fuelTanks.cpacs.xml | 14 ++++++++++++++ tests/unittests/test_fuelTanks.py | 4 ++-- tests/unittests/tiglTanks.cpp | 17 +++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 88c4fa3d80..50b4fe97dc 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -803,6 +803,20 @@ + + Corrupt tank + Test case exception handling + SimpleFuselage + + + + Vessel with wrong geometry + + 0.4 + 1. + + + diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 72431b97d4..673a0c3c24 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -40,7 +40,7 @@ def tearDown(self): def test_configuration(self): tank1_uID = "tank1" - self.assertEqual(self.config.get_fuel_tanks_count(), 6) + self.assertEqual(self.config.get_fuel_tanks_count(), 7) self.assertIsInstance( self.config.get_fuel_tank(1), configuration.CCPACSFuelTank ) @@ -72,7 +72,7 @@ def test_fuelTanks(self): fuelTanks.get_fuel_tank_index(tank1_uID), 1, ) - self.assertEqual(fuelTanks.get_fuel_tanks_count(), 6) + self.assertEqual(fuelTanks.get_fuel_tanks_count(), 7) # Test availability of generated class: self.assertIsInstance(fuelTanks, configuration.CCPACSFuelTanks) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 9a927f9262..b57a1c4f11 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -83,6 +83,8 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); tigl::CCPACSVessel* vessel_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); + tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("tank_corrupt_vessel"); + const char* tankTypeExceptionString = "This method is only available for vessels with segments. No segment found."; }; @@ -107,7 +109,7 @@ TEST_F(FuelTanks, configuration) { auto& config = fuelTank->GetConfiguration(); std::string uID = "tank1"; - EXPECT_EQ(config.GetFuelTanksCount(), 6); + EXPECT_EQ(config.GetFuelTanksCount(), 7); EXPECT_EQ(config.GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(config.GetFuelTank(uID)); EXPECT_EQ(config.GetFuelTankIndex(uID), 1); @@ -120,7 +122,7 @@ TEST_F(FuelTanks, fuelTanks) EXPECT_EQ(fuelTanks->GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(fuelTanks->GetFuelTank(uID)); EXPECT_EQ(fuelTanks->GetFuelTankIndex(uID), 1); - EXPECT_EQ(fuelTanks->GetFuelTanksCount(), 6); + EXPECT_EQ(fuelTanks->GetFuelTanksCount(), 7); } TEST_F(FuelTanks, fuelTank) @@ -184,6 +186,9 @@ TEST_F(FuelTanks, vessel_type_info) EXPECT_FALSE(vessel_isotensoid->HasEllipsoidDome()); EXPECT_FALSE(vessel_isotensoid->HasTorisphericalDome()); EXPECT_TRUE(vessel_isotensoid->HasIsotensoidDome()); + + EXPECT_THROW(vessel_corrupt->IsVesselViaSegments(), tigl::CTiglError); + EXPECT_THROW(vessel_corrupt->IsVesselViaDesignParameters(), tigl::CTiglError); } TEST_F(FuelTanks, vessel_sections) @@ -234,6 +239,14 @@ TEST_F(FuelTanks, vessel_guide_curves) EXPECT_EQ(vessel_guides->GetGuideCurveSegment("tank2_seg1_upper").GetGuideCurveProfileUID(), "gc_upper"); CheckExceptionMessage([&]() { vessel_parametric->GetGuideCurveSegment("tank2_seg1_upper"); }, tankTypeExceptionString); + + CheckExceptionMessage([&]() { vessel_segments->GetGuideCurveSegment("not_existing_guide_curve"); }, + "Guide Curve with UID not_existing_guide_curve does not exists"); +} + +TEST_F(FuelTanks, vessel_loft_algo) +{ + EXPECT_THROW(vessel_corrupt->GetLoft(), tigl::CTiglError); } TEST_F(FuelTanks, vessel_loft_evaluation) From c299238b9068cc7091206637085f341c969f76d1 Mon Sep 17 00:00:00 2001 From: Alder Date: Sun, 23 Mar 2025 21:23:13 +0100 Subject: [PATCH 074/122] change short shape name letters --- src/fuelTanks/CCPACSFuelTank.cpp | 2 +- src/fuelTanks/CCPACSVessel.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 3b9cc64ff8..28852de1f5 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -79,7 +79,7 @@ std::string CCPACSFuelTank::GetShortShapeName() const if (GetUID() == t->GetUID()) { findex = i; std::stringstream shortName; - shortName << "D" << findex; + shortName << "T" << findex; return shortName.str(); } } diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 1eac6b2da5..b0f5f9da42 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -634,12 +634,12 @@ std::string CCPACSVessel::GetShortShapeName() const unsigned int findex = 0; unsigned int i = 0; - for (auto& h : GetParent()->GetVessels()) { + for (auto& v : GetParent()->GetVessels()) { ++i; - if (GetUID() == h->GetUID()) { + if (GetUID() == v->GetUID()) { findex = i; std::stringstream shortName; - shortName << "H" << findex; + shortName << "V" << findex; return shortName.str(); } } From e5dbe730246a2e36fa7d856eaecaba1bd02ff16f Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 24 Mar 2025 10:09:30 +0100 Subject: [PATCH 075/122] add tests for CCPACSFuelTanks exceptions. Also small code changes. --- src/fuelTanks/CCPACSFuelTanks.cpp | 6 +++--- tests/unittests/tiglTanks.cpp | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/fuelTanks/CCPACSFuelTanks.cpp b/src/fuelTanks/CCPACSFuelTanks.cpp index fd69dd8d56..836cd79b0e 100644 --- a/src/fuelTanks/CCPACSFuelTanks.cpp +++ b/src/fuelTanks/CCPACSFuelTanks.cpp @@ -44,12 +44,12 @@ CCPACSFuelTank const& CCPACSFuelTanks::GetFuelTank(std::string const& uID) const CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(std::string const& uID) { auto it = std::find_if(m_fuelTanks.begin(), m_fuelTanks.end(), - [&](std::unique_ptr const& v) { return v->GetUID() == uID; }); + [&](std::unique_ptr const& t) { return t->GetUID() == uID; }); if (it != std::end(m_fuelTanks)) { return **it; } - throw CTiglError("Could not find fuelTank with uid" + uID); + throw CTiglError("Could not find fuelTank with uid " + uID, TIGL_UID_ERROR); } CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(int index) const @@ -69,7 +69,7 @@ int CCPACSFuelTanks::GetFuelTankIndex(const std::string& uID) const return i + 1; } } - throw CTiglError("Invalid UID in CCPACSFuelTanks::GetFuelTankIndex", TIGL_UID_ERROR); + throw CTiglError("Could not find fuelTank with uid " + uID, TIGL_UID_ERROR); } } //namespace tigl diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index b57a1c4f11..567dbde315 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -113,6 +113,14 @@ TEST_F(FuelTanks, configuration) EXPECT_EQ(config.GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(config.GetFuelTank(uID)); EXPECT_EQ(config.GetFuelTankIndex(uID), 1); + + CheckExceptionMessage([&]() { config.GetFuelTank("not_existing_tank"); }, + "Could not find fuelTank with uid not_existing_tank"); + + CheckExceptionMessage([&]() { config.GetFuelTankIndex("not_existing_tank"); }, + "Could not find fuelTank with uid not_existing_tank"); + + CheckExceptionMessage([&]() { config.GetFuelTank(99); }, "Invalid index in CCPACSFuelTanks::GetFuelTank"); } TEST_F(FuelTanks, fuelTanks) From d2665086388f49964497d74712dc6fb089d3d411 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 24 Mar 2025 12:14:57 +0100 Subject: [PATCH 076/122] add tests for exceptions in ccpacsvessels --- src/fuelTanks/CCPACSVessels.cpp | 4 ++-- tests/unittests/tiglTanks.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/fuelTanks/CCPACSVessels.cpp b/src/fuelTanks/CCPACSVessels.cpp index 58e89cdf38..75c47c235a 100644 --- a/src/fuelTanks/CCPACSVessels.cpp +++ b/src/fuelTanks/CCPACSVessels.cpp @@ -49,7 +49,7 @@ CCPACSVessel& CCPACSVessels::GetVessel(std::string const& uID) if (it != std::end(m_vessels)) { return **it; } - throw CTiglError("Could not find vessel with uid" + uID); + throw CTiglError("Could not find vessel with uid " + uID, TIGL_UID_ERROR); } CCPACSVessel& CCPACSVessels::GetVessel(int index) const @@ -69,7 +69,7 @@ int CCPACSVessels::GetVesselIndex(const std::string& uID) const return i + 1; } } - throw CTiglError("Invalid UID in CCPACSVessels::GetVesselIndex", TIGL_UID_ERROR); + throw CTiglError("Could not find vessel with uid " + uID, TIGL_UID_ERROR); } } //namespace tigl diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 567dbde315..47921bd7bd 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -149,6 +149,14 @@ TEST_F(FuelTanks, vessels) EXPECT_EQ(vessels.GetVessel("tank1_outerVessel").GetDefaultedUID(), "tank1_outerVessel"); EXPECT_EQ(vessels.GetVesselIndex("tank1_outerVessel"), 1); EXPECT_EQ(vessels.GetVessels().at(0)->GetDefaultedUID(), "tank1_outerVessel"); + + CheckExceptionMessage([&]() { vessels.GetVessel("not_existing_vessel"); }, + "Could not find vessel with uid not_existing_vessel"); + + CheckExceptionMessage([&]() { vessels.GetVesselIndex("not_existing_vessel"); }, + "Could not find vessel with uid not_existing_vessel"); + + CheckExceptionMessage([&]() { vessels.GetVessel(99); }, "Invalid index in CCPACSVessels::GetVessel"); } TEST_F(FuelTanks, vessel_general) From fd59074d96129c4043469a55536b2b98b5ad2df4 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 24 Mar 2025 13:55:29 +0100 Subject: [PATCH 077/122] add tests for parametric lofts --- tests/unittests/tiglTanks.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 47921bd7bd..84e5599ec2 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -260,18 +260,19 @@ TEST_F(FuelTanks, vessel_guide_curves) "Guide Curve with UID not_existing_guide_curve does not exists"); } -TEST_F(FuelTanks, vessel_loft_algo) -{ - EXPECT_THROW(vessel_corrupt->GetLoft(), tigl::CTiglError); -} - TEST_F(FuelTanks, vessel_loft_evaluation) { EXPECT_NEAR(vessel_segments->GetGeometricVolume(), 6.57, 1e-2); - EXPECT_NEAR(vessel_parametric->GetGeometricVolume(), 18.1, 1e-2); + EXPECT_NEAR(vessel_spherical->GetGeometricVolume(), 18.1, 1e-2); + EXPECT_NEAR(vessel_ellipsoid->GetGeometricVolume(), 5.43, 1e-2); + EXPECT_NEAR(vessel_torispherical->GetGeometricVolume(), 7.87, 1e-2); + EXPECT_NEAR(vessel_isotensoid->GetGeometricVolume(), 9.01, 1e-2); EXPECT_NEAR(vessel_segments->GetSurfaceArea(), 11.15, 1e-2); - EXPECT_NEAR(vessel_parametric->GetSurfaceArea(), 36.19, 1e-2); + EXPECT_NEAR(vessel_spherical->GetSurfaceArea(), 36.19, 1e-2); + EXPECT_NEAR(vessel_ellipsoid->GetSurfaceArea(), 16.22, 1e-2); + EXPECT_NEAR(vessel_torispherical->GetSurfaceArea(), 20.49, 1e-2); + EXPECT_NEAR(vessel_isotensoid->GetSurfaceArea(), 22.40, 1e-2); EXPECT_NEAR(vessel_segments->GetCircumference(1, 0.5), 7.43, 1e-2); CheckExceptionMessage([&]() { vessel_parametric->GetCircumference(1, 0.5); }, tankTypeExceptionString); @@ -284,6 +285,8 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_EQ(vessel_segments->GetGetPointBehavior(), asParameterOnSurface); EXPECT_NO_THROW(vessel_segments->SetGetPointBehavior(onLinearLoft)); EXPECT_EQ(vessel_segments->GetGetPointBehavior(), onLinearLoft); + + EXPECT_THROW(vessel_corrupt->GetLoft(), tigl::CTiglError); } TEST_F(FuelTanks, structure) From 191011fd182c0e9f35116c58fe650b91f5bf4322 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:12:30 +0100 Subject: [PATCH 078/122] fuelTank: add tests, add invalidation stuff --- src/fuelTanks/CCPACSFuelTank.cpp | 15 +++++++++++++++ src/fuelTanks/CCPACSFuelTank.h | 9 ++++++++- tests/unittests/tiglTanks.cpp | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 28852de1f5..48949ec547 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -23,6 +23,7 @@ #include "CCPACSVessel.h" #include "CTiglError.h" #include "CGroupShapes.h" +#include "CNamedShape.h" namespace tigl { @@ -65,6 +66,8 @@ PNamedShape CCPACSFuelTank::BuildLoft() const } PNamedShape groupedShape = CGroupShapes(shapes); + groupedShape->SetName(GetUID().c_str()); + groupedShape->SetShortName(GetShortShapeName().c_str()); return groupedShape; } @@ -86,4 +89,16 @@ std::string CCPACSFuelTank::GetShortShapeName() const return "UNKNOWN"; } +void CCPACSFuelTank::RegisterInvalidationCallback(std::function const& fn){ + invalidationCallbacks.push_back(fn); +} + +void CCPACSFuelTank::InvalidateImpl(const boost::optional&) const +{ + CTiglAbstractGeometricComponent::Reset(); + for (auto const& invalidator: invalidationCallbacks) { + invalidator(); + } +} + } //namespace tigl diff --git a/src/fuelTanks/CCPACSFuelTank.h b/src/fuelTanks/CCPACSFuelTank.h index e13456866c..0c6ebf54f7 100644 --- a/src/fuelTanks/CCPACSFuelTank.h +++ b/src/fuelTanks/CCPACSFuelTank.h @@ -39,11 +39,18 @@ class CCPACSFuelTank : public generated::CPACSFuelTank, public CTiglRelativelyPo TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; -private: + TIGL_EXPORT void RegisterInvalidationCallback(std::function const&); + +protected: PNamedShape BuildLoft() const override; private: + + virtual void InvalidateImpl(const boost::optional&) const override; + std::string GetShortShapeName() const; + + std::vector> invalidationCallbacks; }; } //namespace tigl diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 84e5599ec2..2cdf3bbad2 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -29,6 +29,7 @@ #include "CTiglUIDManager.h" #include "CCPACSVessel.h" +#include "CNamedShape.h" class FuelTanks : public ::testing::Test { @@ -139,6 +140,13 @@ TEST_F(FuelTanks, fuelTank) const std::string name = fuelTank->GetName(); EXPECT_EQ(name, "Simple tank 1"); + + EXPECT_EQ(fuelTank->GetComponentType(), TIGL_COMPONENT_TANK); + + const auto loft = fuelTank->GetLoft(); + ASSERT_NE(loft, nullptr); + EXPECT_EQ(loft->Name(), "tank1"); + EXPECT_EQ(loft->ShortName(), "T1"); } // ToDo: Check how to use pointer -> From c3b3bdba7b2b79f9459d956d204b63652f312d3b Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:45:00 +0100 Subject: [PATCH 079/122] add tests for fuelTank --- tests/unittests/tiglTanks.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 2cdf3bbad2..a4345a749e 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -31,6 +31,15 @@ #include "CCPACSVessel.h" #include "CNamedShape.h" +class DummyAircraftModel : public tigl::CCPACSAircraftModel +{ +public: + DummyAircraftModel() + : tigl::CCPACSAircraftModel(nullptr, nullptr) + { + } +}; + class FuelTanks : public ::testing::Test { protected: @@ -143,10 +152,26 @@ TEST_F(FuelTanks, fuelTank) EXPECT_EQ(fuelTank->GetComponentType(), TIGL_COMPONENT_TANK); + // Test loft building const auto loft = fuelTank->GetLoft(); ASSERT_NE(loft, nullptr); EXPECT_EQ(loft->Name(), "tank1"); EXPECT_EQ(loft->ShortName(), "T1"); + + // Test return of UNKNOWN ShortName + DummyAircraftModel dummyAircraft; + tigl::CTiglUIDManager dummyUidMgr; + tigl::CCPACSFuelTanks dummyTanks(&dummyAircraft, &dummyUidMgr); + tigl::CCPACSFuelTank dummyTank(&dummyTanks, &dummyUidMgr); + dummyTank.SetUID("not_in_list"); + const auto dummyLoft = dummyTank.GetLoft(); + EXPECT_EQ(dummyLoft->ShortName(), "UNKNOWN"); + + // Test invalidation + bool called = false; + dummyTank.RegisterInvalidationCallback([&]() { called = true; }); + dummyTank.Invalidate(); + EXPECT_TRUE(called); } // ToDo: Check how to use pointer -> From 08bda42d34f91372b52c4c6e82e1f778f54c118f Mon Sep 17 00:00:00 2001 From: Alder Date: Thu, 27 Mar 2025 22:25:44 +0100 Subject: [PATCH 080/122] add test for tank with symmetric profiles --- src/fuelTanks/CCPACSVessel.cpp | 34 ++++----- .../TestData/simpletest-fuelTanks.cpacs.xml | 76 ++++++++++++++++++- tests/unittests/test_fuelTanks.py | 4 +- tests/unittests/tiglTanks.cpp | 22 +++++- 4 files changed, 109 insertions(+), 27 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index b0f5f9da42..9de438db54 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -648,31 +648,27 @@ std::string CCPACSVessel::GetShortShapeName() const void CCPACSVessel::SetFaceTraits(PNamedShape loft) const { - int nFacesTotal = GetNumberOfFaces(loft->Shape()); - int nFacesAero = nFacesTotal; - bool hasSymmetryPlane = GetNumberOfEdges(m_segments_choice1.get().GetSegment(1).GetEndWire()) > 1; + int nFacesTotal = GetNumberOfFaces(loft->Shape()); + int nFacesAero = nFacesTotal; - std::vector names; - names.push_back(loft->Name()); - names.push_back("symmetry"); - names.push_back("Front"); - names.push_back("Rear"); + auto& segments = m_segments_choice1.get(); + int nSegments = segments.GetSegmentCount(); - if (!CTiglTopoAlgorithms::IsDegenerated(m_segments_choice1.get().GetSegment(1).GetStartWire())) { - nFacesAero -= 1; + bool hasSymmetryPlane = GetNumberOfEdges(segments.GetSegment(1).GetEndWire()) > 1; + + std::array names = {loft->Name(), "symmetry", "Front", "Rear"}; + + if (!CTiglTopoAlgorithms::IsDegenerated(segments.GetSegment(1).GetStartWire())) { + nFacesAero--; } - if (!CTiglTopoAlgorithms::IsDegenerated( - m_segments_choice1.get().GetSegment(m_segments_choice1.get().GetSegmentCount()).GetEndWire())) { - nFacesAero -= 1; + if (!CTiglTopoAlgorithms::IsDegenerated(segments.GetSegment(nSegments).GetEndWire())) { + nFacesAero--; } - // if we have a smooth surface, the whole fuslage is treatet as one segment - int nSegments = m_segments_choice1.get().GetSegmentCount(); - int facesPerSegment = nFacesAero / nSegments; + int iFaceTotal = 0; + int nSymmetryFaces = hasSymmetryPlane ? 1 : 0; - int iFaceTotal = 0; - int nSymmetryFaces = (int)hasSymmetryPlane; for (int iSegment = 0; iSegment < nSegments; ++iSegment) { for (int iFace = 0; iFace < facesPerSegment - nSymmetryFaces; ++iFace) { loft->FaceTraits(iFaceTotal++).SetName(names[0].c_str()); @@ -682,7 +678,7 @@ void CCPACSVessel::SetFaceTraits(PNamedShape loft) const } } - // set the caps + // Front and rear caps int iFace = 2; for (; iFaceTotal < nFacesTotal; ++iFaceTotal) { loft->FaceTraits(iFaceTotal).SetName(names[iFace++].c_str()); diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 50b4fe97dc..5fe852d4a1 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -84,7 +84,7 @@ Fuselage Positioning 3 - 15. + 17. 90 0 fuselage_section2 @@ -803,15 +803,76 @@ + + Simple tank with symmetric profile + This tank contains a a symmetrical profile. This is not really recommended in CPACS anymore, but as long as it is implemented in TiGL it should be subject to unit testing. + SimpleFuselage + + + 17 + + + + + Symmetric vessel + + + 1 + 1.2 + 1.2 + + + +

+ Section 1 + + + 0 + + + + + Section 1 Element 1 + fuselageHalfCircleProfile + + + +
+
+ Section 2 + + + 1 + + + + + Section 2 Element 1 + fuselageHalfCircleProfile + + + +
+ + + + Outer vessel Segment 1 + symmetricVessel_section1_element1 + symmetricVessel_section2_element1 + + +
+ + Corrupt tank Test case exception handling SimpleFuselage - + Vessel with wrong geometry - + 0.4 1. @@ -842,6 +903,15 @@ 1.0;0.0;-1.0;0.0;1.0 + + Half Circle + Profile build up from set of Points on half circle where may Dimensions are 1..-1 + + 0.0;0.0;0.0 + 0.0;1.0;0.0 + -1.0;0.0;1.0 + + diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 673a0c3c24..9671e63d3d 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -40,7 +40,7 @@ def tearDown(self): def test_configuration(self): tank1_uID = "tank1" - self.assertEqual(self.config.get_fuel_tanks_count(), 7) + self.assertEqual(self.config.get_fuel_tanks_count(), 8) self.assertIsInstance( self.config.get_fuel_tank(1), configuration.CCPACSFuelTank ) @@ -72,7 +72,7 @@ def test_fuelTanks(self): fuelTanks.get_fuel_tank_index(tank1_uID), 1, ) - self.assertEqual(fuelTanks.get_fuel_tanks_count(), 7) + self.assertEqual(fuelTanks.get_fuel_tanks_count(), 8) # Test availability of generated class: self.assertIsInstance(fuelTanks, configuration.CCPACSFuelTanks) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index a4345a749e..ccb8a8f6a4 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -93,7 +93,8 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); tigl::CCPACSVessel* vessel_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); - tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("tank_corrupt_vessel"); + tigl::CCPACSVessel* vessel_symmetric = &uidMgr.ResolveObject("tank7_symmetricVessel"); + tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("tank_corrupt_vessel"); const char* tankTypeExceptionString = "This method is only available for vessels with segments. No segment found."; }; @@ -119,7 +120,7 @@ TEST_F(FuelTanks, configuration) { auto& config = fuelTank->GetConfiguration(); std::string uID = "tank1"; - EXPECT_EQ(config.GetFuelTanksCount(), 7); + EXPECT_EQ(config.GetFuelTanksCount(), 8); EXPECT_EQ(config.GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(config.GetFuelTank(uID)); EXPECT_EQ(config.GetFuelTankIndex(uID), 1); @@ -140,7 +141,7 @@ TEST_F(FuelTanks, fuelTanks) EXPECT_EQ(fuelTanks->GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(fuelTanks->GetFuelTank(uID)); EXPECT_EQ(fuelTanks->GetFuelTankIndex(uID), 1); - EXPECT_EQ(fuelTanks->GetFuelTanksCount(), 7); + EXPECT_EQ(fuelTanks->GetFuelTanksCount(), 8); } TEST_F(FuelTanks, fuelTank) @@ -322,6 +323,21 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_THROW(vessel_corrupt->GetLoft(), tigl::CTiglError); } +TEST_F(FuelTanks, vessel_face_traits) +{ + auto symmetric_loft = vessel_symmetric->GetLoft(); + EXPECT_EQ(symmetric_loft->FaceTraits(0).Name(), vessel_symmetric->GetUID()); + EXPECT_EQ(symmetric_loft->FaceTraits(1).Name(), "symmetry"); + EXPECT_EQ(symmetric_loft->FaceTraits(2).Name(), "Front"); + EXPECT_EQ(symmetric_loft->FaceTraits(3).Name(), "Rear"); + + auto standard_loft = vessel_segments->GetLoft(); + EXPECT_EQ(standard_loft->FaceTraits(0).Name(), vessel_segments->GetUID()); + EXPECT_EQ(standard_loft->FaceTraits(1).Name(), vessel_segments->GetUID()); + EXPECT_EQ(standard_loft->FaceTraits(2).Name(), "Front"); + EXPECT_EQ(standard_loft->FaceTraits(3).Name(), "Rear"); +} + TEST_F(FuelTanks, structure) { auto& structure_with_walls = vessel_isotensoid->GetStructure(); From 1ff41f637fde92a5e964d235fa8aea529346f831 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 28 Mar 2025 22:46:05 +0100 Subject: [PATCH 081/122] add test covering unknown short name in CCPACSVessel --- tests/unittests/tiglTanks.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index ccb8a8f6a4..3303b4cf6c 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -96,6 +96,14 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_symmetric = &uidMgr.ResolveObject("tank7_symmetricVessel"); tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("tank_corrupt_vessel"); + // Dummies for exception handling + DummyAircraftModel dummyAircraft; + tigl::CTiglUIDManager dummyUidMgr; + tigl::CCPACSFuelTanks dummyTanks{&dummyAircraft, &dummyUidMgr}; + tigl::CCPACSFuelTank dummyTank{&dummyTanks, &dummyUidMgr}; + tigl::CCPACSVessels dummyVessels{&dummyTank, &dummyUidMgr}; + tigl::CCPACSVessel dummyVessel{&dummyVessels, &dummyUidMgr}; + const char* tankTypeExceptionString = "This method is only available for vessels with segments. No segment found."; }; @@ -160,13 +168,9 @@ TEST_F(FuelTanks, fuelTank) EXPECT_EQ(loft->ShortName(), "T1"); // Test return of UNKNOWN ShortName - DummyAircraftModel dummyAircraft; - tigl::CTiglUIDManager dummyUidMgr; - tigl::CCPACSFuelTanks dummyTanks(&dummyAircraft, &dummyUidMgr); - tigl::CCPACSFuelTank dummyTank(&dummyTanks, &dummyUidMgr); dummyTank.SetUID("not_in_list"); - const auto dummyLoft = dummyTank.GetLoft(); - EXPECT_EQ(dummyLoft->ShortName(), "UNKNOWN"); + const auto dummyTankLoft = dummyTank.GetLoft(); + EXPECT_EQ(dummyTankLoft->ShortName(), "UNKNOWN"); // Test invalidation bool called = false; @@ -321,6 +325,7 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_EQ(vessel_segments->GetGetPointBehavior(), onLinearLoft); EXPECT_THROW(vessel_corrupt->GetLoft(), tigl::CTiglError); + EXPECT_THROW(dummyVessel.GetLoft(), tigl::CTiglError); } TEST_F(FuelTanks, vessel_face_traits) From 7b7960d21cc1b391c9b9e17feaa688b0e7b2fc18 Mon Sep 17 00:00:00 2001 From: Alder Date: Fri, 28 Mar 2025 23:07:35 +0100 Subject: [PATCH 082/122] add test covering exit condition in GetGuideCurvePoints if no guide curve exists --- tests/unittests/tiglTanks.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 3303b4cf6c..12f509efe8 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -296,6 +296,8 @@ TEST_F(FuelTanks, vessel_guide_curves) CheckExceptionMessage([&]() { vessel_segments->GetGuideCurveSegment("not_existing_guide_curve"); }, "Guide Curve with UID not_existing_guide_curve does not exists"); + + EXPECT_EQ(vessel_segments->GetGuideCurvePoints().size(), 0); } TEST_F(FuelTanks, vessel_loft_evaluation) From 9e6936ef00417e1fe8d1e92699eb5dfb3f3d20b7 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Sat, 29 Mar 2025 16:43:45 +0100 Subject: [PATCH 083/122] add tests for parametric vessel exceptions --- .../TestData/simpletest-fuelTanks.cpacs.xml | 70 ++++++++++++++++++- tests/unittests/tiglTanks.cpp | 33 ++++++++- 2 files changed, 100 insertions(+), 3 deletions(-) diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 5fe852d4a1..a780367dd6 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -870,12 +870,80 @@ SimpleFuselage - + Vessel with wrong geometry 0.4 1. + + Vessel with negative ax ratio + + 1 + 1 + + + -1 + + + + + Vessel with too small dish radius + + 1 + 1 + + + 0.5 + 0.1 + + + + + Vessel with too large knuckle radius + + 1 + 1 + + + 1.5 + 1.5 + + + + + Vessel with too large polar opening radius + + 1 + 1 + + + 1.5 + + + + + Vessel with negative radius + + -1 + 1 + + + 0.5 + + + + + Vessel with negative length + + 1 + -1 + + + 0.5 + + + diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 12f509efe8..0983ef8018 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -80,7 +80,8 @@ class FuelTanks : public ::testing::Test tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuelTanks::tiglHandle).GetUIDManager(); // tank - tigl::CCPACSFuelTank const* fuelTank = &uidMgr.ResolveObject("tank1"); + tigl::CCPACSFuelTank const* fuelTank = &uidMgr.ResolveObject("tank1"); + tigl::CCPACSFuelTank const* fuelTank_corrupt = &uidMgr.ResolveObject("tank_corrupt"); // vessels const tigl::CCPACSVessels& vessels = fuelTank->GetVessels(); @@ -94,7 +95,7 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); tigl::CCPACSVessel* vessel_symmetric = &uidMgr.ResolveObject("tank7_symmetricVessel"); - tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("tank_corrupt_vessel"); + tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("vessel_corrupt_geometry"); // Dummies for exception handling DummyAircraftModel dummyAircraft; @@ -330,6 +331,34 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_THROW(dummyVessel.GetLoft(), tigl::CTiglError); } +TEST_F(FuelTanks, vessel_parametric_exceptions) +{ + CheckExceptionMessage([&]() { fuelTank_corrupt->GetVessels().GetVessel("vessel_corrupt_ellipsoid").GetLoft(); }, + "Half axis fraction (-1.000000) of vessel \"Vessel with negative ax ratio\" " + "(uID=\"vessel_corrupt_ellipsoid\") must be a positive value!"); + + CheckExceptionMessage( + [&]() { fuelTank_corrupt->GetVessels().GetVessel("vessel_corrupt_torispherical1").GetLoft(); }, + "The dish radius (0.500000) of vessel \"Vessel with too small dish radius\" " + "(uID=\"vessel_corrupt_torispherical1\") must be larger than the cylinder radius (1.000000)!"); + + CheckExceptionMessage( + [&]() { fuelTank_corrupt->GetVessels().GetVessel("vessel_corrupt_torispherical2").GetLoft(); }, + "The knuckle radius (1.500000) of vessel \"Vessel with too large knuckle radius\" " + "(uID=\"vessel_corrupt_torispherical2\") must be larger than 0 and smaller than the cylinder Radius " + "(1.000000)!"); + + CheckExceptionMessage( + [&]() { fuelTank_corrupt->GetVessels().GetVessel("vessel_corrupt_negative_radius").GetLoft(); }, + "The cylinder radius (-1.000000) of vessel \"Vessel with negative radius\" " + "(uID=\"vessel_corrupt_negative_radius\") must be larger than 0!"); + + CheckExceptionMessage( + [&]() { fuelTank_corrupt->GetVessels().GetVessel("vessel_corrupt_negative_length").GetLoft(); }, + "The cylinder length (-1.000000) of vessel \"Vessel with negative length\" " + "(uID=\"vessel_corrupt_negative_length\") must be larger than or equal to 0!"); +} + TEST_F(FuelTanks, vessel_face_traits) { auto symmetric_loft = vessel_symmetric->GetLoft(); From a462b9ad61be7a865305152a14c02e86746d36c0 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Sat, 29 Mar 2025 17:50:57 +0100 Subject: [PATCH 084/122] add tests covering axRatio > 1 of elliptical domes --- .../TestData/simpletest-fuelTanks.cpacs.xml | 22 ++++++++++++++++++- tests/unittests/test_fuelTanks.py | 15 ++++++++----- tests/unittests/tiglTanks.cpp | 16 ++++++++------ 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index a780367dd6..42708bf465 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -595,7 +595,7 @@ - + Vessel with ellipsoid dome @@ -655,6 +655,26 @@ + + Vessel with second ellipsoid dome + + + 1.7 + + + 1 + 1 + 1 + + + 0.3 + 0.1 + + + 1.2 + + + diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 9671e63d3d..6eb894992c 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -13,6 +13,10 @@ def setUp(self): self.tixi = Tixi3() self.tigl = Tigl3() self.assertIsNone(self.tixi.open("TestData/simpletest-fuelTanks.cpacs.xml")) + + # Remove corrupt tanks + self.tixi.removeElement("/cpacs/vehicles/aircraft/model/fuelTanks/fuelTank[8]") + self.assertIsNone(self.tigl.open(self.tixi, "")) mgr = configuration.CCPACSConfigurationManager.get_instance() @@ -23,7 +27,8 @@ def setUp(self): self.vessel_segments = uid_mgr.get_geometric_component("tank1_outerVessel") self.vessel_guides = uid_mgr.get_geometric_component("tank2_outerVessel") self.vessel_spherical = uid_mgr.get_geometric_component("tank3_sphericalDome") - self.vessel_ellipsoid = uid_mgr.get_geometric_component("tank3_ellipsoidDome") + self.vessel_ellipsoid1 = uid_mgr.get_geometric_component("tank3_ellipsoidDome1") + self.vessel_ellipsoid2 = uid_mgr.get_geometric_component("tank3_ellipsoidDome1") self.vessel_torispherical = uid_mgr.get_geometric_component( "tank4_torisphericalDome" ) @@ -137,10 +142,10 @@ def test_vessel_type_info(self): self.assertFalse(self.vessel_spherical.has_torispherical_dome()) self.assertFalse(self.vessel_spherical.has_isotensoid_dome()) - self.assertFalse(self.vessel_ellipsoid.has_spherical_dome()) - self.assertTrue(self.vessel_ellipsoid.has_ellipsoid_dome()) - self.assertFalse(self.vessel_ellipsoid.has_torispherical_dome()) - self.assertFalse(self.vessel_ellipsoid.has_isotensoid_dome()) + self.assertFalse(self.vessel_ellipsoid1.has_spherical_dome()) + self.assertTrue(self.vessel_ellipsoid1.has_ellipsoid_dome()) + self.assertFalse(self.vessel_ellipsoid1.has_torispherical_dome()) + self.assertFalse(self.vessel_ellipsoid1.has_isotensoid_dome()) self.assertFalse(self.vessel_torispherical.has_spherical_dome()) self.assertFalse(self.vessel_torispherical.has_ellipsoid_dome()) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 0983ef8018..04612bd8bb 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -90,7 +90,8 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_parametric = &uidMgr.ResolveObject("tank3_sphericalDome"); tigl::CCPACSVessel* vessel_spherical = &uidMgr.ResolveObject("tank3_sphericalDome"); - tigl::CCPACSVessel* vessel_ellipsoid = &uidMgr.ResolveObject("tank3_ellipsoidDome"); + tigl::CCPACSVessel* vessel_ellipsoid1 = &uidMgr.ResolveObject("tank3_ellipsoidDome1"); + tigl::CCPACSVessel* vessel_ellipsoid2 = &uidMgr.ResolveObject("tank3_ellipsoidDome2"); tigl::CCPACSVessel* vessel_torispherical = &uidMgr.ResolveObject("tank4_torisphericalDome"); tigl::CCPACSVessel* vessel_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); @@ -227,10 +228,10 @@ TEST_F(FuelTanks, vessel_type_info) EXPECT_FALSE(vessel_spherical->HasTorisphericalDome()); EXPECT_FALSE(vessel_spherical->HasIsotensoidDome()); - EXPECT_FALSE(vessel_ellipsoid->HasSphericalDome()); - EXPECT_TRUE(vessel_ellipsoid->HasEllipsoidDome()); - EXPECT_FALSE(vessel_ellipsoid->HasTorisphericalDome()); - EXPECT_FALSE(vessel_ellipsoid->HasIsotensoidDome()); + EXPECT_FALSE(vessel_ellipsoid1->HasSphericalDome()); + EXPECT_TRUE(vessel_ellipsoid1->HasEllipsoidDome()); + EXPECT_FALSE(vessel_ellipsoid1->HasTorisphericalDome()); + EXPECT_FALSE(vessel_ellipsoid1->HasIsotensoidDome()); EXPECT_FALSE(vessel_torispherical->HasSphericalDome()); EXPECT_FALSE(vessel_torispherical->HasEllipsoidDome()); @@ -305,13 +306,14 @@ TEST_F(FuelTanks, vessel_loft_evaluation) { EXPECT_NEAR(vessel_segments->GetGeometricVolume(), 6.57, 1e-2); EXPECT_NEAR(vessel_spherical->GetGeometricVolume(), 18.1, 1e-2); - EXPECT_NEAR(vessel_ellipsoid->GetGeometricVolume(), 5.43, 1e-2); + EXPECT_NEAR(vessel_ellipsoid1->GetGeometricVolume(), 5.43, 1e-2); EXPECT_NEAR(vessel_torispherical->GetGeometricVolume(), 7.87, 1e-2); EXPECT_NEAR(vessel_isotensoid->GetGeometricVolume(), 9.01, 1e-2); EXPECT_NEAR(vessel_segments->GetSurfaceArea(), 11.15, 1e-2); EXPECT_NEAR(vessel_spherical->GetSurfaceArea(), 36.19, 1e-2); - EXPECT_NEAR(vessel_ellipsoid->GetSurfaceArea(), 16.22, 1e-2); + EXPECT_NEAR(vessel_ellipsoid1->GetSurfaceArea(), 16.22, 1e-2); + EXPECT_NEAR(vessel_ellipsoid2->GetSurfaceArea(), 1.47, 1e-2); EXPECT_NEAR(vessel_torispherical->GetSurfaceArea(), 20.49, 1e-2); EXPECT_NEAR(vessel_isotensoid->GetSurfaceArea(), 22.40, 1e-2); From 92e9c3a933176c2b180aa4ef099b5b5a5cd26458 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:08:27 +0100 Subject: [PATCH 085/122] add test for polar opening radius exception --- tests/unittests/test_fuelTanks.py | 4 ---- tests/unittests/tiglTanks.cpp | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 6eb894992c..580c661b7c 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -13,10 +13,6 @@ def setUp(self): self.tixi = Tixi3() self.tigl = Tigl3() self.assertIsNone(self.tixi.open("TestData/simpletest-fuelTanks.cpacs.xml")) - - # Remove corrupt tanks - self.tixi.removeElement("/cpacs/vehicles/aircraft/model/fuelTanks/fuelTank[8]") - self.assertIsNone(self.tigl.open(self.tixi, "")) mgr = configuration.CCPACSConfigurationManager.get_instance() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 04612bd8bb..1ad3d6b224 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -350,6 +350,11 @@ TEST_F(FuelTanks, vessel_parametric_exceptions) "(uID=\"vessel_corrupt_torispherical2\") must be larger than 0 and smaller than the cylinder Radius " "(1.000000)!"); + CheckExceptionMessage( + [&]() { fuelTank_corrupt->GetVessels().GetVessel("vessel_corrupt_isotensoid").GetLoft(); }, + "The polar opening radius (1.500000) of vessel \"Vessel with too large polar opening radius\" " + "(uID=\"vessel_corrupt_isotensoid\") must be larger than 0 and smaller than the cylinder radius (1.000000)!"); + CheckExceptionMessage( [&]() { fuelTank_corrupt->GetVessels().GetVessel("vessel_corrupt_negative_radius").GetLoft(); }, "The cylinder radius (-1.000000) of vessel \"Vessel with negative radius\" " From 0afc3cab3f35116886db60e73fa7a611e667b41c Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 4 Apr 2025 23:36:30 +0200 Subject: [PATCH 086/122] add GetSection via sectionUID --- src/fuelTanks/CCPACSVessel.cpp | 10 ++++++++++ src/fuelTanks/CCPACSVessel.h | 3 ++- tests/unittests/tiglTanks.cpp | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 9de438db54..0aca3b94c0 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -99,6 +99,16 @@ CCPACSFuselageSection& CCPACSVessel::GetSection(int index) const } } +CCPACSFuselageSection& CCPACSVessel::GetSection(const std::string& sectionUID) +{ + if (m_sections_choice1) { + return m_sections_choice1.get().GetSection(sectionUID); + } + else { + throw CTiglError(_vesselTypeException); + } +} + TopoDS_Shape CCPACSVessel::GetSectionFace(const std::string sectionUID) const { const int segmentCount = GetSegmentCount(); diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index ce503ca920..a3cf56c783 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -51,8 +51,9 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi TIGL_EXPORT int GetSectionCount() const; // Get a specific section TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; + TIGL_EXPORT CCPACSFuselageSection& GetSection(const std::string& sectionUID); // Get a section face - TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string section_uid) const; + TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string sectionUID) const; // Get number of segments TIGL_EXPORT int GetSegmentCount() const; diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 1ad3d6b224..76804cb7c3 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -256,8 +256,13 @@ TEST_F(FuelTanks, vessel_sections) EXPECT_EQ(vessel_parametric->GetSectionCount(), 0); EXPECT_NO_THROW(vessel_segments->GetSection(1)); + EXPECT_NO_THROW(vessel_segments->GetSection("outerVessel_section1")); + EXPECT_THROW(vessel_segments->GetSection("outerVessel_notExistingSection"), tigl::CTiglError); + CheckExceptionMessage([&]() { vessel_segments->GetSection(4); }, invalidIndexMessage); CheckExceptionMessage([&]() { vessel_parametric->GetSection(2); }, tankTypeExceptionString); + CheckExceptionMessage([&]() { vessel_parametric->GetSection("outerVessel_notExistingSection"); }, + tankTypeExceptionString); EXPECT_NO_THROW(vessel_segments->GetSectionFace("outerVessel_section1")); EXPECT_NO_THROW(vessel_segments->GetSectionFace("outerVessel_section3")); From 2c96fbc177f5c383ccaa9aa74ff0c28b1a026f7f Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Sat, 5 Apr 2025 16:21:26 +0200 Subject: [PATCH 087/122] some code refactoring and improvement of tests --- tests/unittests/tiglTanks.cpp | 92 ++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 76804cb7c3..c8d7033079 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -31,6 +31,31 @@ #include "CCPACSVessel.h" #include "CNamedShape.h" +namespace +{ +// Error message constants for exception tests +constexpr const char* tankTypeExceptionString = + "This method is only available for vessels with segments. No segment found."; +constexpr const char* invalidIndexMessage = "Invalid index in CCPACSFuselageSections::GetSection"; +constexpr const char* wrongSectionUIDMessage = "GetSectionFace: Could not find a fuselage section for the given UID"; + +// Helper function to check exception messages. +void CheckExceptionMessage(const std::function& func, const char* expectedMessage) +{ + try { + func(); + FAIL() << "Expected tigl::CTiglError but no exception was thrown."; + } + catch (const tigl::CTiglError& e) { + EXPECT_STREQ(e.what(), expectedMessage); + } + catch (...) { + FAIL() << "Expected tigl::CTiglError but a different exception was thrown."; + } +} +} // anonymous namespace + +// Dummy class for exception handling tests class DummyAircraftModel : public tigl::CCPACSAircraftModel { public: @@ -53,9 +78,9 @@ class FuelTanks : public ::testing::Test tixiHandle = -1; tixiRet = tixiOpenDocument(filename, &tixiHandle); - ASSERT_TRUE(tixiRet == SUCCESS); + ASSERT_EQ(tixiRet, SUCCESS); tiglRet = tiglOpenCPACSConfiguration(tixiHandle, "testAircraft", &tiglHandle); - ASSERT_TRUE(tiglRet == TIGL_SUCCESS); + ASSERT_EQ(tiglRet, TIGL_SUCCESS); } static void TearDownTestCase() @@ -66,6 +91,7 @@ class FuelTanks : public ::testing::Test tixiHandle = -1; } + // No specific setup/teardown per test needed at the moment. void SetUp() override { } @@ -73,17 +99,19 @@ class FuelTanks : public ::testing::Test { } + // Static handles for CPACS document and configuration. static TixiDocumentHandle tixiHandle; static TiglCPACSConfigurationHandle tiglHandle; + // UID manager for object resolution tigl::CTiglUIDManager& uidMgr = tigl::CCPACSConfigurationManager::GetInstance().GetConfiguration(FuelTanks::tiglHandle).GetUIDManager(); - // tank - tigl::CCPACSFuelTank const* fuelTank = &uidMgr.ResolveObject("tank1"); - tigl::CCPACSFuelTank const* fuelTank_corrupt = &uidMgr.ResolveObject("tank_corrupt"); + // Fuel tank objects + const tigl::CCPACSFuelTank* fuelTank = &uidMgr.ResolveObject("tank1"); + const tigl::CCPACSFuelTank* fuelTank_corrupt = &uidMgr.ResolveObject("tank_corrupt"); - // vessels + // Vessel objects resolved from the fuel tank const tigl::CCPACSVessels& vessels = fuelTank->GetVessels(); tigl::CCPACSVessel* vessel_segments = &uidMgr.ResolveObject("tank1_outerVessel"); tigl::CCPACSVessel* vessel_guides = &uidMgr.ResolveObject("tank2_outerVessel"); @@ -98,38 +126,23 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_symmetric = &uidMgr.ResolveObject("tank7_symmetricVessel"); tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("vessel_corrupt_geometry"); - // Dummies for exception handling + // Dummy objects for exception testing DummyAircraftModel dummyAircraft; tigl::CTiglUIDManager dummyUidMgr; tigl::CCPACSFuelTanks dummyTanks{&dummyAircraft, &dummyUidMgr}; tigl::CCPACSFuelTank dummyTank{&dummyTanks, &dummyUidMgr}; tigl::CCPACSVessels dummyVessels{&dummyTank, &dummyUidMgr}; tigl::CCPACSVessel dummyVessel{&dummyVessels, &dummyUidMgr}; - - const char* tankTypeExceptionString = "This method is only available for vessels with segments. No segment found."; }; TixiDocumentHandle FuelTanks::tixiHandle = 0; TiglCPACSConfigurationHandle FuelTanks::tiglHandle = 0; -void CheckExceptionMessage(std::function func, const char* expectedMessage) -{ - try { - func(); - FAIL() << "Expected tigl::CTiglError but no exception was thrown."; - } - catch (const tigl::CTiglError& e) { - EXPECT_STREQ(e.what(), expectedMessage); - } - catch (...) { - FAIL() << "Expected tigl::CTiglError but a different exception was thrown."; - } -} - TEST_F(FuelTanks, configuration) { auto& config = fuelTank->GetConfiguration(); std::string uID = "tank1"; + EXPECT_EQ(config.GetFuelTanksCount(), 8); EXPECT_EQ(config.GetFuelTank(1).GetDefaultedUID(), uID); EXPECT_NO_THROW(config.GetFuelTank(uID)); @@ -158,30 +171,28 @@ TEST_F(FuelTanks, fuelTank) { EXPECT_NO_THROW(fuelTank->GetVessels()); - const std::string name = fuelTank->GetName(); - EXPECT_EQ(name, "Simple tank 1"); - + // Check tank name and type. + EXPECT_EQ(fuelTank->GetName(), "Simple tank 1"); EXPECT_EQ(fuelTank->GetComponentType(), TIGL_COMPONENT_TANK); - // Test loft building - const auto loft = fuelTank->GetLoft(); + // Test loft building and naming. + auto loft = fuelTank->GetLoft(); ASSERT_NE(loft, nullptr); EXPECT_EQ(loft->Name(), "tank1"); EXPECT_EQ(loft->ShortName(), "T1"); - // Test return of UNKNOWN ShortName + // Test return of UNKNOWN ShortName. dummyTank.SetUID("not_in_list"); - const auto dummyTankLoft = dummyTank.GetLoft(); + auto dummyTankLoft = dummyTank.GetLoft(); EXPECT_EQ(dummyTankLoft->ShortName(), "UNKNOWN"); - // Test invalidation + // Test invalidation callback. bool called = false; dummyTank.RegisterInvalidationCallback([&]() { called = true; }); dummyTank.Invalidate(); EXPECT_TRUE(called); } -// ToDo: Check how to use pointer -> TEST_F(FuelTanks, vessels) { EXPECT_EQ(vessels.GetVesselsCount(), 2); @@ -213,11 +224,13 @@ TEST_F(FuelTanks, vessel_component_info) TEST_F(FuelTanks, vessel_type_info) { + // Check whether vessels are built via segments or design parameters. EXPECT_TRUE(vessel_segments->IsVesselViaSegments()); EXPECT_FALSE(vessel_segments->IsVesselViaDesignParameters()); EXPECT_FALSE(vessel_spherical->IsVesselViaSegments()); EXPECT_TRUE(vessel_spherical->IsVesselViaDesignParameters()); + // Check dome types. EXPECT_FALSE(vessel_segments->HasSphericalDome()); EXPECT_FALSE(vessel_segments->HasEllipsoidDome()); EXPECT_FALSE(vessel_segments->HasTorisphericalDome()); @@ -243,15 +256,13 @@ TEST_F(FuelTanks, vessel_type_info) EXPECT_FALSE(vessel_isotensoid->HasTorisphericalDome()); EXPECT_TRUE(vessel_isotensoid->HasIsotensoidDome()); + // Check for corrupt vessel exceptions. EXPECT_THROW(vessel_corrupt->IsVesselViaSegments(), tigl::CTiglError); EXPECT_THROW(vessel_corrupt->IsVesselViaDesignParameters(), tigl::CTiglError); } TEST_F(FuelTanks, vessel_sections) { - const char* invalidIndexMessage = "Invalid index in CCPACSFuselageSections::GetSection"; - const char* wrongSectionUIDMessage = "GetSectionFace: Could not find a fuselage section for the given UID"; - EXPECT_EQ(vessel_segments->GetSectionCount(), 3); EXPECT_EQ(vessel_parametric->GetSectionCount(), 0); @@ -276,8 +287,7 @@ TEST_F(FuelTanks, vessel_segments) EXPECT_EQ(vessel_segments->GetSegmentCount(), 2); EXPECT_EQ(vessel_parametric->GetSegmentCount(), 0); - const tigl::CCPACSVessel* const_vessel_parametric = vessel_parametric; - + const auto* const_vessel_parametric = vessel_parametric; EXPECT_NO_THROW(vessel_segments->GetSegment(1)); CheckExceptionMessage([&]() { vessel_parametric->GetSegment(1); }, tankTypeExceptionString); CheckExceptionMessage([&]() { const_vessel_parametric->GetSegment(1); }, tankTypeExceptionString); @@ -309,6 +319,7 @@ TEST_F(FuelTanks, vessel_guide_curves) TEST_F(FuelTanks, vessel_loft_evaluation) { + // Evaluate geometric properties. EXPECT_NEAR(vessel_segments->GetGeometricVolume(), 6.57, 1e-2); EXPECT_NEAR(vessel_spherical->GetGeometricVolume(), 18.1, 1e-2); EXPECT_NEAR(vessel_ellipsoid1->GetGeometricVolume(), 5.43, 1e-2); @@ -325,9 +336,10 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_NEAR(vessel_segments->GetCircumference(1, 0.5), 7.43, 1e-2); CheckExceptionMessage([&]() { vessel_parametric->GetCircumference(1, 0.5); }, tankTypeExceptionString); - EXPECT_NEAR(vessel_segments->GetPoint(1, 0.5, 0.5).X(), 1.54, 1e-2); - EXPECT_NEAR(vessel_segments->GetPoint(1, 0.5, 0.5).Y(), 0, 1e-5); - EXPECT_NEAR(vessel_segments->GetPoint(1, 0.5, 0.5).Z(), -1.2, 1e-1); + auto point = vessel_segments->GetPoint(1, 0.5, 0.5); + EXPECT_NEAR(point.X(), 1.54, 1e-2); + EXPECT_NEAR(point.Y(), 0, 1e-5); + EXPECT_NEAR(point.Z(), -1.2, 1e-1); CheckExceptionMessage([&]() { vessel_parametric->GetPoint(1, 0.5, 0.5); }, tankTypeExceptionString); EXPECT_EQ(vessel_segments->GetGetPointBehavior(), asParameterOnSurface); From 645d9597c303d65a06cb4b50621fb2482ae5f873 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 9 Apr 2025 22:10:14 +0200 Subject: [PATCH 088/122] add description for isotensoid magic numbers --- src/fuelTanks/CCPACSVessel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 0aca3b94c0..8637df32ea 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -303,6 +303,8 @@ void CCPACSVessel::IsotensoidContour(double rCyl, double rPolarOpening, int node double phi = 0.0; double alpha = std::asin(rPolarOpening / rCyl); + // Isotensoid dome contours are described by a differential equation. The following code is an analytical approximation + // provided by the DLR Institute of Lightweight Systems. while (std::tan(alpha) * std::tan(alpha) < 2 && r.back() > 1.22 * rPolarOpening) { phi += dPhi; alpha = std::asin(rPolarOpening / r.back()); From 306bcc2d430b086dc81e1e0c12e8d42b6894d9ed Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Thu, 24 Apr 2025 23:28:05 +0200 Subject: [PATCH 089/122] Remove previous date Co-authored-by: Jan Kleinert --- ChangeLog.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index c9f45132c0..a44f860259 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,8 +9,6 @@ Changes since last release - General changes: - Implemented the new CPACS fuelTanks. -10/01/2025 - - Fixes - #936 A particular defined positioning (of the C++-type CCPACSPositioning) was not available via Python bindings since the std::vector> is not exposed to swig. New getter functions have been implemented in CCPACSPositioning.h to make these elements accesible via index, similar to the implementation of for several other classes. For more information see https://github.com/RISCSoftware/cpacs_tigl_gen/issues/59. From 8a1bf2c3fc9465f19652d9def7c78ec7853a7583 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Thu, 24 Apr 2025 23:31:08 +0200 Subject: [PATCH 090/122] Update src/api/tigl.h Co-authored-by: Jan Kleinert --- src/api/tigl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/tigl.h b/src/api/tigl.h index f14aafb329..512b50edc5 100644 --- a/src/api/tigl.h +++ b/src/api/tigl.h @@ -233,8 +233,8 @@ TIGL_COMPONENT_ENGINE_NACELLE, /**< The Component is a engine nacelle */ TIGL_COMPONENT_FUSELAGE_WALL, /**< The Component is a fuselage wall */ TIGL_COMPONENT_CONTROL_SURFACE_DEVICE, /**< The component is a control surface device (flap) */ TIGL_COMPONENT_DUCT, /**< The Component belongs to a duct */ -TIGL_COMPONENT_TANK, /**< The Component is a fuselage tank */ -TIGL_COMPONENT_TANK_HULL, /**< The Component is a vessel of a fuselage tank */ +TIGL_COMPONENT_TANK, /**< The Component is a fuel tank */ +TIGL_COMPONENT_TANK_HULL, /**< The Component is a vessel of a fuel tank */ TIGL_COMPONENT_OTHER }; From c54499dbe46267b1c3d565051cc6c4cf6d901e4f Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 25 Apr 2025 15:55:27 +0200 Subject: [PATCH 091/122] replace GetFirstVertex and GetLastVertex by TopExp::FirstVertex and TopExp::LastVertex --- src/common/tiglcommonfunctions.cpp | 14 -------------- src/common/tiglcommonfunctions.h | 6 ------ src/fuelTanks/CCPACSVessel.cpp | 10 +++++----- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/common/tiglcommonfunctions.cpp b/src/common/tiglcommonfunctions.cpp index 96e01df9b8..1a601eac19 100644 --- a/src/common/tiglcommonfunctions.cpp +++ b/src/common/tiglcommonfunctions.cpp @@ -1855,20 +1855,6 @@ void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices } } -TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& edge) -{ - TopTools_ListOfShape edgeList; - GetEndVertices(edge, edgeList); - return TopoDS::Vertex(edgeList.First()); -} - -TopoDS_Vertex GetLastVertex(const TopoDS_Edge& edge) -{ - TopTools_ListOfShape edgeList; - GetEndVertices(edge, edgeList); - return TopoDS::Vertex(edgeList.Last()); -} - TopoDS_Face GetNearestFace(const TopoDS_Shape& shape, const gp_Pnt& pnt) { TopExp_Explorer explorer; diff --git a/src/common/tiglcommonfunctions.h b/src/common/tiglcommonfunctions.h index bf79d14bb3..8a2515812d 100644 --- a/src/common/tiglcommonfunctions.h +++ b/src/common/tiglcommonfunctions.h @@ -365,12 +365,6 @@ TIGL_EXPORT bool CheckCommonVertex(const TopoDS_Edge& e1, const TopoDS_Edge& e2) // Method for searching all vertices which are only connected to a single edge TIGL_EXPORT void GetEndVertices(const TopoDS_Shape& shape, TopTools_ListOfShape& endVertices); -// Method to return the first vertex of an edge -TIGL_EXPORT TopoDS_Vertex GetFirstVertex(const TopoDS_Edge& e); - -// Method to return the last vertex of an edge -TIGL_EXPORT TopoDS_Vertex GetLastVertex(const TopoDS_Edge& e); - // Method for finding the face which has the lowest distance to the passed point TIGL_EXPORT TopoDS_Face GetNearestFace(const TopoDS_Shape& src, const gp_Pnt& pnt); diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 8637df32ea..4cdf898695 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -355,7 +355,7 @@ void CCPACSVessel::BuildVesselWire(std::vector& edges, BRepBuilderA wire.Add(edge); } - TopoDS_Vertex v2 = GetLastVertex(edges.back()); + TopoDS_Vertex v2 = TopExp::LastVertex(edges.back()); gp_Pnt mirror_point(BRep_Tool::Pnt(v2).X(), 0, 0); gp_Trsf mirror; mirror.SetMirror(gp_Ax2(mirror_point, gp_Dir(1, 0, 0))); @@ -406,7 +406,7 @@ void CCPACSVessel::BuildVesselWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const std::vector edges = {domeEdge}; if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetLastVertex(domeEdge); + TopoDS_Vertex v1 = TopExp::LastVertex(domeEdge); TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); @@ -457,7 +457,7 @@ void CCPACSVessel::BuildVesselWireTorispherical(BRepBuilderAPI_MakeWire& wire) c std::vector edges = {domeEdge1, domeEdge2}; if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetLastVertex(domeEdge2); + TopoDS_Vertex v1 = TopExp::LastVertex(domeEdge2); TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); @@ -492,13 +492,13 @@ void CCPACSVessel::BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) cons TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(bspline); TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-x.back(), 0.0, 0.0)); - TopoDS_Vertex v2 = GetLastVertex(domeEdge); + TopoDS_Vertex v2 = TopExp::LastVertex(domeEdge); TopoDS_Edge lidEdge = BRepBuilderAPI_MakeEdge(v1, v2); std::vector edges = {lidEdge, domeEdge}; if (cylinderLength > 0.0) { - TopoDS_Vertex v1 = GetFirstVertex(domeEdge); + TopoDS_Vertex v1 = TopExp::FirstVertex(domeEdge); TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); TopoDS_Edge cylinderEdge = BRepBuilderAPI_MakeEdge(v1, v2).Edge(); From 2bc899abdd59d4d06de3fd19e4e27ef431d1e7cc Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 28 Apr 2025 21:29:56 +0200 Subject: [PATCH 092/122] remove Anton --- src/fuelTanks/CCPACSFuelTank.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 48949ec547..05cb41c765 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -1,7 +1,6 @@ /* * Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) * -* Created: 2022-04-06 Anton Reiswich * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at From f970bdbcc2af74cf51c24276f177362089fa700f Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 29 Apr 2025 21:26:38 +0200 Subject: [PATCH 093/122] add checks before dereferencing; return GetFuelTank as const& --- src/configuration/CCPACSConfiguration.cpp | 66 ++++++++++++++--------- src/configuration/CCPACSConfiguration.h | 2 +- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/configuration/CCPACSConfiguration.cpp b/src/configuration/CCPACSConfiguration.cpp index 2e6d60e9f1..d643d9e2cb 100644 --- a/src/configuration/CCPACSConfiguration.cpp +++ b/src/configuration/CCPACSConfiguration.cpp @@ -573,37 +573,45 @@ const boost::optional& CCPACSConfiguration::GetDucts() const int CCPACSConfiguration::GetFuelTanksCount() const { - if (aircraftModel) { - if (aircraftModel->GetFuelTanks()) { - return aircraftModel->GetFuelTanks()->GetFuelTanksCount(); - } - else { - return 0; - } + if (!aircraftModel) { + return 0; } - else { + + auto const& fuelTanks = aircraftModel->GetFuelTanks(); + if (!fuelTanks) { return 0; } + + return fuelTanks->GetFuelTanksCount(); + } -CCPACSFuelTank& CCPACSConfiguration::GetFuelTank(int index) const +CCPACSFuelTank const& CCPACSConfiguration::GetFuelTank(int index) const { - if (aircraftModel) { - return aircraftModel->GetFuelTanks()->GetFuelTank(index); - } - else { + if (!aircraftModel) { throw CTiglError("No configuration loaded"); } + + auto const& fuelTanks = aircraftModel->GetFuelTanks(); + if (!fuelTanks) { + throw CTiglError("No fuel tanks found"); + } + + return fuelTanks->GetFuelTank(index); } CCPACSFuelTank const& CCPACSConfiguration::GetFuelTank(const std::string& UID) const { - if (aircraftModel) { - return aircraftModel->GetFuelTanks()->GetFuelTank(UID); - } - else { + if (!aircraftModel) { throw CTiglError("No configuration loaded"); } + + auto const& fuelTanks = aircraftModel->GetFuelTanks(); + if (!fuelTanks) { + throw CTiglError("No fuel tanks found"); + } + + return fuelTanks->GetFuelTank(UID); } int CCPACSConfiguration::GetFuelTankIndex(const std::string& UID) const @@ -613,22 +621,30 @@ int CCPACSConfiguration::GetFuelTankIndex(const std::string& UID) const CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() { - if (aircraftModel) { - return *aircraftModel->GetFuelTanks(); - } - else { + if (!aircraftModel) { throw CTiglError("No configuration loaded"); } + + auto const& fuelTanks = aircraftModel->GetFuelTanks(); + if (!fuelTanks) { + throw CTiglError("No fuel tanks found"); + } + + return *aircraftModel->GetFuelTanks(); } const CCPACSFuelTanks& CCPACSConfiguration::GetFuelTanks() const { - if (aircraftModel) { - return *aircraftModel->GetFuelTanks(); - } - else { + if (!aircraftModel) { throw CTiglError("No configuration loaded"); } + + auto const& fuelTanks = aircraftModel->GetFuelTanks(); + if (!fuelTanks) { + throw CTiglError("No fuel tanks found"); + } + + return *aircraftModel->GetFuelTanks(); } boost::optional& CCPACSConfiguration::GetEnginePylons() diff --git a/src/configuration/CCPACSConfiguration.h b/src/configuration/CCPACSConfiguration.h index 8903beb31d..c5dd637adc 100644 --- a/src/configuration/CCPACSConfiguration.h +++ b/src/configuration/CCPACSConfiguration.h @@ -168,7 +168,7 @@ class CCPACSConfiguration TIGL_EXPORT int GetFuelTanksCount() const; // Returns the fuel tank for a given index. - TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index) const; + TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(int index) const; // Returns the fuel tank for a given UID. TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(const std::string& UID) const; From 16559760c6ff79eaae518d37b76bf933dbd5e7eb Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 30 Apr 2025 08:13:46 +0200 Subject: [PATCH 094/122] return CCPACSConfiguration as const reference --- src/fuelTanks/CCPACSFuelTank.cpp | 2 +- src/fuelTanks/CCPACSFuelTank.h | 2 +- src/fuelTanks/CCPACSVessel.cpp | 2 +- src/fuelTanks/CCPACSVessel.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 05cb41c765..30852cf4d7 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -33,7 +33,7 @@ CCPACSFuelTank::CCPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr) { } -CCPACSConfiguration& CCPACSFuelTank::GetConfiguration() const +CCPACSConfiguration const& CCPACSFuelTank::GetConfiguration() const { return GetParent()->GetParent()->GetConfiguration(); } diff --git a/src/fuelTanks/CCPACSFuelTank.h b/src/fuelTanks/CCPACSFuelTank.h index 0c6ebf54f7..49354e402d 100644 --- a/src/fuelTanks/CCPACSFuelTank.h +++ b/src/fuelTanks/CCPACSFuelTank.h @@ -33,7 +33,7 @@ class CCPACSFuelTank : public generated::CPACSFuelTank, public CTiglRelativelyPo public: TIGL_EXPORT CCPACSFuelTank(CCPACSFuelTanks* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration const& GetConfiguration() const; TIGL_EXPORT std::string GetDefaultedUID() const override; TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 4cdf898695..84dc3a790e 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -58,7 +58,7 @@ CCPACSVessel::CCPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr) { } -CCPACSConfiguration& CCPACSVessel::GetConfiguration() const +CCPACSConfiguration const& CCPACSVessel::GetConfiguration() const { return GetParent()->GetParent()->GetConfiguration(); } diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index a3cf56c783..9a86a2ccd2 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -37,7 +37,7 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi TIGL_EXPORT explicit CCPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr); // Get the parent configuration - TIGL_EXPORT CCPACSConfiguration& GetConfiguration() const; + TIGL_EXPORT CCPACSConfiguration const& GetConfiguration() const; // Get the default uID TIGL_EXPORT std::string GetDefaultedUID() const override; From 8811e1d9853233a91068e7bcddfd52c7b1563831 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 30 Apr 2025 10:20:28 +0200 Subject: [PATCH 095/122] add const and non-const methods --- src/fuelTanks/CCPACSFuelTanks.cpp | 7 ++++++- src/fuelTanks/CCPACSFuelTanks.h | 3 ++- src/fuelTanks/CCPACSVessel.cpp | 12 +++++++++++- src/fuelTanks/CCPACSVessel.h | 6 +++++- src/fuelTanks/CCPACSVessels.cpp | 7 ++++++- src/fuelTanks/CCPACSVessels.h | 3 ++- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/fuelTanks/CCPACSFuelTanks.cpp b/src/fuelTanks/CCPACSFuelTanks.cpp index 836cd79b0e..0b8524c1f8 100644 --- a/src/fuelTanks/CCPACSFuelTanks.cpp +++ b/src/fuelTanks/CCPACSFuelTanks.cpp @@ -52,7 +52,12 @@ CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(std::string const& uID) throw CTiglError("Could not find fuelTank with uid " + uID, TIGL_UID_ERROR); } -CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(int index) const +CCPACSFuelTank const& CCPACSFuelTanks::GetFuelTank(int index) const +{ + return const_cast(*this).GetFuelTank(index); +} + +CCPACSFuelTank& CCPACSFuelTanks::GetFuelTank(int index) { index--; if (index < 0 || index >= GetFuelTanksCount()) { diff --git a/src/fuelTanks/CCPACSFuelTanks.h b/src/fuelTanks/CCPACSFuelTanks.h index b1ec278f48..092ff67b27 100644 --- a/src/fuelTanks/CCPACSFuelTanks.h +++ b/src/fuelTanks/CCPACSFuelTanks.h @@ -36,7 +36,8 @@ class CCPACSFuelTanks : public generated::CPACSFuelTanks TIGL_EXPORT CCPACSFuelTank& GetFuelTank(std::string const& uID); // Get a specific fuel tank for a given index. - TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index) const; + TIGL_EXPORT CCPACSFuelTank const& GetFuelTank(int index) const; + TIGL_EXPORT CCPACSFuelTank& GetFuelTank(int index); // Returns the fuel tank index for a given uID. TIGL_EXPORT int GetFuelTankIndex(std::string const& uID) const; diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 84dc3a790e..7db8e8358b 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -89,7 +89,12 @@ int CCPACSVessel::GetSectionCount() const } } -CCPACSFuselageSection& CCPACSVessel::GetSection(int index) const +CCPACSFuselageSection const& CCPACSVessel::GetSection(int index) const +{ + return const_cast(*this).GetSection(index); +} + +CCPACSFuselageSection& CCPACSVessel::GetSection(int index) { if (m_sections_choice1) { return m_sections_choice1.get().GetSection(index); @@ -99,6 +104,11 @@ CCPACSFuselageSection& CCPACSVessel::GetSection(int index) const } } +CCPACSFuselageSection const& CCPACSVessel::GetSection(const std::string& sectionUID) const +{ + return const_cast(*this).GetSection(sectionUID); +} + CCPACSFuselageSection& CCPACSVessel::GetSection(const std::string& sectionUID) { if (m_sections_choice1) { diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 9a86a2ccd2..b928fcfed6 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -49,9 +49,13 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi // Get number of sections TIGL_EXPORT int GetSectionCount() const; + // Get a specific section - TIGL_EXPORT CCPACSFuselageSection& GetSection(int index) const; + TIGL_EXPORT CCPACSFuselageSection const& GetSection(int index) const; + TIGL_EXPORT CCPACSFuselageSection& GetSection(int index); + TIGL_EXPORT CCPACSFuselageSection const& GetSection(const std::string& sectionUID) const; TIGL_EXPORT CCPACSFuselageSection& GetSection(const std::string& sectionUID); + // Get a section face TIGL_EXPORT TopoDS_Shape GetSectionFace(const std::string sectionUID) const; diff --git a/src/fuelTanks/CCPACSVessels.cpp b/src/fuelTanks/CCPACSVessels.cpp index 75c47c235a..f29773b17e 100644 --- a/src/fuelTanks/CCPACSVessels.cpp +++ b/src/fuelTanks/CCPACSVessels.cpp @@ -52,7 +52,12 @@ CCPACSVessel& CCPACSVessels::GetVessel(std::string const& uID) throw CTiglError("Could not find vessel with uid " + uID, TIGL_UID_ERROR); } -CCPACSVessel& CCPACSVessels::GetVessel(int index) const +CCPACSVessel const& CCPACSVessels::GetVessel(int index) const +{ + return const_cast(*this).GetVessel(index); +} + +CCPACSVessel& CCPACSVessels::GetVessel(int index) { index--; if (index < 0 || index >= GetVesselsCount()) { diff --git a/src/fuelTanks/CCPACSVessels.h b/src/fuelTanks/CCPACSVessels.h index 6068831053..3f18ec2e38 100644 --- a/src/fuelTanks/CCPACSVessels.h +++ b/src/fuelTanks/CCPACSVessels.h @@ -37,7 +37,8 @@ class CCPACSVessels : public generated::CPACSVessels TIGL_EXPORT CCPACSVessel& GetVessel(std::string const& uID); // Get a specific vessel for a given index. - TIGL_EXPORT CCPACSVessel& GetVessel(int index) const; + TIGL_EXPORT CCPACSVessel const& GetVessel(int index) const; + TIGL_EXPORT CCPACSVessel& GetVessel(int index); // Returns the vessel index for a given uID. TIGL_EXPORT int GetVesselIndex(const std::string& uID) const; From 3f4e73404bb4b6bc6b481c053c8e1512209533ae Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 30 Apr 2025 12:16:32 +0200 Subject: [PATCH 096/122] refactoring EvaluateDome function --- src/fuelTanks/CCPACSVessel.cpp | 71 ++++++++++++++-------------------- src/fuelTanks/CCPACSVessel.h | 8 ++-- 2 files changed, 32 insertions(+), 47 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 7db8e8358b..a28910c92a 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -248,58 +248,46 @@ bool CCPACSVessel::IsVesselViaDesignParameters() const bool CCPACSVessel::HasSphericalDome() const { - EvaluateDome(); - if (_ellipsoidPtr && _ellipsoidPtr->GetHalfAxisFraction() == 1) { - return true; - } - else { - return false; - } + return GetEllipsoidDome() && GetEllipsoidDome()->GetHalfAxisFraction() == 1.0; } bool CCPACSVessel::HasEllipsoidDome() const { - EvaluateDome(); - if (_ellipsoidPtr) { - return true; - } - else { - return false; - } + return GetEllipsoidDome() != nullptr; } bool CCPACSVessel::HasIsotensoidDome() const { - EvaluateDome(); - if (_isotensoidPtr) { - return true; - } - else { - return false; - } + return GetIsotensoidDome() != nullptr; } bool CCPACSVessel::HasTorisphericalDome() const { - EvaluateDome(); - if (_torisphericalPtr) { - return true; + return GetTorisphericalDome() != nullptr; +} + +CCPACSEllipsoidDome const* CCPACSVessel::GetEllipsoidDome() const +{ + if (m_domeType_choice2) { + return m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); } - else { - return false; + return nullptr; +} + +CCPACSTorisphericalDome const* CCPACSVessel::GetTorisphericalDome() const +{ + if (m_domeType_choice2) { + return m_domeType_choice2->GetTorispherical_choice2().get_ptr(); } + return nullptr; } -void CCPACSVessel::EvaluateDome() const +CCPACSIsotensoidDome const* CCPACSVessel::GetIsotensoidDome() const { - if (!_isEvaluated) { - if (m_domeType_choice2) { - _ellipsoidPtr = m_domeType_choice2->GetEllipsoid_choice1().get_ptr(); - _torisphericalPtr = m_domeType_choice2->GetTorispherical_choice2().get_ptr(); - _isotensoidPtr = m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); - } - _isEvaluated = true; + if (m_domeType_choice2) { + return m_domeType_choice2->GetIsotensoid_choice3().get_ptr(); } + return nullptr; } void CCPACSVessel::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, @@ -381,7 +369,7 @@ void CCPACSVessel::BuildVesselWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double axRatio = _ellipsoidPtr->GetHalfAxisFraction(); + double axRatio = GetEllipsoidDome()->GetHalfAxisFraction(); if (axRatio < 0.0) { throw CTiglError("Half axis fraction (" + std::to_string(axRatio) + ") of vessel \"" + GetName() + "\" (uID=\"" + GetUID() + "\") must be a positive value!"); @@ -431,8 +419,8 @@ void CCPACSVessel::BuildVesselWireTorispherical(BRepBuilderAPI_MakeWire& wire) c double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double R = _torisphericalPtr->GetDishRadius(); // Radius of the sphere (crown radius) - double r = _torisphericalPtr->GetKnuckleRadius(); // Radius of the torus (knuckle radius) + double R = GetTorisphericalDome()->GetDishRadius(); // Radius of the sphere (crown radius) + double r = GetTorisphericalDome()->GetKnuckleRadius(); // Radius of the torus (knuckle radius) if (R <= cylinderRadius) { throw CTiglError("The dish radius (" + std::to_string(R) + ") of vessel \"" + GetName() + "\" (uID=\"" + @@ -482,7 +470,7 @@ void CCPACSVessel::BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) cons double cylinderRadius = m_cylinderRadius_choice2.get(); double cylinderLength = m_cylinderLength_choice2.get(); - double polarOpeningRadius = _isotensoidPtr->GetPolarOpeningRadius(); + double polarOpeningRadius = GetIsotensoidDome()->GetPolarOpeningRadius(); if (polarOpeningRadius <= 0 || polarOpeningRadius >= cylinderRadius) { throw CTiglError("The polar opening radius (" + std::to_string(polarOpeningRadius) + ") of vessel \"" + GetName() + "\" (uID=\"" + GetUID() + @@ -531,13 +519,13 @@ void CCPACSVessel::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than or equal to 0!"); } - if (_ellipsoidPtr) { + if (GetEllipsoidDome()) { BuildVesselWireEllipsoid(wire); } - else if (_torisphericalPtr) { + else if (GetTorisphericalDome()) { BuildVesselWireTorispherical(wire); } - else if (_isotensoidPtr) { + else if (GetIsotensoidDome()) { BuildVesselWireIsotensoid(wire); } @@ -563,7 +551,6 @@ PNamedShape CCPACSVessel::BuildLoft() const return loft; } else if (m_domeType_choice2) { - EvaluateDome(); BuildShapeFromSimpleParameters(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); return loft; diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index b928fcfed6..45bf008b68 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -116,11 +116,9 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi const std::string _vesselTypeException = "This method is only available for vessels with segments. No segment found."; - mutable const tigl::generated::CPACSEllipsoidDome* _ellipsoidPtr = NULL; - mutable const tigl::generated::CPACSTorisphericalDome* _torisphericalPtr = NULL; - mutable const tigl::generated::CPACSIsotensoidDome* _isotensoidPtr = NULL; - mutable bool _isEvaluated = false; - void EvaluateDome() const; + CCPACSEllipsoidDome const* GetEllipsoidDome() const; + CCPACSTorisphericalDome const* GetTorisphericalDome() const; + CCPACSIsotensoidDome const* GetIsotensoidDome() const; // Get short name for loft std::string GetShortShapeName() const; From 8146075d90c0974ec81a21f95f85e814f05a603a Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 30 Apr 2025 12:30:20 +0200 Subject: [PATCH 097/122] remove getPoint and pointBehavior functions for now --- src/fuelTanks/CCPACSVessel.cpp | 22 ---------------------- src/fuelTanks/CCPACSVessel.h | 10 ---------- tests/unittests/test_fuelTanks.py | 18 ------------------ tests/unittests/tiglTanks.cpp | 10 ---------- 4 files changed, 60 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index a28910c92a..08f80ed4f4 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -562,28 +562,6 @@ PNamedShape CCPACSVessel::BuildLoft() const } } -gp_Pnt CCPACSVessel::GetPoint(int segmentIndex, double eta, double zeta) -{ - // ToDo: This functionality could also be implemented for parametric vessels, if needed - if (m_segments_choice1) { - return ((CCPACSFuselageSegment&)GetSegment(segmentIndex)).GetPoint(eta, zeta, _getPointBehavior); - } - else { - throw CTiglError(_vesselTypeException); - } -} - -// Sets the GetPoint behavior to asParameterOnSurface or onLinearLoft -void CCPACSVessel::SetGetPointBehavior(TiglGetPointBehavior behavior) -{ - _getPointBehavior = behavior; -} - -TiglGetPointBehavior CCPACSVessel::GetGetPointBehavior() const -{ - return _getPointBehavior; -} - CCPACSGuideCurve& CCPACSVessel::GetGuideCurveSegment(std::string uid) { return const_cast(static_cast(*this).GetGuideCurveSegment(uid)); diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 45bf008b68..8e2d230de3 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -76,16 +76,6 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi // Get the circumference of the vessel TIGL_EXPORT double GetCircumference(int segmentIndex, double eta); - // Get a point on the given vessel segment in dependence of a parameters eta and zeta with - // 0.0 <= eta <= 1.0 and 0.0 <= zeta <= 1.0. For eta = 0.0 the point lies on the start - // profile of the segment, for eta = 1.0 on the end profile of the segment. For zeta = 0.0 - // the point is the start point of the profile wire, for zeta = 1.0 the last profile wire point. - TIGL_EXPORT gp_Pnt GetPoint(int segmentIndex, double eta, double zeta); - // Set the _getPointBehavior to asParameterOnSurface or onLinearLoft - TIGL_EXPORT void SetGetPointBehavior(TiglGetPointBehavior behavior = asParameterOnSurface); - // Get the _getPointBehavior - TIGL_EXPORT TiglGetPointBehavior GetGetPointBehavior() const; - // Get the guide curve segment (partial guide curve) with a given uID TIGL_EXPORT CCPACSGuideCurve& GetGuideCurveSegment(std::string uid); TIGL_EXPORT const CCPACSGuideCurve& GetGuideCurveSegment(std::string uid) const; diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 580c661b7c..95ac6c3b51 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -224,24 +224,6 @@ def test_vessel_loft_evaluation(self): vessel_parametric.get_circumference(1, 0.5) self.assertEqual(str(context.exception), self.tank_type_exception_msg) - point = vessel_segments.get_point(1, 0.5, 0.5) - self.assertAlmostEqual(round(point.X(), 2), 1.54) - self.assertAlmostEqual(round(point.Y(), 2), 0.0) - self.assertAlmostEqual(round(point.Z(), 2), -1.2) - with self.assertRaises(RuntimeError) as context: - vessel_parametric.get_point(1, 0.5, 0.5) - self.assertEqual(str(context.exception), self.tank_type_exception_msg) - - self.assertEqual( - vessel_segments.get_get_point_behavior(), configuration.asParameterOnSurface - ) - self.assertIsNone( - vessel_segments.set_get_point_behavior(configuration.onLinearLoft) - ) - self.assertEqual( - vessel_segments.get_get_point_behavior(), configuration.onLinearLoft - ) - def test_structure(self): structure_with_walls = self.vessel_isotensoid.get_structure() structure_with_stringer_frames = self.vessel_segments.get_structure() diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index c8d7033079..25ff7a4a40 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -336,16 +336,6 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_NEAR(vessel_segments->GetCircumference(1, 0.5), 7.43, 1e-2); CheckExceptionMessage([&]() { vessel_parametric->GetCircumference(1, 0.5); }, tankTypeExceptionString); - auto point = vessel_segments->GetPoint(1, 0.5, 0.5); - EXPECT_NEAR(point.X(), 1.54, 1e-2); - EXPECT_NEAR(point.Y(), 0, 1e-5); - EXPECT_NEAR(point.Z(), -1.2, 1e-1); - CheckExceptionMessage([&]() { vessel_parametric->GetPoint(1, 0.5, 0.5); }, tankTypeExceptionString); - - EXPECT_EQ(vessel_segments->GetGetPointBehavior(), asParameterOnSurface); - EXPECT_NO_THROW(vessel_segments->SetGetPointBehavior(onLinearLoft)); - EXPECT_EQ(vessel_segments->GetGetPointBehavior(), onLinearLoft); - EXPECT_THROW(vessel_corrupt->GetLoft(), tigl::CTiglError); EXPECT_THROW(dummyVessel.GetLoft(), tigl::CTiglError); } From 84c06d06b2364791f03cb800005a9bdc45ded74b Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Sat, 3 May 2025 21:21:51 +0200 Subject: [PATCH 098/122] refactor isotensoid contour by introducing a struct and extending the documentation --- src/fuelTanks/CCPACSVessel.cpp | 50 ++++++++++++++++++---------------- src/fuelTanks/CCPACSVessel.h | 30 +++++++++++++++++--- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 08f80ed4f4..9220dd79a0 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -290,38 +290,40 @@ CCPACSIsotensoidDome const* CCPACSVessel::GetIsotensoidDome() const return nullptr; } -void CCPACSVessel::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, - std::vector& r) const +CCPACSVessel::IsotensoidContour::IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber) { double dPhi = 1.0 / nodeNumber; - r.push_back(rCyl); - x.push_back(0.0); + radii.push_back(rCyl); + axialPositions.push_back(0.0); double phi = 0.0; double alpha = std::asin(rPolarOpening / rCyl); - // Isotensoid dome contours are described by a differential equation. The following code is an analytical approximation - // provided by the DLR Institute of Lightweight Systems. - while (std::tan(alpha) * std::tan(alpha) < 2 && r.back() > 1.22 * rPolarOpening) { + while (std::tan(alpha) * std::tan(alpha) < 2 && radii.back() > 1.22 * rPolarOpening) { phi += dPhi; - alpha = std::asin(rPolarOpening / r.back()); - double rm = r.back() / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); + alpha = std::asin(rPolarOpening / radii.back()); + + double rm = radii.back() / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); double dr = rm * dPhi * std::sin(phi); - r.push_back(r.back() - dr); + radii.push_back(radii.back() - dr); + double dx = rm * dPhi * std::cos(phi); - x.push_back(x.back() + dx); + axialPositions.push_back(axialPositions.back() + dx); } - double slope = (r.back() - r[r.size() - 2]) / (x.back() - x[x.size() - 2]); + // Add 5 points linear until polar opening + double slope = + (radii.back() - radii[radii.size() - 2]) / (axialPositions.back() - axialPositions[axialPositions.size() - 2]); for (int i = 0; i < 5; ++i) { - x.push_back(x.back() + (rPolarOpening - r.back()) / slope); - r.push_back(r.back() + slope * (x.back() - x[x.size() - 2])); + axialPositions.push_back(axialPositions.back() + (rPolarOpening - radii.back()) / slope); + radii.push_back(radii.back() + slope * (axialPositions.back() - axialPositions[axialPositions.size() - 2])); } - double dx = x.back() - x.front(); - for (auto& val : x) { - val -= dx; + // Shifting to x=0 + double totalDx = axialPositions.back() - axialPositions.front(); + for (double& v : axialPositions) { + v -= totalDx; } } @@ -478,18 +480,18 @@ void CCPACSVessel::BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) cons std::to_string(cylinderRadius) + ")!"); } - std::vector x, r; - IsotensoidContour(cylinderRadius, polarOpeningRadius, 50, x, r); - double h = x.back() - x.front(); + // 50 Points is chosen as a compromise between performance and accuracy + IsotensoidContour contour(cylinderRadius, polarOpeningRadius, 50); + double h = contour.axialPositions.back() - contour.axialPositions.front(); - TColgp_Array1OfPnt array(1, x.size()); - for (size_t i = 0; i < x.size(); ++i) { - array.SetValue(i + 1, gp_Pnt(-x[i], 0.0, r[i])); + TColgp_Array1OfPnt array(1, contour.axialPositions.size()); + for (size_t i = 0; i < contour.axialPositions.size(); ++i) { + array.SetValue(i + 1, gp_Pnt(-contour.axialPositions[i], 0.0, contour.radii[i])); } Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(bspline); - TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-x.back(), 0.0, 0.0)); + TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-contour.axialPositions.back(), 0.0, 0.0)); TopoDS_Vertex v2 = TopExp::LastVertex(domeEdge); TopoDS_Edge lidEdge = BRepBuilderAPI_MakeEdge(v1, v2); diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 8e2d230de3..4b24599d78 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -113,10 +113,6 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi // Get short name for loft std::string GetShortShapeName() const; - TiglGetPointBehavior _getPointBehavior{asParameterOnSurface}; - void IsotensoidContour(double rCyl, double rPolarOpening, int nodeNumber, std::vector& x, - std::vector& r) const; - void BuildShapeFromSegments(TopoDS_Shape& loftShape) const; void BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const; @@ -124,6 +120,32 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi void BuildVesselWireEllipsoid(BRepBuilderAPI_MakeWire& wire) const; void BuildVesselWireTorispherical(BRepBuilderAPI_MakeWire& wire) const; void BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) const; + + /** + * @brief Approximated contour of an isotensoid dome section. + * + * This struct computes and stores the axial profile and corresponding radii + * of an isotensoid dome, starting from a cylindrical base and ending at the + * polar opening. + * + * @details + * The algorithmic approach is based on patent EP0714753A2. For a more in-depth + * treatment of the theory and practical applications, see: + * Vasiliev, Valery V. Composite pressure vessels: Design, analysis, and + * manufacturing. Bull Ridge Corporation, 2009. + * + * @param cylinderRadius Radius of the initial cylindrical base. + * @param polarOpeningRadius Radius at the polar opening of the dome. + * @param nodeNumber Number of integration steps used to sample + * the contour curve + */ + struct IsotensoidContour { + + std::vector axialPositions; + std::vector radii; + + IsotensoidContour(double cylinderRadius, double polarOpeningRadius, int nodeNumber); + }; }; } // namespace tigl From ab21f7ec69547caec92d91f08379b26ba4cb2787 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 5 May 2025 10:25:38 +0200 Subject: [PATCH 099/122] add null pointer checks for parametric vessels --- src/fuelTanks/CCPACSVessel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 9220dd79a0..7b63bece54 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -510,7 +510,12 @@ void CCPACSVessel::BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) cons void CCPACSVessel::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const { - BRepBuilderAPI_MakeWire wire; + + if (!m_domeType_choice2 || !m_cylinderRadius_choice2 || !m_cylinderLength_choice2) { + throw CTiglError("Parametric vessel specification incomplete: " + "cylinderRadius, cylinderLength and domeType required.", + TIGL_ERROR); + } if (m_cylinderRadius_choice2.get() <= 0) { throw CTiglError("The cylinder radius (" + std::to_string(m_cylinderRadius_choice2.get()) + ") of vessel \"" + @@ -521,6 +526,8 @@ void CCPACSVessel::BuildShapeFromSimpleParameters(TopoDS_Shape& loftShape) const GetName() + "\" (uID=\"" + GetUID() + "\") must be larger than or equal to 0!"); } + BRepBuilderAPI_MakeWire wire; + if (GetEllipsoidDome()) { BuildVesselWireEllipsoid(wire); } From c427b08e5243a03c61122831301dc73726042067 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 5 May 2025 10:51:02 +0200 Subject: [PATCH 100/122] move bspline and edge conversion to isotensoid contour struct --- src/fuelTanks/CCPACSVessel.cpp | 24 ++++++++++++++++-------- src/fuelTanks/CCPACSVessel.h | 4 ++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 7b63bece54..7b35f03f3b 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -327,6 +327,20 @@ CCPACSVessel::IsotensoidContour::IsotensoidContour(double rCyl, double rPolarOpe } } +Handle(Geom_BSplineCurve) CCPACSVessel::IsotensoidContour::ToBSpline() const +{ + TColgp_Array1OfPnt pts(1, (int)axialPositions.size()); + for (size_t i = 0; i < axialPositions.size(); ++i) { + pts.SetValue((int)i + 1, gp_Pnt(-axialPositions[i], 0.0, radii[i])); + } + return GeomAPI_PointsToBSpline(pts).Curve(); +} + +TopoDS_Edge CCPACSVessel::IsotensoidContour::ToEdge() const +{ + return BRepBuilderAPI_MakeEdge(ToBSpline()); +} + void CCPACSVessel::BuildShapeFromSegments(TopoDS_Shape& loftShape) const { const auto& segments = m_segments_choice1.get(); @@ -482,14 +496,7 @@ void CCPACSVessel::BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) cons // 50 Points is chosen as a compromise between performance and accuracy IsotensoidContour contour(cylinderRadius, polarOpeningRadius, 50); - double h = contour.axialPositions.back() - contour.axialPositions.front(); - - TColgp_Array1OfPnt array(1, contour.axialPositions.size()); - for (size_t i = 0; i < contour.axialPositions.size(); ++i) { - array.SetValue(i + 1, gp_Pnt(-contour.axialPositions[i], 0.0, contour.radii[i])); - } - Handle(Geom_BSplineCurve) bspline = GeomAPI_PointsToBSpline(array).Curve(); - TopoDS_Edge domeEdge = BRepBuilderAPI_MakeEdge(bspline); + TopoDS_Edge domeEdge = contour.ToEdge(); TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-contour.axialPositions.back(), 0.0, 0.0)); TopoDS_Vertex v2 = TopExp::LastVertex(domeEdge); @@ -498,6 +505,7 @@ void CCPACSVessel::BuildVesselWireIsotensoid(BRepBuilderAPI_MakeWire& wire) cons std::vector edges = {lidEdge, domeEdge}; if (cylinderLength > 0.0) { + double h = contour.axialPositions.back() - contour.axialPositions.front(); TopoDS_Vertex v1 = TopExp::FirstVertex(domeEdge); TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.5 * cylinderLength + h, 0.0, cylinderRadius)); diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 4b24599d78..86b461a1ce 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -145,6 +145,10 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi std::vector radii; IsotensoidContour(double cylinderRadius, double polarOpeningRadius, int nodeNumber); + + Handle(Geom_BSplineCurve) ToBSpline() const; + TopoDS_Edge ToEdge() const; + }; }; From 76b1ade83d8f8d92cf2344b36ef2c434e6cc7900 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 5 May 2025 15:21:30 +0200 Subject: [PATCH 101/122] add faceTraits for parametric vessels --- src/fuelTanks/CCPACSVessel.cpp | 37 +++++++++++++++++++++++++++------- src/fuelTanks/CCPACSVessel.h | 3 ++- tests/unittests/tiglTanks.cpp | 2 +- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 7b35f03f3b..e05fcae7c8 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) * * Created: 2022-03-15 Anton Reiswich @@ -191,15 +191,13 @@ double CCPACSVessel::GetGeometricVolume() double CCPACSVessel::GetSurfaceArea() { const PNamedShape& shape = GetLoft(); - - // Loop over all faces that are not symmetry, front or rear - double area = 0.; + double area = 0.; TopTools_IndexedMapOfShape shapeMap; TopExp::MapShapes(shape->Shape(), TopAbs_FACE, shapeMap); for (int i = 1; i <= shapeMap.Extent(); ++i) { const std::string& faceName = shape->GetFaceTraits(i - 1).Name(); - if (GetUID() == faceName) { + if (faceName != "symmetry") { const TopoDS_Face& face = TopoDS::Face(shapeMap(i)); GProp_GProps shapeProps; BRepGProp::SurfaceProperties(face, shapeProps); @@ -564,12 +562,13 @@ PNamedShape CCPACSVessel::BuildLoft() const if (m_sections_choice1) { BuildShapeFromSegments(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); - SetFaceTraits(loft); + SetFaceTraitsFromSegments(loft); return loft; } else if (m_domeType_choice2) { BuildShapeFromSimpleParameters(loftShape); PNamedShape loft(new CNamedShape(loftShape, loftName.c_str(), loftShortName.c_str())); + SetFaceTraitsFromParams(loft); return loft; } else { @@ -650,7 +649,7 @@ std::string CCPACSVessel::GetShortShapeName() const return "UNKNOWN"; } -void CCPACSVessel::SetFaceTraits(PNamedShape loft) const +void CCPACSVessel::SetFaceTraitsFromSegments(PNamedShape loft) const { int nFacesTotal = GetNumberOfFaces(loft->Shape()); int nFacesAero = nFacesTotal; @@ -689,4 +688,28 @@ void CCPACSVessel::SetFaceTraits(PNamedShape loft) const } } + +void CCPACSVessel::SetFaceTraitsFromParams(PNamedShape loft) const +{ + int nFaces = GetNumberOfFaces(loft->Shape()); + + if (nFaces != 4 && nFaces != 6) { + const char* vesselName = loft->Name().c_str(); + for (int i = 0; i < nFaces; ++i) { + loft->FaceTraits(i).SetName(vesselName); + } + return; + } + + // Cylinders are always the two middel segments + const int cylCount = 2; + const int cylStart = (nFaces - cylCount) / 2; + const int cylEnd = cylStart + cylCount; + + for (int i = 0; i < nFaces; ++i) { + const char* tag = (i >= cylStart && i < cylEnd) ? "Cylinder" : "Dome"; + loft->FaceTraits(i).SetName(tag); + } +} + } //namespace tigl diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 86b461a1ce..2534b4dd00 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -100,7 +100,8 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi PNamedShape BuildLoft() const override; // Set the face traits - void SetFaceTraits(PNamedShape loft) const; + void SetFaceTraitsFromSegments(PNamedShape loft) const; + void SetFaceTraitsFromParams(PNamedShape loft) const; private: const std::string _vesselTypeException = diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 25ff7a4a40..d8b16b9b7c 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -326,7 +326,7 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_NEAR(vessel_torispherical->GetGeometricVolume(), 7.87, 1e-2); EXPECT_NEAR(vessel_isotensoid->GetGeometricVolume(), 9.01, 1e-2); - EXPECT_NEAR(vessel_segments->GetSurfaceArea(), 11.15, 1e-2); + EXPECT_NEAR(vessel_segments->GetSurfaceArea(), 19.93, 1e-2); EXPECT_NEAR(vessel_spherical->GetSurfaceArea(), 36.19, 1e-2); EXPECT_NEAR(vessel_ellipsoid1->GetSurfaceArea(), 16.22, 1e-2); EXPECT_NEAR(vessel_ellipsoid2->GetSurfaceArea(), 1.47, 1e-2); From b4cea2e65591713fa34e06b9d25fa45476e3c5e3 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 5 May 2025 20:40:07 +0200 Subject: [PATCH 102/122] make _vesselTypeException a static member variable --- src/fuelTanks/CCPACSVessel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 2534b4dd00..322de5b34d 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -104,7 +104,7 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi void SetFaceTraitsFromParams(PNamedShape loft) const; private: - const std::string _vesselTypeException = + inline static const std::string _vesselTypeException = "This method is only available for vessels with segments. No segment found."; CCPACSEllipsoidDome const* GetEllipsoidDome() const; From b29319000a999d4dfc9f4fe33985d207c20633ec Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 6 May 2025 11:59:48 +0200 Subject: [PATCH 103/122] move CheckExceptionMessage to testUtils and use string_view --- tests/common/testUtils.h | 5 ++++- tests/unittests/testUtils.cpp | 15 +++++++++++++++ tests/unittests/tiglTanks.cpp | 16 +--------------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/common/testUtils.h b/tests/common/testUtils.h index f9b7e386aa..b5990d544e 100644 --- a/tests/common/testUtils.h +++ b/tests/common/testUtils.h @@ -24,6 +24,8 @@ #define TESTUTILS_H #include +#include +#include #include #include @@ -34,6 +36,7 @@ void outputXY(const int & i, const double& x, const double&y, const std::string& filename); void outputXYVector(const int& i, const double& x, const double& y, const double& vx, const double& vy, const std::string& filename); void StoreResult(const std::string& filename, const Handle(Geom_BSplineCurve)& curve, const TColgp_Array1OfPnt& pt); +void CheckExceptionMessage(const std::function& func, std::string_view expectedMessage); Handle(Geom_BSplineSurface) LoadBSplineSurface(const std::string& filename); Handle(Geom_BSplineCurve) LoadBSplineCurve(const std::string& filename); @@ -46,7 +49,7 @@ class CaptureTiGLLog std::string log(); ~CaptureTiGLLog(); - + private: TiglLogLevel _oldVerbosityLevel; }; diff --git a/tests/unittests/testUtils.cpp b/tests/unittests/testUtils.cpp index c8d0f71b42..d10314a2e4 100644 --- a/tests/unittests/testUtils.cpp +++ b/tests/unittests/testUtils.cpp @@ -21,6 +21,7 @@ */ #include"testUtils.h" +#include "CTiglError.h" #include #include #include @@ -119,3 +120,17 @@ CaptureTiGLLog::~CaptureTiGLLog() { tigl::CTiglLogging::Instance().SetConsoleVerbosity(_oldVerbosityLevel); } + +void CheckExceptionMessage(const std::function& func, std::string_view expectedMessage) +{ + try { + func(); + FAIL() << "Expected tigl::CTiglError but no exception was thrown."; + } + catch (const tigl::CTiglError& e) { + EXPECT_STREQ(e.what(), expectedMessage.data()); + } + catch (...) { + FAIL() << "Expected tigl::CTiglError but a different exception was thrown."; + } +} diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index d8b16b9b7c..c1553f6c68 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -22,6 +22,7 @@ #include "test.h" #include "tigl.h" +#include "testUtils.h" #include "CCPACSFuelTank.h" #include "CCPACSFuelTanks.h" @@ -38,21 +39,6 @@ constexpr const char* tankTypeExceptionString = "This method is only available for vessels with segments. No segment found."; constexpr const char* invalidIndexMessage = "Invalid index in CCPACSFuselageSections::GetSection"; constexpr const char* wrongSectionUIDMessage = "GetSectionFace: Could not find a fuselage section for the given UID"; - -// Helper function to check exception messages. -void CheckExceptionMessage(const std::function& func, const char* expectedMessage) -{ - try { - func(); - FAIL() << "Expected tigl::CTiglError but no exception was thrown."; - } - catch (const tigl::CTiglError& e) { - EXPECT_STREQ(e.what(), expectedMessage); - } - catch (...) { - FAIL() << "Expected tigl::CTiglError but a different exception was thrown."; - } -} } // anonymous namespace // Dummy class for exception handling tests From f4cffca82464438073ce419722651c8086627189 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 6 May 2025 12:02:41 +0200 Subject: [PATCH 104/122] remove unnessesary include --- tests/common/testUtils.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/common/testUtils.h b/tests/common/testUtils.h index b5990d544e..e9678b1647 100644 --- a/tests/common/testUtils.h +++ b/tests/common/testUtils.h @@ -24,7 +24,6 @@ #define TESTUTILS_H #include -#include #include #include From f1358e8496650030afa331179379a5cdfe072744 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 6 May 2025 20:17:33 +0200 Subject: [PATCH 105/122] renae dummyPositionings -> emptyPositionings --- src/fuselage/CTiglFuselageConnection.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index fa3ba8d450..d7594d1d17 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -173,8 +173,7 @@ CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSection boost::optional& CTiglFuselageConnection::GetParentComponentPositionings() const { - // ToDo: is there a better implementation for Elements not having a positionings element? - static boost::optional dummyPositionings; + static boost::optional emptyPositionings; if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetPositionings(); @@ -183,7 +182,7 @@ boost::optional& CTiglFuselageConnection::GetParentComponent return segment->GetParent()->GetParent()->GetPositionings(); } else if (segment->GetParent()->IsParent()) { - return dummyPositionings; + return emptyPositionings; } else { throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); From 68d2789e15a7fc2f8b469283349c6ba2a459af05 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 7 May 2025 14:58:45 +0200 Subject: [PATCH 106/122] add ParentComponentHasPositionings to CTiglFuselageConnection --- src/fuselage/CCPACSFuselage.cpp | 10 ++++++---- src/fuselage/CCPACSFuselageSegment.cpp | 8 +++++--- src/fuselage/CTiglFuselageConnection.cpp | 10 +++++----- src/fuselage/CTiglFuselageConnection.h | 3 +++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/fuselage/CCPACSFuselage.cpp b/src/fuselage/CCPACSFuselage.cpp index 38257e851e..343270be0d 100644 --- a/src/fuselage/CCPACSFuselage.cpp +++ b/src/fuselage/CCPACSFuselage.cpp @@ -463,10 +463,12 @@ TopoDS_Shape transformFuselageProfileGeometry(const CTiglTransformation& fuselTr trafo.PreMultiply(connection.GetSectionTransformation()); // Do positioning transformations - boost::optional posTrans = connection.GetPositioningTransformation(); - if (posTrans) { - trafo.PreMultiply(*posTrans); - } + if (connection.ParentComponentHasPositionings()) { + boost::optional posTrans = connection.GetPositioningTransformation(); + if (posTrans) { + trafo.PreMultiply(*posTrans); + } + } trafo.PreMultiply(fuselTransform); diff --git a/src/fuselage/CCPACSFuselageSegment.cpp b/src/fuselage/CCPACSFuselageSegment.cpp index 3e69e5667f..b988442953 100644 --- a/src/fuselage/CCPACSFuselageSegment.cpp +++ b/src/fuselage/CCPACSFuselageSegment.cpp @@ -102,9 +102,11 @@ namespace trafo.PreMultiply(connection.GetSectionTransformation()); // Do positioning transformations - boost::optional connectionTransform = connection.GetPositioningTransformation(); - if (connectionTransform) - trafo.PreMultiply(*connectionTransform); + if (connection.ParentComponentHasPositionings()) { + boost::optional connectionTransform = connection.GetPositioningTransformation(); + if (connectionTransform) + trafo.PreMultiply(*connectionTransform); + } trafo.PreMultiply(fuselTransform); diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index d7594d1d17..71ced808c3 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -154,6 +154,11 @@ CTiglTransformation CTiglFuselageConnection::GetSectionElementTransformation() c return transformation; } +bool CTiglFuselageConnection::ParentComponentHasPositionings() const +{ + return (segment->GetParent()->IsParent() || segment->GetParent()->IsParent()); +} + CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSections() const { if (segment->GetParent()->IsParent()) { @@ -173,17 +178,12 @@ CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSection boost::optional& CTiglFuselageConnection::GetParentComponentPositionings() const { - static boost::optional emptyPositionings; - if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetPositionings(); } else if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetPositionings(); } - else if (segment->GetParent()->IsParent()) { - return emptyPositionings; - } else { throw CTiglError("CTiglFuselageConnection: Unknown parent for segment."); } diff --git a/src/fuselage/CTiglFuselageConnection.h b/src/fuselage/CTiglFuselageConnection.h index 304612037b..2bee9464ed 100644 --- a/src/fuselage/CTiglFuselageConnection.h +++ b/src/fuselage/CTiglFuselageConnection.h @@ -69,6 +69,9 @@ class CTiglFuselageConnection // Returns the section element matrix referenced by this connection TIGL_EXPORT CTiglTransformation GetSectionElementTransformation() const; + // Returns whether the parent component has positionings + TIGL_EXPORT bool ParentComponentHasPositionings() const; + private: CCPACSFuselageSections const& GetParentComponentSections() const; From cdfb617f6c76757d99f6bdcea1934c585238010f Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 7 May 2025 15:07:12 +0200 Subject: [PATCH 107/122] remove ToDo remark --- src/fuselage/CTiglFuselageConnection.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fuselage/CTiglFuselageConnection.cpp b/src/fuselage/CTiglFuselageConnection.cpp index 71ced808c3..9caceba786 100644 --- a/src/fuselage/CTiglFuselageConnection.cpp +++ b/src/fuselage/CTiglFuselageConnection.cpp @@ -167,7 +167,6 @@ CCPACSFuselageSections const& CTiglFuselageConnection::GetParentComponentSection else if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetSections(); } - // ToDo: add exception handling else if (segment->GetParent()->IsParent()) { return segment->GetParent()->GetParent()->GetSections_choice1().get(); } From c819921090d9a4f7788ae188e4ee9716642334a7 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Thu, 8 May 2025 11:30:34 +0200 Subject: [PATCH 108/122] add tests covering const GetSection methods --- tests/unittests/tiglTanks.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index c1553f6c68..7101af9006 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -249,11 +249,15 @@ TEST_F(FuelTanks, vessel_type_info) TEST_F(FuelTanks, vessel_sections) { + const tigl::CCPACSVessel* constSegments = vessel_segments; + EXPECT_EQ(vessel_segments->GetSectionCount(), 3); EXPECT_EQ(vessel_parametric->GetSectionCount(), 0); EXPECT_NO_THROW(vessel_segments->GetSection(1)); + EXPECT_NO_THROW(constSegments->GetSection(1)); EXPECT_NO_THROW(vessel_segments->GetSection("outerVessel_section1")); + EXPECT_NO_THROW(constSegments->GetSection("outerVessel_section1")); EXPECT_THROW(vessel_segments->GetSection("outerVessel_notExistingSection"), tigl::CTiglError); CheckExceptionMessage([&]() { vessel_segments->GetSection(4); }, invalidIndexMessage); From d23a3151860c049b7dfaf31c3cba92a323718ad6 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Thu, 8 May 2025 11:40:00 +0200 Subject: [PATCH 109/122] add tests covering parametric faceTraits --- tests/unittests/tiglTanks.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 7101af9006..86ad3ff594 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -376,6 +376,14 @@ TEST_F(FuelTanks, vessel_face_traits) EXPECT_EQ(standard_loft->FaceTraits(1).Name(), vessel_segments->GetUID()); EXPECT_EQ(standard_loft->FaceTraits(2).Name(), "Front"); EXPECT_EQ(standard_loft->FaceTraits(3).Name(), "Rear"); + + auto parametric_loft = vessel_torispherical->GetLoft(); + EXPECT_EQ(parametric_loft->FaceTraits(0).Name(), "Dome"); + EXPECT_EQ(parametric_loft->FaceTraits(1).Name(), "Dome"); + EXPECT_EQ(parametric_loft->FaceTraits(2).Name(), "Cylinder"); + EXPECT_EQ(parametric_loft->FaceTraits(3).Name(), "Cylinder"); + EXPECT_EQ(parametric_loft->FaceTraits(4).Name(), "Dome"); + EXPECT_EQ(parametric_loft->FaceTraits(5).Name(), "Dome"); } TEST_F(FuelTanks, structure) From 088c3b0ed42b47f88195797bb7637a6ce92260cb Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Thu, 8 May 2025 11:45:02 +0200 Subject: [PATCH 110/122] remove if-handling for nFaces != 4 or 6, as this is directly implemented in the CCPACSVessel class (other cases therefore cannot occur, so code use useless). --- src/fuelTanks/CCPACSVessel.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index e05fcae7c8..0e0aef07e1 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -693,14 +693,6 @@ void CCPACSVessel::SetFaceTraitsFromParams(PNamedShape loft) const { int nFaces = GetNumberOfFaces(loft->Shape()); - if (nFaces != 4 && nFaces != 6) { - const char* vesselName = loft->Name().c_str(); - for (int i = 0; i < nFaces; ++i) { - loft->FaceTraits(i).SetName(vesselName); - } - return; - } - // Cylinders are always the two middel segments const int cylCount = 2; const int cylStart = (nFaces - cylCount) / 2; From 26373560014af17b52d7ae79a63599b643b2ad9a Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Thu, 8 May 2025 12:05:02 +0200 Subject: [PATCH 111/122] add test covering incomplete combination of radius, length and domeType --- .../TestData/simpletest-fuelTanks.cpacs.xml | 12 +++++++++++- tests/unittests/tiglTanks.cpp | 11 +++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index 42708bf465..c8aa205eea 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -890,12 +890,22 @@ SimpleFuselage - + Vessel with wrong geometry 0.4 1. + + Vessel 2 with wrong geometry + + 1. + + + 1 + + + Vessel with negative ax ratio diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 86ad3ff594..03aebc5e8f 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -110,7 +110,8 @@ class FuelTanks : public ::testing::Test tigl::CCPACSVessel* vessel_isotensoid = &uidMgr.ResolveObject("tank5_isotensoidDome"); tigl::CCPACSVessel* vessel_symmetric = &uidMgr.ResolveObject("tank7_symmetricVessel"); - tigl::CCPACSVessel* vessel_corrupt = &uidMgr.ResolveObject("vessel_corrupt_geometry"); + tigl::CCPACSVessel* vessel_corrupt1 = &uidMgr.ResolveObject("vessel_corrupt_geometry1"); + tigl::CCPACSVessel* vessel_corrupt2 = &uidMgr.ResolveObject("vessel_corrupt_geometry2"); // Dummy objects for exception testing DummyAircraftModel dummyAircraft; @@ -243,8 +244,8 @@ TEST_F(FuelTanks, vessel_type_info) EXPECT_TRUE(vessel_isotensoid->HasIsotensoidDome()); // Check for corrupt vessel exceptions. - EXPECT_THROW(vessel_corrupt->IsVesselViaSegments(), tigl::CTiglError); - EXPECT_THROW(vessel_corrupt->IsVesselViaDesignParameters(), tigl::CTiglError); + EXPECT_THROW(vessel_corrupt1->IsVesselViaSegments(), tigl::CTiglError); + EXPECT_THROW(vessel_corrupt1->IsVesselViaDesignParameters(), tigl::CTiglError); } TEST_F(FuelTanks, vessel_sections) @@ -326,7 +327,9 @@ TEST_F(FuelTanks, vessel_loft_evaluation) EXPECT_NEAR(vessel_segments->GetCircumference(1, 0.5), 7.43, 1e-2); CheckExceptionMessage([&]() { vessel_parametric->GetCircumference(1, 0.5); }, tankTypeExceptionString); - EXPECT_THROW(vessel_corrupt->GetLoft(), tigl::CTiglError); + EXPECT_THROW(vessel_corrupt1->GetLoft(), tigl::CTiglError); + CheckExceptionMessage([&]() { vessel_corrupt2->GetLoft(); }, "Parametric vessel specification incomplete: " + "cylinderRadius, cylinderLength and domeType required."); EXPECT_THROW(dummyVessel.GetLoft(), tigl::CTiglError); } From 457a53f79184b9915e2bdec816c33f516a78dfe5 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Thu, 8 May 2025 16:21:30 +0200 Subject: [PATCH 112/122] add/fix InvalidateImpl methods for tank and vessel; remove uID from structure --- cpacs_gen_input/cpacs_schema.xsd | 1 - src/fuelTanks/CCPACSFuelTank.cpp | 9 +---- src/fuelTanks/CCPACSFuelTank.h | 4 +-- src/fuelTanks/CCPACSVessel.cpp | 12 +++++++ src/fuelTanks/CCPACSVessel.h | 2 ++ src/fuelTanks/CCPACSVessels.h | 1 + src/generated/CPACSFramesAssembly.cpp | 4 +-- src/generated/CPACSStringersAssembly.cpp | 4 +-- src/generated/CPACSVesselSkinLayers.cpp | 10 ++++-- src/generated/CPACSVesselStructure.cpp | 35 +------------------ src/generated/CPACSVesselStructure.h | 8 ++--- src/generated/CPACSWalls.cpp | 4 +-- .../TestData/simpletest-fuelTanks.cpacs.xml | 2 +- tests/unittests/tiglTanks.cpp | 4 --- 14 files changed, 35 insertions(+), 65 deletions(-) diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index ccbba5d94f..9d11cfc899 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -36400,7 +36400,6 @@ The fuel tank volume type should also be used for the wing fuel tank - diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 30852cf4d7..8f7f3e4e38 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -88,16 +88,9 @@ std::string CCPACSFuelTank::GetShortShapeName() const return "UNKNOWN"; } -void CCPACSFuelTank::RegisterInvalidationCallback(std::function const& fn){ - invalidationCallbacks.push_back(fn); -} - void CCPACSFuelTank::InvalidateImpl(const boost::optional&) const { - CTiglAbstractGeometricComponent::Reset(); - for (auto const& invalidator: invalidationCallbacks) { - invalidator(); - } + loft.clear(); } } //namespace tigl diff --git a/src/fuelTanks/CCPACSFuelTank.h b/src/fuelTanks/CCPACSFuelTank.h index 49354e402d..fca1b3d843 100644 --- a/src/fuelTanks/CCPACSFuelTank.h +++ b/src/fuelTanks/CCPACSFuelTank.h @@ -39,14 +39,12 @@ class CCPACSFuelTank : public generated::CPACSFuelTank, public CTiglRelativelyPo TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override; TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override; - TIGL_EXPORT void RegisterInvalidationCallback(std::function const&); - protected: PNamedShape BuildLoft() const override; private: - virtual void InvalidateImpl(const boost::optional&) const override; + void InvalidateImpl(const boost::optional&) const override; std::string GetShortShapeName() const; diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 0e0aef07e1..5bc77e6fd5 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -704,4 +704,16 @@ void CCPACSVessel::SetFaceTraitsFromParams(PNamedShape loft) const } } +void CCPACSVessel::InvalidateImpl(const boost::optional&) const +{ + loft.clear(); + if (m_segments_choice1) { + m_segments_choice1.get().Invalidate(); + } + if (m_structure) { + m_structure->Invalidate(); + } + GetParent()->GetParent()->Invalidate(); +} + } //namespace tigl diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index 322de5b34d..c8c7dc9509 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -104,6 +104,8 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi void SetFaceTraitsFromParams(PNamedShape loft) const; private: + void InvalidateImpl(const boost::optional&) const override; + inline static const std::string _vesselTypeException = "This method is only available for vessels with segments. No segment found."; diff --git a/src/fuelTanks/CCPACSVessels.h b/src/fuelTanks/CCPACSVessels.h index 3f18ec2e38..2249cfe65a 100644 --- a/src/fuelTanks/CCPACSVessels.h +++ b/src/fuelTanks/CCPACSVessels.h @@ -23,6 +23,7 @@ #include "generated/CPACSVessels.h" #include +#include namespace tigl { diff --git a/src/generated/CPACSFramesAssembly.cpp b/src/generated/CPACSFramesAssembly.cpp index 2871f7726e..2a642d0f5d 100644 --- a/src/generated/CPACSFramesAssembly.cpp +++ b/src/generated/CPACSFramesAssembly.cpp @@ -69,7 +69,7 @@ namespace generated return GetParent()->GetNextUIDParent(); } if (IsParent()) { - return GetParent(); + return GetParent()->GetNextUIDParent(); } } return nullptr; @@ -85,7 +85,7 @@ namespace generated return GetParent()->GetNextUIDParent(); } if (IsParent()) { - return GetParent(); + return GetParent()->GetNextUIDParent(); } } return nullptr; diff --git a/src/generated/CPACSStringersAssembly.cpp b/src/generated/CPACSStringersAssembly.cpp index 806144c942..1d05738161 100644 --- a/src/generated/CPACSStringersAssembly.cpp +++ b/src/generated/CPACSStringersAssembly.cpp @@ -69,7 +69,7 @@ namespace generated return GetParent()->GetNextUIDParent(); } if (IsParent()) { - return GetParent(); + return GetParent()->GetNextUIDParent(); } } return nullptr; @@ -85,7 +85,7 @@ namespace generated return GetParent()->GetNextUIDParent(); } if (IsParent()) { - return GetParent(); + return GetParent()->GetNextUIDParent(); } } return nullptr; diff --git a/src/generated/CPACSVesselSkinLayers.cpp b/src/generated/CPACSVesselSkinLayers.cpp index 88fc79d9e0..d78d8784ec 100644 --- a/src/generated/CPACSVesselSkinLayers.cpp +++ b/src/generated/CPACSVesselSkinLayers.cpp @@ -52,12 +52,18 @@ namespace generated const CTiglUIDObject* CPACSVesselSkinLayers::GetNextUIDParent() const { - return m_parent; + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; } CTiglUIDObject* CPACSVesselSkinLayers::GetNextUIDParent() { - return m_parent; + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; } CTiglUIDManager& CPACSVesselSkinLayers::GetUIDManager() diff --git a/src/generated/CPACSVesselStructure.cpp b/src/generated/CPACSVesselStructure.cpp index a7f69ea13c..9e0d9c469a 100644 --- a/src/generated/CPACSVesselStructure.cpp +++ b/src/generated/CPACSVesselStructure.cpp @@ -21,6 +21,7 @@ #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" #include "TixiHelper.h" namespace tigl @@ -36,7 +37,6 @@ namespace generated CPACSVesselStructure::~CPACSVesselStructure() { - if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); } const CCPACSVessel* CPACSVesselStructure::GetParent() const @@ -77,17 +77,6 @@ namespace generated void CPACSVesselStructure::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) { - // read attribute uID - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { - m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); - if (m_uID.empty()) { - LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; - } - // read element stringers if (tixi::TixiCheckElement(tixiHandle, xpath + "/stringers")) { m_stringers = boost::in_place(reinterpret_cast(this), m_uidMgr); @@ -132,14 +121,10 @@ namespace generated } } - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); } void CPACSVesselStructure::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const { - // write attribute uID - tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); - // write element stringers if (m_stringers) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/stringers"); @@ -186,24 +171,6 @@ namespace generated } - const std::string& CPACSVesselStructure::GetUID() const - { - return m_uID; - } - - void CPACSVesselStructure::SetUID(const std::string& value) - { - if (m_uidMgr && value != m_uID) { - if (m_uID.empty()) { - m_uidMgr->RegisterObject(value, *this); - } - else { - m_uidMgr->UpdateObjectUID(m_uID, value); - } - } - m_uID = value; - } - const boost::optional& CPACSVesselStructure::GetStringers() const { return m_stringers; diff --git a/src/generated/CPACSVesselStructure.h b/src/generated/CPACSVesselStructure.h index 077fede0d8..083a60b615 100644 --- a/src/generated/CPACSVesselStructure.h +++ b/src/generated/CPACSVesselStructure.h @@ -26,12 +26,12 @@ #include #include "CPACSVesselSkinLayers.h" #include "CreateIfNotExists.h" -#include "CTiglUIDObject.h" #include "tigl_internal.h" namespace tigl { class CTiglUIDManager; +class CTiglUIDObject; class CCPACSVessel; namespace generated @@ -42,7 +42,7 @@ namespace generated /// @brief Structure /// /// - class CPACSVesselStructure : public CTiglReqUIDObject + class CPACSVesselStructure { public: TIGL_EXPORT CPACSVesselStructure(CCPACSVessel* parent, CTiglUIDManager* uidMgr); @@ -62,9 +62,6 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const std::string& GetUID() const; - TIGL_EXPORT virtual void SetUID(const std::string& value); - TIGL_EXPORT virtual const boost::optional& GetStringers() const; TIGL_EXPORT virtual boost::optional& GetStringers(); @@ -94,7 +91,6 @@ namespace generated CTiglUIDManager* m_uidMgr; - std::string m_uID; boost::optional m_stringers; boost::optional m_frames; boost::optional m_skinLayers; diff --git a/src/generated/CPACSWalls.cpp b/src/generated/CPACSWalls.cpp index 5fad863132..b6f4716249 100644 --- a/src/generated/CPACSWalls.cpp +++ b/src/generated/CPACSWalls.cpp @@ -60,7 +60,7 @@ namespace generated return GetParent()->GetNextUIDParent(); } if (IsParent()) { - return GetParent(); + return GetParent()->GetNextUIDParent(); } } return nullptr; @@ -73,7 +73,7 @@ namespace generated return GetParent()->GetNextUIDParent(); } if (IsParent()) { - return GetParent(); + return GetParent()->GetNextUIDParent(); } } return nullptr; diff --git a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml index c8aa205eea..b7640f0c08 100644 --- a/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml +++ b/tests/unittests/TestData/simpletest-fuelTanks.cpacs.xml @@ -733,7 +733,7 @@ 0.1 - + diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 03aebc5e8f..b80ced1b2e 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -174,10 +174,7 @@ TEST_F(FuelTanks, fuelTank) EXPECT_EQ(dummyTankLoft->ShortName(), "UNKNOWN"); // Test invalidation callback. - bool called = false; - dummyTank.RegisterInvalidationCallback([&]() { called = true; }); dummyTank.Invalidate(); - EXPECT_TRUE(called); } TEST_F(FuelTanks, vessels) @@ -397,6 +394,5 @@ TEST_F(FuelTanks, structure) EXPECT_EQ(structure_with_stringer_frames->GetFrames()->GetFrames().size(), 1); EXPECT_EQ(structure_with_stringer_frames->GetStringers()->GetStringers().size(), 1); - EXPECT_EQ(structure_with_walls->GetUID(), "tank5_structure"); EXPECT_EQ(structure_with_walls->GetWalls()->GetWallSegments().GetWallSegments().size(), 3); } From 05f3c81cf72caa0318173d4df425d147787cc49b Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 9 May 2025 09:28:02 +0200 Subject: [PATCH 113/122] apply clang formatting; update created by info; update copyright date --- src/fuelTanks/CCPACSFuelTank.cpp | 4 +++- src/fuelTanks/CCPACSFuelTank.h | 6 +++--- src/fuelTanks/CCPACSFuelTanks.cpp | 4 +++- src/fuelTanks/CCPACSFuelTanks.h | 4 +++- src/fuelTanks/CCPACSVessel.cpp | 6 +++--- src/fuelTanks/CCPACSVessel.h | 6 +++--- src/fuelTanks/CCPACSVesselStructure.cpp | 4 +++- src/fuelTanks/CCPACSVesselStructure.h | 5 +++-- src/fuelTanks/CCPACSVessels.cpp | 5 +++-- src/fuelTanks/CCPACSVessels.h | 5 +++-- tests/unittests/test_fuelTanks.py | 18 ++++++++++++++++++ 11 files changed, 48 insertions(+), 19 deletions(-) diff --git a/src/fuelTanks/CCPACSFuelTank.cpp b/src/fuelTanks/CCPACSFuelTank.cpp index 8f7f3e4e38..12a33ffeb1 100644 --- a/src/fuelTanks/CCPACSFuelTank.cpp +++ b/src/fuelTanks/CCPACSFuelTank.cpp @@ -1,6 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/src/fuelTanks/CCPACSFuelTank.h b/src/fuelTanks/CCPACSFuelTank.h index fca1b3d843..6582927a48 100644 --- a/src/fuelTanks/CCPACSFuelTank.h +++ b/src/fuelTanks/CCPACSFuelTank.h @@ -1,7 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * -* Created: 2022-04-06 Anton Reiswich +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -43,7 +44,6 @@ class CCPACSFuelTank : public generated::CPACSFuelTank, public CTiglRelativelyPo PNamedShape BuildLoft() const override; private: - void InvalidateImpl(const boost::optional&) const override; std::string GetShortShapeName() const; diff --git a/src/fuelTanks/CCPACSFuelTanks.cpp b/src/fuelTanks/CCPACSFuelTanks.cpp index 0b8524c1f8..398c133fcf 100644 --- a/src/fuelTanks/CCPACSFuelTanks.cpp +++ b/src/fuelTanks/CCPACSFuelTanks.cpp @@ -1,6 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * +* Created: 2025-05-09 Marko Alder +* * Created: 2022-04-06 Anton Reiswich * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/fuelTanks/CCPACSFuelTanks.h b/src/fuelTanks/CCPACSFuelTanks.h index 092ff67b27..e450e55fbf 100644 --- a/src/fuelTanks/CCPACSFuelTanks.h +++ b/src/fuelTanks/CCPACSFuelTanks.h @@ -1,6 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * +* Created: 2025-05-09 Marko Alder +* * Created: 2022-04-06 Anton Reiswich * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 5bc77e6fd5..407d166bd4 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -1,7 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * -* Created: 2022-03-15 Anton Reiswich +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -688,7 +689,6 @@ void CCPACSVessel::SetFaceTraitsFromSegments(PNamedShape loft) const } } - void CCPACSVessel::SetFaceTraitsFromParams(PNamedShape loft) const { int nFaces = GetNumberOfFaces(loft->Shape()); diff --git a/src/fuelTanks/CCPACSVessel.h b/src/fuelTanks/CCPACSVessel.h index c8c7dc9509..db09b9eaa4 100644 --- a/src/fuelTanks/CCPACSVessel.h +++ b/src/fuelTanks/CCPACSVessel.h @@ -1,7 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * -* Created: 2022-03-15 Anton Reiswich +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -151,7 +152,6 @@ class CCPACSVessel : public generated::CPACSVessel, public CTiglRelativelyPositi Handle(Geom_BSplineCurve) ToBSpline() const; TopoDS_Edge ToEdge() const; - }; }; diff --git a/src/fuelTanks/CCPACSVesselStructure.cpp b/src/fuelTanks/CCPACSVesselStructure.cpp index d114ec5d83..f0e467bba3 100644 --- a/src/fuelTanks/CCPACSVesselStructure.cpp +++ b/src/fuelTanks/CCPACSVesselStructure.cpp @@ -1,6 +1,8 @@ /* -* Copyright (c) 2018 RISC Software GmbH +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/src/fuelTanks/CCPACSVesselStructure.h b/src/fuelTanks/CCPACSVesselStructure.h index 3fd4fcd2cc..2e548ffde8 100644 --- a/src/fuelTanks/CCPACSVesselStructure.h +++ b/src/fuelTanks/CCPACSVesselStructure.h @@ -1,7 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * -* Created: 2022-04-06 Anton Reiswich +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/src/fuelTanks/CCPACSVessels.cpp b/src/fuelTanks/CCPACSVessels.cpp index f29773b17e..01a2a36242 100644 --- a/src/fuelTanks/CCPACSVessels.cpp +++ b/src/fuelTanks/CCPACSVessels.cpp @@ -1,7 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * -* Created: 2022-04-06 Anton Reiswich +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/src/fuelTanks/CCPACSVessels.h b/src/fuelTanks/CCPACSVessels.h index 2249cfe65a..895315c6b9 100644 --- a/src/fuelTanks/CCPACSVessels.h +++ b/src/fuelTanks/CCPACSVessels.h @@ -1,7 +1,8 @@ /* -* Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) +* Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * -* Created: 2022-04-06 Anton Reiswich +* Created: 2025-05-09 Marko Alder +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 95ac6c3b51..16756db97b 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -1,3 +1,21 @@ +############################################################################# +# Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) +# +# Created: 2023-12-29 Marko Alder +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################# + import unittest from tigl3.tigl3wrapper import * From d2eae989ef62ee50b65fcdb80b0409bf93c34b77 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 9 May 2025 09:31:28 +0200 Subject: [PATCH 114/122] fix date in header --- tests/unittests/tiglTanks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index b80ced1b2e..0b4bb13abd 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) * - * Created: 2023-12-29 Marko Alder + * Created: 2025-05-09 Marko Alder * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From b8cb8cb49fe3a6a5212bc15165832cd6903ccff1 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 9 May 2025 09:32:01 +0200 Subject: [PATCH 115/122] fix copyright date --- tests/unittests/tiglTanks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index 0b4bb13abd..d63a0dceaa 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2022 German Aerospace Center (DLR/SC) + * Copyright (C) 2007-2025 German Aerospace Center (DLR/SC) * * Created: 2025-05-09 Marko Alder * From b0356424f2c86868ba4d94b1a1726e7263b08411 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 9 May 2025 14:45:31 +0200 Subject: [PATCH 116/122] introduce default behavior for scaling and rotation via CCPACSTransformation and adopt CTiglRelativelyPositionedComponent accordingly --- src/fuelTanks/CCPACSVessel.cpp | 4 +- src/geometry/CCPACSTransformation.cpp | 20 ++++++ src/geometry/CCPACSTransformation.h | 8 +++ .../CTiglRelativelyPositionedComponent.cpp | 72 ++++++++++--------- .../CTiglRelativelyPositionedComponent.h | 7 +- 5 files changed, 71 insertions(+), 40 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 407d166bd4..56e8d778ef 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -55,8 +55,10 @@ namespace tigl CCPACSVessel::CCPACSVessel(CCPACSVessels* parent, CTiglUIDManager* uidMgr) : generated::CPACSVessel(parent, uidMgr) - , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation, true, true) + , CTiglRelativelyPositionedComponent(GetParent()->GetParent(), &m_transformation) { + m_transformation.setScalingType(ABS_LOCAL); + m_transformation.setRotationType(ABS_LOCAL); } CCPACSConfiguration const& CCPACSVessel::GetConfiguration() const diff --git a/src/geometry/CCPACSTransformation.cpp b/src/geometry/CCPACSTransformation.cpp index d4e745b10f..d9997865fd 100644 --- a/src/geometry/CCPACSTransformation.cpp +++ b/src/geometry/CCPACSTransformation.cpp @@ -188,6 +188,11 @@ void CCPACSTransformation::setRotation(const CTiglPoint& rotation) m_rotation->SetAsPoint(rotation); } +void CCPACSTransformation::setRotationType(ECPACSTranslationType rotationType) +{ + _rotationType = rotationType; +} + void CCPACSTransformation::setScaling(const CTiglPoint& scale) { if (!m_scaling) { @@ -196,6 +201,11 @@ void CCPACSTransformation::setScaling(const CTiglPoint& scale) m_scaling->SetAsPoint(scale); } +void CCPACSTransformation::setScalingType(ECPACSTranslationType scalingType) +{ + _scalingType = scalingType; +} + void CCPACSTransformation::setTransformationMatrix(const CTiglTransformation& matrix) { // decompose matrix into scaling, rotation and translation @@ -275,6 +285,16 @@ ECPACSTranslationType CCPACSTransformation::getTranslationType() const } } +ECPACSTranslationType CCPACSTransformation::getScalingType() const +{ + return _scalingType; +} + +ECPACSTranslationType CCPACSTransformation::getRotationType() const +{ + return _rotationType; +} + CTiglTransformation CCPACSTransformation::getTransformationMatrix() const { return *_transformationMatrix; diff --git a/src/geometry/CCPACSTransformation.h b/src/geometry/CCPACSTransformation.h index 34b6e49c8b..c3695a740c 100644 --- a/src/geometry/CCPACSTransformation.h +++ b/src/geometry/CCPACSTransformation.h @@ -61,13 +61,17 @@ class CCPACSTransformation : public generated::CPACSTransformation TIGL_EXPORT void setTranslation(const CTiglPoint& translation); TIGL_EXPORT void setTranslation(const CTiglPoint& translation, ECPACSTranslationType); TIGL_EXPORT void setRotation(const CTiglPoint& rotation); + TIGL_EXPORT void setRotationType(ECPACSTranslationType rotationType); TIGL_EXPORT void setScaling(const CTiglPoint& scale); + TIGL_EXPORT void setScalingType(ECPACSTranslationType scalingType); TIGL_EXPORT void setTransformationMatrix(const CTiglTransformation& matrix); TIGL_EXPORT CTiglPoint getTranslationVector() const; TIGL_EXPORT CTiglPoint getRotation() const; TIGL_EXPORT CTiglPoint getScaling() const; TIGL_EXPORT ECPACSTranslationType getTranslationType() const; + TIGL_EXPORT ECPACSTranslationType getScalingType() const; + TIGL_EXPORT ECPACSTranslationType getRotationType() const; TIGL_EXPORT CTiglTransformation getTransformationMatrix() const; /** @@ -84,6 +88,10 @@ class CCPACSTransformation : public generated::CPACSTransformation // caches the transformation created from scaling, rotation and translation Cache _transformationMatrix; + + // ABS_LOCAL per default only applies for translation, while scaling and rotation is global + ECPACSTranslationType _scalingType = ABS_GLOBAL; + ECPACSTranslationType _rotationType = ABS_GLOBAL; }; } // namespace tigl diff --git a/src/geometry/CTiglRelativelyPositionedComponent.cpp b/src/geometry/CTiglRelativelyPositionedComponent.cpp index 517991ac4b..62bd56f58f 100644 --- a/src/geometry/CTiglRelativelyPositionedComponent.cpp +++ b/src/geometry/CTiglRelativelyPositionedComponent.cpp @@ -46,12 +46,6 @@ CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTi CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis) : _parent(parent), _transformation(trans), _symmetryAxis(symmetryAxis){} -CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, Standard_Boolean applyRotation, Standard_Boolean applyScaling) - : _parent(parent), _transformation(trans), _symmetryAxis(nullptr), _applyRotation(applyRotation), _applyScaling(applyScaling){} - -CTiglRelativelyPositionedComponent::CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis, Standard_Boolean applyRotation, Standard_Boolean applyScaling) - : _parent(parent), _transformation(trans), _symmetryAxis(symmetryAxis), _applyRotation(applyRotation), _applyScaling(applyScaling){} - void CTiglRelativelyPositionedComponent::Reset() const { CTiglAbstractGeometricComponent::Reset(); @@ -79,40 +73,40 @@ void CTiglRelativelyPositionedComponent::SetSymmetryAxis(const TiglSymmetryAxis& CTiglTransformation CTiglRelativelyPositionedComponent::GetTransformationMatrix() const { - const CTiglTransformation thisTransformation = GetTransform() ? GetTransform()->getTransformationMatrix() : CTiglTransformation(); - if (_parent && GetTranslationType() == ABS_LOCAL) { - const CTiglTransformation& parentTransformation = _parent->GetTransformationMatrix(); - CTiglTransformation transformation = thisTransformation; + CTiglTransformation thisTransformation = GetTransform() ? GetTransform()->getTransformationMatrix() : CTiglTransformation(); - double scale[3], rotation[3], translation[3]; - parentTransformation.Decompose(&scale[0], &rotation[0], &translation[0]); + if (!_parent) { + return thisTransformation; + } - if (_applyScaling) { - CTiglTransformation parentScaling; - parentScaling.AddScaling(scale[0],scale[1],scale[2]); - transformation = parentScaling * transformation; - } + if (GetScalingType() == ABS_GLOBAL && GetRotationType() == ABS_GLOBAL && GetTranslationType() && ABS_GLOBAL) { + return thisTransformation; + } - if (_applyRotation) { - CTiglTransformation parentRotation; - parentRotation.AddRotationX(rotation[0]); - parentRotation.AddRotationY(rotation[1]); - parentRotation.AddRotationZ(rotation[2]); - transformation = parentRotation * transformation; - } + const CTiglTransformation& parentTransformation = _parent->GetTransformationMatrix(); - CTiglTransformation parentTranslation; - parentTranslation.AddTranslation( - translation[0], - translation[1], - translation[2] - ); - transformation = parentTranslation * transformation; + if (GetScalingType() == ABS_LOCAL && GetRotationType() == ABS_LOCAL && GetTranslationType() == ABS_LOCAL) { + return parentTransformation * thisTransformation; + } - return transformation; + double scale[3], rotation[3], translation[3]; + parentTransformation.Decompose(&scale[0], &rotation[0], &translation[0]); + + if (GetScalingType() == ABS_LOCAL) { + thisTransformation.AddScaling(scale[0], scale[1], scale[2]); } - else - return thisTransformation; + + if (GetRotationType() == ABS_LOCAL) { + thisTransformation.AddRotationX(rotation[0]); + thisTransformation.AddRotationY(rotation[1]); + thisTransformation.AddRotationZ(rotation[2]); + } + + if (GetTranslationType() == ABS_LOCAL) { + thisTransformation.AddTranslation(translation[0], translation[1], translation[2]); + } + + return thisTransformation; } void CTiglRelativelyPositionedComponent::SetTransformation(const CCPACSTransformation &transform) @@ -163,6 +157,16 @@ ECPACSTranslationType CTiglRelativelyPositionedComponent::GetTranslationType() c return ABS_GLOBAL; // TODO(bgruber): is this a valid default? } +ECPACSTranslationType CTiglRelativelyPositionedComponent::GetRotationType() const +{ + return GetTransform()->getRotationType(); +} + +ECPACSTranslationType CTiglRelativelyPositionedComponent::GetScalingType() const +{ + return GetTransform()->getScalingType(); +} + // Returns a pointer to the list of children of a component. CTiglRelativelyPositionedComponent::ChildContainerType CTiglRelativelyPositionedComponent::GetChildren(bool recursive) { diff --git a/src/geometry/CTiglRelativelyPositionedComponent.h b/src/geometry/CTiglRelativelyPositionedComponent.h index fd9cf09a50..ecd3e76d53 100644 --- a/src/geometry/CTiglRelativelyPositionedComponent.h +++ b/src/geometry/CTiglRelativelyPositionedComponent.h @@ -122,8 +122,6 @@ class CTiglRelativelyPositionedComponent : public CTiglAbstractGeometricComponen TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(MaybeOptionalPtr parentUid, MaybeOptionalPtr trans, boost::optional* symmetryAxis); TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans); TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis); - TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, Standard_Boolean applyRotation, Standard_Boolean applyScaling); - TIGL_EXPORT explicit CTiglRelativelyPositionedComponent(tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr trans, boost::optional* symmetryAxis, Standard_Boolean applyRotation, Standard_Boolean applyScaling); TIGL_EXPORT void Reset() const; @@ -138,6 +136,8 @@ class CTiglRelativelyPositionedComponent : public CTiglAbstractGeometricComponen TIGL_EXPORT virtual CTiglPoint GetScaling() const; TIGL_EXPORT virtual CTiglPoint GetTranslation() const; TIGL_EXPORT virtual ECPACSTranslationType GetTranslationType() const; + TIGL_EXPORT virtual ECPACSTranslationType GetRotationType() const; + TIGL_EXPORT virtual ECPACSTranslationType GetScalingType() const; TIGL_EXPORT boost::optional GetParentUID() const; TIGL_EXPORT void SetParentUID(const std::string& parentUID); @@ -161,9 +161,6 @@ class CTiglRelativelyPositionedComponent : public CTiglAbstractGeometricComponen ChildContainerType _children; MaybeOptionalPtr _parentUID; ///< UID of the parent of this component, if supported by derived type - Standard_Boolean _applyRotation = false; - Standard_Boolean _applyScaling = false; - MaybeOptionalPtr _transformation; // references down to the transformation of the derived class (may be empty in case derived class does not have transformation) boost::optional* _symmetryAxis; // references down to the symmetryAxis of the derived class (may be empty in case derived class does not have symmetry) }; From af57dda71d09f86b216d10ebf05f94ed1001a4a6 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Fri, 9 May 2025 16:36:23 +0200 Subject: [PATCH 117/122] add test for correct location of wall base point --- tests/unittests/tiglTanks.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unittests/tiglTanks.cpp b/tests/unittests/tiglTanks.cpp index d63a0dceaa..7f7468071c 100644 --- a/tests/unittests/tiglTanks.cpp +++ b/tests/unittests/tiglTanks.cpp @@ -394,5 +394,13 @@ TEST_F(FuelTanks, structure) EXPECT_EQ(structure_with_stringer_frames->GetFrames()->GetFrames().size(), 1); EXPECT_EQ(structure_with_stringer_frames->GetStringers()->GetStringers().size(), 1); - EXPECT_EQ(structure_with_walls->GetWalls()->GetWallSegments().GetWallSegments().size(), 3); + const auto& walls = structure_with_walls->GetWalls(); + EXPECT_EQ(walls->GetWallSegments().GetWallSegments().size(), 3); + + const auto& pos = walls->GetWallPosition("tank5_wall_p1"); + gp_Pnt p; + ASSERT_NO_THROW(p = pos.GetBasePoint()); + EXPECT_DOUBLE_EQ(p.X(), 14.5); + EXPECT_DOUBLE_EQ(p.Y(), -1); + EXPECT_DOUBLE_EQ(p.Z(), -0.2); } From feb2c7fef46a5e42194e6a31d11018ce9b92ee2a Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Mon, 12 May 2025 13:35:33 +0200 Subject: [PATCH 118/122] add bugfix for isotensoid domes --- src/fuelTanks/CCPACSVessel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 56e8d778ef..b5da4d7ff2 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -49,6 +49,7 @@ #include #include #include +#include namespace tigl { @@ -301,7 +302,10 @@ CCPACSVessel::IsotensoidContour::IsotensoidContour(double rCyl, double rPolarOpe double phi = 0.0; double alpha = std::asin(rPolarOpening / rCyl); - while (std::tan(alpha) * std::tan(alpha) < 2 && radii.back() > 1.22 * rPolarOpening) { + const double eps = std::numeric_limits::epsilon(); + + while (std::tan(alpha) * std::tan(alpha) < 2 && radii.back() > 1.22 * rPolarOpening && + (radii.size() < 2 || radii.back() < radii[radii.size() - 2] + eps)) { phi += dPhi; alpha = std::asin(rPolarOpening / radii.back()); From 5cb28541dc8ff96aa588b9d2cd5789561df02dbd Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 20 May 2025 14:24:21 +0200 Subject: [PATCH 119/122] fix isotensoids --- src/fuelTanks/CCPACSVessel.cpp | 54 ++++++++++++++++++++++--------- tests/unittests/test_fuelTanks.py | 4 +-- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index b5da4d7ff2..da49fc3cc0 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -50,6 +50,7 @@ #include #include #include +#include namespace tigl { @@ -299,30 +300,51 @@ CCPACSVessel::IsotensoidContour::IsotensoidContour(double rCyl, double rPolarOpe radii.push_back(rCyl); axialPositions.push_back(0.0); - double phi = 0.0; + // initial values + double phi = 0.0; + double dr = 0.0; + double dx = 1.0; + double radius = rCyl; + double axialPosition = 0.0; + double alpha = std::asin(rPolarOpening / rCyl); - const double eps = std::numeric_limits::epsilon(); + const double eps = 1e-8 * std::max(rCyl, rPolarOpening); + int i = 0; - while (std::tan(alpha) * std::tan(alpha) < 2 && radii.back() > 1.22 * rPolarOpening && - (radii.size() < 2 || radii.back() < radii[radii.size() - 2] + eps)) { - phi += dPhi; - alpha = std::asin(rPolarOpening / radii.back()); + while (std::tan(alpha) * std::tan(alpha) < 2 && radius > 1.22 * rPolarOpening && dr >= 0.0) { - double rm = radii.back() / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); - double dr = rm * dPhi * std::sin(phi); - radii.push_back(radii.back() - dr); + radii.push_back(radius); + axialPositions.push_back(axialPosition); + + phi = phi + dPhi; + alpha = std::asin(rPolarOpening / radii.back()); - double dx = rm * dPhi * std::cos(phi); - axialPositions.push_back(axialPositions.back() + dx); + double meridianRadius = radius / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); + dr = meridianRadius * dPhi * std::sin(phi); + radius = radius - dr; + dx = meridianRadius * dPhi * std::cos(phi); + axialPosition = axialPosition + dx; } // Add 5 points linear until polar opening - double slope = - (radii.back() - radii[radii.size() - 2]) / (axialPositions.back() - axialPositions[axialPositions.size() - 2]); - for (int i = 0; i < 5; ++i) { - axialPositions.push_back(axialPositions.back() + (rPolarOpening - radii.back()) / slope); - radii.push_back(radii.back() + slope * (axialPositions.back() - axialPositions[axialPositions.size() - 2])); + double lastX = axialPositions.back(); + double lastR = radii.back(); + double prevX = axialPositions[axialPositions.size() - 2]; + double prevR = radii[radii.size() - 2]; + + double slope = (lastR - prevR) / (lastX - prevX); + + double dxTotal = (rPolarOpening - lastR) / slope; + double deltaX = dxTotal / 4.0; + double deltaR = (rPolarOpening - lastR) / 4.0; + + axialPositions.reserve(axialPositions.size() + 4); + radii.reserve(radii.size() + 4); + + for (int i = 1; i <= 4; ++i) { + axialPositions.push_back(lastX + i * deltaX); + radii.push_back(lastR + i * deltaR); } // Shifting to x=0 diff --git a/tests/unittests/test_fuelTanks.py b/tests/unittests/test_fuelTanks.py index 16756db97b..4186407dfa 100644 --- a/tests/unittests/test_fuelTanks.py +++ b/tests/unittests/test_fuelTanks.py @@ -232,7 +232,7 @@ def test_vessel_loft_evaluation(self): self.assertAlmostEqual(round(vessel_segments.get_geometric_volume(), 2), 6.57) self.assertAlmostEqual(round(vessel_parametric.get_geometric_volume(), 2), 18.1) - self.assertAlmostEqual(round(vessel_segments.get_surface_area(), 2), 11.15) + self.assertAlmostEqual(round(vessel_segments.get_surface_area(), 2), 19.94) self.assertAlmostEqual(round(vessel_parametric.get_surface_area(), 2), 36.19) self.assertAlmostEqual( @@ -247,8 +247,6 @@ def test_structure(self): structure_with_stringer_frames = self.vessel_segments.get_structure() # Test availability of generated class: - self.assertEqual(structure_with_walls.get_uid(), "tank5_structure") - self.assertIsInstance( structure_with_stringer_frames.get_frames(), configuration.CCPACSFramesAssembly, From 03efb9f4f06c8f8980ee0edce53c251dfd012704 Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 20 May 2025 14:28:09 +0200 Subject: [PATCH 120/122] fix inline comment --- src/fuelTanks/CCPACSVessel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index da49fc3cc0..960b61a5ab 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -327,7 +327,7 @@ CCPACSVessel::IsotensoidContour::IsotensoidContour(double rCyl, double rPolarOpe axialPosition = axialPosition + dx; } - // Add 5 points linear until polar opening + // Add 4 points linear until polar opening double lastX = axialPositions.back(); double lastR = radii.back(); double prevX = axialPositions[axialPositions.size() - 2]; From 19a657e96897d9a7e8b28146d3e731b41d6c84bd Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Tue, 20 May 2025 15:58:46 +0200 Subject: [PATCH 121/122] remove unnecessary includes --- src/fuelTanks/CCPACSVessel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 960b61a5ab..7f6833418f 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -49,8 +49,6 @@ #include #include #include -#include -#include namespace tigl { From 58dec1aa29bdc3279ea99a330491eafa843725dd Mon Sep 17 00:00:00 2001 From: MarAlder <43143741+MarAlder@users.noreply.github.com> Date: Wed, 21 May 2025 13:32:13 +0200 Subject: [PATCH 122/122] refactor isotensoid contour computation --- src/fuelTanks/CCPACSVessel.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/fuelTanks/CCPACSVessel.cpp b/src/fuelTanks/CCPACSVessel.cpp index 7f6833418f..4ba65fd021 100644 --- a/src/fuelTanks/CCPACSVessel.cpp +++ b/src/fuelTanks/CCPACSVessel.cpp @@ -305,24 +305,22 @@ CCPACSVessel::IsotensoidContour::IsotensoidContour(double rCyl, double rPolarOpe double radius = rCyl; double axialPosition = 0.0; - double alpha = std::asin(rPolarOpening / rCyl); + double const rPolarOpening2 = rPolarOpening * rPolarOpening; + double res = 2 - rPolarOpening2 / (rCyl * rCyl - rPolarOpening2); - const double eps = 1e-8 * std::max(rCyl, rPolarOpening); - int i = 0; - - while (std::tan(alpha) * std::tan(alpha) < 2 && radius > 1.22 * rPolarOpening && dr >= 0.0) { + while (res > 0.0 && radius > 1.22 * rPolarOpening && dr >= 0.0) { radii.push_back(radius); axialPositions.push_back(axialPosition); - phi = phi + dPhi; - alpha = std::asin(rPolarOpening / radii.back()); + phi = phi + dPhi; + + res = 2 - rPolarOpening2 / (radius * radius - rPolarOpening2); + dx = radius * dPhi / res; + dr = dx * std::tan(phi); - double meridianRadius = radius / (std::cos(phi) * (2 - std::tan(alpha) * std::tan(alpha))); - dr = meridianRadius * dPhi * std::sin(phi); - radius = radius - dr; - dx = meridianRadius * dPhi * std::cos(phi); - axialPosition = axialPosition + dx; + axialPosition += dx; + radius -= dr; } // Add 4 points linear until polar opening