[overture] Re: help to get a simple hyperbolic mapping code working

  • From: Bill Henshaw <henshaw@xxxxxxxx>
  • To: overture@xxxxxxxxxxxxx
  • Date: Tue, 14 Apr 2009 08:07:31 -0700

Hi Sunil:
 The HyperbolicMapping is usually called interactively and so has
not been tested very much when called directly.
The following should work but you will need Overture.v23.

...Bill

int extrude2DMapping(Mapping& m,const int NLayers)
{
  HyperbolicMapping hyp;
  const bool isSurfaceGrid=false, init=true;
  hyp.setSurface(m,isSurfaceGrid,init);
  hyp.setGridDimensions(axis1,20);
  hyp.setGridDimensions(axis2,30);
//  hyp.setIsSurfaceGrid(false);
  hyp.generate();

  int plotOption=1;
  PlotStuff ps(plotOption,"extrude2DMapping");         // for plotting
  PlotStuffParameters psp;

  PlotIt::plot(ps,hyp,psp);
}

Sunil S Nandihalli wrote:
Hello every body,
I would like some help with getting a simple hyperbolic mesher working... Any help would be appreciated.
The following is the output from the run inside a debugger
*********************************************
Starting program: /home/sunil/work/download/overture/Overture.v22.debug.withBillChanges/primer/hyperbolic.step1
[Thread debugging using libthread_db enabled]
A++ Internal_Index bounds checking: ON
Mapping::mapGrid:ERROR: array r is not of the expected shape
terminate called after throwing an instance of 'char*'
[New Thread 0xb39036c0 (LWP 17179)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb39036c0 (LWP 17179)]
0xb7f32410 in __kernel_vsyscall ()
************************************
The backtrace is
#6  0xb3c69e6a in __cxa_throw () from /usr//lib/libstdc++.so.6
#7 0xb6837648 in Mapping::mapGrid (this=0xbf80c364, r=@0xbf801078, x=@0xbf80a7c4, xr=@0x87ba5c0, params=@0x87cd050) at Mapping.C:3002 #8 0xb6af4be4 in HyperbolicMapping::evaluateStartCurve (this=0xbf80a1ec, xStart=@0xbf80a7c4) at hype/generate.C:739 #9 0xb6af5dcf in HyperbolicMapping::initializeMarchingArrays (this=0xbf80a1ec, i3Start=0, numberOfAdditionalSteps=0, x=@0xbf80b468, xt=@0xbf80b5e8, xr=@0xbf8093e4, normal=@0xbf8 09264, xrr=@0xbf8090e4, s=@0xbf808de4, ss=@0xbf808c64, xrrDotN=@0xbf808f64, kappa=@0xbf808ae4) at hype/generate.C:873 #10 0xb6af817b in HyperbolicMapping::generate (this=0xbf80a1ec, numberOfAdditionalSteps=@0xbf80c30c) at hype/generate.C:100 #11 0x0806de83 in extrude2DMapping (m=@0xbf80c364, NLayers=10) at hyperbolic.step1.C:15
#12 0x0806df92 in main (argc=Cannot access memory at address 0x431b
) at hyperbolic.step1.C:22

Thanks in advance..
Sunil.


------------------------------------------------------------------------

#include <iostream>
#include "Overture.h"
#include "HyperbolicMapping.h"
#include "PlaneMapping.h"
#include "MappedGrid.h"
#include "PlotStuff.h"

int extrude2DMapping(Mapping& m,const int NLayers)
{
  HyperbolicMapping hyp;
  hyp.setSurface(m);
  hyp.setGridDimensions(axis1,20);
  hyp.setGridDimensions(axis2,30);
  hyp.setIsSurfaceGrid(false);
  hyp.generate();
}

int main(int argc,char** argv)
{
  Overture::start(argc,argv);
  PlaneMapping p;
  extrude2DMapping(p,10);
  Overture::finish();
}

Other related posts: