How to use Geometry Solver?

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
wanghao
Regular
Posts: 15
Joined: Thu Apr 18, 2013 10:43 am

How to use Geometry Solver?

Post by wanghao »

Hi, louise
Thank you for your reply in email. I have known the usage of CAdjustMeshInterference class.
Now, I want to know the usage of Geometry solver. I try to replace the example's script from the "Scripting Examples" in website, but I get wrong result. I can't get the CGeometrySolver() to work out properly when running the script "polyester-geometry solver.py" in TexGen. I got a lot of warnings, like "Warning: Degrees of freedom 0 and 30 are already constrained! Ignoring this boundary condition.". Where am I wrong?

BTW, How to achieve the interference adjustment like in paper "Prediction of textile geometry using an energy minimization approach" ?

-----------------------------polyester-geometry solver.py----------------------------------
from TexGen.Core import *

# Read in a textile
ReadFromXML('1.tg3')
Textile = GetTextile()

# Create an instance of the geometry solver
Solver = CGeometrySolver()

# Set some parameters
Solver.SetContactStiffness(1e6)
Solver.SetDisabledStiffness(1e-6)
Solver.SetSeed(1.0)
# Create the system of equations to be solved
Solver.CreateSystem(Textile)
# Solve the system
Solver.SolveSystem()
# Save the result to a VTK file for viewing purposes
Solver.SaveToVTK("GeomSolve")
# Deform the textile
Solver.DeformTextile()
# Save the result back to a TG3 file
SaveToXML('Def-1.tg3')
-------------------------------------------------------------------------------------------------

---------------------------------------1.tg3-----------------------------------------------
<?xml version="1.0" ?>
<TexGenModel version="3.5.3">
<Textile name=%26quot%3Bpolyester%26quot%3B YoungsModulusValue="2.000000000000e+005" YoungsModulusUnits="MPa" YoungsModulusYValue="1.000000000000e+004" YoungsModulusYUnits="MPa" YoungsModulusZValue="1.000000000000e+004" YoungsModulusZUnits="MPa" PoissonsRatio="3.000000000000e-001" PoissonsRatioY="4.000000000000e-001" PoissonsRatioZ="4.000000000000e-001" ShearModulusXYValue="5.000000000000e+003" ShearModulusXYUnits="MPa" ShearModulusXZValue="5.000000000000e+003" ShearModulusXZUnits="MPa" ShearModulusYZValue="5.000000000000e+003" ShearModulusYZUnits="MPa" AlphaXValue="-2.000000000000e-007" AlphaXUnits="/K" AlphaYValue="3.000000000000e-006" AlphaYUnits="/K" AlphaZValue="3.000000000000e-006" AlphaZUnits="/K" GeometryScale="mm" MatrixYoungsModulusValue="3.000000000000e+003" MatrixYoungsModulusUnits="MPa" MatrixPoissonsRatio="2.000000000000e-001" MatrixAlpha="6.500000000000e-006" type="CTextile" NeedsBuilding="0">
<Domain type="CDomainPlanes">
<Plane Normal="1.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" d="0.000000000000e+000" />
<Plane Normal="-1.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" d="-4.400000000000e-001" />
<Plane Normal="0.000000000000e+000, 1.000000000000e+000, 0.000000000000e+000" d="0.000000000000e+000" />
<Plane Normal="0.000000000000e+000, -1.000000000000e+000, 0.000000000000e+000" d="-4.400000000000e-001" />
<Plane Normal="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" d="-2.000000000000e-002" />
<Plane Normal="0.000000000000e+000, 0.000000000000e+000, -1.000000000000e+000" d="-7.000000000000e-002" />
</Domain>
<Yarn index="0" YoungsModulusValue="2.000000000000e+005" YoungsModulusUnits="MPa" YoungsModulusYValue="1.000000000000e+004" YoungsModulusYUnits="MPa" YoungsModulusZValue="1.000000000000e+004" YoungsModulusZUnits="MPa" PoissonsRatio="3.000000000000e-001" PoissonsRatioY="4.000000000000e-001" PoissonsRatioZ="4.000000000000e-001" ShearModulusXYValue="5.000000000000e+003" ShearModulusXYUnits="MPa" ShearModulusXZValue="5.000000000000e+003" ShearModulusXZUnits="MPa" ShearModulusYZValue="5.000000000000e+003" ShearModulusYZUnits="MPa" AlphaXValue="-2.000000000000e-007" AlphaXUnits="/K" AlphaYValue="3.000000000000e-006" AlphaYUnits="/K" AlphaZValue="3.000000000000e-006" AlphaZUnits="/K" NumSlaveNodes="25" NumSectionPoints="20" NeedsBuilding="7">
<Interpolation Periodic="1" ForceInPlaneTangent="0" ForceMasterNodeTangent="0" type="CInterpolationCubic" />
<YarnSection type="CYarnSectionConstant" ConstMesh="1">
<Section type="CSectionEllipse" Width="1.800000000000e-001" Height="4.000000000000e-002">
<SectionMesh type="CSectionMeshTriangulate" MinAngle="2.000000000000e+001" MaxArea="1.000000000000e+000" />
</Section>
</YarnSection>
<FibreDistribution type="CFibreDistributionConst" />
<Repeat value="4.400000000000e-001, 0.000000000000e+000, 0.000000000000e+000" />
<Repeat value="0.000000000000e+000, 4.400000000000e-001, 0.000000000000e+000" />
<MasterNode index="0" Position="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="1" Position="2.200000000000e-001, 0.000000000000e+000, 5.000000000000e-002" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="2" Position="4.400000000000e-001, 0.000000000000e+000, 0.000000000000e+000" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
</Yarn>
<Yarn index="1" YoungsModulusValue="2.000000000000e+005" YoungsModulusUnits="MPa" YoungsModulusYValue="1.000000000000e+004" YoungsModulusYUnits="MPa" YoungsModulusZValue="1.000000000000e+004" YoungsModulusZUnits="MPa" PoissonsRatio="3.000000000000e-001" PoissonsRatioY="4.000000000000e-001" PoissonsRatioZ="4.000000000000e-001" ShearModulusXYValue="5.000000000000e+003" ShearModulusXYUnits="MPa" ShearModulusXZValue="5.000000000000e+003" ShearModulusXZUnits="MPa" ShearModulusYZValue="5.000000000000e+003" ShearModulusYZUnits="MPa" AlphaXValue="-2.000000000000e-007" AlphaXUnits="/K" AlphaYValue="3.000000000000e-006" AlphaYUnits="/K" AlphaZValue="3.000000000000e-006" AlphaZUnits="/K" NumSlaveNodes="25" NumSectionPoints="20" NeedsBuilding="7">
<Interpolation Periodic="1" ForceInPlaneTangent="0" ForceMasterNodeTangent="0" type="CInterpolationCubic" />
<YarnSection type="CYarnSectionConstant" ConstMesh="1">
<Section type="CSectionEllipse" Width="1.800000000000e-001" Height="4.000000000000e-002">
<SectionMesh type="CSectionMeshTriangulate" MinAngle="2.000000000000e+001" MaxArea="1.000000000000e+000" />
</Section>
</YarnSection>
<FibreDistribution type="CFibreDistributionConst" />
<Repeat value="4.400000000000e-001, 0.000000000000e+000, 0.000000000000e+000" />
<Repeat value="0.000000000000e+000, 4.400000000000e-001, 0.000000000000e+000" />
<MasterNode index="0" Position="0.000000000000e+000, 2.200000000000e-001, 5.000000000000e-002" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="1" Position="2.200000000000e-001, 2.200000000000e-001, 0.000000000000e+000" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="2" Position="4.400000000000e-001, 2.200000000000e-001, 5.000000000000e-002" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
</Yarn>
<Yarn index="2" YoungsModulusValue="2.000000000000e+005" YoungsModulusUnits="MPa" YoungsModulusYValue="1.000000000000e+004" YoungsModulusYUnits="MPa" YoungsModulusZValue="1.000000000000e+004" YoungsModulusZUnits="MPa" PoissonsRatio="3.000000000000e-001" PoissonsRatioY="4.000000000000e-001" PoissonsRatioZ="4.000000000000e-001" ShearModulusXYValue="5.000000000000e+003" ShearModulusXYUnits="MPa" ShearModulusXZValue="5.000000000000e+003" ShearModulusXZUnits="MPa" ShearModulusYZValue="5.000000000000e+003" ShearModulusYZUnits="MPa" AlphaXValue="-2.000000000000e-007" AlphaXUnits="/K" AlphaYValue="3.000000000000e-006" AlphaYUnits="/K" AlphaZValue="3.000000000000e-006" AlphaZUnits="/K" NumSlaveNodes="25" NumSectionPoints="20" NeedsBuilding="7">
<Interpolation Periodic="1" ForceInPlaneTangent="0" ForceMasterNodeTangent="0" type="CInterpolationCubic" />
<YarnSection type="CYarnSectionConstant" ConstMesh="1">
<Section type="CSectionEllipse" Width="1.800000000000e-001" Height="4.000000000000e-002">
<SectionMesh type="CSectionMeshTriangulate" MinAngle="2.000000000000e+001" MaxArea="1.000000000000e+000" />
</Section>
</YarnSection>
<FibreDistribution type="CFibreDistributionConst" />
<Repeat value="4.400000000000e-001, 0.000000000000e+000, 0.000000000000e+000" />
<Repeat value="0.000000000000e+000, 4.400000000000e-001, 0.000000000000e+000" />
<MasterNode index="0" Position="0.000000000000e+000, 0.000000000000e+000, 5.000000000000e-002" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="1" Position="0.000000000000e+000, 2.200000000000e-001, 0.000000000000e+000" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="2" Position="0.000000000000e+000, 4.400000000000e-001, 5.000000000000e-002" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
</Yarn>
<Yarn index="3" YoungsModulusValue="2.000000000000e+005" YoungsModulusUnits="MPa" YoungsModulusYValue="1.000000000000e+004" YoungsModulusYUnits="MPa" YoungsModulusZValue="1.000000000000e+004" YoungsModulusZUnits="MPa" PoissonsRatio="3.000000000000e-001" PoissonsRatioY="4.000000000000e-001" PoissonsRatioZ="4.000000000000e-001" ShearModulusXYValue="5.000000000000e+003" ShearModulusXYUnits="MPa" ShearModulusXZValue="5.000000000000e+003" ShearModulusXZUnits="MPa" ShearModulusYZValue="5.000000000000e+003" ShearModulusYZUnits="MPa" AlphaXValue="-2.000000000000e-007" AlphaXUnits="/K" AlphaYValue="3.000000000000e-006" AlphaYUnits="/K" AlphaZValue="3.000000000000e-006" AlphaZUnits="/K" NumSlaveNodes="25" NumSectionPoints="20" NeedsBuilding="7">
<Interpolation Periodic="1" ForceInPlaneTangent="0" ForceMasterNodeTangent="0" type="CInterpolationCubic" />
<YarnSection type="CYarnSectionConstant" ConstMesh="1">
<Section type="CSectionEllipse" Width="1.800000000000e-001" Height="4.000000000000e-002">
<SectionMesh type="CSectionMeshTriangulate" MinAngle="2.000000000000e+001" MaxArea="1.000000000000e+000" />
</Section>
</YarnSection>
<FibreDistribution type="CFibreDistributionConst" />
<Repeat value="4.400000000000e-001, 0.000000000000e+000, 0.000000000000e+000" />
<Repeat value="0.000000000000e+000, 4.400000000000e-001, 0.000000000000e+000" />
<MasterNode index="0" Position="2.200000000000e-001, 0.000000000000e+000, 0.000000000000e+000" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="1" Position="2.200000000000e-001, 2.200000000000e-001, 4.000000000000e-002" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
<MasterNode index="2" Position="2.200000000000e-001, 4.400000000000e-001, 0.000000000000e+000" Tangent="0.000000000000e+000, 0.000000000000e+000, 0.000000000000e+000" Up="0.000000000000e+000, 0.000000000000e+000, 1.000000000000e+000" />
</Yarn>
</Textile>
</TexGenModel>
-------------------------------------------------------------------------------------------------

best wishes.

wanghao
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: How to use Geometry Solver?

Post by louisepb »

Hi Wanghao,

Glad you made it onto the forum!

If you are trying to use the geometry solver on the polyester textile then an initial problem may be the seed size that you have set. This basically governs the size of mesh that is created. The domain of the polyester textile is 0.44mm square so to have a seed size of 1.0 doesn't make much sense. You could maybe start off by trying 0.1 but you will probably need to experiment with this. You may well need to experiment with all the parameters to find those which give the best result.

Louise
Post Reply