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

TOPIC: elements in a polygon

elements in a polygon 9 years 3 weeks ago #18722

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

i'm trying to include sediment slide to my model, but only on certain regions of the mesh. In the according subroutine (maxslope.f) this is done by a loop over the elements. I defined a polygon and checked if the first point of the element is inside this polygon (and so the slide is calculated) or outside (do nothing). Although i dont find any mistake it is not working... If i specify an element directly by it number it works...
In the following is the according code:

! LOOP ON ELEMENTS
DO IELEM=1,NELEM
!

I1=IKLE(IELEM,1)
I2=IKLE(IELEM,2)
I3=IKLE(IELEM,3)
NS=4
!the 4 corner-nodes of the polygon
XS(01)=74082
YS(01)=99787
XS(02)=74110
YS(02)=99821
XS(03)=74069
YS(03)=99840
XS(04)=74057
YS(04)=99804
!checks if the x- and y- coordinate of point 1 is inside polygon
IF(inpoly(XEL(IELEM,1),YEL(IELEM,1),xS,yS,nS))THEN
!for only one point
! IF(IELEM.EQ.59188)THEN
...
...
Has someone an idea or finds a mistake?

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

elements in a polygon 9 years 3 weeks ago #18724

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi Marcus

I think you made a mistake between Elements and Nodes
XEL and YEL are the coordinates of the element (only 1 per element)
X and Y are the coordinates of nodes (3 nodes per element)

I'm not sure but probably XEL(IELEM,1) is not a correct reference for the vector.
You probably have to use X(I1) and Y(I1) instead

Hope this helps
Christophe
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18726

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

unfortunately your suggestion it is not working. In the subroutine three points I are defined with the connectivity (IKLE) for one specific element IELEM and their coordinates are XEL and YEL, or not?

DO IELEM=1,NELEM
!
I1=IKLE(IELEM,1)
I2=IKLE(IELEM,2)
I3=IKLE(IELEM,3)
!
X2=XEL(IELEM,2)
X3=XEL(IELEM,3)
Y2=YEL(IELEM,2)
Y3=YEL(IELEM,3)
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18728

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
No
The coordinates of each points are X(I1), Y(I1), ...
XEL and YEL are the coordinates of the element, ie the gravity center of the element. There is only one XEL, YEL per element

regards
Christophe
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18730

  • MarkusR
  • MarkusR's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 56
  • Thank you received: 1
Ok,now im confused...
so why has XEL and YEL the structure like XEL(IELEM,3) like it is described in this post?

www.opentelemac.org/index.php/assistance...zf-at-each-time-step

Further it is not clear how to define then the center of the element. XEL(IELEM) is not working.
Best regards,

Markus
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18731

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
You're right, Xel and Yel are the coordinates of the nodes composing the element so there is 3 values in Xel and Yel
I forgot the specific case of spherical coordinates...

Let's back to your problem
When you said you program is not working, what do you mean, the computation run but the condition is never satisfied?

regards
Christophe
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18732

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

yes exactly the simulation runs and its like no node is found inside the polygon and nothing is done...if i specify only one element directly i get response, which is high evolution at a point with a slope of 70°.

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

elements in a polygon 9 years 3 weeks ago #18733

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Could you share the fortran file?
Christophe
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18738

  • MarkusR
  • MarkusR's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 56
  • Thank you received: 1
yes of course. i marked the modified parts with !!!!!!!!!!!!!
Attachments:
The administrator has disabled public write access.

elements in a polygon 9 years 3 weeks ago #18740

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
I'm not sure to well understand your problem as in your fortran, the condition on the nodes and the condition xith the element number are in two different parts!
If you have more than 1 class of sediment, you never enter in the first part of the condition where the condition (IF(inpoly(XEL(IELEM,1),YEL(IELEM,1),xS,yS,nS))THEN) is tested !

And by opposition, if you have only 1 class, you never test the second one (IF(IELEM.EQ.59188)THEN).

This is very strange in fact!

Regards
Christophe
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.