Sundance.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                             Sundance
00005 //                 Copyright 2011 Sandia Corporation
00006 // 
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Kevin Long (kevin.long@ttu.edu)
00038 // 
00039 
00040 /* @HEADER@ */
00041 
00042 #ifndef SUNDANCE_H
00043 #define SUNDANCE_H
00044 
00045 /* Utilities */
00046 #include "SundanceDefs.hpp"
00047 #include "SundanceOut.hpp"
00048 #include "SundancePathUtils.hpp"
00049 #include "Teuchos_Time.hpp"
00050 #include "Teuchos_GlobalMPISession.hpp"
00051 #include "Teuchos_TimeMonitor.hpp"
00052 #include "Teuchos_ParameterList.hpp"
00053 #include "Teuchos_ParameterXMLFileReader.hpp"
00054 #include "Teuchos_CommandLineProcessor.hpp"
00055 
00056 /* Symbolics */
00057 #include "SundanceTestFunction.hpp"
00058 #include "SundanceUnknownFunction.hpp"
00059 #include "SundanceUnknownParameter.hpp"
00060 #include "SundanceDiscreteSpace.hpp"
00061 #include "SundanceDiscreteFunction.hpp"
00062 #include "SundanceEssentialBC.hpp"
00063 #include "SundanceIntegral.hpp"
00064 #include "SundanceDerivative.hpp"
00065 #include "SundanceCoordExpr.hpp"
00066 #include "SundanceCellDiameterExpr.hpp"
00067 #include "SundanceCurveNormExpr.hpp"
00068 #include "SundanceCellVectorExpr.hpp"
00069 #include "SundanceStdMathOps.hpp"
00070 #include "SundanceParameter.hpp"
00071 #include "SundancePointwiseUserDefFunctor.hpp"
00072 #include "SundanceUserDefFunctor.hpp"
00073 #include "SundanceUserDefOp.hpp"
00074 #include "SundanceVectorCalculus.hpp"
00075 #include "SundanceCurveExpr.hpp"
00076 
00077 /* Parametrized Curves */
00078 #include "SundanceCircle.hpp"
00079 #include "SundanceBox2D.hpp"
00080 #include "SundanceBox3D.hpp"
00081 #include "SundanceLine2D.hpp"
00082 #include "SundancePlane3D.hpp"
00083 #include "SundanceEllipse2D.hpp"
00084 #include "SundanceSphere.hpp"
00085 #include "SundancePolygon2D.hpp"
00086 #include "SundanceTriangleSurf3D.hpp"
00087 #include "SundanceDummyParametrizedCurve.hpp"
00088 #include "SundanceParamCurveIntegral.hpp"
00089 #include "SundanceParametrizedCurve.hpp"
00090 #include "SundanceCurveIntegralCalc.hpp"
00091 #include "SundanceCurveCollection.hpp"
00092 
00093 /* Meshes */
00094 #include "SundanceMesh.hpp"
00095 #include "SundanceMeshType.hpp"
00096 #include "SundanceBasicSimplicialMeshType.hpp"
00097 #include "SundanceMeshSource.hpp"
00098 #include "SundanceMeshTransformation.hpp"
00099 #include "SundancePartitionedLineMesher.hpp"
00100 #include "SundanceExtrusionMeshTransformation.hpp"
00101 #include "SundancePartitionedRectangleMesher.hpp"
00102 #include "SundanceSerialPartitionerBase.hpp"
00103 #include "SundanceFileIOChacoPartitioner.hpp"
00104 #include "SundanceTriangleMeshReader.hpp"
00105 #include "SundanceExodusNetCDFMeshReader.hpp"
00106 #include "SundanceExodusMeshReader.hpp"
00107 #include "SundanceMeshBuilder.hpp"
00108 #include "SundanceBamgMeshReader.hpp"
00109 #include "SundanceHNMesher2D.hpp"
00110 #include "SundanceHNMeshType2D.hpp"
00111 #include "SundanceHNMesher3D.hpp"
00112 #include "SundanceHNMeshType3D.hpp"
00113 
00114 
00115 #ifdef HAVE_SUNDANCE_PEANO
00116   #ifdef HAVE_SUNDANCE_PEANO_NO_2D
00117   #else
00118     #include "SundancePeanoMeshType2D.hpp"
00119     #include "SundancePeanoMesher2D.hpp"
00120   #endif
00121   #ifdef HAVE_SUNDANCE_PEANO_NO_3D
00122   #else
00123     #include "SundancePeanoMeshType3D.hpp"
00124     #include "SundancePeanoMesher3D.hpp"
00125   #endif
00126 #endif
00127 
00128 /* Mesh refinement*/
00129 #include "SundanceRefinementBase.hpp"
00130 #include "SundanceRefinementClass.hpp"
00131 
00132 /* Cell filters */
00133 #include "SundanceCellFilter.hpp"
00134 #include "SundanceMaximalCellFilter.hpp"
00135 #include "SundanceBoundaryCellFilter.hpp"
00136 #include "SundanceDimensionalCellFilter.hpp"
00137 #include "SundancePositionalCellPredicate.hpp"
00138 #include "SundanceDomainDefinition.hpp"
00139 
00140 /* Writers */
00141 #include "SundanceFieldWriter.hpp"
00142 #include "SundanceMatlabWriter.hpp" // deprecated
00143 #include "SundanceDSVWriter.hpp"
00144 #include "SundanceVerboseFieldWriter.hpp"
00145 #include "SundanceTriangleWriter.hpp"
00146 #include "SundanceVTKWriter.hpp"
00147 #include "SundanceExodusWriter.hpp"
00148 
00149 
00150 /* FE  */
00151 #include "SundanceBasisFamily.hpp"
00152 #include "SundanceBernstein.hpp"
00153 #include "SundanceQuadratureFamily.hpp"
00154 #include "SundanceLagrange.hpp"
00155 #include "SundanceLegendre.hpp"
00156 #include "SundanceGaussianQuadrature.hpp"
00157 #include "SundanceFeketeQuadrature.hpp"
00158 #include "SundanceTrapesoidQuadrature.hpp"
00159 #include "SundanceGaussLobattoQuadrature.hpp"
00160 #include "SundancePolygonQuadrature.hpp"
00161 #include "SundanceSurfQuadrature.hpp"
00162 
00163 /* Spectral */
00164 #include "SundanceHermiteSpectralBasis.hpp"
00165 
00166 /* Problem level classes */
00167 #include "SundanceCoordinateSystem.hpp"
00168 #include "SundanceLinearProblem.hpp"
00169 #include "SundanceLinearEigenproblem.hpp"
00170 #include "SundanceL2Projector.hpp"
00171 #include "SundanceNonlinearProblem.hpp"
00172 #include "SundanceFunctionalEvaluator.hpp"
00173 #include "SundanceFunctional.hpp"
00174 #include "SundanceRivaraDriver.hpp"
00175 #include "SundanceExprFieldWrapper.hpp"
00176 #include "SundanceNitscheBC.hpp"
00177 #include "SundanceBlock.hpp"
00178 
00179 
00180 /* Solvers & stuff */
00181 #include "PlayaVectorType.hpp"
00182 #include "PlayaEpetraVectorType.hpp"
00183 #include "PlayaEpetraMatrixMatrixProduct.hpp"
00184 #include "PlayaEpetraMatrixMatrixSum.hpp"
00185 #include "PlayaEpetraMatrixOps.hpp"
00186 #include "PlayaBICGSTABSolverDecl.hpp"
00187 #include "PlayaAztecSolver.hpp"
00188 #include "PlayaLinearSolverImpl.hpp"
00189 #include "PlayaLinearCombinationImpl.hpp"
00190 #include "PlayaLinearSolverBuilder.hpp"
00191 #include "PlayaMLOperator.hpp"
00192 #include "PlayaParameterListPreconditionerFactory.hpp"
00193 #include "SundancePCDPreconditioner.hpp"
00194 #include "PlayaEpetraMatrixMatrixProduct.hpp"
00195 #include "PlayaEpetraMatrixMatrixSum.hpp"
00196 #include "PlayaEpetraMatrixOps.hpp"
00197 
00198 
00199 
00200 /* Nonlinear solvers */
00201 #include "NOX.H"
00202 #include "NOX_Common.H"
00203 #include "NOX_Utils.H"
00204 #include "PlayaNOXSolver.hpp"
00205 #include "PlayaNonlinearSolver.hpp"
00206 #include "PlayaNonlinearSolverBuilder.hpp"
00207 
00208 
00209 /* Eigensolvers */
00210 #include "PlayaAnasaziEigensolverDecl.hpp"
00211 #include "PlayaEigensolver.hpp"
00212 
00213 
00214 /* Atomistic/continuum */
00215 #include "SundanceAToCDensitySampler.hpp"
00216 #include "SundanceCToAInterpolator.hpp"
00217 
00218 
00219 /* do explicit qualification of List to avoid conflicts
00220  * with the unfriendly lack of namespaces in MPI2C++
00221  */
00222 
00223 namespace Sundance
00224 {
00225 
00226 using namespace PlayaExprTemplates;
00227 using namespace Playa;
00228 using namespace Teuchos;
00229 using Sundance::List;
00230   using std::setw;
00231   using std::exception;
00232 
00233 
00234 /**
00235  * Class Sundance provides several static methods for
00236  * managing the environment of a simulation. Every simulation code
00237  * should begin with a call to Sundance::init() and end with
00238  * a call to Sundance::finalize().
00239  */
00240 class SundanceGlobal
00241 {
00242 public:
00243 
00244   /** */
00245   static void setOption(const std::string& optionName,
00246     int& value,
00247     const std::string& helpMsg);
00248 
00249   /** */
00250   static void setOption(const std::string& optionName,
00251     std::string& value,
00252     const std::string& helpMsg);
00253 
00254   /** */
00255   static void setOption(const std::string& optionName,
00256     double& value,
00257     const std::string& helpMsg);
00258 
00259   /** */
00260   static void setOption(const std::string& optionTrueName,
00261     const std::string& optionFalseName,
00262     bool& value,
00263     const std::string& helpMsg);
00264 
00265 
00266   /** 
00267    * Do initialization steps such as starting MPI (if necessary), 
00268    * parsing the Unix command
00269    * line, and reading runtime options from the configuration file.
00270    * MPI is initialized through a call to Teuchos::GlobalMPISession, 
00271    * which in turn checks whether MPI needs initialization and calls
00272    * MPI_Init() if necessary. If some other library you're using has
00273    * its own MPI initialization system, it is thus perfectly safe to
00274    * call Sundance::init() as well.
00275    */
00276   static int init(int* argc, char*** argv);
00277     
00278   /** 
00279    * Do finalization steps such as calling MPI_finalize() (if necessary),
00280    * and collecting and printing timing information.
00281    */
00282   static int finalize();
00283     
00284   /** */
00285   static void handleException(std::exception& e);
00286 
00287   /** */
00288   static Teuchos::FancyOStream& os() ;
00289 
00290 
00291   /** */
00292   static bool passFailTest(bool pass);
00293 
00294   /** */
00295   static bool passFailTest(double error, double tol);
00296 
00297   /** */
00298   static bool passFailTest(const std::string& statusMsg,
00299     bool status, double error, double tol);
00300 
00301 
00302   /** Set to true if a message should be written by each processor
00303    * at startup. */
00304   static bool& showStartupMessage();
00305 
00306   /** Decide whether to skip timing outputs to work around
00307    * a trilinos 6.0.x bug */
00308   static bool& skipTimingOutput()
00309     {static bool rtn=false; return rtn;}
00310 
00311   /** */
00312   static int& testStatus() {static int rtn = -1; return rtn;}
00313 
00314 
00315 
00316   static CommandLineProcessor& clp()
00317     {static CommandLineProcessor rtn; return rtn;}
00318 
00319   static bool checkTest(double error, double tol);
00320 
00321 
00322 };
00323 
00324 
00325 /** \relates SundanceGlobal */
00326 void handleException(std::exception& e);
00327 
00328 /** \relates SundanceGlobal */
00329 bool passFailTest(bool pass);
00330 
00331 /** \relates SundanceGlobal */
00332 bool passFailTest(double error, double tol);
00333 
00334 /** \relates SundanceGlobal */
00335 bool passFailTest(const std::string& statusMsg,
00336   bool status, double error, double tol);
00337 
00338 /** \relates SundanceGlobal */
00339 int& testStatus() ;
00340 
00341 /** \relates SundanceGlobal */
00342 CommandLineProcessor& clp() ;
00343 
00344 /** \relates SundanceGlobal */
00345 int init(int* argc, char*** argv);
00346 
00347 /** \relates SundanceGlobal */
00348 int finalize();
00349 
00350 
00351 /** */
00352 void setOption(const std::string& optionName,
00353   int& value,
00354   const std::string& helpMsg);
00355 
00356 /** */
00357 void setOption(const std::string& optionName,
00358   std::string& value,
00359   const std::string& helpMsg);
00360 
00361 /** */
00362 void setOption(const std::string& optionName,
00363   double& value,
00364   const std::string& helpMsg);
00365 
00366 /** */
00367 void setOption(const std::string& optionTrueName,
00368   const std::string& optionFalseName,
00369   bool& value,
00370   const std::string& helpMsg);
00371 
00372 }
00373 
00374 
00375 
00376 
00377 #endif
00378 

Site Contact