// 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 ChangeContactGroupSide1Location(ChangeLocationRequest) returns(ChangeResponse);
  rpc ChangeContactGroupSide2Location(ChangeLocationRequest) returns(ChangeResponse);

  rpc ChangeContactGroupContactType(ansys.api.discovery.v0.connections.contact.ChangeContactTypeRequest) returns (ChangeResponse);
  rpc SplitContactGroup(ChangeEmptyRequest) returns (ChangeResponse);
  rpc ConvertContactGroup(ConvertContactGroupChangeRequest) returns (ChangeResponse);

  rpc ChangeContactGroupFrictionCoefficient(ChangeDoubleRequest) returns (ChangeResponse);
  rpc ChangeContactGroupStiffnessFactor(ChangeDoubleRequest) returns (ChangeResponse);
  rpc ChangeContactGroupDetectionRadiusFactor(ChangeDoubleRequest) returns (ChangeResponse);
  rpc ChangeContactGroupOffset(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupShearStrength(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupTensileStrength(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupAreStrengthLimitsSet(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeContactGroupAdjustGapOrOverlap(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeContactGroupMakeJustTouching(ChangeBooleanRequest) returns (ChangeResponse);
  rpc ChangeContactGroupIdealize(ChangeBooleanRequest) returns (ChangeResponse);

  rpc ChangeContactGroupDetectionDistanceLow(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupDetectionDistanceHigh(ChangeQuantityRequest) returns (ChangeResponse);

  rpc ChangeContactGroupSpecifyThermalConductance(ChangeSpecifyConductanceRequest) returns (ChangeResponse);
  rpc ChangeContactGroupSpecifyElectricConductance(ChangeSpecifyConductanceRequest) returns (ChangeResponse);
  rpc ChangeContactGroupConductanceThickness(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupConductanceMaterial(ChangeAssignmentRequest) returns (ChangeResponse);
  rpc ChangeContactGroupThermalContactConductivity(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupElectricContactConductivity(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupThermalContactConductance(ChangeQuantityRequest) returns (ChangeResponse);
  rpc ChangeContactGroupElectricContactConductance(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.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 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;
  ContactProperties contact = 7;
}