home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / microcrn / issue_40.arc / DAIMS.ARC / OCPANEL.CPP < prev    next >
Text File  |  1988-02-10  |  2KB  |  61 lines

  1. #include <math.h>
  2. #include "viscosity.h"
  3. #include "matrix.hxx"
  4. #include "Cheb_vector.hxx"
  5. #include "vimatrix.hxx"
  6. #include "ocean.hxx"
  7. #include "ocpanel.hxx"
  8. extern void update_ocean_glue(char * ocean_panel_handle, 
  9.                  double * data, int size );
  10. extern void test(char * ocean_panel_handle);
  11. /* 
  12. -*++ ocpanel::ocpanel(): constructor
  13. ** 
  14. ** (*++ history: 
  15. **     16 Jan 88    Bruce Eckel    Creation date
  16. ** ++*)
  17. ** 
  18. ** (*++ detailed: 
  19. ** ++*)
  20. */
  21.  
  22. ocpanel::ocpanel(ocean_layer & ocean) { 
  23.     ocean_panel_handle = 
  24.     ocean_panel_constructor(ocean.lambda(), ocean.xldomain(),
  25.                 ocean.xrdomain(), ocean.viscosity_value(),
  26.                 ocean.viscosity_type(), ocean.nmodes()); 
  27.     screen_update_rate = 1;
  28. }
  29. /* constructor is messy -- leaves stuff lying about */
  30.     
  31.  
  32. /* 
  33. -*++ ocpanel::display(): displays ocean data via sunview
  34. ** 
  35. ** (*++ history: 
  36. **     12 Jan 88    Bruce Eckel    Creation date
  37. ** ++*)
  38. ** 
  39. ** (*++ detailed: 
  40. ** ++*)
  41. */
  42.  
  43. void ocpanel::display(phys_vector & DispVec)
  44. {
  45.     static int count = 0;
  46. //    cout << "count = " << count << "\n";
  47. //    cout << "display_rate " << display_rate() << "\n";
  48. //    cout << "ocean_panel_handle " << (long)ocean_panel_handle << "\n";;
  49. //    cout << "size = " << DispVec.size() << "\n";
  50. //    for (int i = 0; i < DispVec.size(); i ++ )
  51. //    cout << DispVec.doublvect()[i] << " ";
  52. //    cout.flush();
  53.     if (++count == display_rate()) {
  54.     count = 0;
  55.     update_ocean_glue(ocean_panel_handle, DispVec.doublvect(), 
  56.                  DispVec.size());
  57. //    test(ocean_panel_handle);
  58.     }
  59. }
  60.  
  61.