static bool xrect(const POINT* p, unsigned int n) { return ( n == 5 && p[0].x == p[4].x && p[0].y == p[4].y && rectangular( p[0].x, p[0].y, p[1].x, p[1].y, p[2].x, p[2].y, p[3].x, p[3].y ) ); }
proj simpleconic(double par0, double par1) { struct coord lat0; struct coord lat1; deg2rad(par0,&lat0); deg2rad(par1,&lat1); if(fabs(lat0.l+lat1.l)<.01) return rectangular(par0); if(fabs(lat0.l-lat1.l)<.01) { a = lat0.s/lat0.l; r0 = lat0.c/lat0.s + lat0.l; } else { a = (lat1.c-lat0.c)/(lat0.l-lat1.l); r0 = ((lat0.c+lat1.c)/a + lat1.l + lat0.l)/2; } return Xsimpleconic; }
int main(int argc, char *argv[]) { int ierr = 0; #ifdef EPETRA_MPI MPI_Init(&argc,&argv); Epetra_MpiComm Comm(MPI_COMM_WORLD); #else Epetra_SerialComm Comm; #endif // Comm.SetTracebackMode(0); // This should shut down any error tracing bool verbose = false; // Check if we should print results to standard out if (argc>1) if (argv[1][0]=='-' && argv[1][1]=='v') verbose = true; #ifdef EPETRA_MPI int localverbose = verbose ? 1 : 0; int globalverbose=0; MPI_Allreduce(&localverbose, &globalverbose, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); verbose = (globalverbose>0); #endif int MyPID = Comm.MyPID(); int NumProc = Comm.NumProc(); if (verbose && MyPID==0) cout << Epetra_Version() << endl << endl; if (verbose) cout << Comm <<endl; int NumMyElements = 4; long long NumGlobalElements = NumMyElements*NumProc; int IndexBase = 0; Epetra_Map Map(NumGlobalElements, NumMyElements, IndexBase, Comm); EPETRA_TEST_ERR( Drumm1(Map, verbose),ierr); EPETRA_TEST_ERR( Drumm2(Map, verbose),ierr); bool preconstruct_graph = false; EPETRA_TEST_ERR( four_quads(Comm, preconstruct_graph, verbose), ierr); preconstruct_graph = true; EPETRA_TEST_ERR( four_quads(Comm, preconstruct_graph, verbose), ierr); EPETRA_TEST_ERR( rectangular(Comm, verbose), ierr); EPETRA_TEST_ERR( Young1(Comm, verbose), ierr); #ifdef EPETRA_MPI MPI_Finalize(); #endif return ierr; }