FEApp_BrusselatorProblem.cpp

Go to the documentation of this file.
00001 // $Id$ 
00002 // $Source$ 
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_BrusselatorProblem.hpp"
00033 #include "FEApp_BrusselatorNodeBCStrategy.hpp"
00034 
00035 FEApp::BrusselatorProblem::
00036 BrusselatorProblem(
00037       const Teuchos::RCP<Teuchos::ParameterList>& params,
00038       const Teuchos::RCP<ParamLib>& paramLib_) :
00039   paramLib(paramLib_)
00040 {
00041   alpha = params->get("alpha", 1.0);
00042   beta = params->get("beta", 1.0);
00043   D1 = params->get("D1", 1.0);
00044   D2 = params->get("D2", 1.0);
00045 }
00046 
00047 FEApp::BrusselatorProblem::
00048 ~BrusselatorProblem()
00049 {
00050 }
00051 
00052 unsigned int
00053 FEApp::BrusselatorProblem::
00054 numEquations() const
00055 {
00056   return 2;
00057 }
00058 
00059 void
00060 FEApp::BrusselatorProblem::
00061 buildProblem(
00062     const Epetra_Map& dofMap,
00063     const Epetra_Map& overlapped_dofMap,
00064     FEApp::AbstractPDE_TemplateManager<EvalTypes>& pdeTM,
00065     std::vector< Teuchos::RCP<FEApp::NodeBC> >& bcs,
00066     std::vector< Teuchos::RCP<FEApp::AbstractResponseFunction> >& responses,
00067     const Teuchos::RCP<Epetra_Vector>& u)
00068 {
00069   // Build PDE equations
00070   FEApp::BrusselatorPDE_TemplateBuilder pdeBuilder(alpha, beta, D1, D2, 
00071                                                    paramLib);
00072   pdeTM.buildObjects(pdeBuilder);
00073 
00074   // Build boundary conditions
00075   FEApp::BrusselatorNodeBCStrategy_TemplateBuilder bcBuilder(alpha, beta,
00076                                                              paramLib);
00077   int left_node = dofMap.MinAllGID();
00078   int right_node = 
00079     (dofMap.MaxAllGID() - dofMap.MinAllGID())/2 + dofMap.MinAllGID();
00080   bcs.resize(2);
00081   bcs[0] = Teuchos::rcp(new FEApp::NodeBC(dofMap, overlapped_dofMap,
00082             left_node, 2, bcBuilder));
00083   bcs[1] = Teuchos::rcp(new FEApp::NodeBC(dofMap, overlapped_dofMap,
00084             right_node, 2, bcBuilder));
00085 
00086   // Currently no responses
00087   responses.resize(0);
00088 
00089   // Build initial solution
00090 //   for (int i=0; i<u->MyLength()/2; i++) {
00091 //     (*u)[2*i]   = alpha;
00092 //     (*u)[2*i+1] = beta/alpha;
00093 //   }
00094   u->PutScalar(0.0);
00095 }
00096 

Generated on Wed May 12 21:39:32 2010 for Sacado Package Browser (Single Doxygen Collection) by  doxygen 1.4.7