Sundance.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                              Sundance
00005 //                 Copyright (2005) Sandia Corporation
00006 // 
00007 // Copyright (year first published) Sandia Corporation.  Under the terms 
00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 
00009 // retains certain rights in this software.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //  
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //                                                                                 
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA                                                                                
00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 
00026 // Sandia National Laboratories, Livermore, California, USA
00027 // 
00028 // ************************************************************************
00029 /* @HEADER@ */
00030 
00031 #ifndef SUNDANCE_H
00032 #define SUNDANCE_H
00033 
00034 /* Utilities */
00035 #include "SundanceDefs.hpp"
00036 #include "SundanceOut.hpp"
00037 #include "SundancePathUtils.hpp"
00038 #include "Teuchos_Time.hpp"
00039 #include "Teuchos_GlobalMPISession.hpp"
00040 #include "Teuchos_TimeMonitor.hpp"
00041 #include "Teuchos_ParameterList.hpp"
00042 #include "Teuchos_ParameterXMLFileReader.hpp"
00043 #include "Teuchos_CommandLineProcessor.hpp"
00044 
00045 /* Symbolics */
00046 #include "SundanceTestFunction.hpp"
00047 #include "SundanceUnknownFunction.hpp"
00048 #include "SundanceUnknownParameter.hpp"
00049 #include "SundanceDiscreteSpace.hpp"
00050 #include "SundanceDiscreteFunction.hpp"
00051 #include "SundanceEssentialBC.hpp"
00052 #include "SundanceIntegral.hpp"
00053 #include "SundanceDerivative.hpp"
00054 #include "SundanceCoordExpr.hpp"
00055 #include "SundanceCellDiameterExpr.hpp"
00056 #include "SundanceCurveNormExpr.hpp"
00057 #include "SundanceCellVectorExpr.hpp"
00058 #include "SundanceStdMathOps.hpp"
00059 #include "SundanceParameter.hpp"
00060 #include "SundancePointwiseUserDefFunctor.hpp"
00061 #include "SundanceUserDefFunctor.hpp"
00062 #include "SundanceUserDefOp.hpp"
00063 #include "SundanceVectorCalculus.hpp"
00064 #include "SundanceCurveExpr.hpp"
00065 
00066 /* Parametrized Curves */
00067 #include "SundanceCircle.hpp"
00068 #include "SundanceBox2D.hpp"
00069 #include "SundanceBox3D.hpp"
00070 #include "SundanceLine2D.hpp"
00071 #include "SundancePlane3D.hpp"
00072 #include "SundanceEllipse2D.hpp"
00073 #include "SundanceSphere.hpp"
00074 #include "SundancePolygon2D.hpp"
00075 #include "SundanceTriangleSurf3D.hpp"
00076 #include "SundanceDummyParametrizedCurve.hpp"
00077 #include "SundanceParamCurveIntegral.hpp"
00078 #include "SundanceParametrizedCurve.hpp"
00079 #include "SundanceCurveIntegralCalc.hpp"
00080 #include "SundanceCurveCollection.hpp"
00081 
00082 /* Meshes */
00083 #include "SundanceMesh.hpp"
00084 #include "SundanceMeshType.hpp"
00085 #include "SundanceBasicSimplicialMeshType.hpp"
00086 #include "SundanceMeshSource.hpp"
00087 #include "SundanceMeshTransformation.hpp"
00088 #include "SundancePartitionedLineMesher.hpp"
00089 #include "SundanceExtrusionMeshTransformation.hpp"
00090 #include "SundancePartitionedRectangleMesher.hpp"
00091 #include "SundanceSerialPartitionerBase.hpp"
00092 #include "SundanceFileIOChacoPartitioner.hpp"
00093 #include "SundanceTriangleMeshReader.hpp"
00094 #include "SundanceExodusNetCDFMeshReader.hpp"
00095 #include "SundanceExodusMeshReader.hpp"
00096 #include "SundanceMeshBuilder.hpp"
00097 #include "SundanceBamgMeshReader.hpp"
00098 #include "SundanceHNMesher2D.hpp"
00099 #include "SundanceHNMeshType2D.hpp"
00100 #include "SundanceHNMesher3D.hpp"
00101 #include "SundanceHNMeshType3D.hpp"
00102 
00103 
00104 #ifdef HAVE_SUNDANCE_PEANO
00105   #ifdef HAVE_SUNDANCE_PEANO_NO_2D
00106   #else
00107     #include "SundancePeanoMeshType2D.hpp"
00108     #include "SundancePeanoMesher2D.hpp"
00109   #endif
00110   #ifdef HAVE_SUNDANCE_PEANO_NO_3D
00111   #else
00112     #include "SundancePeanoMeshType3D.hpp"
00113     #include "SundancePeanoMesher3D.hpp"
00114   #endif
00115 #endif
00116 
00117 /* Mesh refinement*/
00118 #include "SundanceRefinementBase.hpp"
00119 #include "SundanceRefinementClass.hpp"
00120 
00121 /* Cell filters */
00122 #include "SundanceCellFilter.hpp"
00123 #include "SundanceMaximalCellFilter.hpp"
00124 #include "SundanceBoundaryCellFilter.hpp"
00125 #include "SundanceDimensionalCellFilter.hpp"
00126 #include "SundancePositionalCellPredicate.hpp"
00127 #include "SundanceDomainDefinition.hpp"
00128 
00129 /* Writers */
00130 #include "SundanceFieldWriter.hpp"
00131 #include "SundanceMatlabWriter.hpp" // deprecated
00132 #include "SundanceDSVWriter.hpp"
00133 #include "SundanceVerboseFieldWriter.hpp"
00134 #include "SundanceTriangleWriter.hpp"
00135 #include "SundanceVTKWriter.hpp"
00136 #include "SundanceExodusWriter.hpp"
00137 
00138 
00139 /* FE  */
00140 #include "SundanceBasisFamily.hpp"
00141 #include "SundanceBernstein.hpp"
00142 #include "SundanceQuadratureFamily.hpp"
00143 #include "SundanceLagrange.hpp"
00144 #include "SundanceLegendre.hpp"
00145 #include "SundanceGaussianQuadrature.hpp"
00146 #include "SundanceFeketeQuadrature.hpp"
00147 #include "SundanceTrapesoidQuadrature.hpp"
00148 #include "SundanceGaussLobattoQuadrature.hpp"
00149 #include "SundancePolygonQuadrature.hpp"
00150 #include "SundanceSurfQuadrature.hpp"
00151 
00152 /* Spectral */
00153 #include "SundanceHermiteSpectralBasis.hpp"
00154 
00155 /* Problem level classes */
00156 #include "SundanceCoordinateSystem.hpp"
00157 #include "SundanceLinearProblem.hpp"
00158 #include "SundanceLinearEigenproblem.hpp"
00159 #include "SundanceL2Projector.hpp"
00160 #include "SundanceNonlinearProblem.hpp"
00161 #include "SundanceFunctionalEvaluator.hpp"
00162 #include "SundanceFunctional.hpp"
00163 #include "SundanceRivaraDriver.hpp"
00164 #include "SundanceExprFieldWrapper.hpp"
00165 #include "SundanceNitscheBC.hpp"
00166 #include "SundanceBlock.hpp"
00167 
00168 
00169 /* Solvers & stuff */
00170 #include "PlayaVectorType.hpp"
00171 #include "PlayaEpetraVectorType.hpp"
00172 #include "PlayaEpetraMatrixMatrixProduct.hpp"
00173 #include "PlayaEpetraMatrixMatrixSum.hpp"
00174 #include "PlayaEpetraMatrixOps.hpp"
00175 #include "PlayaBICGSTABSolverDecl.hpp"
00176 #include "PlayaAztecSolver.hpp"
00177 #include "PlayaLinearSolverImpl.hpp"
00178 #include "PlayaLinearCombinationImpl.hpp"
00179 #include "PlayaLinearSolverBuilder.hpp"
00180 #include "PlayaMLOperator.hpp"
00181 #include "PlayaParameterListPreconditionerFactory.hpp"
00182 #include "SundancePCDPreconditioner.hpp"
00183 #include "PlayaEpetraMatrixMatrixProduct.hpp"
00184 #include "PlayaEpetraMatrixMatrixSum.hpp"
00185 #include "PlayaEpetraMatrixOps.hpp"
00186 
00187 
00188 
00189 /* Nonlinear solvers */
00190 #include "NOX.H"
00191 #include "NOX_Common.H"
00192 #include "NOX_Utils.H"
00193 #include "PlayaNOXSolver.hpp"
00194 #include "PlayaNonlinearSolver.hpp"
00195 #include "PlayaNonlinearSolverBuilder.hpp"
00196 
00197 
00198 /* Eigensolvers */
00199 #include "PlayaAnasaziEigensolverDecl.hpp"
00200 #include "PlayaEigensolver.hpp"
00201 
00202 
00203 /* Atomistic/continuum */
00204 #include "SundanceAToCDensitySampler.hpp"
00205 #include "SundanceCToAInterpolator.hpp"
00206 
00207 
00208 /* do explicit qualification of List to avoid conflicts
00209  * with the unfriendly lack of namespaces in MPI2C++
00210  */
00211 
00212 namespace Sundance
00213 {
00214 
00215 using namespace PlayaExprTemplates;
00216 using namespace Playa;
00217 using namespace Teuchos;
00218 using Sundance::List;
00219 
00220 
00221 /**
00222  * Class Sundance provides several static methods for
00223  * managing the environment of a simulation. Every simulation code
00224  * should begin with a call to Sundance::init() and end with
00225  * a call to Sundance::finalize().
00226  */
00227 class SundanceGlobal
00228 {
00229 public:
00230 
00231   /** */
00232   static void setOption(const std::string& optionName,
00233     int& value,
00234     const std::string& helpMsg);
00235 
00236   /** */
00237   static void setOption(const std::string& optionName,
00238     std::string& value,
00239     const std::string& helpMsg);
00240 
00241   /** */
00242   static void setOption(const std::string& optionName,
00243     double& value,
00244     const std::string& helpMsg);
00245 
00246   /** */
00247   static void setOption(const std::string& optionTrueName,
00248     const std::string& optionFalseName,
00249     bool& value,
00250     const std::string& helpMsg);
00251 
00252 
00253   /** 
00254    * Do initialization steps such as starting MPI (if necessary), 
00255    * parsing the Unix command
00256    * line, and reading runtime options from the configuration file.
00257    * MPI is initialized through a call to Teuchos::GlobalMPISession, 
00258    * which in turn checks whether MPI needs initialization and calls
00259    * MPI_Init() if necessary. If some other library you're using has
00260    * its own MPI initialization system, it is thus perfectly safe to
00261    * call Sundance::init() as well.
00262    */
00263   static int init(int* argc, char*** argv);
00264     
00265   /** 
00266    * Do finalization steps such as calling MPI_finalize() (if necessary),
00267    * and collecting and printing timing information.
00268    */
00269   static int finalize();
00270     
00271   /** */
00272   static void handleException(std::exception& e);
00273 
00274   /** */
00275   static Teuchos::FancyOStream& os() ;
00276 
00277 
00278   /** */
00279   static bool passFailTest(bool pass);
00280 
00281   /** */
00282   static bool passFailTest(double error, double tol);
00283 
00284   /** */
00285   static bool passFailTest(const std::string& statusMsg,
00286     bool status, double error, double tol);
00287 
00288 
00289   /** Set to true if a message should be written by each processor
00290    * at startup. */
00291   static bool& showStartupMessage();
00292 
00293   /** Decide whether to skip timing outputs to work around
00294    * a trilinos 6.0.x bug */
00295   static bool& skipTimingOutput()
00296     {static bool rtn=false; return rtn;}
00297 
00298   /** */
00299   static int& testStatus() {static int rtn = -1; return rtn;}
00300 
00301 
00302 
00303   static CommandLineProcessor& clp()
00304     {static CommandLineProcessor rtn; return rtn;}
00305 
00306   static bool checkTest(double error, double tol);
00307 
00308 
00309 };
00310 
00311 
00312 /** \relates SundanceGlobal */
00313 void handleException(std::exception& e);
00314 
00315 /** \relates SundanceGlobal */
00316 bool passFailTest(bool pass);
00317 
00318 /** \relates SundanceGlobal */
00319 bool passFailTest(double error, double tol);
00320 
00321 /** \relates SundanceGlobal */
00322 bool passFailTest(const std::string& statusMsg,
00323   bool status, double error, double tol);
00324 
00325 /** \relates SundanceGlobal */
00326 int& testStatus() ;
00327 
00328 /** \relates SundanceGlobal */
00329 CommandLineProcessor& clp() ;
00330 
00331 /** \relates SundanceGlobal */
00332 int init(int* argc, char*** argv);
00333 
00334 /** \relates SundanceGlobal */
00335 int finalize();
00336 
00337 
00338 /** */
00339 void setOption(const std::string& optionName,
00340   int& value,
00341   const std::string& helpMsg);
00342 
00343 /** */
00344 void setOption(const std::string& optionName,
00345   std::string& value,
00346   const std::string& helpMsg);
00347 
00348 /** */
00349 void setOption(const std::string& optionName,
00350   double& value,
00351   const std::string& helpMsg);
00352 
00353 /** */
00354 void setOption(const std::string& optionTrueName,
00355   const std::string& optionFalseName,
00356   bool& value,
00357   const std::string& helpMsg);
00358 
00359 }
00360 
00361 
00362 
00363 
00364 #endif
00365 

Site Contact