Author Topic: Where to perform compliance calculation?  (Read 6990 times)

ekbon

  • Jr. Member
  • **
  • Posts: 13
Where to perform compliance calculation?
« on: October 26, 2023, 09:25:47 AM »
Dear all,

I would like to calculate and output the compliance of the model I have built.
I have followed these related forum posts:
http://feap.berkeley.edu/forum/index.php?topic=1747
https://feap.berkeley.edu/forum/index.php?topic=1799

However, I am unsure on where to apply the calculation as I only wish to perform this calculation once at the end of the solution.

I was looking at using a user-defined macro but it seemed to be called before umatl.

Any advice on how to approach this would be greatly appreciated.
Thank you,
Elliot

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: Where to perform compliance calculation?
« Reply #1 on: October 26, 2023, 09:37:23 PM »
(1) serial or parallel
(2) define compliance.  what is the formula that you want to evaluate?

ekbon

  • Jr. Member
  • **
  • Posts: 13
Re: Where to perform compliance calculation?
« Reply #2 on: October 27, 2023, 12:25:50 AM »
Dear Prof. Govindjee,

1) Serial
2) Compliance being the scalar produced from the dot product of the force vector, hr(np(27)), with the displacement/solution vector, hr(np(40)), i.e. c = F^T . U

Thank you,
Elliot

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: Where to perform compliance calculation?
« Reply #3 on: October 27, 2023, 07:01:05 AM »
A UMACr command will be easy.  Make sure to call the command after you have converged your problem.

ekbon

  • Jr. Member
  • **
  • Posts: 13
Re: Where to perform compliance calculation?
« Reply #4 on: October 30, 2023, 09:49:43 AM »
Dear Prof. Govindjee

Thank you for your response. I believe I have successfully implemented the user macro and compliance calculation.

Would you mind advising if my approach is reading the hr array for F and U correctly, and is somewhat computationally efficient?

Code: [Select]
      logical   pcomp
      character lct*15
      real*8    ctl(3)
      save

      real*8      c
      real*8      F(ndf*numnp),U(ndf*numnp)

!     Set command word

      if(pcomp(uct,'mac1',4)) then        ! Default form: DO NOT CHANGE
            uct = 'UMAC'                  ! Specify new name

      else                                ! Perform user operation
            ! Calculation and output of response(s)
            ! Read F & U
            F(:) = hr(np(27):np(27)+(ndf*numnp))
            U(:) = hr(np(40):np(40)+(ndf*numnp))

            ! Dot Product F & U
            c = dot_product(F,U)
            write(*,*) 'comp=', c

      endif

Thanks again for your input,
Elliot

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Where to perform compliance calculation?
« Reply #5 on: October 30, 2023, 10:39:03 AM »
FEAP may be able to output what you want already.  If you issue the command: REACtion you will see a term

   Energy: Displacements * Reactions =     1.790238072301419E-02

The number is the product.

Your element must be able to compute residuals for. ISW=6.

If you use hr(np((27)) you may miss things like body forces.

On the other hand, if you are doing transients the above may include inertial effects.

ekbon

  • Jr. Member
  • **
  • Posts: 13
Re: Where to perform compliance calculation?
« Reply #6 on: October 31, 2023, 01:07:08 AM »
Dear Prof. Taylor,

Thank you for your response.
This output is exactly what I am looking for (additionally it verifies the macro code as they produce the same value for my current problem).

Kind regards,
Elliot

ekbon

  • Jr. Member
  • **
  • Posts: 13
Re: Where to perform compliance calculation?
« Reply #7 on: October 31, 2023, 11:00:03 AM »
Dear all,

Within the umacr routine, is it possible to access the UCONstituative arguments (vv), and if so, how do I achieve this?

Thank you,
Elliot

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Where to perform compliance calculation?
« Reply #8 on: October 31, 2023, 12:31:12 PM »
These are the parameters you input on the command line?  If so, I do not see a way you can get them later.

You could add a module or your own common block and copy them into that when you do the user model.  Then you could get them.  If you have multiple materials then you would need to keep track of how many materials you are loading too.

ekbon

  • Jr. Member
  • **
  • Posts: 13
Re: Where to perform compliance calculation?
« Reply #9 on: November 01, 2023, 08:29:16 AM »
Dear Prof. Taylor,

I would like to pass a parameter defined in the input file to be accessed in the umacr routine.

I thought passing the parameter as input to the material model was an approach to this, i.e.
Code: [Select]
MATErial
  SOLId    !ELAStic ISOTropic YM PR
    UCONstititive topE YM PR XX
(where XX denotes the integer I'd like to access in umacr1.f) but I think this might be a convoluted way to approach this.

Is there a better way to access a parameter from the input file in the umacr routine?

Thank you for your advice,
Elliot

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: Where to perform compliance calculation?
« Reply #10 on: November 01, 2023, 10:18:41 AM »
There is a routing 'getparam' in program.  You give the name of the parameter you want (should be lower case), it should return the current value.  So if you want 'xx' you use

call getparam('xx', xx_value, err, prt)

err & prt are logical -- if error in finding parameter:  err = .true.; if you want to output the value set:  prt = .true. (probably you want false).

xx_value is real(kind=8) and is the value of 'xx'

Is this what you want?

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: Where to perform compliance calculation?
« Reply #11 on: November 01, 2023, 11:34:11 AM »
Note to set the parameter you would do something like
Code: [Select]
PARAmeter
  xx = 5