Author Topic: Global number of elements  (Read 5848 times)

prio_j

  • New Member
  • *
  • Posts: 5
Global number of elements
« on: September 03, 2014, 03:01:36 AM »
Hello,

I have some basic questions about variables. Are global number of elements and number of nodes stored in each processor?

For example, a cube of 64 nodes and 27 elements is divided into 2 domains.
I have local number of element and nodes:
numel = 18
numnp = 48

Which variables store global number of elements of 64 and global number of nodes of 27?

Thank you and best regards
Jarunan

Sebastian Castro

  • Jr. Member
  • **
  • Posts: 24
Re: Global number of elements
« Reply #1 on: September 04, 2014, 09:40:41 AM »
Hi,

I'm been using parfeap for a while and I think I can answer your questions.

1. To get the total number of nodes in the problem, you have to use the variable numtn located in pfeapb.h
2. There's not a variable to get the total number of elements in your problem, you only can get the local number in each processor.

In addition, if you want to recover the global numbering of a node, I use this code

Code: [Select]
implicit none

include 'pointer.h' ! np, up
include 'comblk.h'  ! hr, mr
include 'cdata.h'   ! numnp
include 'pfeapb.h'  ! numtn, pfeap_on, pfeap_gnod

integer i, gnod(numnp), lnod, bserchi

do i = 1,numnp
    if (.not. pfeap_on) then
        gnod(i) = i
    else
        if (pfeap_gnod) then
            lnod = bserchi(mr(np(244)), numpn, i)
        else
            lnod = i
        endif
        gnod(i) = mr(np(244)+lnod-1)
    endif
enddo
where gnode(i) gives you the global node of the i-th local node.

If you want to recover the total number of elements and the global numbering of each one, you have to modify the pmacr7.F file ($FEAPHOME8_4/parfeap/pmacr7.F).

Kind regards

Sebastian

prio_j

  • New Member
  • *
  • Posts: 5
Re: Global number of elements
« Reply #2 on: September 05, 2014, 01:36:24 AM »
Hi,

Thank you very much for your help. It works!
I also modified pmacr7.F, then read information from the input files (Icube_0001, Icube_0002,...)

Have you also called MPI functions in FEAP? I would like to have an example. I tried but errors occurred which I cannot figure out yet what it is.

In user/umacr8.f:

Code: [Select]
include  'mpif.h'

        call MPI_Reduce(maxel, maxel_glob, 1, MPI_INT, MPI_MAX, root,
     &               MPI_COMM_WORLD)

Best,
Jarunan

Sebastian Castro

  • Jr. Member
  • **
  • Posts: 24
Re: Global number of elements
« Reply #3 on: September 05, 2014, 09:52:38 AM »
Sorry, I have never used MPI functions in FEAP.

However, if you are trying to get only the total number of elements, the easiest way should be reading the Ocube file after the partition is made, and then you don't need to modify pmacr7.F now that I think.

Good luck.

Sebastian