Author Topic: Defining B.C by the command BOUNdary in the partition scheme (FEAP8.5)  (Read 14521 times)

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Also, repeat the test using EBOU instead of BOUN with your original problem and the one element one.

ws18

  • Jr. Member
  • **
  • Posts: 46
Dear Professors,

I found a very strange phenomenon. The BOUNdary can work if the element number is less than a certain amount, say, the test shows that the mesh with 3*3*1 can work but the mesh with more elements cannot work anymore. It seems that the effectiveness of the command BOUNdary is node/element amount dependent.

Since the one element mesh does not have this issue, I output the 4*4*1 mesh case. I also attached the inputfile and please take a look if you have any doubt on the inputfile.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
So that we are certain about what you are running.  Please run the attached two input files and post their output.
Also before doing so, please remove any user elements etc. from your executable.

Further, do you have the possibility of using a different compiler?  either the Intel compiler (free for students) or GCC 6.x?
« Last Edit: July 07, 2017, 10:25:27 PM by Prof. S. Govindjee »

ws18

  • Jr. Member
  • **
  • Posts: 46
Dear Prof. Govindjee,

I ran the two files without any user element or material change. But I kept the change on the file pcontr.f recommended by Prof. Taylor.

In terms of using a different compiler, I can try do this and inform you my finding this weekend.

Thanks for your time.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Ok.  Here are two more files to run (leave Prof. Taylor's changes in your code).

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
And one more set...

ws18

  • Jr. Member
  • **
  • Posts: 46
I ran all the four files. Output files are attached, please check.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Ok.  Time to keep diving further down the rabbit hole.  In unix/memory/setmem.f, look for freallocfn( ) and change the code to look as follows:
Code: [Select]
!         Compute length in integer*X recast to integer*4 for malloc
!         X is either integer4 or integer8

          point = length
          longv = int((point*ipa + mod(point*ipa,ipr))/ipr)
          if(n.eq.31) then
            write(iow,*) 'point ',point,' longv ',longv
            call iprint(mr(np(n)),ndf,numnp*2,ndf,'before frealloc')
          end if
          call freallocfn(np(n),longv,ip,ipr)
          if(n.eq.31) then
            call iprint(mr(np(n)),ndf,numnp*2,ndf,'after frealloc')
          end if

so you are just adding the if blocks before and after the call to freallocfn.  To run this, you will also have to add
Code: [Select]
      include  'sdata.h'at the top of the file.

Now re-run Ipt1newd and Ipt2newd

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
In addition to the above changes, please also make the following changes to the function "static offset_t reallocfn( )" in unix/memory/cmem.c (starting around line 273).

(1) Before the line q = (byte*) realloc..., add the following two lines:
Code: [Select]
    int i;
    for(i=0;i<200;i++) printf("%d ",*(p+p_shift+atomlen*i) ); printf("\n\n");

(2) After the line q = (byte*) realloc..., add the following line:
Code: [Select]
    for(i=0;i<200;i++) printf("%d ",*(q+p_shift+atomlen*i) ); printf("\n\n");
(3) Before the line memset(&q_cmem_data..., add the following two lines:
Code: [Select]
    printf("p_shift %d, q_shift %d\n",p_shift,q_shift);
    for(i=0;i<200;i++) printf("%d ",*(q+q_shift+atomlen*i) ); printf("\n\n");

Re-run Ipt1newd and Ipt2newd.  This time there will be output to the screen (a bunch of numbers).  Please post the numbers you get for each run.
« Last Edit: July 08, 2017, 02:45:34 PM by Prof. S. Govindjee »

ws18

  • Jr. Member
  • **
  • Posts: 46
Dear Prof. Govindjee,

I made the change on the setmem.f, the output files are attached.

For the changes on cmem.c, I don't know how to make the changes effective. I cannot compile it just like setmem.f, right?

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
do the following.

(1) make a copy of cmem.c to say cmem_save_c

(2) edit cmem.c as indicated

(2) cd $FEAPHOME8_5

(3) make

This will compile cmem.c and update your archive with the modified version.  Once we figure out the problem, you can move your cmem_save_c back to cmem.c and remake your program.

ws18

  • Jr. Member
  • **
  • Posts: 46
Dear Prof. Govindjee,

First, I installed the FEAP8.5 in my laptop using gcc 7.1.0. The same problem exists. My laptop system is mac OS X 10.11.6.

Secondly, I followed your suggestions exactly to do modifications on cmem.c file. However, it gave me the "memory" fault after I make it. I tried many times, I cannot get my FEAP recovered by just modify the cmem.c back and make it. I need to reinstall the FEAP. I don't know where I am wrong.

I noticed that the cmem.c file also exists in the folder "largemem" and I copied it with cmemck.c to "Unix" when I install the FEAP. Can we only make changes on the cmem.c file in the folder "memory"? 

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Your compiler and OS should be fine.

Step 0: Compile and run the program memprobe.c in the maintain directory:  gcc memprobe.c; ./a.out  This will spit out some configuration information (that hopefully you have already followed).

Step 1:  Make sure you can build a clean version for FEAP; no edits to any files, no added files.  Just unzip/untar a clean version of the code and make it.   Test the feap executable to make sure it works.  This is to ensure that your toolchain is correct.  You can also post your makefile.in.

Step 2:  Edit the cmem.c in unix/memory as I indicated.

Step 3: Go to your FEAPHOME8_5 and type make

This should produce a working version of feap in main that your can now run.

ws18

  • Jr. Member
  • **
  • Posts: 46
Dear Prof. Govindjee,

It seems I find the problem. I think your FEAP8.5 is fine. The problem is that I used "integer 8" but set ipr=1 in the file fear85.f (in main). I think I should set ipr=2, right?

The comments in the feap85.f and makefile.in said that ipr=1 if the compiler option set all integers to be integer*8. I followed those comments. But I think ipr should be 2, is this understanding correct? Are those comments correct?

I can define B.Cs using Boundary now. My user element can also work.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Yes! ipr = 2 for your machine.  The meaning of ipr is "integers per real".  The standard integer size is 32bits and the standard (double precision) real is 64bits, hence 2 is the correct value.  The use of integer8 refers to the native size of the pointers for your OS/hardware combination.  In your case, with a MAC your machine is using 64bit pointers and thus we store the pointers using integer8 declarations.

The only time, with any modern hardware, that you would set ipr = 1, is if you were going to force all standard integers to be 64bits with a compiler flags such as -fdefault-integer-8 with gfortran, or -i8 with ifort.  The utility of this option would be to allow even larger problems to be solved, since it would allow any single array in FEAP to have more than 2 billion entries.