CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

WENO code for Wave Equation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By FMDenaro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 18, 2017, 01:54
Default WENO code for Wave Equation
  #1
Member
 
Hanye Azimi
Join Date: Oct 2016
Posts: 42
Rep Power: 10
ronak is on a distinguished road
Hi there
I've written a code in Frtran for a wave Equation with WENO scheme but after running I get this error
"Array U has value 0 which is less than lower bound of 1"
Are you familar whith this error? I attached the code. I'll appreciate if you take a look and let me know if you find out the problem.
Best wishes
Attached Files
File Type: txt New Text Document.txt (1.3 KB, 14 views)
ronak is offline   Reply With Quote

Old   July 18, 2017, 03:50
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by ronak View Post
Hi there
I've written a code in Frtran for a wave Equation with WENO scheme but after running I get this error
"Array U has value 0 which is less than lower bound of 1"
Are you familar whith this error? I attached the code. I'll appreciate if you take a look and let me know if you find out the problem.
Best wishes

That is your program error...the index of the vector has a value (zero) and violates the access to the array. Use the check_bound options in your compiler. If you really want to use the idex 0 you have to declare the array to start from 0 (you can also declare for nevative values).
naffrancois likes this.
FMDenaro is offline   Reply With Quote

Old   July 18, 2017, 03:55
Default
  #3
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
Hello,

This error typically means that you are trying to access unallocated memory. This happens in your loop because the index i-r+j goes outside of the prescribed dimension 1:150.
naffrancois is offline   Reply With Quote

Old   July 18, 2017, 04:58
Default
  #4
Member
 
Hanye Azimi
Join Date: Oct 2016
Posts: 42
Rep Power: 10
ronak is on a distinguished road
Quote:
Originally Posted by naffrancois View Post
Hello,

This error typically means that you are trying to access unallocated memory. This happens in your loop because the index i-r+j goes outside of the prescribed dimension 1:150.
Yes. You're right but what should I do? I'm following the algorithm that is attached as a JPG file. there is a function with index i-r+j .
Thanks for ur time.
ronak is offline   Reply With Quote

Old   July 18, 2017, 05:03
Default
  #5
Member
 
Hanye Azimi
Join Date: Oct 2016
Posts: 42
Rep Power: 10
ronak is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
That is your program error...the index of the vector has a value (zero) and violates the access to the array. Use the check_bound options in your compiler. If you really want to use the idex 0 you have to declare the array to start from 0 (you can also declare for nevative values).
Thanks a lot. I don't insist on 0 as the boundary. All I want is a plot from this program while it goes in a right way.
Do you have any suggestion to correct the error while I have U( i-r+j)?
Best
ronak is offline   Reply With Quote

Old   October 16, 2017, 17:35
Default Link to WENO code in fortran
  #6
New Member
 
Aranya Dan
Join Date: Oct 2017
Posts: 19
Rep Power: 9
crazyshock is on a distinguished road
Not sure if this helps but here is a link to my working code in fortran (Weno5, 1D) for reference

https://github.com/aranyadan/WENO51D_fortran
crazyshock is offline   Reply With Quote

Reply

Tags
fortran, wave equation, weno code


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error message cuteapathy CFX 14 March 20, 2012 07:45
orlandi code for poisson equation with FFT ( paid tutorial) HaKu Main CFD Forum 0 June 29, 2009 16:40
Lubrication Reynolds Equation Free Fortran Code CHULS Main CFD Forum 2 August 13, 2007 16:25
F77 Code for Energy Equation Carlos Main CFD Forum 0 April 2, 2002 15:57
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 16:56


All times are GMT -4. The time now is 16:32.