Skip to content

Commit

Permalink
some more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tteschemacher committed Dec 22, 2022
1 parent 8f60475 commit 3e894ad
Show file tree
Hide file tree
Showing 34 changed files with 771 additions and 475 deletions.
3 changes: 2 additions & 1 deletion Cocodrilo/Cocodrilo/Cocodrilo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<Compile Include="IO\OutputKratosFEM.cs" />
<Compile Include="IO\GeometryUtilties.cs" />
<Compile Include="IO\Output.cs" />
<Compile Include="IO\OutputKratosModuleOptimization.cs" />
<Compile Include="IO\OutputKratosIGA.cs" />
<Compile Include="IO\OutputPythonScripts.cs" />
<Compile Include="IO\OutputUtilitiesJSON.cs" />
Expand Down Expand Up @@ -120,13 +121,13 @@
<Compile Include="ElementProperties\PropertyLoad.cs" />
<Compile Include="ElementProperties\PropertyMembrane.cs" />
<Compile Include="ElementProperties\PropertyShell.cs" />
<Compile Include="ElementProperties\PropertySurfaceLoadLoop.cs" />
<Compile Include="ElementProperties\PropertyUtilities.cs" />
<Compile Include="Elements\NumericalElementPoint.cs" />
<Compile Include="Elements\NumericalElement.cs" />
<Compile Include="EventWatcher.cs" />
<Compile Include="Materials\Material.cs" />
<Compile Include="Materials\MaterialDem.cs" />
<Compile Include="Materials\MaterialMultiElasticityAdvanced.cs" />
<Compile Include="Materials\MaterialLinearElasticIsotropicAdvanced.cs" />
<Compile Include="Materials\MaterialMasonryOrthotropicDamage.cs" />
<Compile Include="Materials\MaterialLinearElasticIsotropic.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Cocodrilo/Cocodrilo/CocodriloPlugIn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class CocodriloPlugIn : Rhino.PlugIns.PlugIn
/// <summary>
/// Global penalty factor
/// </summary>
public double GlobPenaltyFactor = 1e7;
public double GlobPenaltyFactor = 1e10;
/// <summary>
/// Global coupling method
/// </summary>
Expand Down
14 changes: 12 additions & 2 deletions Cocodrilo/Cocodrilo/ElementProperties/Property.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ protected Property(
mIsUniqueProperty = IsUniqueProperty;
}

protected Property(
Property previousProperty)
{
mGeometryType = previousProperty.mGeometryType;
mMaterialId = previousProperty.mMaterialId;
mIsFormFinding = previousProperty.mIsFormFinding;
mIsUniqueProperty = previousProperty.mIsUniqueProperty;
}

public virtual Property Clone() =>
new Property(this);

public virtual bool Equals(Property ThisProperty)
{
return false;
Expand Down Expand Up @@ -105,8 +117,6 @@ public virtual bool HasKratosMaterial()
}
public virtual List<string> GetKratosOutputValuesNodes(Cocodrilo.IO.OutputOptions ThisOutputOptions)
=> new List<string> { };
public virtual List<string> GetKratosOutputValuesIntegrationPoints(Cocodrilo.IO.OutputOptions ThisOutputOptions)
=> new List<string> { };
public virtual Dictionary<string, object> GetKratosOutputIntegrationDomainProcess(
Cocodrilo.IO.OutputOptions ThisOutputOptions,
string AnalysisName,
Expand Down
9 changes: 8 additions & 1 deletion Cocodrilo/Cocodrilo/ElementProperties/PropertyCable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ public PropertyCable(
{
mCableProperties = ThisCableProperties;
}

public PropertyCable(
PropertyCable previousPropertyCable)
: base(previousPropertyCable)
{
mCableProperties = previousPropertyCable.mCableProperties;
}
public override Property Clone() =>
new PropertyCable(this);
public override List<Dictionary<string, object>> GetKratosPhysic(List<int> BrepIds)
{
Dictionary<string, object> Parameters = new Dictionary<string, object>{};
Expand Down
67 changes: 44 additions & 23 deletions Cocodrilo/Cocodrilo/ElementProperties/PropertyCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ public struct CheckProperties : IEquatable<CheckProperties>
public bool mDISP_Y { get; set; }
public bool mDISP_Z { get; set; }
public bool mLAGRANGE_MP { get; set; }
List<string> mAdditionalOuputs { get; set; }

public CheckProperties(
bool DISP_X, bool DISP_Y, bool DISP_Z, bool LAGRANGE_MP)
bool DISP_X,
bool DISP_Y,
bool DISP_Z,
bool LAGRANGE_MP,
List<string> AdditionalOuputs)
{
mDISP_X = DISP_X;
mDISP_Y = DISP_Y;
mDISP_Z = DISP_Z;
mLAGRANGE_MP = LAGRANGE_MP;
mAdditionalOuputs = AdditionalOuputs;
}


Expand All @@ -29,7 +35,8 @@ public bool Equals(CheckProperties comp)
return comp.mDISP_X == mDISP_X &&
comp.mDISP_Y == mDISP_Y &&
comp.mDISP_Z == mDISP_Z &&
comp.mLAGRANGE_MP == mLAGRANGE_MP;
comp.mLAGRANGE_MP == mLAGRANGE_MP &&
comp.mAdditionalOuputs == mAdditionalOuputs;
}
}

Expand All @@ -38,9 +45,9 @@ public bool Equals(CheckProperties comp)
public class PropertyCheck : Property
{
//private CheckProperties mCheckProperties { get; set; }
CheckProperties mCheckProperties { get; set; }
public CheckProperties mCheckProperties { get; set; }
public TimeInterval mTimeInterval { get; set; }
bool mOnNode { get; set;}
public bool mOnNode { get; set;}

public PropertyCheck() : base()
{
Expand All @@ -57,7 +64,17 @@ public PropertyCheck(

mOnNode = OnNode;
}
public PropertyCheck(
PropertyCheck previousPropertyCheck)
: base(previousPropertyCheck)
{
mCheckProperties = previousPropertyCheck.mCheckProperties;
mTimeInterval = previousPropertyCheck.mTimeInterval;

mOnNode = previousPropertyCheck.mOnNode;
}
public override Property Clone() =>
new PropertyCheck(this);
public override bool Equals(Property OtherProperty)
{
var other_property = OtherProperty as PropertyCheck;
Expand Down Expand Up @@ -130,21 +147,26 @@ public override List<Dictionary<string, object>> GetKratosProcesses()
{ "output_frequency", 0.1 }
};


List<string> results = new List<string>();
if (mCheckProperties.mDISP_X && mCheckProperties.mDISP_Y && mCheckProperties.mDISP_Z)
results.Add( "DISPLACEMENT" );
else
{
if (mCheckProperties.mDISP_X)
List<string> results = new List<string>();
if (mCheckProperties.mDISP_X && mCheckProperties.mDISP_Y && mCheckProperties.mDISP_Z)
{
results.Add("DISPLACEMENT");
}
else
{
if (mCheckProperties.mDISP_X)
results.Add("DISPLACEMENT_X");
if (mCheckProperties.mDISP_Y)
if (mCheckProperties.mDISP_Y)
results.Add("DISPLACEMENT_Y");
if (mCheckProperties.mDISP_Z)
if (mCheckProperties.mDISP_Z)
results.Add("DISPLACEMENT_Z");
}
if(mCheckProperties.mLAGRANGE_MP)
}

if (mCheckProperties.mLAGRANGE_MP)
{
results.Add("VECTOR_LAGRANGE_MULTIPLIER");
}

if (mOnNode)
{
output_process_parameters.Add("nodal_results", results);
Expand All @@ -156,16 +178,15 @@ public override List<Dictionary<string, object>> GetKratosProcesses()
output_process_parameters.Add("integration_point_results", results);
}


return new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
new Dictionary<string, object>
{
{"kratos_module", "IgaApplication"},
{"python_module", "iga_output_process"},
{"Parameters", output_process_parameters}
}
};
{"kratos_module", "IgaApplication"},
{"python_module", "iga_output_process"},
{"Parameters", output_process_parameters}
}
};
}

public override string GetKratosModelPart()
Expand Down
8 changes: 8 additions & 0 deletions Cocodrilo/Cocodrilo/ElementProperties/PropertyConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public PropertyConnector(
{
mConnectorProperties = ThisConnectorProperties;
}
public PropertyConnector(
PropertyConnector previousPropertyConnector)
: base(previousPropertyConnector)
{
mConnectorProperties = previousPropertyConnector.mConnectorProperties;
}
public override Property Clone() =>
new PropertyConnector(this);
public override bool Equals(Property ThisProperty)
{
if (!(ThisProperty is PropertyConnector))
Expand Down
10 changes: 9 additions & 1 deletion Cocodrilo/Cocodrilo/ElementProperties/PropertyCoupling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ public PropertyCoupling(
mSupport = ThisSupport;
mTimeInterval = ThisTimeInterval;
}

public PropertyCoupling(
PropertyCoupling previousPropertyCoupling)
: base(previousPropertyCoupling)
{
mSupport = previousPropertyCoupling.mSupport;
mTimeInterval = previousPropertyCoupling.mTimeInterval;
}
public override Property Clone() =>
new PropertyCoupling(this);
public override bool Equals(Property ThisProperty)
{
if (!(ThisProperty is PropertyCoupling))
Expand Down
3 changes: 2 additions & 1 deletion Cocodrilo/Cocodrilo/ElementProperties/PropertyDem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public class PropertyDem : Property
{
public PropertyDem(
GeometryType ThisGeometryType,
int MaterialId) :base(ThisGeometryType, MaterialId)
int MaterialId)
: base(ThisGeometryType, MaterialId)
{

}
Expand Down
10 changes: 10 additions & 0 deletions Cocodrilo/Cocodrilo/ElementProperties/PropertyLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ public PropertyLoad(
mTimeInterval = ThisTimeInterval;
}

public PropertyLoad(
PropertyLoad previousPropertyLoad)
: base(previousPropertyLoad)
{
mLoad = previousPropertyLoad.mLoad;
mTimeInterval = previousPropertyLoad.mTimeInterval;
}
public override Property Clone() =>
new PropertyLoad(this);

public override string ToString()
{
return "load property";
Expand Down
23 changes: 8 additions & 15 deletions Cocodrilo/Cocodrilo/ElementProperties/PropertyMembrane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ public PropertyMembrane(
{
mMembraneProperties = ThisMembraneProperties;
}

public PropertyMembrane(
PropertyMembrane previousPropertyMembrane)
: base(previousPropertyMembrane)
{
mMembraneProperties = previousPropertyMembrane.mMembraneProperties;
}
public override Property Clone() =>
new PropertyMembrane(this);
public override List<Dictionary<string, object>> GetKratosPhysic(List<int> BrepIds)
{
string[] variables = new[] { "INTEGRATION_WEIGHT" };
Expand Down Expand Up @@ -101,20 +108,6 @@ public override string GetKratosModelPart()
return "StructuralAnalysis_" + mPropertyId;
}

public override List<string> GetKratosOutputValuesIntegrationPoints(
Cocodrilo.IO.OutputOptions ThisOutputOptions)
{
var variable_list = new List<string> { };
if (ThisOutputOptions.cauchy_stress)
{
variable_list.Add("CAUCHY_STRESS");
}
if (ThisOutputOptions.pk2_stress)
{
variable_list.Add("PK2_STRESS");
}
return variable_list;
}
public override Dictionary<string, object> GetKratosOutputIntegrationDomainProcess(
Cocodrilo.IO.OutputOptions ThisOutputOptions,
string AnalysisName,
Expand Down
Loading

0 comments on commit 3e894ad

Please sign in to comment.