Welcome, Guest
Username: Password: Remember me

TOPIC: Can customized BORD work in parallel version?

Re: Can customized BORD work in parallel version? 11 years 2 months ago #10295

  • jmhervouet
  • jmhervouet's Avatar
Hello,

It depends on what is NBORL. I suppose here that NBORL is a list of global numbers of the original mesh (in points numbering, not in boundary points numbering, otherwise KNOLG would not work), which are on a boundary and that you want to treat. Then you have to find in a loop which boundary point corresponds locally to this:

DO IPTFR=1,NPTFR
IF(NCSIZE.GT.1) THEN
IF(MESH%KNOLG%I(NBOR2%I(IPTFR)).EQ.NBORL(i)) THEN
here my local boundary point iptfr corresponds to i in NBORL and I can treat it
ENDIF
ELSE
IF(NBOR2%I(IPTFR).EQ.NBORL(i)) THEN
here my local boundary point iptfr corresponds to i in NBORL and I can treat it
ENDIF
ENDIF
ENDDO


You may want to do loops differently but the point is that KNOLG is meant for all points and not for boundary points.

Regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 11 years 2 months ago #10300

  • y.kervella
  • y.kervella's Avatar
Thanks for the reply !

In your example, NPTFR is the number of boundary point in the subdomain (ie different of the NPTFR of the global mesh) ?
What is NBOR2%I ?

Is it a way of printing the things that all processors do (for example, I want to print all the boundary points that I want to treat) ?

Youen
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 11 years 2 months ago #10302

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Yes NPTFR is the local number of boundary points. NBOR2 is an alias of MESH2D%NBOR, but this is in Telemac3d.

Regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 11 years 2 months ago #10306

  • y.kervella
  • y.kervella's Avatar
Hello,

I have tried to do in the way you mentionned, like that:
DO k=1,NPTFRL
DO j=1,NPTFR
IF(NCSIZE.GT.1) THEN
IF(MESH%KNOLG%I(NBOR(j)).EQ.NBORL(k)) THEN
HBOR(j)=eta(k)-ZF(NBOR(j))
ENDIF
ELSE
IF(NBOR(j).EQ.NBORL(k)) THEN
HBOR(indBORL(k))=eta(k)-ZF(NBORL(k))
ENDIF
ENDIF
ENDDO
ENDDO

where eta(k) are the values in my input file and NBORL(k) is the global number of the boundary points I want to treat (indBORL is the boundary number of the point I want to treat).
The results are not the same when I run the code in parallel (NCSIZE.GT.1). I think I don't get the good point for bathymetry (ZF(NBOR(j)) but I don't know how to print the differences..
Does someone has an idea of what is wrong in my code ?

Thanks,
Youen
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 11 years 2 months ago #10308

  • y.kervella
  • y.kervella's Avatar
Hello,
I have found my mistake !
I haven't realized that the transformation NBOR was not the same in the sequential version that in the parallel one...
So, now it works !

Thanks a lot for all your explanations !

Youen
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 9 years 11 months ago #15290

  • dsc1r12
  • dsc1r12's Avatar
Hi,

I have a similar problem in parallel using Telemac 2D; I have edited my BORD subroutine to impose a time series of elevation at every node along the liquid boundary.

To start with something simple, I am trying to impose a constant elevation of 3.2m at every node using:

DO K_DC=1,NPTFR ! Loop over all boundary nodes
IF (NCSIZE.GT.0) THEN
DO KK=1,NPTFR
IF (BOUNDARY_COLOUR%I(KK).EQ.NBOR(K_DC)) THEN

HBOR%R(K_DC)=3.2

END IF
END DO
END IF
END DO

When I run the simulation I get the following error:

t2dfort.f(1979): error #6535: This variable or component must be of a derived or structure type [HBOR]
HBOR%R(K_DC)=3.2
^
t2dfort.f(1979): error #6460: This is not a field name that is defined in the encompassing structure. [R]
HBOR%R(K_DC)=3.2
^
t2dfort.f(1979): error #6158: The structure-name is invalid or is missing. [HBOR]
HBOR%R(K_DC)=3.2
^
compilation aborted for t2dfort.f (code 1)

Can someone help with this in defining HBOR% correctly?

Thanks

Danny
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 9 years 11 months ago #15292

  • jmhervouet
  • jmhervouet's Avatar
Hello,

It is just that HBOR is passed to subroutine bord as a DOUBLE PRECISION, so you have to remove %R, so:

HBOR(K_DC)=3.2D0

however I do not understand what your loops will do, except that all points will get 3.2D0, but this is probably not what you want. So please tell us what you want to do (setting 3.2 on a given point with known boundary number in the initial mesh ?) and we can give you the corresponding implementation.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 9 years 11 months ago #15293

  • dsc1r12
  • dsc1r12's Avatar
Hi JMH,

Yes I tried your suggestion beforehand but for some reason the result gave an elevation at the liquid boundary of zero?!
Essentially I am trying to apply a tidal signal (using phase and amplitude data already obtained) to each liquid node.
I define the amplitudes and phases of 9 tidal constituents in an array called A and P respectively at the start of BORD. From these I calculate the elevation at each liquid node which I put into an array called HEIGHT where HEIGHT is the size of NPTFR. I then use your suggestion for defining the elevation at each node on the liquid boundary in parallel:

DO K_DC=1,NPTFR
IF (NCSIZE.GT.0) THEN
DO KK=1,NPTFR
IF (BOUNDARY_COLOUR%I(KK).EQ.NBOR(K_DC)) THEN

HBOR%R(K_DC)=HEIGHT(K_DC)

END IF
END DO
END IF
END DO


Cheers
Danny
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 9 years 11 months ago #15294

  • jmhervouet
  • jmhervouet's Avatar
Hello,

OK this is clearer for me now, so there is probably a confusion in your implementation between the number of boundary points in the original mesh (let us call it NPTFR_GLOBAL) and the local number of boundary points NPTFR. You should also have a section that will work in scalar mode, something like this:

IF(NCSIZE.GT.1) THEN

DO K_DC=1,NPTFR_GLOBAL
DO KK=1,NPTFR
IF(BOUNDARY_COLOUR%I(KK).EQ.NBOR(K_DC)) THEN
HBOR(KK)=HEIGHT(K_DC)
END IF
END DO
END DO

ELSE

DO K_DC=1,NPTFR
HBOR(K_DC)=HEIGHT(K_DC)
END DO

ENDIF

I suppopse here that HEIGHT is built for all initial boundary nodes by all processors (e.g. they read it in the same file). There is no simple automatic way to find NPTFR_GLOBAL but you can hardcode it in the loop and for dimensioning HEIGHT.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re: Can customized BORD work in parallel version? 9 years 11 months ago #15310

  • dsc1r12
  • dsc1r12's Avatar
Hi JMH

Thanks for this, however there is still something going wrong that I am having trouble figuring out. I ran a simple case where I tried to impose a surface elevation of 0.5m on all liquid boundary nodes with the following code: (NOTE: I obtained the total number of boundary nodes in the domain manually from the cli file = 5364, and ZF((NBOR(K_DC))) is the bathymetry at each point)

IF (NCSIZE.GT.0) THEN
DO K_DC=1,5364
DO KK=1,NPTFR
IF(BOUNDARY_COLOUR%I(KK).EQ.NBOR(K_DC)) THEN
!Print *, NBOR(K_DC)
HBOR(KK)=0.5-ZF((NBOR(K_DC)))
END IF
END DO
END DO
ELSE
DO K_DC=1,NPTFR
HBOR(K_DC)=0.5
END DO
END IF

The result gives incorrect values of surface elevation, where initially the majority of the liquid boundary has surface elevation = 0m and a small section has surface elevation of around -1000m. I cant figure out where I am going wrong to allow the liquid nodes to be assigned the wrong values, any help would be much appreciated.
Cheers

Danny
The administrator has disabled public write access.
Moderators: pham

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