From 23c37fc707ac8beec4b1c45c574e44ac26a83293 Mon Sep 17 00:00:00 2001 From: Rene Roos Date: Mon, 17 Jul 2023 10:08:56 +0200 Subject: [PATCH] add proto definition of stackup --- src/ansys/api/acp/v0/array_types.proto | 12 ++-- src/ansys/api/acp/v0/base.proto | 19 +++++-- src/ansys/api/acp/v0/control.proto | 4 +- src/ansys/api/acp/v0/cut_off_material.proto | 2 +- src/ansys/api/acp/v0/drop_off_material.proto | 3 +- src/ansys/api/acp/v0/edge_set.proto | 4 +- src/ansys/api/acp/v0/element_set.proto | 4 +- src/ansys/api/acp/v0/enum_types.proto | 9 ++- src/ansys/api/acp/v0/fabric.proto | 6 +- src/ansys/api/acp/v0/material.proto | 26 ++++++--- src/ansys/api/acp/v0/model.proto | 11 ++-- src/ansys/api/acp/v0/modeling_group.proto | 7 ++- src/ansys/api/acp/v0/modeling_ply.proto | 4 +- .../api/acp/v0/oriented_selection_set.proto | 4 +- src/ansys/api/acp/v0/ply_material.proto | 6 +- src/ansys/api/acp/v0/rosette.proto | 4 +- src/ansys/api/acp/v0/stackup.proto | 56 +++++++++++++++++++ 17 files changed, 137 insertions(+), 44 deletions(-) create mode 100644 src/ansys/api/acp/v0/stackup.proto diff --git a/src/ansys/api/acp/v0/array_types.proto b/src/ansys/api/acp/v0/array_types.proto index 92ffaf5..7bf9b3c 100644 --- a/src/ansys/api/acp/v0/array_types.proto +++ b/src/ansys/api/acp/v0/array_types.proto @@ -2,16 +2,16 @@ syntax = "proto3"; package ansys.api.acp.v0.array_types; message DoubleArray { - repeated double data = 1 [ packed = true ]; - repeated int64 shape = 2 [ packed = true ]; + repeated double data = 1 [packed=true]; + repeated int64 shape = 2 [packed=true]; } message IntArray { - repeated int64 data = 1 [ packed = true ]; - repeated int64 shape = 2 [ packed = true ]; + repeated int64 data = 1 [packed=true]; + repeated int64 shape = 2 [packed=true]; } message Int32Array { - repeated int32 data = 1 [ packed = true ]; - repeated int64 shape = 2 [ packed = true ]; + repeated int32 data = 1 [packed=true]; + repeated int64 shape = 2 [packed=true]; } diff --git a/src/ansys/api/acp/v0/base.proto b/src/ansys/api/acp/v0/base.proto index 75d0a92..82339d7 100644 --- a/src/ansys/api/acp/v0/base.proto +++ b/src/ansys/api/acp/v0/base.proto @@ -1,11 +1,16 @@ syntax = "proto3"; package ansys.api.acp.v0.base; -message Empty {} +message Empty { +} -message ResourcePath { string value = 1; } +message ResourcePath { + string value = 1; +} -message CollectionPath { string value = 1; } +message CollectionPath { + string value = 1; +} message BasicInfo { ResourcePath resource_path = 1; @@ -14,11 +19,15 @@ message BasicInfo { int64 version = 4; } -message GetRequest { ResourcePath resource_path = 1; } +message GetRequest { + ResourcePath resource_path = 1; +} message DeleteRequest { ResourcePath resource_path = 1; int64 version = 2; } -message ListRequest { CollectionPath collection_path = 1; } +message ListRequest { + CollectionPath collection_path = 1; +} diff --git a/src/ansys/api/acp/v0/control.proto b/src/ansys/api/acp/v0/control.proto index d502316..0e66792 100644 --- a/src/ansys/api/acp/v0/control.proto +++ b/src/ansys/api/acp/v0/control.proto @@ -3,4 +3,6 @@ package ansys.api.acp.v0.control; import "ansys/api/acp/v0/base.proto"; -service Control { rpc ShutdownServer(base.Empty) returns (base.Empty); } +service Control { + rpc ShutdownServer(base.Empty) returns (base.Empty); +} diff --git a/src/ansys/api/acp/v0/cut_off_material.proto b/src/ansys/api/acp/v0/cut_off_material.proto index 7ee9d54..eec20b2 100644 --- a/src/ansys/api/acp/v0/cut_off_material.proto +++ b/src/ansys/api/acp/v0/cut_off_material.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package ansys.api.acp.v0.cut_off_material; -// defines the source of the cut-off material +//defines the source of the cut-off material enum MaterialHandlingType { COMPUTED = 0; GLOBAL = 1; diff --git a/src/ansys/api/acp/v0/drop_off_material.proto b/src/ansys/api/acp/v0/drop_off_material.proto index 81318a5..293271d 100644 --- a/src/ansys/api/acp/v0/drop_off_material.proto +++ b/src/ansys/api/acp/v0/drop_off_material.proto @@ -1,8 +1,9 @@ syntax = "proto3"; package ansys.api.acp.v0.drop_off_material; -// defines the source of the drop-off material +//defines the source of the drop-off material enum MaterialHandlingType { GLOBAL = 0; CUSTOM = 1; } + diff --git a/src/ansys/api/acp/v0/edge_set.proto b/src/ansys/api/acp/v0/edge_set.proto index 41fd1f9..e3b8d16 100644 --- a/src/ansys/api/acp/v0/edge_set.proto +++ b/src/ansys/api/acp/v0/edge_set.proto @@ -25,7 +25,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/element_set.proto b/src/ansys/api/acp/v0/element_set.proto index 06d34f8..ee3314e 100644 --- a/src/ansys/api/acp/v0/element_set.proto +++ b/src/ansys/api/acp/v0/element_set.proto @@ -17,7 +17,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/enum_types.proto b/src/ansys/api/acp/v0/enum_types.proto index e9bd58b..7472520 100644 --- a/src/ansys/api/acp/v0/enum_types.proto +++ b/src/ansys/api/acp/v0/enum_types.proto @@ -1,8 +1,7 @@ syntax = "proto3"; package ansys.api.acp.v0.enum_types; -// the initializers are different in the backend but here it has to be -// zero-based +//the initializers are different in the backend but here it has to be zero-based enum StatusType { UNKNOWN = 0; UPTODATE = 1; @@ -20,9 +19,9 @@ enum RosetteSelectionMethod { DIRECTIONS_FROM_TABULAR_VALUES = 7; } -// defines the ply type which is used for instance by the solid model -// extrusion and the post-processing to distinguish between isotropic, -// reinforced, and core materials +//defines the ply type which is used for instance by the solid model +//extrusion and the post-processing to distinguish between isotropic, +//reinforced, and core materials enum PlyType { REGULAR = 0; WOVEN = 1; diff --git a/src/ansys/api/acp/v0/fabric.proto b/src/ansys/api/acp/v0/fabric.proto index a58ac7d..2232689 100644 --- a/src/ansys/api/acp/v0/fabric.proto +++ b/src/ansys/api/acp/v0/fabric.proto @@ -16,8 +16,8 @@ message Properties { cut_off_material.MaterialHandlingType cut_off_material_handling = 6; ply_material.DrapingMaterialType draping_material_model = 7; double draping_ud_coefficient = 8; - base.ResourcePath material = 9; + // todo: drop-off and cut-off material links (resource path) } message ObjectInfo { @@ -25,7 +25,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/material.proto b/src/ansys/api/acp/v0/material.proto index 029f852..3530c79 100644 --- a/src/ansys/api/acp/v0/material.proto +++ b/src/ansys/api/acp/v0/material.proto @@ -21,7 +21,9 @@ message InterpolationOptions { } message DensityPropertySet { - message Data { double rho = 1; } + message Data { + double rho = 1; + } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -55,7 +57,9 @@ message OrthotropicEngineeringConstantsPropertySet { } message IsotropicStressLimitsPropertySet { - message Data { double effective_stress = 1; } + message Data { + double effective_stress = 1; + } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -78,7 +82,9 @@ message OrthotropicStressLimitsPropertySet { } message IsotropicStrainLimitsPropertySet { - message Data { double effective_strain = 1; } + message Data { + double effective_strain = 1; + } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -161,7 +167,9 @@ message LaRCConstantsPropertySet { } message FabricFiberAnglePropertySet { - message Data { double fabric_fiber_angle = 1; } + message Data { + double fabric_fiber_angle = 1; + } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -191,10 +199,8 @@ message Properties { message PropertySets { DensityPropertySet density = 1; oneof engineering_constants { - IsotropicEngineeringConstantsPropertySet - engineering_constants_isotropic = 2; - OrthotropicEngineeringConstantsPropertySet - engineering_constants_orthotropic = 3; + IsotropicEngineeringConstantsPropertySet engineering_constants_isotropic = 2; + OrthotropicEngineeringConstantsPropertySet engineering_constants_orthotropic = 3; } oneof stress_limits { IsotropicStressLimitsPropertySet stress_limits_isotropic = 4; @@ -226,7 +232,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/model.proto b/src/ansys/api/acp/v0/model.proto index 557fc98..7bf462d 100644 --- a/src/ansys/api/acp/v0/model.proto +++ b/src/ansys/api/acp/v0/model.proto @@ -26,9 +26,13 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} -message LoadFromFileRequest { string path = 1; } +message LoadFromFileRequest { + string path = 1; +} // Special Model messages @@ -95,6 +99,5 @@ service ObjectService { rpc SaveAnalysisModel(SaveAnalysisModelRequest) returns (base.Empty); - rpc SaveShellCompositeDefinitions(SaveShellCompositeDefinitionsRequest) - returns (base.Empty); + rpc SaveShellCompositeDefinitions(SaveShellCompositeDefinitionsRequest) returns (base.Empty); } diff --git a/src/ansys/api/acp/v0/modeling_group.proto b/src/ansys/api/acp/v0/modeling_group.proto index c00f65f..48095af 100644 --- a/src/ansys/api/acp/v0/modeling_group.proto +++ b/src/ansys/api/acp/v0/modeling_group.proto @@ -3,14 +3,17 @@ package ansys.api.acp.v0.modeling_group; import "ansys/api/acp/v0/base.proto"; -message Properties {} +message Properties { +} message ObjectInfo { base.BasicInfo info = 1; Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/modeling_ply.proto b/src/ansys/api/acp/v0/modeling_ply.proto index 6e47cfb..bc424c3 100644 --- a/src/ansys/api/acp/v0/modeling_ply.proto +++ b/src/ansys/api/acp/v0/modeling_ply.proto @@ -19,7 +19,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/oriented_selection_set.proto b/src/ansys/api/acp/v0/oriented_selection_set.proto index 8e4c084..ff52788 100644 --- a/src/ansys/api/acp/v0/oriented_selection_set.proto +++ b/src/ansys/api/acp/v0/oriented_selection_set.proto @@ -22,7 +22,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/ply_material.proto b/src/ansys/api/acp/v0/ply_material.proto index 2d80152..fc01c7f 100644 --- a/src/ansys/api/acp/v0/ply_material.proto +++ b/src/ansys/api/acp/v0/ply_material.proto @@ -1,14 +1,14 @@ syntax = "proto3"; package ansys.api.acp.v0.ply_material; -// defines the draping model (algorithm) +//defines the draping model (algorithm) enum DrapingMaterialType { WOVEN = 0; UD = 1; } -// defines the symmetry-type for stackups, sublaminates etc -enum SymmetryType { +//defines the symmetry-type for stackups, sublaminates etc +enum SymmetryType { NO_SYMMETRY = 0; EVEN_SYMMETRY = 1; ODD_SYMMETRY = 2; diff --git a/src/ansys/api/acp/v0/rosette.proto b/src/ansys/api/acp/v0/rosette.proto index 29e0536..1693ca1 100644 --- a/src/ansys/api/acp/v0/rosette.proto +++ b/src/ansys/api/acp/v0/rosette.proto @@ -27,7 +27,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { repeated ObjectInfo objects = 1; } +message ListReply { + repeated ObjectInfo objects = 1; +} message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/stackup.proto b/src/ansys/api/acp/v0/stackup.proto new file mode 100644 index 0000000..1a41e76 --- /dev/null +++ b/src/ansys/api/acp/v0/stackup.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package ansys.api.acp.v0.stackup; + +import "ansys/api/acp/v0/base.proto"; +import "ansys/api/acp/v0/enum_types.proto"; +import "ansys/api/acp/v0/ply_material.proto"; +import "ansys/api/acp/v0/cut_off_material.proto"; +import "ansys/api/acp/v0/drop_off_material.proto"; + +message FabricWithAngle { + base.ResourcePath fabric = 1; + double angle = 2; +} + +message Properties { + // general properties + enum_types.StatusType status = 1; + ply_material.SymmetryType symmetry = 2; + // topdown=True: the first fabric in the list is placed first in the mold + bool topdown = 3; + double area_price = 4; + repeated FabricWithAngle fabrics = 5; + // draping + ply_material.DrapingMaterialType draping_material_model = 6; + double draping_ud_coefficient = 7; + // solid model options + drop_off_material.MaterialHandlingType drop_off_material_handling = 8; + base.ResourcePath drop_off_material = 9; + cut_off_material.MaterialHandlingType cut_off_material_handling = 10; + base.ResourcePath cut_off_material = 11; +} + +message ObjectInfo { + base.BasicInfo info = 1; + Properties properties = 2; +} + +message ListReply { repeated ObjectInfo objects = 1; } + +message CreateRequest { + base.CollectionPath collection_path = 1; + string name = 2; + Properties properties = 3; +} + +service ObjectService { + rpc List(base.ListRequest) returns (ListReply); + + rpc Get(base.GetRequest) returns (ObjectInfo); + + rpc Put(ObjectInfo) returns (ObjectInfo); + + rpc Delete(base.DeleteRequest) returns (base.Empty); + + rpc Create(CreateRequest) returns (ObjectInfo); +}