CTextileWeave2D Mesh

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
rpenidef
Posts: 7
Joined: Tue Sep 27, 2016 8:49 pm

CTextileWeave2D Mesh

Post by rpenidef »

Dear Moderators,

Hello, I have a quick question about the CTextileWeave2D meshing. I am trying to create textiles with the wizard and then changing number of layers and resolution with python. The Resolution is straightforward; but, I am struggling with the number of layers part.

Code: Select all

textilename = AddTextile(weave)
####End of wizard script
textile = GetTextile(textilename)
print textile.GetType()
sectionMesh = CSectionMeshRectangular (4,True)
print sectionMesh.GetType()
Which gives,as expected:
CTextileWeave2D
CSectionMeshRectangular

Then I try to use this method "AssignSectionMesh (const CSectionMesh &SectionMesh)" from the CTextileWeave2D class as follows.

Code: Select all

textile.AssignSectionMesh(sectionMesh)
But I get this:

Code: Select all

AttributeError: AssignSectionMesh
My guess is that I am missing something in the middle, but looking through the API this seemed to be the easier way. Any suggestion or another work around would be really helpful.

Thank you everyone. And I have to congratulate the team, this is an amazing software.

Regards,

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

Re: CTextileWeave2D Mesh

Post by louisepb »

Hi Rodrigo,

You're on the right track. There is just a slight change needed which is a result of Python functions being created with C++ wrappers. The CTextileWeave2D class inherits from the CTextile class but Python cannot interpret the different classes in the same way that C++ can. After the GetTextile command you need to do

Code: Select all

weave =textile.GetWeave()
This gets the pointer to the actual weave class rather than the base class. If you then use

Code: Select all

weave.AssignSectionMesh(sectionMesh)
it should work for you.

Hope that helps,
Louise
rpenidef
Posts: 7
Joined: Tue Sep 27, 2016 8:49 pm

Re: CTextileWeave2D Mesh

Post by rpenidef »

Hello Louise,

I did what you told me,

Code: Select all

textile = GetTextile(textilename)
print textile.GetType()
weave =textile.GetWeave()
sectionMesh = CSectionMeshRectangular (4,True)
#sectionMesh.SetNumLayers (4)
print sectionMesh.GetType()
weave.AssignSectionMesh(sectionMesh)
for i in range(10):
    yarn = textile.GetYarn(i)
    yarn.SetResolution(50)
There is no error now, nor warning, but I still get the 2 layers. And while exporting to Abaqus something is going wrong. See figures below.

Thank you Louise for your time,

Rodrigo

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

Re: CTextileWeave2D Mesh

Post by louisepb »

Hi Rodrigo,

The change that you've made will work if you don't choose the refine option. In this case the yarns have constant cross-section and use the number of layers specified. When the refine option is used then sections are specified at each node and I now realise that there is then an issue because the number of layers will be calculated automatically rather than using the number specified. I'll take a look at that.

I assume that you mean the step in the elements is the thing that goes wrong? This is how the code is written. It keeps the elements intact and checks whether the centre point of the element is inside the domain. If it is then the element is retained in that position. This results in a step in the mesh but keeps the periodicity of the mesh without the risk of malformed elements if they were just sliced to the edge of the domain.

Best wishes,
Louise
rpenidef
Posts: 7
Joined: Tue Sep 27, 2016 8:49 pm

Re: CTextileWeave2D Mesh

Post by rpenidef »

Hello Louise,

Yeah, not using the refine I am able to change the mesh. But the interference depth when I do not use the refine is too big to export as an ABAQUS Dry Fiber File (even with the default 2 layers).

I get this output from TexGen:

Code: Select all

Intersection depth in yarn 0 too large for adjustment
Unable to create ABAQUS input file with adjusted mesh: Intersection depths too large
If you could post a workaround this issue with the refine algorithm once you take a look to it I would be grateful.

Thank you,

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

Re: CTextileWeave2D Mesh

Post by louisepb »

Hi Rodrigo,

I have now fixed this and it will be available in the next release.

Best wishes,
Louise
Post Reply