FEApp_HeatNonlinearSourceProblem.cpp

Go to the documentation of this file.
00001 // $Id: FEApp_HeatNonlinearSourceProblem.cpp,v 1.4.2.2 2007/08/14 00:19:05 etphipp Exp $ 
00002 // $Source: /space/CVS/Trilinos/packages/sacado/example/FEApp/FEApp_HeatNonlinearSourceProblem.cpp,v $ 
00003 // @HEADER
00004 // ***********************************************************************
00005 // 
00006 //                           Sacado Package
00007 //                 Copyright (2006) Sandia Corporation
00008 // 
00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00010 // the U.S. Government retains certain rights in this software.
00011 // 
00012 // This library is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Lesser General Public License as
00014 // published by the Free Software Foundation; either version 2.1 of the
00015 // License, or (at your option) any later version.
00016 //  
00017 // This library is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Lesser General Public License for more details.
00021 //  
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA
00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
00027 // (etphipp@sandia.gov).
00028 // 
00029 // ***********************************************************************
00030 // @HEADER
00031 
00032 #include "FEApp_HeatNonlinearSourceProblem.hpp"
00033 #include "FEApp_ConstantNodeBCStrategy.hpp"
00034 
00035 FEApp::HeatNonlinearSourceProblem::
00036 HeatNonlinearSourceProblem(
00037         const Teuchos::RCP<Teuchos::ParameterList>& params_,
00038               const Teuchos::RCP<Sacado::ScalarParameterLibrary>& paramLib_) :
00039   params(params_),
00040   paramLib(paramLib_)
00041 {
00042   leftBC = params->get("Left BC", 0.0);
00043   rightBC = params->get("Right BC", 0.0);
00044 }
00045 
00046 FEApp::HeatNonlinearSourceProblem::
00047 ~HeatNonlinearSourceProblem()
00048 {
00049 }
00050 
00051 unsigned int
00052 FEApp::HeatNonlinearSourceProblem::
00053 numEquations() const
00054 {
00055   return 1;
00056 }
00057 
00058 void
00059 FEApp::HeatNonlinearSourceProblem:: 
00060 buildProblem(const Epetra_Map& dofMap,
00061        const Epetra_Map& overlapped_dofMap,
00062        FEApp::AbstractPDE_TemplateManager<ValidTypes>& pdeTM,
00063        std::vector< Teuchos::RCP<FEApp::NodeBC> >& bcs,
00064        const Teuchos::RCP<Epetra_Vector>& u)
00065 {
00066   // Build PDE equations
00067   FEApp::HeatNonlinearSourcePDE_TemplateBuilder pdeBuilder(params, paramLib);
00068   pdeTM.buildObjects(pdeBuilder);
00069 
00070   // Build boundary conditions
00071   FEApp::ConstantNodeBCStrategy_TemplateBuilder leftBuilder(0, 0, leftBC, 1,
00072                   paramLib);
00073   FEApp::ConstantNodeBCStrategy_TemplateBuilder rightBuilder(0, 0, rightBC, 2,
00074                    paramLib);
00075   int left_node = dofMap.MinAllGID();
00076   int right_node = dofMap.MaxAllGID();
00077   bcs.resize(2);
00078   bcs[0] = Teuchos::rcp(new FEApp::NodeBC(dofMap, overlapped_dofMap,
00079             left_node, 1, leftBuilder));
00080   bcs[1] = Teuchos::rcp(new FEApp::NodeBC(dofMap, overlapped_dofMap,
00081             right_node, 1, rightBuilder));
00082 
00083   // Build initial solution
00084   u->PutScalar(1.0);
00085 }

Generated on Tue Oct 20 12:55:03 2009 for Sacado Package Browser (Single Doxygen Collection) by doxygen 1.4.7