Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: elements in a polygon

elements in a polygon 9 years 3 weeks ago #18741

  • MarkusR
  • MarkusR's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 56
  • Thank you received: 1
hey,

no the fortran file is split up in two parts. only one class and more than one. I thought i have to define the if(inpoly)-comand after the loop of all elements which is done twice each after the separation of size-classes and so i have to define it also twice. Further the if(inpoly..) command for only one class ends before the ELSE-command (line 165) from the IF(NSICLA.EQ.1).

The IF(IELEM.EQ.59188) is commented out and only for checking there.

Best regards,
Markus
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18742

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
I suppose you didn't have any compilation warning.
So for testing, I think you should write (before the test) the result of the call to INPOLY.
Something like:
WRITE(LU,*) IELEM, INPOLY(XEL(IELEM,1),YEL(IELEM,1),XS,YS,NS)
It's not necessary to run a lot of time step...

regards
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: MarkusR

elements in a polygon 9 years 3 weeks ago #18744

  • MarkusR
  • MarkusR's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 56
  • Thank you received: 1
Good hint, thanks.

Using this command shows than no element is inside this polygon..all elements are listed with an F

But ok than there must be a mistake in defining the polygon maybe.

Thanks!
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18746

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
Test with a large polygon which cover a large part of your model

regards
Christophe
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18748

  • MarkusR
  • MarkusR's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 56
  • Thank you received: 1
I checked it, but its not working, it tried also in defining the polygon clockwise and counterclockwise.

But if i use WRITE(LU,*) IELEM, XEL(IELEM,1),YEL(IELEM,1)
To see what the coordinates are, i get that they are relative coordinated.
XEL(IELEM,1) is allways 0, and XEL(IELEM,2) is the distance from corner node 1 to 2...
so its quite obvious why no node is inside the polygon..and further why they are named as mesh coordinates..

So i have to think of something else to specify elements inside a defined area.

But thanks a lot for your help!
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18751

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
this is stange but you could easily bypass this problem by changing the test.
Use X(I1) with I1=IKLE(IELEM,1)...

Maybe this will be MESH%X%R(I1) if this doesn't work with only X

regards
Christophe
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18753

  • MarkusR
  • MarkusR's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 56
  • Thank you received: 1
YES, Thats it!
I1=IKLE(IELEM,1)
IF(inpoly(mesh%x%R(I1),mesh%y%R(I1),xS,yS,nS))THEN

works
So thanks again!
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18783

  • jmhervouet
  • jmhervouet's Avatar
Hello,

The reason why it did not work with XEL and YEL is that the coordinates given per elements are shifted so that point 1 in the triangle is the origin. This has been done to optimise the computation of vectors and matrices.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: Pablo, pavans

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.