]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Skeleton SLEPC import.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Jan 2013 16:16:36 +0000 (16:16 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Jan 2013 16:16:36 +0000 (16:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@28185 0785d39b-7218-0410-832d-ea1e28bc413d

tests/Makefile
tests/slepc/00.cc [new file with mode: 0644]
tests/slepc/00/cmp/generic [new file with mode: 0644]
tests/slepc/Makefile [new file with mode: 0644]

index cdcf4d72afc5162f9db15f660db62dde4518f07e..f5d0503d22381110f5e2be17141264431802153d 100644 (file)
@@ -23,6 +23,7 @@ nofail-dirs = a-framework       \
              $(if $(DEAL_II_USE_MPI:no=),      $(if $(USE_CONTRIB_P4EST:no=),mpi,),) \
              $(if $(USE_CONTRIB_P4EST:no=),    distributed_grids,) \
              $(if $(USE_CONTRIB_PETSC:no=),    petsc,) \
+             $(if $(USE_CONTRIB_SLEPC:no=),    slepc,) \
              $(if $(USE_CONTRIB_TRILINOS:no=), trilinos,) \
              $(if $(USE_CONTRIB_UMFPACK:no=),  umfpack,) \
              $(if $(USE_CONTRIB_METIS:no=),    metis,) \
diff --git a/tests/slepc/00.cc b/tests/slepc/00.cc
new file mode 100644 (file)
index 0000000..8265474
--- /dev/null
@@ -0,0 +1,93 @@
+//-------------------------------------------------------
+//    $Id: 01.cc 24924 2013-01-28 young $
+//    Version: $Name$ 
+//
+//    Copyright (C) 2013 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//-------------------------------------------------------
+
+
+// just check initialising SLEPc can be done and that it initialises
+// PETSc in the way we expect, ie. *a* PETSc object exist.
+
+#include "../tests.h"
+#include <deal.II/lac/slepc_solver.h>    
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/numbers.h>
+#include <fstream>
+#include <iostream>
+
+std::ofstream logfile ("00/output");
+
+int main (int argc,char **argv) 
+{
+  deallog.attach (logfile);
+  deallog.depth_console (1);
+
+  try
+    {
+
+      logfile << "Initializing SLEPc (PETSc): " 
+             << std::flush;
+
+      SlepcInitialize (&argc, &argv, 0, 0);
+      {
+       logfile << "ok" 
+               << std::endl;
+
+       // Do something simple with PETSc
+       logfile << "Using PetscScalar:" 
+               << std::endl;
+
+       const PetscScalar pi  = numbers::PI;
+       const PetscScalar two = 2.;
+
+       logfile << "   pi:           " << pi 
+               << std::endl
+               << "   two:          " << two 
+               << std::endl
+               << "   two times pi: " << two*pi 
+               << std::endl;
+
+       
+       logfile << "Finalizing SLEPc (PETSc): " 
+               << std::flush;
+
+      }
+      SlepcFinalize ();
+
+      logfile << "ok" 
+             << std::endl << std::endl;
+    }
+
+  catch (std::exception &exc)
+    {
+      std::cerr << std::endl << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      std::cerr << "Exception on processing: " << std::endl
+               << exc.what() << std::endl
+               << "Aborting!" << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      
+      return 1;
+    }
+
+  catch (...) 
+    {
+      std::cerr << std::endl << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      std::cerr << "Unknown exception!" << std::endl
+               << "Aborting!" << std::endl
+               << "----------------------------------------------------"
+               << std::endl;
+      return 1;
+    };
+}
diff --git a/tests/slepc/00/cmp/generic b/tests/slepc/00/cmp/generic
new file mode 100644 (file)
index 0000000..d96846c
--- /dev/null
@@ -0,0 +1,8 @@
+
+Initializing SLEPc (PETSc): ok
+Using PetscScalar:
+   pi:           3.14159
+   two:          2.00000
+   two times pi: 6.28319
+Finalizing SLEPc (PETSc): ok
+
diff --git a/tests/slepc/Makefile b/tests/slepc/Makefile
new file mode 100644 (file)
index 0000000..a722f76
--- /dev/null
@@ -0,0 +1,10 @@
+############################################################
+# Makefile,v 1.15 2002/06/13 12:51:13 hartmann Exp
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+############################################################
+
+include ../Makefile.paths
+include $D/common/Make.global_options
+include ../Makefile.rules
+include Makefile.depend
+include Makefile.tests

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.