// Copyright 2025, ANSYS Inc. Unauthorized use, distribution or duplication is prohibited.
syntax = "proto3";
package ansys.api.discovery.v0.connections.contactgroup;

import "ansys/api/dbu/v0/dbumodels.proto";
import "ansys/api/discovery/v0/conditions/condition.proto";
import "ansys/api/discovery/v0/connections/contact.proto";
import "ansys/api/discovery/v0/discoverymodels.proto";

option csharp_namespace = "Ansys.Api.Discovery.V0.Connections";

service ContactGroup
{
  rpc ChangeContactSide1Location(ChangeLocationRequest) returns(ChangeResponse);
  rpc ChangeContactSide2Location(ChangeLocationRequest) returns(ChangeResponse);

  rpc ChangeContactType(ansys.api.discovery.v0.connections.contact.ChangeContactTypeRequest) returns (ChangeResponse);
  rpc Split(ChangeEmptyRequest) returns (ChangeResponse);
  rpc Convert(ConvertContactGroupChangeRequest) returns (ChangeResponse);

  rpc ChangeFrictionCoefficient(ChangeDoubleRequest) returns (ChangeResponse);
  rpc ChangeStiffnessFactor(ChangeDoubleRequest) returns (ChangeResponse);
  rpc ChangeDetectionRadiusFactor(ChangeDoubleRequest) returns (ChangeResponse);
  rpc ChangeOffset(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeShearStrength(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeTensileStrength(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeAreStrengthLimitsSet(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeAdjustGapOrOverlap(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeMakeJustTouching(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeIdealize(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeSpecifyThermalConductance(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeSpecifyThermalConductanceFromThicknessAndMaterial(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeSpecifyElectricConductance(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeSpecifyElectricConductanceFromThicknessAndMaterial(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeThermalContactConductance(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeThermalConductanceThickness(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeElectricContactConductance(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeElectricConductanceThickness(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeDetectionDistanceLow(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeDetectionDistanceHigh(ChangeQuantityRequest) returns (ChangeResponse);
  rpc GetByLabel(ansys.api.discovery.v0.conditions.GetByLabelRequest) returns (ContactGroupDefinition);
}

message ConvertContactGroupChangeRequest{
  ansys.api.dbu.v0.PhysicsEntityIdentifier object_id = 1;
  ContactGoupConversionType contact_group_type = 2;
  ansys.api.discovery.v0.connections.contact.ContactPairs contact_pairs = 3;
  optional bool idealize = 4;
  optional double friction_coefficient = 5;
}

// Contact group condition definitions
enum ContactGoupConversionType {
  SLIDING_CONTACT_GROUP = 0;
  JOINT = 1;
  BOND = 2;
  EXCLUDE = 3;
}

message ContactGroupProperties {
  ansys.api.discovery.v0.connections.contact.ContactType contact_type = 1;
  ansys.api.discovery.v0.connections.contact.ContactPairs contact_pairs = 2;
  double friction_coefficient = 3;
  double stiffness_factor = 4;
  double detection_radius_factor = 5;
  Quantity offset = 6;
  Quantity shear_strenght = 7;
  Quantity tensile_strength = 8;
  bool are_strength_limits_set = 9;
  bool adjust_gap_or_overlap = 10;
  bool make_just_touching = 11;
  bool idealize = 12;
  bool specify_thermal_conductance = 13;
  bool specify_thermal_conductance_from_thickness_and_material = 14;
  bool specify_electric_conductance = 15;
  bool specify_electric_conductance_from_thickness_and_material = 16;
  Quantity thermal_contact_conductance = 17;
  Quantity thermal_conductance_thickness = 18;
  Quantity electrical_contact_conductance = 19;
  Quantity electrical_conductance_thickness = 20;
}

message ContactGroupDefinition {
  ansys.api.dbu.v0.PhysicsEntityIdentifier id = 1;
  ansys.api.dbu.v0.PhysicsEntityIdentifier parent_id = 2;
  string label = 3;
  repeated string side1_locations = 4;
  repeated string side2_locations = 5;
  bool suppressed = 6;
  ContactGroupProperties contact = 7;
}