Xyce  6.1
N_ANP_OpBuilders.C
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_ANP_OpBuilders.C,v $
27 //
28 // Purpose : Output Manager
29 //
30 // Special Notes :
31 //
32 // Creator : David G. Baur, Raytheon
33 //
34 // Creation Date : 11/11/2014
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.3 $
40 //
41 // Revision Date : $Date: 2015/04/08 19:18:20 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 #include <string>
49 #include <vector>
50 
51 #include <N_ANP_fwd.h>
52 #include <N_UTL_fwd.h>
53 
54 #include <N_ANP_Op.h>
55 #include <N_ANP_AnalysisManager.h>
56 #include <N_UTL_Algorithm.h>
57 #include <N_UTL_OpBuilder.h>
58 #include <N_UTL_Param.h>
59 
60 namespace Xyce {
61 namespace Analysis {
62 
63 struct AnalysisInitialTimeOpBuilder : public Util::Op::Builder
64 {
66  : analysisManager_(analysis_manager)
67  {}
68 
70  {}
71 
72  virtual void registerCreateFunctions(Util::Op::BuilderManager &builder_manager) const
73  {
74  builder_manager.addCreateFunction<AnalysisInitialTimeOp>();
75  }
76 
77  virtual Util::Op::Operator *makeOp(Util::ParamList::const_iterator &it) const
78  {
79  Util::Op::Operator *new_op = 0;
80  const std::string &param_tag = (*it).tag();
81  const std::string &param_string = (*it).stringValue();
82 
83  if (param_tag == "ANALYSIS_INITIAL_TIME") {
84  new_op = new AnalysisInitialTimeOp(param_tag, analysisManager_);
85  new_op->addArg(param_string);
86  }
87 
88  return new_op;
89  }
90 
91 private:
93 };
94 
95 struct AnalysisFinalTimeOpBuilder : public Util::Op::Builder
96 {
98  : analysisManager_(analysis_manager)
99  {}
100 
102  {}
103 
104  virtual void registerCreateFunctions(Util::Op::BuilderManager &builder_manager) const
105  {
106  builder_manager.addCreateFunction<AnalysisFinalTimeOp>();
107  }
108 
109  virtual Util::Op::Operator *makeOp(Util::ParamList::const_iterator &it) const
110  {
111  Util::Op::Operator *new_op = 0;
112  const std::string &param_tag = (*it).tag();
113  const std::string &param_string = (*it).stringValue();
114 
115  if (param_tag == "ANALYSIS_FINAL_TIME") {
116  new_op = new AnalysisFinalTimeOp(param_tag, analysisManager_);
117  new_op->addArg(param_string);
118  }
119 
120  return new_op;
121  }
122 
123 private:
125 };
126 
127 //-----------------------------------------------------------------------------
128 // Function : registerOpBuilders
129 // Purpose :
130 // Special Notes :
131 // Scope : public
132 // Creator : Dave Shirley, PSSI
133 // Creation Date : 8/15/06
134 //-----------------------------------------------------------------------------
135 void registerOpBuilders(Util::Op::BuilderManager &builder_manager, Parallel::Machine comm, AnalysisManager &analysis_manager)
136 {
137  builder_manager.addBuilder(new AnalysisInitialTimeOpBuilder(analysis_manager));
138  builder_manager.addBuilder(new AnalysisFinalTimeOpBuilder(analysis_manager));
139 }
140 
141 } // namespace Analysis
142 } // namespace Xyce
Pure virtual class to augment a linear system.
virtual void registerCreateFunctions(Util::Op::BuilderManager &builder_manager) const
virtual void registerCreateFunctions(Util::Op::BuilderManager &builder_manager) const
AnalysisInitialTimeOpBuilder(const AnalysisManager &analysis_manager)
virtual Util::Op::Operator * makeOp(Util::ParamList::const_iterator &it) const
AnalysisFinalTimeOpBuilder(const AnalysisManager &analysis_manager)
void registerOpBuilders(Util::Op::BuilderManager &builder_manager, Parallel::Machine comm, AnalysisManager &analysis_manager)
virtual Util::Op::Operator * makeOp(Util::ParamList::const_iterator &it) const