Xyce  6.1
N_NLS_NOX_AugmentLinSys_GStepping.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2015 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-------------------------------------------------------------------------
26 // Filename : $RCSfile: N_NLS_NOX_AugmentLinSys_GStepping.h,v $
27 //
28 // Purpose : Concrete class for augmenting the Jacobian for
29 // pseudo-transient solves.
30 //
31 // Special Notes :
32 //
33 // Creator : Roger Pawlowski, NLS, 9233
34 //
35 // Creation Date : 3/6/2006
36 //
37 // Revision Information:
38 // ---------------------
39 //
40 // Revision Number: $Revision: 1.12 $
41 //
42 // Revision Date : $Date: 2015/04/08 19:18:29 $
43 //
44 // Current Owner : $Author: tvrusso $
45 //-------------------------------------------------------------------------
46 
47 #ifndef Xyce_N_NLS_NOX_AugmentLinSys_GStepping_h
48 #define Xyce_N_NLS_NOX_AugmentLinSys_GStepping_h
49 
50 
51 #include <vector>
52 #include "Teuchos_RCP.hpp"
53 #include "N_NLS_NOX_AugmentLinSys.h"
54 
55 class Epetra_MapColoring;
56 
57 //-----------------------------------------------------------------------------
58 // Class : N_NLS::NOX::GStepping
59 // Purpose : Handles matrix augmentation to support GMIN stepping.
60 // Creator : Roger Pawlowski, SNL, 9233
61 // Creation Date : 3/6/2006
62 //-----------------------------------------------------------------------------
63 namespace Xyce {
64 namespace Nonlinear {
65 namespace N_NLS_NOX {
66 
67  class GStepping : public AugmentLinSys {
68 
69  public:
70 
71  enum NodeListType {
74  };
75 
76  public:
77 
78  //! Ctor for the voltage nodes as a GID list.
79  GStepping(const std::vector<int>& vnodeGIDVec,
80  Xyce::Linear::Vector* cloneVector,
81  double endValue,
82  double residCond=0);
83 
84  //! Ctor with an EpetraMapColoring for all voltage unknowns.
85  GStepping(const Teuchos::RCP
86  <Epetra_MapColoring>& color_map,
87  Xyce::Linear::Vector* cloneVector,
88  double endValue,
89  double residCond=0);
90 
91  //! Dtor.
92  ~GStepping();
93 
94  void setProgressVariable(double time_step_size);
95 
96  void augmentResidual(const Xyce::Linear::Vector * solution,
97  Xyce::Linear::Vector * residual_vector);
98 
99  void augmentJacobian(Xyce::Linear::Matrix * jacobian);
100 
101  inline void setResidualConductance(double c) {residualConductance_=c;};
102 
103  private:
104 
105  //! Type of list we are using.
107 
108  //! Conductance.
109  double conductance_;
110 
111  //! List of voltage node GIDs.
112  const std::vector<int> vnodeGIDVec_;
113 
114  //! Color 0 are the voltage unknowns.
115  Teuchos::RCP<Epetra_MapColoring> color_map_;
116 
117  //! Temporary vector used to store diagonal.
118  Xyce::Linear::Vector* tmp_vector_ptr_;
119 
120  //! low end of the exponential term.
122 
123  //! residual value of the conductance. Should almost always be zero
125 
126  };
127 
128 }}}
129 
130 #endif
131 
void setProgressVariable(double time_step_size)
Set the progress variable (time step size for pseudo transient).
Pure virtual class to augment a linear system.
double scaled_end_value_
low end of the exponential term.
GStepping(const std::vector< int > &vnodeGIDVec, Xyce::Linear::Vector *cloneVector, double endValue, double residCond=0)
Ctor for the voltage nodes as a GID list.
void augmentResidual(const Xyce::Linear::Vector *solution, Xyce::Linear::Vector *residual_vector)
Augments the Residual.
void augmentJacobian(Xyce::Linear::Matrix *jacobian)
Augments the Jacobian.
double residualConductance_
residual value of the conductance. Should almost always be zero
const std::vector< int > vnodeGIDVec_
List of voltage node GIDs.
NodeListType node_list_type_
Type of list we are using.
Teuchos::RCP< Epetra_MapColoring > color_map_
Color 0 are the voltage unknowns.
Xyce::Linear::Vector * tmp_vector_ptr_
Temporary vector used to store diagonal.