51
spr Reference Manual 0.3 Generated by Spr Team Aug 18, 2006 Preliminary version)

spr Reference Manual - Unicamp

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: spr Reference Manual - Unicamp

spr Reference Manual0.3

Generated by Spr Team

Aug 18, 2006

Preliminary version)

Page 2: spr Reference Manual - Unicamp
Page 3: spr Reference Manual - Unicamp

Contents

1 Introduction 1

1.1 SPR Team (alphabetic order) . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Code Language and requirements . . . . . . . . . . . . . . . . . . . 2

1.3 Financial support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Getting start 3

2.1 Main Configuration file: wspr.cfg . . . . . . . . . . . . . . . . . . . . 4

2.2 Local derivative config file . . . . . . . . . . . . . . . . . . . . . . . 6

2.3 Maxwell TE mode variable config files . . . . . . . . . . . . . . . . . 6

2.4 Maxwell TE mode variable visualization configure files . . . . . . . . 8

3 spr Hierarchy 13

3.1 spr Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.2 spr Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 spr Class Documentation 15

4.1 WMaskGrid Class Reference . . . . . . . . . . . . . . . . . . . . . . 15

4.2 WMaxwell Class Reference . . . . . . . . . . . . . . . . . . . . . . 18

4.3 WPlot Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 20

4.4 WSpr Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 23

Page 4: spr Reference Manual - Unicamp
Page 5: spr Reference Manual - Unicamp

Chapter 1

Introduction

This program uses the Sparse Point Representation (SPR) methodology for adaptivefinite differences simulations in computational eletromagnetics in 2D.

The principle of the SPR method is to represent the solution only through those pointvalues indicated by the significant wavelet coefficients, which are used as local regular-ity indicators, which are defined as interpolation errors. Typically, few points are foundin each time step, the grid being coarse in smooth regions, and refined close to irregu-larities. The method has two basic parts. In the representation part, there are wavelettools containing reconstruction operators defined by means of interpolating subdivisionschemes.

In the operational part, spatial derivatives are discretized by traditional uniform finitedifferences, using step sizes that can be made proportional to each point local scale.

It may occur that some required neighboring stencils are not present in the grid. Insuch case, the corresponding point values are approximated from coarser scales usingthe wavelet tools of the representation part. Runge-Kutta 4 and Runge-Kutta FelhbergODE solvers are used for time discretization.

For details of such procedures we refer to [1, 2, 3, 4, 5, 6].

1.1 SPR Team (alphabetic order)

• Margarete Domingues (LAC/INPE)

• Paulo Jorge Ferreira (IEETA/UA)

• Sônia Gomes (IMECC/UNICAMP)

• Anamaria Gomide (IC/UNICAMP)

• José Rocha Pereira (DETI/UA)

• Pedro Tavares Pinho(ISEL)

Page 6: spr Reference Manual - Unicamp

2 Introduction

1.2 Code Language and requirements

This source code is developed in OOP/C++ language with blitz++ library. It wasdeveloped in kdevelop 3 enviroment, in a GNU/LINUX OS with gnu g + + compiler,but it must be multiplataform. All documentation are done using doxygen 1.4.6. Allrevisions are performed using CVS. The visualization of the program uses gnuplotversion 4 or later.

1.3 Financial support

This work is supported by CAPES/GRICES grants to the international coopera-tion project " Estudo de métodos numéricos para a resoluções das Equações deMaxwell" and the pos-doc project "Discretização das Equações de Maxwell no Con-texto Wavelet".

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 7: spr Reference Manual - Unicamp

Chapter 2

Getting start

The spr program start with a command line that choose the test or example to be runand a configuration file. To call the program :

#./spr code wspr.cfg

where code is defined as:

260 TestTransformsTime

200 TestViewMesh

100 compute Spr with different boundaries(rigid, symmetric,antisymmetric);

200 view mesh after spr ;

260 compute the CPU time of the spr;

270 compute and CPU time of the spr using local points transforms;

280 test the local derivative and show the resulting derivatives;

290 test time evolution using RK4 of a advection equation;

291 test Maxwell Equation TE mode time evolution using RK4(directly in WSprclass);

300 draw phi;

400 test mesh extension;

1000 run Maxwell Equation TE mode SPR time evolution using RKF45, with PEC;

1100 run Maxwell Equation TE mode time evolution using RK4, with PEC+UPML;

1200 run Maxwell Equation TE mode SPR time evolution using RK4, withPEC+UPML;

5000 test mask grid store and usage.

Page 8: spr Reference Manual - Unicamp

4 Getting start

All configuration files uses the extension "cfg". They are used to define the main pa-rameters of the spr, the options of visualizations and how to define the initial conditionsand derivatives. The main configuration file is wspr.cfg, but depending of the optionyou choose others configurations files will be also necessary. Here on we will presentthe basic configuration files we use.

2.1 Main Configuration file: wspr.cfg

This configuration file is used to set up the WSpr class, and usually is need in callingthe program. The parameters of this configure file are:

numberOfElementsX 33 -> [0,32] x [0,32]numberOfElementsY 33threshold 0.001minLevel 3interpOrder 4boundaryCodeSpr 1 ->rigid boundary

2 -> symmetric boudary3 -> antisymmetric boudary

it is used as a compose code from boundariesleft down right up like 1111

initial condition fileintial conditial name (just one word)

Example:

2572570.0001

44

1111

gauss.cfgGauss

For input datasets and config files in WSpr there are these basic test functions avaiable:

• gaussian - gauss.cfg

• front Oblique - frontOblique.cfg

24

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 9: spr Reference Manual - Unicamp

2.1 Main Configuration file: wspr.cfg 5

1.01.025.05.0

#frontOblique.cfg

function option 2 for frontnumber of parameters 4posX default 1.0posY default 1.0scaleX default 25scaleY default 5

Equation:

A(i, j) = posX − tanh(scaleX(idx) + scaleY (jdy − posY ));

• gaussian with a sin(x) sin(y) - gaussSin.cfg

361.0-2500.00.30.30.20.2

#gaussSin.cfg must have

function option 3 for Gaussian + Sinnumber of parameters 6

scale expalphaX

centerXcenterY

scaleSinXscaleSinY

Equation:

A(i, j) = scale exp(alphaX((idX − CenterX)2 + (jdY − CentralY )2))+scaleSinX sin(2πidx) + scaleSinY sin(2πjdy);

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 10: spr Reference Manual - Unicamp

6 Getting start

In these files there are enought information to deal with the possible configutationparameters. Also, it is possible to create your on input data. In this case, you can createyour data.cfg and put the number od points you have in your data file and the name ofyour data file.

Example:

1025 1025 datafile.dat

It is expected that your data file is in double precision and written in blitz format, ie

1000× 1000 = [111 · · · 1];

If your data set is a matrix use Matrix2Blitz to format your data set to blitz in doubleprecision.

Example:

03HzCD.dat10001000

#data.cfg must have

data file option 0number of parameters 3

sizeXsizeY

2.2 Local derivative config file

The local derivative config file has just a bool flag to turn on or off the local derivative.So this file has just the number "1" if the local derivative is desired or "0" if it is not.The program looks for a file named localDerivative.cfg.

2.3 Maxwell TE mode variable config files

The Maxwell TE mode equations are

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 11: spr Reference Manual - Unicamp

2.3 Maxwell TE mode variable config files 7

∂Ex

∂t=

(∂Hz

∂y− σEx

)∂Ey

∂t= −1

ε

(∂Hz

∂x+ σEy

)∂Hz

∂t=

(∂Ex

∂y− ∂Ey

∂x

)− ρ′Hz

The wsprEx.cfg has the following data:

2572570.01

44

2233

zero.cfgZero

where zero.cfg has the following information

10

The wsprEy.cfg has the following data:

2572570.01

44

3322

zero.cfgZero

The wsprHz.cfg has the following data:

2572570.0001

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 12: spr Reference Manual - Unicamp

8 Getting start

44

2222

gauss.cfgGauss

2.4 Maxwell TE mode variable visualization configurefiles

The visualization of the eletrical and magnetical fields differs in many aspects, so theyhave differents cfg files. All the visualizations are done in gnuplot. There are also aconfig file for the grid and for the plot. All the visualizations are very expensives interms of computational time, so some times is better to put them off to have.

2.4.1 Plot visualization

The plot visualization uses splots with a blue-yellow-red pallete. The parameter in-structions in the cfg files are:

_isSetPlot : if _isSetPlot ==0 no plot will be performe.

Obs: Usually the next three label will beset automaticaly in the programs

_title : only one word_xLabel : only one word_yLabel : only one word

_xRangeMin_xRangeMax_yRangeMin_yRangeMax

_zRangeMin_zRangeMax

_fixZRange : 0 if we do not like to fix z range on the splot

_gnuplotOption :0-> null/dev, 10->persist

_terminalOption :0-> x11, 10->eps, 11->eps color,

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 13: spr Reference Manual - Unicamp

2.4 Maxwell TE mode variable visualization configure files 9

101->png is also in color !! , 111->png color

_screenNumber :numer for the screen in the X11 terminal, usually 10 is okay.

_grfFileNameOutput

_paletteOption :10->yellow red, 15->red yellow,20->blue-red, 100->points colors for grid

_splotOption : 10-> field, 20->lines, 100->grid

_designOption : 10-> field, 100->grid

The Ex configure file is the wExPlotGnuplot.cfg and it has the following data:

1plot

xy

0.01.00.01.0-200.0200.0

0

1010110

viewField

201010

The Ey configure file is the wEyPlotGnuplot.cfg and it has now the same parameters.

The Hz configure file is the wHzPlotGnuplot.cfg and it has the following parameters:

1plot

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 14: spr Reference Manual - Unicamp

10 Getting start

xy

0.01.00.01.0-1.01.0

1

1010110

viewField

201010

2.4.2 Grid visualization

The grid visualization puts a collor pallete to help the visualization of the level that thepoint belongs to. For grids greater that 257 this does not help much. The parameterinstructions in the cfg files are:

_isSetPlot

_title_xLabel_yLabel

_xRangeMin_xRangeMax_yRangeMin_yRangeMax

_zRangeMin_zRangeMax

_fixZRange

_gnuplotOption_terminalOption

_screenNumber

_grfFileNameOutput

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 15: spr Reference Manual - Unicamp

2.4 Maxwell TE mode variable visualization configure files 11

_paletteOption_splotOption_designOption

Tips:

if _isSetPlot ==0 no plot will be performe.

The Ex configure file is the wExGridGnuplot.cfg and it has the following data:

1

plotrowcolumn

0.01.00.01.0-1.08.0

0

10101100

viewField

100100100

The Ey configure file is the wEyGridGnuplot.cfg and it has now the same parameters.

The Hz configure file is the wHzGridGnuplot.cfg and it has the following parameters:

1

plotrowcolumn

0.01.00.0

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 16: spr Reference Manual - Unicamp

12 Getting start

1.0-1.08.0

0

10101100

viewField

100100100

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 17: spr Reference Manual - Unicamp

Chapter 3

spr Hierarchy

3.1 spr Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

WMaskGrid15WMaxwell18WPlot20WSpr23

3.2 spr Class List

Here are the classes, structs, unions and interfaces with brief descriptions:

WMaskGrid 15WMaxwell 18WPlot 20WSpr 23

Page 18: spr Reference Manual - Unicamp

14 spr Hierarchy

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 19: spr Reference Manual - Unicamp

Chapter 4

spr Class Documentation

4.1 WMaskGrid Class Reference

#include <wmaskgrid.h>

Public Member Functions

• WMaskGrid (int numberOfElements, int numberOfElementsBorder, double Fac-tor, Array2D &A)

• void setup (int numberOfElements, int numberOfElementsBorder, double Fac-tor, Array2D &A)

• double getValue (int row, int col)• void putValue (int row, int col, double value)• void cpValueInBorder (Array2D &u, double value=1.0)• double firstDerivativeAntiSymmetric (double dxy, int row, int col, int flag)• double firstDerivativeSymmetric (double dxy, int row, int col, int flag)• void testStorage (void)• Array2D buildGrid (void)• double getScalingFactor (void) const• void setScalingFactor (double Factor)

Protected Attributes

• int _numberOfElements• int _numberOfElementsBorder• double _factorOfScaling• Array2D _gridInf• Array2D _gridSup• Array2D _gridLeft• Array2D _gridRight• Array2D _gridInner

Page 20: spr Reference Manual - Unicamp

16 spr Class Documentation

4.1.1 Detailed Description

4.1.2 Constructor & Destructor Documentation

4.1.2.1 WMaskGrid::WMaskGrid (int numberOfElements, intnumberOfElementsBorder, double Factor, Array2D & A)

Function WMaskGrid It creates a shared inner area between to grids last update:18/Aug/2006

4.1.3 Member Function Documentation

4.1.3.1 Array2D WMaskGrid::buildGrid (void)

Function buildGrid It recovers the maskgrid matrix to a usual matrix storage last up-date: 18/Aug/2006

4.1.3.2 void WMaskGrid::cpValueInBorder (Array2D & u, double value =1.0)

Function cpValueInBorder It cp the border values of one grid in the maskgrid matrixborder last update: 18/Aug/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 21: spr Reference Manual - Unicamp

4.1 WMaskGrid Class Reference 17

4.1.3.3 double WMaskGrid::firstDerivativeAntiSymmetric (double dxy, int row,int col, int flag)

Function firstDerivativeAntiSymmetric It computes first derivative with an antisym-metric boundary Not tested, and not used for now. last update: 18/Aug/2006

4.1.3.4 double WMaskGrid::firstDerivativeSymmetric (double dxy, int row, intcol, int flag)

Function firstDerivativeSymmetric It computes first derivative with a symmetricboundary Not tested, and not used for now. last update: 18/Aug/2006

4.1.3.5 double WMaskGrid::getValue (int row, int col)

Function getValue It picks a value in the maskgrid matrix last update: 18/Aug/2006

4.1.3.6 void WMaskGrid::putValue (int row, int col, double value)

Function putValue It puts a value in the maskgrid matrix last update: 18/Aug/2006

4.1.3.7 void WMaskGrid::setup (int numberOfElements, intnumberOfElementsBorder, double Factor, Array2D & A)

Function set up It creates (set up) a shared inner area between to grids last update:18/Aug/2006

4.1.3.8 void WMaskGrid::testStorage (void)

Function testStorage It tests the maskgrid matrix storage last update: 18/Aug/2006

The documentation for this class was generated from the following files:

• /home/margarete/UA/spr/src/wmaskgrid.h• /home/margarete/UA/spr/src/wmaskgrid.cpp

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 22: spr Reference Manual - Unicamp

18 spr Class Documentation

4.2 WMaxwell Class Reference

#include <wmaxwell.h>

Public Member Functions

• WMaxwell ()• void timeEvolutionTEMode (void)• void timeEvolutionTEModeUPML (void)• void timeEvolutionTEModeUPMLSpr (void)

Protected Member Functions

• void checkMeshParameters (WSpr &U, WSpr &V, WSpr &W)• Array2D curl (WSpr &U, WSpr &V, int boundaryCondition)• Array2D firstDerivative (WSpr &U, int dimension, int boundaryCondition)

4.2.1 Detailed Description

This class deal with Maxwell equation time evolution. It uses WSpr class, WPlot class.

4.2.2 Constructor & Destructor Documentation

4.2.2.1 WMaxwell::WMaxwell ()

Class WMaxwell It deals with the numerical solution of Maxwell Equations usingFinite Difference and a SPR of Hz,Ex and Ey. date: 1/Aug/2006

4.2.3 Member Function Documentation

4.2.3.1 void WMaxwell::checkMeshParameters (WSpr & U, WSpr & V, WSpr& W) [protected]

Function checkMeshParameters It checks the parameters for time evolution of MaxwellEquation in TE mode in a lossless medium formulation using a spr representation ofHz,Ex and Ey. date: 1/Aug/2006

4.2.3.2 Array2D WMaxwell::curl (WSpr & U, WSpr & V, intboundaryCondition) [protected]

Function curl It computs the 2D curl of 2 WSpr variables last update: 18/Aug/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 23: spr Reference Manual - Unicamp

4.2 WMaxwell Class Reference 19

4.2.3.3 Array2D WMaxwell::firstDerivative (WSpr & U, int dimension, intboundaryCondition) [protected]

Function firstDerivative It computs the first derivative of a WSpr variable last update:18/Aug/2006

4.2.3.4 void WMaxwell::timeEvolutionTEMode (void)

Function timeEvolutionTEMode It computes the time evolution of Maxwell Equationin TE mode in a lossless medium formulation using a spr representation of Hz,Ex andEy. date: 1/Aug/2006

4.2.3.5 void WMaxwell::timeEvolutionTEModeUPML (void)

Function timeEvolutionTEModeUPML It computes the time evolution of MaxwellEquation in TE mode with a UPML ABC we are not using a spr representation ofHz,Ex and Ey. date: 9/Aug/2006

4.2.3.6 void WMaxwell::timeEvolutionTEModeUPMLSpr (void)

Function timeEvolutionTEModeUPMLSpr It computes the time evolution of MaxwellEquation in TE mode with a UPML ABC we are using a spr representation of Hz,Exand Ey. date: 11/Aug/2006

The documentation for this class was generated from the following files:

• /home/margarete/UA/spr/src/wmaxwell.h• /home/margarete/UA/spr/src/wmaxwell.cpp

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 24: spr Reference Manual - Unicamp

20 spr Class Documentation

4.3 WPlot Class Reference

#include <wplot.h>

Public Member Functions

• WPlot ()• void setWPlotGnuplot (char ∗fileNameCfg)• void splotFieldGnuplot (Array2D &A, char ∗title)• void splotFieldGnuplot (Array2D &A, char ∗title, char ∗grfFileNameOutput)• void splotFieldGnuplot (Array2D &A, char ∗title, char ∗grfFileName, char ∗x-

Label, char ∗yLabel, double xMin, double xMax, double yMin, double yMax,double zMin, double zMax)

• void setRange (double xMin, double xMax, double yMin, double yMax, doublezMin, double zMax)

Protected Member Functions

• void setPaletteGnuplot (int paletteOption)• void setTerminalGnuplot (int gnuplotOption, int terminalOption)• void setSplotGnuplot (int splotOption, int splotDesignOption)

Protected Attributes

• bool _isSetPlot• bool _fixZRange• char _title [500]• char _xLabel [250]• char _yLabel [250]• char _textgnuplotOptions [100]• char _textPalette [500]• char _textTerminalOptions [500]• char _textSplotOptions [250]• char _textSplotDesign [250]• char _grfFileNameOutput [250]• char _grfFileExtName [5]• int _gnuplotOption• int _terminalOption• int _screenNumber• int _paletteOption• int _splotOption• int _splotDesignOption• double _xMin• double _xMax• double _yMin

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 25: spr Reference Manual - Unicamp

4.3 WPlot Class Reference 21

• double _yMax• double _zMin• double _zMax

4.3.1 Detailed Description

Plots splots on Gnuplot for fields and meshes.

4.3.2 Constructor & Destructor Documentation

4.3.2.1 WPlot::WPlot ()

Class WPlot Configure the plots parameters and ative the setup parameters date:1/Aug/2006

4.3.3 Member Function Documentation

4.3.3.1 void WPlot::setPaletteGnuplot (int paletteOption) [protected]

Function setPaletteGnuplot This function sets the palette for GnuPlot outputs palette-Option = 10->yellow red, 15->red yellow, 20->blue-red, 100->points colors for griddate: 1/Aug/2006

4.3.3.2 void WPlot::setRange (double xMin, double xMax, double yMin, doubleyMax, double zMin, double zMax)

Function setRange This function sets the range for the grid visualization in gnuplot asmall border is add to the grid for a better visualization date: 1/Aug/2006

4.3.3.3 void WPlot::setSplotGnuplot (int splotOption, int splotDesignOption)[protected]

Function setSplotGnuplot This function sets the splot parameters splotOptions = 10-> field, 20->lines, 100->grid splotDesignOptions = 10-> field, 100->grid date:1/Aug/2006

4.3.3.4 void WPlot::setTerminalGnuplot (int gnuplotOption, int terminalOption)[protected]

Function setTerminalGnuplot This function sets the terminal for GnuPlot outputsterminalOptions = 0-> x11, 10->eps, 11->eps color, 101->png is also in color !! ,111->png color gnuplotOptions = 0-> null/dev, 10->persist date: 1/Aug/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 26: spr Reference Manual - Unicamp

22 spr Class Documentation

4.3.3.5 void WPlot::setWPlotGnuplot (char ∗ fileNameCfg)

Function setWPlotGnuplot Configure the plots parameters and ative the setup parame-ters date: 1/Aug/2006

4.3.3.6 void WPlot::splotFieldGnuplot (Array2D & A, char ∗ title)

Function splotFieldGnuplot This function plot the grid points of the solution is Sprrepresentation in real time directly in gnuplot produce two screen shots + eps file date:1/Aug/2006

The documentation for this class was generated from the following files:

• /home/margarete/UA/spr/src/wplot.h• /home/margarete/UA/spr/src/wplot.cpp

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 27: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 23

4.4 WSpr Class Reference

#include <wspr.h>

DWT

f j+1DWT−→ (f j0 , d(1,2,3)j0 , . . . d(1,2,3),j)

for ` = j, j−1, . . . , j0for k = 0, . . . N `

x

for m = 0, . . . N `y

f `k,m = f `+1

2k,2m

d(1) `k,m = f `+1

2k,2m+1 − f̃ `+12k,2m+1

d(2) `k,m = f `+1

2k+1,2m − f̃ `+12k+1,2m

d(3) `k,m = f `+1

2k+1,2m+1 − f̃ `+12k+1,2m+1

IDWT

(f j0 , d(1,2,3) j0 , . . . , d(1,2,3) j)IDWT−→ f j+1

for ` = j0, . . . , jfor k = 0, . . . , N `

x

for m = 0, . . . N `y

f `+12k,2m = f `

k

f `+12k,2m+1 = d

(1) `k,m + f̃ `+1

2k,2m+1

f `+12k+1,2m = d

(2) `k,m + f̃ `+1

2k+1,2m

f `+12k+1,2m+1 = d

(3) `k,m + f̃ `+1

2k+1,2m+1

Public Member Functions

• WSpr (char ∗configFileName)• WSpr (int numberOfElementsX, int numberOfElementsY, double thresh-

old=0.001, int minLevel=3, int interpOrder=4, int boundaryCodeSpr=1111, char∗initialConditionFileName="InitialCondition.cfg")

• void testLocalDerivate (void)• void testSprWithBoundaries (void)• void testViewMeshTransforms (void)• void testTransformTimeLocalPoints (void)• void testTransformsTime (void)• void testExtendMesh (void)• void testTimeEvolution (void)• void testMaxwellTimeEvolution (void)• void drawPhi (void)

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 28: spr Reference Manual - Unicamp

24 spr Class Documentation

• Array2D computeRK4 (double dt, Array2D &u, Array2D(WSpr::∗rhs-Eval)(Array2D &fu, double dX, double dY))

• void compute_RK4 (double dt, Array2D &u, Array2D &v, Ar-ray2D &w, Array2D(WSpr::∗rhsEval1)(Array2D &w, double ep-silon0), Array2D(WSpr::∗rhsEval2)(Array2D &w, double epsilon0),Array2D(WSpr::∗rhsEval3)(Array2D &u, double epsilon0, Array2D &v,double mu0), double epsilon0, double mu0)

• double computeRKFCashKarp45 (double timeStep, int numberOfSteps, Ar-ray2D &u, Array2D(WSpr::∗rhsEval)(Array2D &f, double dX, double dY))

• double computeRKFCashKarp45 (double timeStep, int numberOfSteps, Ar-ray2D &u, Array2D &v, Array2D &w, Array2D(WSpr::∗rhsEval1)(Array2D&w, double par1), Array2D(WSpr::∗rhsEval2)(Array2D &w, double par2),Array2D(WSpr::∗rhsEval3)(Array2D &u, double par1, Array2D &v, doublepar3), double par1, double par2)

• double computeRKCashKarp45 (double dt, Array2D &u, Array2D(WSpr::∗rhs-Eval)(Array2D &f, double dX, double dY))

• double computeRKCashKarp45 (double dt, Array2D &u, Array2D &v,Array2D &w, Array2D(WSpr::∗rhsEval1)(Array2D &w, double par1),Array2D(WSpr::∗rhsEval2)(Array2D &w, double par2), Array2D(WSpr::∗rhs-Eval3)(Array2D &u, double par1, Array2D &v, double par3), double par1,double par2)

• Array2D advRHS (Array2D &u, double dx, double dy)• Array2D exRHS (Array2D &u, double epsilon0)

last update: 23/jun/2006

• Array2D eyRHS (Array2D &u, double epsilon0)• Array2D hzRHS (Array2D &u, double epsilon0, Array2D &v, double mu0)• void dataToSparse (void)• void sparseToData (void)• void dataToSparseInnerGrid (int numberOfBorderPoints)• void extendMesh (int numberOfNeighbors=1, int numberOfGenerations=1)• void applyConeCondition (void)

Use: findLevel, findStride.

• void verifySpr (void)• void verifySprInnerGrid (int numberOfBordersPoints)• void plotDataGnuplot (char ∗title)• void plotDataGnuplot (char ∗title, char ∗grfFileNameOutput)• void plotDataGnuplot (char ∗title, char ∗grfFileName, char ∗grfFileNameCfg)• void plotGridGnuplot (char ∗title)• void plotGridGnuplot (char ∗title, char ∗grfFileNameOutput)• void plotGridGnuplot (char ∗title, char ∗grfFileName, char ∗grfFileNameCfg)• void computeSameMesh (WSpr &U, WSpr &V)• void initArray (void)• void infoNAN (void)• Array2D computeFirstDerivativeInSpr (int direction, int kind)• Array2D computeFirstDerivativeInSpr (Array2D &u, int direction, int kind)

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 29: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 25

• int getNumberOfElements (int dimension)• double getThreshold (void)• void forceSprFlag (bool flag)

Public Attributes

• Array2D _mat• Array2D _matDer

Protected Member Functions

• void setWSpr (void)• void setWaveletFilter (void)• void setBoundarySpr (void)• void setDerivativeCoefficients (void)• int logTwo (int n)

Auxiliary tools from class WSpr.

• int powerTwo (int n)• int getNumberOfLevels (int n)• void recoverGrid (Array2D &tmp)• void interpGrid (Array2D &tmp)• double interpPoint (Array2D &u, int m, int n, bool isToUseOrigMesh-

Points=true)——————————————————–Interpolation of point values

• void interpInnerCol (Array2D &u)• void interpInnerRow (Array2D &u)• void interpLowerColRigid (Array2D &u)• void interpUpperColRigid (Array2D &u)• void interpLowerRowRigid (Array2D &u)• void interpUpperRowRigid (Array2D &u)• void interpLowerColSymmetric (Array2D &u)• void interpUpperColSymmetric (Array2D &u)• void interpLowerRowSymmetric (Array2D &u)• void interpUpperRowSymmetric (Array2D &u)• void interpLowerColAntisymmetric (Array2D &u)• void interpUpperColAntisymmetric (Array2D &u)• void interpLowerRowAntisymmetric (Array2D &u)• void interpUpperRowAntisymmetric (Array2D &u)• void recoverInnerCol (Array2D &u)• void recoverInnerRow (Array2D &u)• void recoverLowerColRigid (Array2D &u)• void recoverUpperColRigid (Array2D &u)• void recoverLowerRowRigid (Array2D &u)• void recoverUpperRowRigid (Array2D &u)

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 30: spr Reference Manual - Unicamp

26 spr Class Documentation

• void recoverLowerColSymmetric (Array2D &u)• void recoverUpperColSymmetric (Array2D &u)• void recoverLowerRowSymmetric (Array2D &u)• void recoverUpperRowSymmetric (Array2D &u)• void recoverLowerColAntisymmetric (Array2D &u)• void recoverUpperColAntisymmetric (Array2D &u)• void recoverLowerRowAntisymmetric (Array2D &u)• void recoverUpperRowAntisymmetric (Array2D &u)• double interpInnerColPoint (Array2D &u, int m, int n)• double interpInnerRowPoint (Array2D &u, int m, int n)• double interpLowerColPointRigid (Array2D &u, int m, int n)• double interpUpperRowPointRigid (Array2D &u, int m, int n)• double interpUpperColPointRigid (Array2D &u, int m, int n)• double interpLowerRowPointRigid (Array2D &u, int m, int n)• double interpLowerColPointSymmetric (Array2D &u, int m, int n)• double interpUpperRowPointSymmetric (Array2D &u, int m, int n)• double interpUpperColPointSymmetric (Array2D &u, int m, int n)• double interpLowerRowPointSymmetric (Array2D &u, int m, int n)• double interpLowerColPointAntisymmetric (Array2D &u, int m, int n)• double interpUpperRowPointAntisymmetric (Array2D &u, int m, int n)• double interpUpperColPointAntisymmetric (Array2D &u, int m, int n)• double interpLowerRowPointAntisymmetric (Array2D &u, int m, int n)• void writeMessage (const char ∗message, const char ∗fileName, int ExiT=1, int

App=0)• double computeFirstDerivativeInfBoundary (Array2D &u, int m, int n, int stride,

int direction, int kind)

last update: 20/jun/2006

• double computeFirstDerivativeSupBoundary (Array2D &u, int m, int n, intstride, int direction, int kind)

last update: 20/jun/2006

• double computeFirstDerivativeLocalScaleX (Array2D &u, int m, int n, int kind)• double computeFirstDerivativeLocalScaleY (Array2D &u, int m, int n, int kind)• double computeFirstDerivativeInLocalScale (Array2D &u, int m, int n, int

direction)• int computeDistanceOfNearestNeighbor (Array2D &u, int m, int n, int direction)• void dataToSparse (Array2D &u)• void sparseToData (Array2D &u)• void extendMesh (Array2D &u, int numberOfNeighbors=1, int numberOf-

Generations=1)• void applyConeCondition (Array2D &u)• void verifySpr (Array2D &u)• void verifySprInnerGrid (Array2D &u, int numberOfBordersPoints)• void computeSameMesh (Array2D &u, Array2D &v, Array2D &w)• void plotDataGnuplot (Array2D &u, char ∗title)

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 31: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 27

Visualization tools from class WSpr.

• void plotDataGnuplot (Array2D &u, char ∗title, char ∗grfFileNameOutput)• void plotDataGnuplot (Array2D &u, char ∗title, char ∗grfFileName, char ∗grf-

FileNameCfg)• void plotGridGnuplot (Array2D &u, char ∗title)• void plotGridGnuplot (Array2D &u, char ∗title, char ∗grfFileNameOutput)• void plotGridGnuplot (Array2D &u, char ∗title, char ∗grfFileName, char ∗grf-

FileNameCfg)• int findLevel (int m, int n, int meshLevel)• int findLevel (int m, int n, int meshLevel, int ∗mPosition, int ∗nPosition)• int findLocalSpacing (int m, int n)• int findStride (int m, int n)• int findPointPosition (Array2D &u, int m, int n)• int findPositionInMesh (int m, int n, int level, int ∗mPosition, int ∗nPosition)• int findMaxDecompositionLevel (Array2D &u)• void initArray (Array2D &u, char ∗confFileName)• void dataAsciiToBlitz (char ∗fileNameIn, char ∗fileNameOut, int sizeX, int size-

Y)• void infoNAN (Array2D &u)• long countNAN (Array2D &u)

Protected Attributes

• bool _isInSpr• bool _isLocalDerivative• char _initialConditionFileName [301]• char _functionName [301]• int _minLevel• int _maxLevel• int _interpOrder• int _boundaryCodeSpr• int _numberOfElementsX• int _numberOfElementsY• int _meshLevel• double _threshold• Array1D _waveletFilter• Array1D _interpFilterRigidBoundary• Array1D _interpFilterSymmetricBoundary• Array1D _interpFilterAntiSymmetricBoundary• Array1D _coefFirstDerivative

4.4.1 Detailed Description

This class computes the sparse point representation. to be applied in EDPs solvers withfinite difference and RK methods.

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 32: spr Reference Manual - Unicamp

28 spr Class Documentation

4.4.2 Member Function Documentation

4.4.2.1 Array2D WSpr::advRHS (Array2D & u, double dx, double dy)

Function advRHS Compute the rhs of the advection equation ut= -ux-uy last update:23/jun/2006

-(Ux+Uy) central diff 4th order

4.4.2.2 void WSpr::applyConeCondition (void)

Use: findLevel, findStride.

Function applyConeCondition Compute and apply the cone condition for each signi-ficative point in the grid last update: 25/jul/2006

4.4.2.3 int WSpr::computeDistanceOfNearestNeighbor (Array2D & u, int m,int n, int direction) [protected]

Function computeDistanceOfNearestNeighbor Compute distance of the nearest neigh-bor if _isLocalDerivative is true last update: 21/jul/2006

4.4.2.4 double WSpr::computeFirstDerivativeInfBoundary (Array2D & u, intm, int n, int stride, int direction, int kind) [protected]

last update: 20/jun/2006

Function computeFirstDerivativeInfBoundary Compute the local scale derivative forinferior boundaries It uses a 4th order direction is 1 for x derivative direction is 2 for yderivative kind is 1 for symmetric boundary kind is 2 for antisymmetric boundary

4.4.2.5 Array2D WSpr::computeFirstDerivativeInSpr (int direction, int kind)

Function computeFirstDerivativeInSpr Compute the derivative only when u is !nan Ituses a 4th order direction is 1 for x derivative direction is 2 for y derivative kind is 1 forsymmetric boundary kind is 2 for antisymmetric boundary last update: 20/jun/2006

4.4.2.6 double WSpr::computeFirstDerivativeLocalScaleX (Array2D & u, intm, int n, int kind) [protected]

Function computeFirstDerivativeLocalScaleX Compute the local scale derivative if _-isLocalDerivative is true last update: 21/jul/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 33: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 29

4.4.2.7 double WSpr::computeFirstDerivativeLocalScaleY (Array2D & u, intm, int n, int kind) [protected]

Function computeFirstDerivativeLocalScaleY Compute the local scale derivative if _-isLocalDerivative is true last update: 20/jun/2006

4.4.2.8 double WSpr::computeFirstDerivativeSupBoundary (Array2D & u, intm, int n, int stride, int direction, int kind) [protected]

last update: 20/jun/2006

Function computeFirstDerivativeSupBoundary Compute the local scale derivative forsuperior boundaries It uses a 4th order direction is 1 for x derivative direction is 2 fory derivative kind is 1 for symmetric boundary kind is 2 for antisymmetric boundary

4.4.2.9 double WSpr::computeRKCashKarp45 (double dt, Array2D & u,Array2D & v, Array2D & w, Array2D(WSpr::∗)(Array2D &w, doublepar1) rhsEval1, Array2D(WSpr::∗)(Array2D &w, double par2)rhsEval2, Array2D(WSpr::∗)(Array2D &u, double par1, Array2D &v,double par3) rhsEval3, double par1, double par2)

Function compute RK Felhberg method order 4(5) Compute Runge Kutta 4(5) methodusing Cash and Karp coefficients It updates the solution u and returns the error betweenthe two RK last update: 6/aug/2006 For a 3 equation system

4.4.2.10 double WSpr::computeRKCashKarp45 (double dt, Array2D & u,Array2D(WSpr::∗)(Array2D &f, double dX, double dY) rhsEval)

Function compute RK Felhberg method order 4(5) Compute Runge Kutta 4(5) methodusing Cash and Karp coefficients It updates the solution u and returns the error betweenthe two RK last update: 3/aug/2006

4.4.2.11 void WSpr::computeSameMesh (WSpr & U, WSpr & V)

Function computeSameMesh Merge the not nan points if one of the three arrays has inthis position a not nan point last update: 23/jun/2006

4.4.2.12 long WSpr::countNAN (Array2D & u) [protected]

Function countNAN Compute the number of NAN in a transformed matrix last update:12/may/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 34: spr Reference Manual - Unicamp

30 spr Class Documentation

4.4.2.13 void WSpr::dataAsciiToBlitz (char ∗ fileNameIn, char ∗ fileNameOut,int sizeX, int sizeY) [protected]

Function dataAsciiToBlitz This function converts ascii matrix data file in a BLITZformat data file last update: 12/may/2006

4.4.2.14 void WSpr::dataToSparse (Array2D & u) [protected]

Copy A(2k,2m) and

Build all odd points

All points associated to the interpolatory wavelet coefficients that are not significant(less than the treshold) are set NAN

All odd points are recursively checked

4.4.2.15 void WSpr::dataToSparse (void)

Function dataToSparse 2D Compute 2d interpolatory multilevel SPR decompositionand set the non significant coefficients to NAN. N is considered a even number andthe matrix is [0,N], so it has N+1 elements Calling functions: getNumberOfLevelsinterpGrid last update: 10/may/2006

4.4.2.16 void WSpr::dataToSparseInnerGrid (int numberOfPointsBorder)

Function dataToSparse 2D Inner Grid Compute 2d interpolatory multilevel SPR de-composition and set the non significant coefficients to NAN. N is considered a evennumber and the matrix is [0,N], so it has N+1 elements Calling functions: getNumber-OfLevels interpGridInnerMesh last update: 11/aug/2006

4.4.2.17 Array2D WSpr::exRHS (Array2D & hz, double epsilon)

last update: 23/jun/2006

Function exRHS Compute the rhs of the advection equation ex_t= 1/epsilon0 ∗Hz/partial y

4.4.2.18 void WSpr::extendMesh (int numberOfNeighbors = 1, intnumberOfGenerations = 1)

Function extendMesh(Array2D u, int numberOfNeibors, int numberOfGenerations)This insert neighbor point for each significative point in the grid at the same levelof the point and in the upper levels last update: 6/jul/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 35: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 31

4.4.2.19 Array2D WSpr::eyRHS (Array2D & hz, double epsilon)

Function eyRHS Compute the rhs of the advection equation ey_t= - 1/epsilon0 ∗Hz/partial x last update: 23/jun/2006

4.4.2.20 int WSpr::findLevel (int m, int n, int level, int ∗ mPosition, int ∗nPosition) [protected]

returns the point (m,n) level for a square matrix (isotropic decomposition) and theparity of the coordinate points last update: 10/may/2006

4.4.2.21 int WSpr::findLevel (int m, int n, int level) [protected]

Function findLevel returns the point (m,n) level for a square matrix (isotropic decom-position) last update: 10/may/2006

4.4.2.22 int WSpr::findMaxDecompositionLevel (Array2D & A)[protected]

Function findMaxDecompositionLevel Find max decomposition level that is not NANIt uses: findLevel last update: 12/may/2006

4.4.2.23 int WSpr::findPointPosition (Array2D & A, int m, int n)[protected]

return code: 0 - the point is not in the right mesh, ie it is a (even,even) point 1 - the pointneeds an inner column inperpolation 2 - the point needs a lower column inperpolation3 - the point needs an upper column inperpolation 4 - the point needs an inner rowinperpolation 5 - the point needs a lower row inperpolation 6 - the point needs an upperrow inperpolation

4.4.2.24 int WSpr::findPositionInMesh (int m, int n, int level, int ∗ mPosition,int ∗ nPosition) [protected]

Function findPositionInMesh returns the point (m,n) position in the original mesh thatthis point belongs to and the level of that mesh. last update: 9/jul/2006

4.4.2.25 int WSpr::findStride (int m, int n) [protected]

Function findStride returns the stride associated with the local level of the point (m,n)last update: 10/may/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 36: spr Reference Manual - Unicamp

32 spr Class Documentation

4.4.2.26 int WSpr::getNumberOfLevels (int n) [protected]

Function getNumberOfLevels Verify in which level the decomposition is last update:6/may/2006

4.4.2.27 Array2D WSpr::hzRHS (Array2D & ex, double epsilon0, Array2D &ey, double mu)

Function hzRHS Compute the rhs of the advection equation hz_t= 1/mu0 ∗ ex/partialy - ey/partial x last update: 26/jun/2006

4.4.2.28 void WSpr::infoNAN (void)

Function infoNAN Print on screen info about number of NAN It uses: countNAN,findMaxDecompositionLevel last update: 12/may/2006

4.4.2.29 void WSpr::initArray (void)

Function initArray This function generate the initial value function or read it from afile in BLITZ format last update: 12/may/2006

4.4.2.30 void WSpr::interpGrid (Array2D & u) [protected]

Function interpGrid This function interpolates the (odd,even), (odd,odd) and (odd,even) points of a grid given the (even,even) points in a recursive way until minLevel.The boundary points are treated as rigid, symmetric or antisymetric Must be imple-mented the periodic boundary. last update: 10/may/2006

4.4.2.31 void WSpr::interpInnerCol (Array2D & u) [protected]

Function interpInnerCol This function interpolates the inner column points of a grid Ituses a 4th order Lagrangian interpolation scheme. last update: 14/may/2006

4.4.2.32 double WSpr::interpInnerColPoint (Array2D & u, int m, int n)[protected]

Function interpInnerColPoint This function interpolates a point in the inner grid usingcolumn interpolation It uses a 4th order Lagrangian interpolation scheme. last update:16/may/2006

4.4.2.33 void WSpr::interpInnerRow (Array2D & u) [protected]

Function interpInnerRow This function interpolates the inner row points of a grid Ituses a 4th order Lagrangian interpolation scheme. last update: 14/may/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 37: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 33

4.4.2.34 double WSpr::interpInnerRowPoint (Array2D & u, int m, int n)[protected]

Function interpInnerRowPoint This function interpolate a point in the inner grid usingrow interpolation It uses a 4th order Lagrangian interpolation scheme. last update:16/may/2006

4.4.2.35 void WSpr::interpLowerColAntisymmetric (Array2D & u)[protected]

Function interpLowerColAntisymmetric This function interpolates the lower boundarycolumn points of a grid using a antisymmetric boundary It uses a 4th order Lagrangianinterpolation scheme. last update: 02/aug/2006

4.4.2.36 double WSpr::interpLowerColPointAntisymmetric (Array2D & u, intm, int n) [protected]

Function interpLowerColPointAntisymmetric This function interpolate a point in thelower column grid using column interpolation It uses a 4th order Lagrangian interpo-lation scheme. last update: 2/Aug/2006

4.4.2.37 double WSpr::interpLowerColPointRigid (Array2D & u, int m, int n)[protected]

Function interpLowerColPointRigid This function interpolate a point in the lowercolumn grid using column interpolation It uses a 4th order Lagrangian interpolationscheme. last update: 16/may/2006

4.4.2.38 double WSpr::interpLowerColPointSymmetric (Array2D & u, int m,int n) [protected]

Function interpLowerColPointSymmetric This function interpolate a point in the lowercolumn grid using column interpolation It uses a 4th order Lagrangian interpolationscheme. last update: 2/Aug/2006

4.4.2.39 void WSpr::interpLowerColRigid (Array2D & u) [protected]

Function interpLowerColRigid This function interpolates the lower boundary columnpoints of a grid using a rigid boundary It uses a 4th order Lagrangian interpolationscheme. last update: 14/may/2006

4.4.2.40 void WSpr::interpLowerColSymmetric (Array2D & u)[protected]

Function interpLowerColSymmetric This function interpolates the lower boundary col-umn points of a grid using a antisymmetric boundary It uses a 4th order Lagrangian

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 38: spr Reference Manual - Unicamp

34 spr Class Documentation

interpolation scheme. last update: 02/aug/2006

4.4.2.41 void WSpr::interpLowerRowAntisymmetric (Array2D & u)[protected]

Function interpLowerRowAntisymmetric This function interpolates the lower bound-ary row points of a grid using a antisymmetric boundary It uses a 4th order Lagrangianinterpolation scheme. last update: 2/aug/2006

4.4.2.42 double WSpr::interpLowerRowPointAntisymmetric (Array2D & u, intm, int n) [protected]

Function interpLowerRowPointAntisymmetric This function interpolate a point in thelower row grid using column interpolation It uses a 4th order Lagrangian interpolationscheme. last update: 2/Aug/2006

4.4.2.43 double WSpr::interpLowerRowPointRigid (Array2D & u, int m, int n)[protected]

Function interpLowerRowPointRigid This function interpolate a point in the lower rowgrid using column interpolation It uses a 4th order Lagrangian interpolation scheme.last update: 16/may/2006

4.4.2.44 double WSpr::interpLowerRowPointSymmetric (Array2D & u, int m,int n) [protected]

Function interpLowerRowPointSymmetric This function interpolate a point in thelower row grid using column interpolation It uses a 4th order Lagrangian interpola-tion scheme. last update: 2/Aug/2006

4.4.2.45 void WSpr::interpLowerRowRigid (Array2D & u) [protected]

Function interpLowerRowRigid This function interpolates the lower boundary rowpoints of a grid using a rigid boundary It uses a 4th order Lagrangian interpolationscheme. last update: 14/may/2006

4.4.2.46 void WSpr::interpLowerRowSymmetric (Array2D & u)[protected]

Function interpLowerRowSymmetric This function interpolates the lower boundaryrow points of a grid using a antisymmetric boundary It uses a 4th order Lagrangianinterpolation scheme. last update: 2/aug/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 39: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 35

4.4.2.47 double WSpr::interpPoint (Array2D & u, int m, int n, boolisToUseOrigMeshPoints = true) [protected]

——————————————————–Interpolation of point values

Function interpPoint This function interpolate a point in the grid It uses: findpoint-Position, interpPoint, interpInner(Col,Row)Point, interp(Lower,Upper)(Col,Row)Pointlast update: 16/may/2006

4.4.2.48 void WSpr::interpUpperColAntisymmetric (Array2D & u)[protected]

Function interpUpperColAntisymmetric This function interpolates the upper boundarycolumn points of a grid using a antisymmetric boundary It uses a 4th order Lagrangianinterpolation scheme. last update: 2/aug/2006

4.4.2.49 double WSpr::interpUpperColPointAntisymmetric (Array2D & u, intm, int n) [protected]

Function interpUpperColPointAntisymmetric This function interpolate a point in theupper column grid using column interpolation It uses a 4th order Lagrangian interpo-lation scheme. last update: 2/Aug/2006

4.4.2.50 double WSpr::interpUpperColPointRigid (Array2D & u, int m, int n)[protected]

Function interpUpperColPointRigid This function interpolate a point in the upper col-umn grid using column interpolation It uses a 4th order Lagrangian interpolationscheme. last update: 16/may/2006

4.4.2.51 double WSpr::interpUpperColPointSymmetric (Array2D & u, int m,int n) [protected]

Function interpUpperColPointSymmetric This function interpolate a point in the uppercolumn grid using column interpolation It uses a 4th order Lagrangian interpolationscheme. last update: 2/Aug/2006

4.4.2.52 void WSpr::interpUpperColRigid (Array2D & u) [protected]

Function interpUpperColRigid This function interpolates the upper boundary columnpoints of a grid using a rigid boundary It uses a 4th order Lagrangian interpolationscheme. last update: 14/may/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 40: spr Reference Manual - Unicamp

36 spr Class Documentation

4.4.2.53 void WSpr::interpUpperColSymmetric (Array2D & u)[protected]

Function interpUpperColSymmetric This function interpolates the upper boundary col-umn points of a grid using a antisymmetric boundary It uses a 4th order Lagrangianinterpolation scheme. last update: 2/aug/2006

4.4.2.54 void WSpr::interpUpperRowAntisymmetric (Array2D & u)[protected]

Function interpUpperColAntisymmetric This function interpolates the upper boundaryrow points of a grid using a antisymmetric boundary It uses a 4th order Lagrangianinterpolation scheme. last update: 2/aug/2006

4.4.2.55 double WSpr::interpUpperRowPointAntisymmetric (Array2D & u, intm, int n) [protected]

Function interpUpperRowPointAntisymmetric This function interpolate a point in thelower row grid using column interpolation It uses a 4th order Lagrangian interpolationscheme. last update: 2/Aug/2006

4.4.2.56 double WSpr::interpUpperRowPointRigid (Array2D & u, int m, int n)[protected]

Function interpUpperRowPointRigid This function interpolate a point in the lower rowgrid using column interpolation It uses a 4th order Lagrangian interpolation scheme.last update: 16/may/2006

4.4.2.57 double WSpr::interpUpperRowPointSymmetric (Array2D & u, int m,int n) [protected]

Function interpUpperRowPointSymmetric This function interpolate a point in thelower row grid using column interpolation It uses a 4th order Lagrangian interpola-tion scheme. last update: 2/Aug/2006

4.4.2.58 void WSpr::interpUpperRowRigid (Array2D & u) [protected]

Function interpUpperColRigid This function interpolates the upper boundary rowpoints of a grid using a rigid boundary It uses a 4th order Lagrangian interpolationscheme. last update: 14/may/2006

4.4.2.59 void WSpr::interpUpperRowSymmetric (Array2D & u)[protected]

Function interpUpperColSymmetric This function interpolates the upper boundary rowpoints of a grid using a antisymmetric boundary It uses a 4th order Lagrangian inter-

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 41: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 37

polation scheme. last update: 2/aug/2006

4.4.2.60 int WSpr::logTwo (int n) [protected]

Auxiliary tools from class WSpr.

Function logTwo Compute Log2(n) last update: 6/may/2006

4.4.2.61 void WSpr::plotDataGnuplot (Array2D & u, char ∗ title)[protected]

Visualization tools from class WSpr.

Function plotDataGnuplot This function plot the value of the solution in real time di-rectly in gnuplot produce one screen shots or eps or png file last update: 31/jul/2006

4.4.2.62 void WSpr::plotGridGnuplot (Array2D & u, char ∗ title)[protected]

Function plotGridGnuplot This function plot the grid points of the solution is Spr rep-resentation in real time directly in gnuplot produce two screen shots + eps file lastupdate: 12/jun/2006

4.4.2.63 int WSpr::powerTwo (int n) [protected]

Function powerTwo Compute 2∧j of a given number j last update: 6/may/2006

4.4.2.64 void WSpr::recoverGrid (Array2D & u) [protected]

Function recoverGrid This function recover the original grid interpolating the(odd,even), (odd,odd) and (odd, even) points of a grid given the (even,even) pointsin a recursive way from the minimum level. It uses a 4th order Lagrangian interpola-tion scheme. The bounday points are treated as rigid but the idea is a function call forit, to implemented it also for symetric and anti-simetric boundaries interpolations. lastupdate: 10/may/2006

4.4.2.65 void WSpr::recoverInnerCol (Array2D & u) [protected]

Function recoverInnerCol This function interpolates the inner column points of a gridis they are NAN It uses a 4th order Lagrangian interpolation scheme. last update:14/may/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 42: spr Reference Manual - Unicamp

38 spr Class Documentation

4.4.2.66 void WSpr::recoverInnerRow (Array2D & u) [protected]

Function recoverInnerRow This function interpolates the inner row points of a gridis they are NAN It uses a 4th order Lagrangian interpolation scheme. last update:14/may/2006

4.4.2.67 void WSpr::recoverLowerColAntisymmetric (Array2D & u)[protected]

Function recoverLowerColAntisymmetric This function interpolates the lower columnpoints of a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme.last update: 2/Aug/2006

4.4.2.68 void WSpr::recoverLowerColRigid (Array2D & u) [protected]

Function recoverLowerColRigid This function interpolates the lower column points ofa grid is they are NAN It uses a 4th order Lagrangian interpolation scheme. last update:14/may/2006

4.4.2.69 void WSpr::recoverLowerColSymmetric (Array2D & u)[protected]

Function recoverLowerColSymmetric This function interpolates the lower columnpoints of a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme.last update: 2/Aug/2006

4.4.2.70 void WSpr::recoverLowerRowAntisymmetric (Array2D & u)[protected]

Function recoverLowerRowAntisymmetric This function interpolates the lower rowpoints of a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme.last update: 2/Aug/2006

4.4.2.71 void WSpr::recoverLowerRowRigid (Array2D & u) [protected]

Function recoverLowerRowRigid This function interpolates the lower row points of agrid is they are NAN It uses a 4th order Lagrangian interpolation scheme. last update:14/may/2006

4.4.2.72 void WSpr::recoverLowerRowSymmetric (Array2D & u)[protected]

Function recoverLowerRowSymmetric This function interpolates the lower row pointsof a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme. lastupdate: 2/Aug/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 43: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 39

4.4.2.73 void WSpr::recoverUpperColAntisymmetric (Array2D & u)[protected]

Function recoverUpperColAntisymmetric This function interpolates the upper columnpoints of a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme.last update: 2/Aug/2006

4.4.2.74 void WSpr::recoverUpperColRigid (Array2D & u) [protected]

Function recoverUpperColRigid This function interpolates the upper column points ofa grid is they are NAN It uses a 4th order Lagrangian interpolation scheme. last update:14/may/2006

4.4.2.75 void WSpr::recoverUpperColSymmetric (Array2D & u)[protected]

Function recoverUpperColSymmetric This function interpolates the upper columnpoints of a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme.last update: 2/Aug/2006

4.4.2.76 void WSpr::recoverUpperRowAntisymmetric (Array2D & u)[protected]

Function recoverUpperRowAntisymmetric This function interpolates the upper rowpoints of a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme.last update: 2/Aug/2006

4.4.2.77 void WSpr::recoverUpperRowRigid (Array2D & u) [protected]

Function recoverUpperRowRigid This function interpolates the upper row points of agrid is they are NAN It uses a 4th order Lagrangian interpolation scheme. last update:14/may/2006

4.4.2.78 void WSpr::recoverUpperRowSymmetric (Array2D & u)[protected]

Function recoverUpperRowSymmetric This function interpolates the upper row pointsof a grid is they are NAN It uses a 4th order Lagrangian interpolation scheme. lastupdate: 2/Aug/2006

4.4.2.79 void WSpr::setDerivativeCoefficients (void) [protected]

Function setDerivativeCoefficients Puts the derivative coeficients - only first derivativeimplemented It uses a 4th order last update: 19/jun/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 44: spr Reference Manual - Unicamp

40 spr Class Documentation

4.4.2.80 void WSpr::setWaveletFilter (void) [protected]

Function setWaveletFilter This function set the interpolatory Wavelet filters forM=2,4,6 and 8 last update: 29/may/2006

4.4.2.81 void WSpr::setWSpr (void) [protected]

Function setWSpr This function initialize the filters and boundaries last update:29/may/2006

4.4.2.82 void WSpr::sparseToData (void)

Function sparseToData 2D This function is the interpolatory transform itself. Callingfunctions: getNumberOfLevels recoverGrid last update: 10/may/2006

4.4.2.83 void WSpr::testExtendMesh (void)

Function testextendMesh Teste the extend mesh function last update: 31/may/2006

4.4.2.84 void WSpr::testLocalDerivate (void)

Function testLocalDerivate Teste the first derivate function last update: 20/jun/2006

4.4.2.85 void WSpr::testMaxwellTimeEvolution (void)

Function testMaxwellTimeEvolution Teste Maxwell Equation in TE mode last update:27/jun/2006

4.4.2.86 void WSpr::testSprWithBoundaries (void)

Function testSprWithBoundaries Test the spr with boundaries symmetric and antisym-metric in x and y last update: 2/aug/2006

4.4.2.87 void WSpr::testTimeEvolution (void)

Function testTimeEvolution Test the first derivate function last update: 20/jun/2006

4.4.2.88 void WSpr::testTransformsTime (void)

Function TestTransformsTime Teste the time duration of the pointwise and grid inversetransform last update: 30/may/2006

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 45: spr Reference Manual - Unicamp

4.4 WSpr Class Reference 41

4.4.2.89 void WSpr::testTransformTimeLocalPoints (void)

Function TestTransformTimeLocalPoints Teste the time duration of the pointwise andgrid inverse transform last update: 31/may/2006

4.4.2.90 void WSpr::testViewMeshTransforms (void)

Function testViewMeshTransform Plot function and mesh last update: 30/may/2006

4.4.2.91 void WSpr::verifySpr (void)

Function verifySpr Verify the sparse point representation, ie, verify if all points con-sidered significative points are really significative last update: 1/jun/2006

4.4.2.92 void WSpr::verifySprInnerGrid (int numberOfBordersPoints)

Function verifySprInnerMesh Verify the sparse point representation, ie, verify if allpoints considered significative points are really significative only in an inner submatrixthat has a fix numbers of cells around it. In this case no boundary condition to the spris necessary if the number of points is great of interpOrder/2. last update: 11/ago/2006

4.4.2.93 void WSpr::writeMessage (const char ∗ message, const char ∗fileName, int ExiT = 1, int App = 0) [protected]

Function writeMessage Write a message in a log file and exit the program if necessarylast update: 22/may/2006

The documentation for this class was generated from the following files:

• /home/margarete/UA/spr/src/wspr.h• /home/margarete/UA/spr/src/wspr.cpp

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 46: spr Reference Manual - Unicamp

42 spr Class Documentation

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 47: spr Reference Manual - Unicamp

Bibliography

[1] M. Holmstrom. Wavelet Based Methods for Time Dependent PDEs. PhD thesis,Uppsala University, 1997. 1

[2] M. Holmstrom. Solving hyperbolic pdes using interpolating wavelets. SIAM Jour-nal on Scienti?c Computing, 2(21), 1999. 1

[3] P. Pinho. Resolução das Equações de Maxwell por Análise de MultiresoluçãoUsando Wavelets Interpolatórias. PhD thesis, Universidade de Aveiro, 2004. 1

[4] P. Pinho, P. J. Ferreira, S. M. Gomes, and J. R. Pereira. Solving Maxwell’s equa-tions using interpolating wavelets. In C. Salema et al., editor, 5th Conference onTelecomunications, 2005. 1

[5] P. Pinho, P. J. Ferreira, S. M. Gomes, and J. R. Pereira. Análise comparativa dedispersão numérica e estabilidade em diferentes esquemas de diferenças finitas dealta ordem para as equações de maxwell. In J. R. Pereira et al., editor, IV EncontroIbérico de Eletromagnetismo Computacional, 2005. 1

[6] J P Berenger. A perfectly matched layer for the absorbtion of electromagneticwaves. Journal of Computational Physics, 114, 1994. 1

Page 48: spr Reference Manual - Unicamp

Index

advRHSWSpr, 28

applyConeConditionWSpr, 28

buildGridWMaskGrid, 16

checkMeshParametersWMaxwell, 18

computeDistanceOfNearestNeighborWSpr, 28

computeFirstDerivativeInfBoundaryWSpr, 28

computeFirstDerivativeInSprWSpr, 28

computeFirstDerivativeLocalScaleXWSpr, 28

computeFirstDerivativeLocalScaleYWSpr, 28

computeFirstDerivativeSupBoundaryWSpr, 29

computeRKCashKarp45WSpr, 29

computeSameMeshWSpr, 29

countNANWSpr, 29

cpValueInBorderWMaskGrid, 16

curlWMaxwell, 18

dataAsciiToBlitzWSpr, 29

dataToSparseWSpr, 30

dataToSparseInnerGridWSpr, 30

exRHSWSpr, 30

extendMeshWSpr, 30

eyRHSWSpr, 30

findLevelWSpr, 31

findMaxDecompositionLevelWSpr, 31

findPointPositionWSpr, 31

findPositionInMeshWSpr, 31

findStrideWSpr, 31

firstDerivativeWMaxwell, 18

firstDerivativeAntiSymmetricWMaskGrid, 16

firstDerivativeSymmetricWMaskGrid, 17

getNumberOfLevelsWSpr, 31

getValueWMaskGrid, 17

hzRHSWSpr, 32

infoNANWSpr, 32

initArrayWSpr, 32

interpGridWSpr, 32

interpInnerColWSpr, 32

interpInnerColPointWSpr, 32

interpInnerRowWSpr, 32

Page 49: spr Reference Manual - Unicamp

INDEX 45

interpInnerRowPointWSpr, 32

interpLowerColAntisymmetricWSpr, 33

interpLowerColPointAntisymmetricWSpr, 33

interpLowerColPointRigidWSpr, 33

interpLowerColPointSymmetricWSpr, 33

interpLowerColRigidWSpr, 33

interpLowerColSymmetricWSpr, 33

interpLowerRowAntisymmetricWSpr, 34

interpLowerRowPointAntisymmetricWSpr, 34

interpLowerRowPointRigidWSpr, 34

interpLowerRowPointSymmetricWSpr, 34

interpLowerRowRigidWSpr, 34

interpLowerRowSymmetricWSpr, 34

interpPointWSpr, 34

interpUpperColAntisymmetricWSpr, 35

interpUpperColPointAntisymmetricWSpr, 35

interpUpperColPointRigidWSpr, 35

interpUpperColPointSymmetricWSpr, 35

interpUpperColRigidWSpr, 35

interpUpperColSymmetricWSpr, 35

interpUpperRowAntisymmetricWSpr, 36

interpUpperRowPointAntisymmetricWSpr, 36

interpUpperRowPointRigidWSpr, 36

interpUpperRowPointSymmetricWSpr, 36

interpUpperRowRigidWSpr, 36

interpUpperRowSymmetricWSpr, 36

logTwoWSpr, 37

plotDataGnuplotWSpr, 37

plotGridGnuplotWSpr, 37

powerTwoWSpr, 37

putValueWMaskGrid, 17

recoverGridWSpr, 37

recoverInnerColWSpr, 37

recoverInnerRowWSpr, 37

recoverLowerColAntisymmetricWSpr, 38

recoverLowerColRigidWSpr, 38

recoverLowerColSymmetricWSpr, 38

recoverLowerRowAntisymmetricWSpr, 38

recoverLowerRowRigidWSpr, 38

recoverLowerRowSymmetricWSpr, 38

recoverUpperColAntisymmetricWSpr, 38

recoverUpperColRigidWSpr, 39

recoverUpperColSymmetricWSpr, 39

recoverUpperRowAntisymmetricWSpr, 39

recoverUpperRowRigidWSpr, 39

recoverUpperRowSymmetricWSpr, 39

setDerivativeCoefficientsWSpr, 39

setPaletteGnuplotWPlot, 21

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 50: spr Reference Manual - Unicamp

46 INDEX

setRangeWPlot, 21

setSplotGnuplotWPlot, 21

setTerminalGnuplotWPlot, 21

setupWMaskGrid, 17

setWaveletFilterWSpr, 39

setWPlotGnuplotWPlot, 21

setWSprWSpr, 40

sparseToDataWSpr, 40

splotFieldGnuplotWPlot, 22

testExtendMeshWSpr, 40

testLocalDerivateWSpr, 40

testMaxwellTimeEvolutionWSpr, 40

testSprWithBoundariesWSpr, 40

testStorageWMaskGrid, 17

testTimeEvolutionWSpr, 40

testTransformsTimeWSpr, 40

testTransformTimeLocalPointsWSpr, 40

testViewMeshTransformsWSpr, 41

timeEvolutionTEModeWMaxwell, 19

timeEvolutionTEModeUPMLWMaxwell, 19

timeEvolutionTEModeUPMLSprWMaxwell, 19

verifySprWSpr, 41

verifySprInnerGridWSpr, 41

WMaskGrid, 15

WMaskGrid, 16WMaskGrid

buildGrid, 16cpValueInBorder, 16firstDerivativeAntiSymmetric, 16firstDerivativeSymmetric, 17getValue, 17putValue, 17setup, 17testStorage, 17WMaskGrid, 16

WMaxwell, 18checkMeshParameters, 18curl, 18firstDerivative, 18timeEvolutionTEMode, 19timeEvolutionTEModeUPML, 19timeEvolutionTEModeUPMLSpr,

19WMaxwell, 18

WPlot, 20setPaletteGnuplot, 21setRange, 21setSplotGnuplot, 21setTerminalGnuplot, 21setWPlotGnuplot, 21splotFieldGnuplot, 22WPlot, 21

writeMessageWSpr, 41

WSpr, 23advRHS, 28applyConeCondition, 28computeDistanceOfNearestNeigh-

bor, 28computeFirstDerivativeInfBoundary,

28computeFirstDerivativeInSpr, 28computeFirstDerivativeLo-

calScaleX, 28computeFirstDerivativeLocalScaleY,

28computeFirstDerivativeSupBound-

ary, 29computeRKCashKarp45, 29computeSameMesh, 29countNAN, 29dataAsciiToBlitz, 29dataToSparse, 30dataToSparseInnerGrid, 30

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen

Page 51: spr Reference Manual - Unicamp

INDEX 47

exRHS, 30extendMesh, 30eyRHS, 30findLevel, 31findMaxDecompositionLevel, 31findPointPosition, 31findPositionInMesh, 31findStride, 31getNumberOfLevels, 31hzRHS, 32infoNAN, 32initArray, 32interpGrid, 32interpInnerCol, 32interpInnerColPoint, 32interpInnerRow, 32interpInnerRowPoint, 32interpLowerColAntisymmetric, 33interpLowerColPointAntisymmetric,

33interpLowerColPointRigid, 33interpLowerColPointSymmetric, 33interpLowerColRigid, 33interpLowerColSymmetric, 33interpLowerRowAntisymmetric, 34interpLowerRowPointAntisymmet-

ric, 34interpLowerRowPointRigid, 34interpLowerRowPointSymmetric, 34interpLowerRowRigid, 34interpLowerRowSymmetric, 34interpPoint, 34interpUpperColAntisymmetric, 35interpUpperColPointAntisymmetric,

35interpUpperColPointRigid, 35interpUpperColPointSymmetric, 35interpUpperColRigid, 35interpUpperColSymmetric, 35interpUpperRowAntisymmetric, 36interpUpperRowPointAntisymmet-

ric, 36interpUpperRowPointRigid, 36interpUpperRowPointSymmetric, 36interpUpperRowRigid, 36interpUpperRowSymmetric, 36logTwo, 37plotDataGnuplot, 37plotGridGnuplot, 37powerTwo, 37

recoverGrid, 37recoverInnerCol, 37recoverInnerRow, 37recoverLowerColAntisymmetric, 38recoverLowerColRigid, 38recoverLowerColSymmetric, 38recoverLowerRowAntisymmetric,

38recoverLowerRowRigid, 38recoverLowerRowSymmetric, 38recoverUpperColAntisymmetric, 38recoverUpperColRigid, 39recoverUpperColSymmetric, 39recoverUpperRowAntisymmetric,

39recoverUpperRowRigid, 39recoverUpperRowSymmetric, 39setDerivativeCoefficients, 39setWaveletFilter, 39setWSpr, 40sparseToData, 40testExtendMesh, 40testLocalDerivate, 40testMaxwellTimeEvolution, 40testSprWithBoundaries, 40testTimeEvolution, 40testTransformsTime, 40testTransformTimeLocalPoints, 40testViewMeshTransforms, 41verifySpr, 41verifySprInnerGrid, 41writeMessage, 41

Generated on Fri Aug 18 23:05:34 2006 for spr.kdevelop by Doxygen