calling the function .GetPointInformation

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
lianges777
Regular
Posts: 10
Joined: Tue Apr 07, 2009 3:49 pm

calling the function .GetPointInformation

Post by lianges777 »

Hello
I am currently studying plasticity in 2D woven fabric reinforced composites. In order to get a better mesh, I want to generate in Texgen only the mesh for the yarns and then mesh the matrix with ABAQUS. Therefore I run the following script in the Texgen graphical interface:


weave = CTextileWeave2D(2, 2, 0.6, 0.1, True)
weave.SetGapSize(0.001)
weave.SwapPosition(0, 1)
weave.SwapPosition(1, 0)
weave.AssignDomain(CDomainPlanes(XYZ(0, 0, 0), XYZ(1.2, 1.2, 0.1)))
textilename = AddTextile(weave)
mesh=CMesh()
weave.AddVolumeToMesh(mesh, True)
PointsInfo=[POINT_INFO()]
weave.GetPointInformation(mesh.GetNodes(), PointsInfo)
mesh.SaveToABAQUS("C:\Documents and Settings\UPM\Escritorio\weaves\plastic.inp",PointsInfo)


However I have got two error messages:
- the first one is in the texgen output and it says: "Unable to create equispaced section points, maximum iterations exceeded: Polygon(N:20)
"

-the second one is in the Python output:
Traceback (most recent call last):
File "gui", line 1, in <module>
File "C:\Documents and Settings\UPM\Escritorio\python scipts\plastic.py", line 19, in <module>
weave.GetPointInformation(mesh.GetNodes(), PointsInfo)
File ".\Python\libxtra\TexGen\Core.py", line 2094, in GetPointInformation
NotImplementedError: Wrong number of arguments for overloaded function 'CTextile_GetPointInformation'.
Possible C/C++ prototypes are:
GetPointInformation(TexGen::CTextile *,std::vector< TexGen::XYZ > const &,std::vector< TexGen::POINT_INFO > &,double)
GetPointInformation(TexGen::CTextile *,std::vector< TexGen::XYZ > const &,std::vector< TexGen::POINT_INFO > &)

Could someone explain to me why I can't call the function GetPointInformation, please?

Thank you very much
Angie
joncrookston
Expert User
Posts: 27
Joined: Wed Apr 11, 2007 4:03 pm
Location: Nottingham, UK

Post by joncrookston »

Hi Angie,

From the prototypes given it looks like your call to GetPointInformation is correct, although from a (very) quick look in the code, the functions which I saw all took another argument of a tolerance value, as in the first prototype. Try calling:

Code: Select all

tolerance = 1.0e-9
weave.GetPointInformation(mesh.GetNodes(), PointsInfo, tolerance)
Let us know how you get on.

As for the equispaced section points, I think this indicates that TexGen couldn't find a configuration of points around the yarn cross section which led to equal spacing. I think this is quite common, and probably not something to worry about, but others may comment if I'm mistaken.

Cheers,
Jon.
lianges777
Regular
Posts: 10
Joined: Tue Apr 07, 2009 3:49 pm

Post by lianges777 »

Dear Jon,

I tried introducing a tolerance but I still have the same error message

The problem, I think, is that PointsInfo is not recognized a a Point_Info vector structure. I thought the equivalent in python of vectors were lists therefore I defined:

PointsInfo=[POINT_INFO()]

Could you please try to run the same script in your own Texgen to see if the same error message appears?

Thank you very much
Best Regards,
Angie
Angie
joncrookston
Expert User
Posts: 27
Joined: Wed Apr 11, 2007 4:03 pm
Location: Nottingham, UK

Post by joncrookston »

Yes, I see what you mean. Try this:

Code: Select all

	pointsInfo = PointInfoVector()
	print 'Passing centroids to TexGen.  Number of centroids = ', len(centroids)
	textile.GetPointInformation(coords, pointsInfo, tolerance)
	print 'done'
where coords is a list of items of type XYZ, e.g. :

Code: Select all

coords = [XYZ(0,0,0) , XYZ(1,1,0), ]
and tolerance is the tolerance for returning yarn information for a point just outside the yarn.

Hope this gets it running.
Jon.
lianges777
Regular
Posts: 10
Joined: Tue Apr 07, 2009 3:49 pm

Post by lianges777 »

Dear Jon
I ran your script and it works
Thank you very much!

Best Regards
Angie
Post Reply