Xyce  6.1
N_NLS_NOX_Group.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_NLS_NOX_Group.C,v $
27 //
28 // Purpose : Interface to Xyce vectors for NOX.
29 //
30 // Special Notes :
31 //
32 // Creator : Tammy Kolda, NLS, 8950
33 //
34 // Creation Date : 01/31/02
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.37 $
40 //
41 // Revision Date : $Date: 2015/08/03 21:12:39 $
42 //
43 // Current Owner : $Author: erkeite $
44 //-------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 
49 // ---------- Standard Includes ----------
50 
51 // ---------- Xyce Includes ----------
52 
53 #include <N_NLS_NOX_Group.h>
54 #include <N_NLS_NOX.h>
55 #include <N_NLS_NOX_Vector.h>
56 #include <N_NLS_NOX_SharedSystem.h>
57 #include <N_LAS_Vector.h>
58 #include <N_ERH_ErrorMgr.h>
59 
60 // ---------- NOX Includes ----------
61 #include <NOX_Abstract_Vector.H>
62 
63 namespace Xyce {
64 namespace Nonlinear {
65 namespace N_NLS_NOX {
66 
67 //-----------------------------------------------------------------------------
68 // Function : N_NLS_LOCA::Group::Group
69 // Purpose :
70 // Special Notes :
71 // Scope : public
72 // Creator :
73 // Creation Date :
74 //-----------------------------------------------------------------------------
76  sharedSystemPtr_(&s),
77  xVecPtr_(Teuchos::rcp(dynamic_cast<Vector*>(s.cloneSolutionVector()))),
78  xVec_(*xVecPtr_),
79  fVecPtr_(Teuchos::rcp_dynamic_cast<Vector>(xVec_.clone(NOX::ShapeCopy))),
80  fVec_(*fVecPtr_),
81  normF_(0.0),
82  haveSolverFactors_(false),
83  linearStatus_(true)
84 {
85  resetIsValid_();
86 }
87 
88 //-----------------------------------------------------------------------------
89 // Function : N_NLS_LOCA::Group::Group
90 // Purpose :
91 // Special Notes :
92 // Scope : public
93 // Creator :
94 // Creation Date :
95 //-----------------------------------------------------------------------------
96 Group::Group(const Group& source, NOX::CopyType type) :
97  sharedSystemPtr_(source.sharedSystemPtr_),
98  xVecPtr_(Teuchos::rcp_dynamic_cast<Vector>(source.getX().clone(type))),
99  xVec_(*xVecPtr_),
100  fVecPtr_(Teuchos::rcp_dynamic_cast<Vector>(xVec_.clone(NOX::ShapeCopy))),
101  fVec_(*fVecPtr_),
102  normF_(0.0),
103  haveSolverFactors_(false),
104  linearStatus_(true)
105 {
106  // Default the is valid flags to "false"
107  resetIsValid_();
108 
109  switch(type)
110  {
111  case NOX::DeepCopy:
112 
113  // Copy F
114  if (source.isF()) {
115  isValidF_ = true;
116  fVec_ = source.fVec_;
117  normF_ = source.normF_;
118  if (sharedSystemPtr_->areStateVectors(&source))
120  }
121 
122  // Take ownership of the Jacobian.
123  if (source.isJacobian()) {
124  //isValidJacobian_ = false;
125  isValidJacobian_ = true;
128  }
129 
130  // Copy Gradient Vector
131  if (source.isGradient()) {
132 
133  if (Teuchos::is_null(gradVecPtr_)) {
134  gradVecPtr_ = Teuchos::rcp_dynamic_cast<Vector>
135  (source.gradVecPtr_->clone(NOX::DeepCopy));
136  }
137  else
138  *gradVecPtr_ = *(source.gradVecPtr_);
139 
140  isValidGradient_ = true;
141  }
142 
143  // Copy Newton Vector
144  if (source.isNewton()) {
145 
146  if (Teuchos::is_null(newtonVecPtr_)) {
147  newtonVecPtr_ = Teuchos::rcp_dynamic_cast<Vector>
148  (source.newtonVecPtr_->clone(NOX::DeepCopy));
149  }
150  else
151  *newtonVecPtr_ = *(source.newtonVecPtr_);
152 
153  isValidNewton_ = true;
154  }
155 
156  break;
157 
158  case NOX::ShapeCopy:
159  resetIsValid_();
160  break;
161 
162  default:
163  const std::string message = "N_NLS::NOX::Group::Group() - Invalid ConstructorType for group copy constructor";
164  N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL, message);
165  }
166 }
167 
168 //-----------------------------------------------------------------------------
169 // Function : N_NLS_LOCA::Group::~Group
170 // Purpose :
171 // Special Notes :
172 // Scope : public
173 // Creator :
174 // Creation Date :
175 //-----------------------------------------------------------------------------
177 {
178 }
179 
180 //-----------------------------------------------------------------------------
181 // Function : N_NLS_LOCA::Group::operator=
182 // Purpose :
183 // Special Notes :
184 // Scope : public
185 // Creator :
186 // Creation Date :
187 //-----------------------------------------------------------------------------
188 NOX::Abstract::Group& Group::operator=(const NOX::Abstract::Group& source)
189 {
190  return operator=(dynamic_cast<const Group&>(source));
191 }
192 
193 //-----------------------------------------------------------------------------
194 // Function : N_NLS_LOCA::Group::operator=
195 // Purpose :
196 // Special Notes :
197 // Scope : public
198 // Creator :
199 // Creation Date :
200 //-----------------------------------------------------------------------------
201 NOX::Abstract::Group& Group::operator=(const Group& source)
202 {
203  linearStatus_ = source.linearStatus_;
204 
205  resetIsValid_();
206 
207  // Copy solution vector
208  xVec_ = source.xVec_;
209 
210  // Copy residual vector and take ownership of state vectors
211  if (source.isF()) {
212  isValidF_ = true;
213  fVec_ = source.fVec_;
214  normF_ = source.normF_;
215  if (source.sharedSystemPtr_->areStateVectors(&source))
217  }
218 
219  // Copy the Jacobian by taking ownership of the shared system
220  if (source.isJacobian()) {
221  isValidJacobian_ = true;
224  }
225 
226  // Copy Gradient Vector
227  if ( source.isGradient() ) {
228 
229  if (Teuchos::is_null(gradVecPtr_)) {
230  gradVecPtr_ = Teuchos::rcp_dynamic_cast<Vector>
231  (source.gradVecPtr_->clone(NOX::DeepCopy));
232  }
233  else
234  *gradVecPtr_ = *(source.gradVecPtr_);
235 
236  isValidGradient_ = true;
237  }
238 
239  // Copy Newton Vector
240  if (source.isNewton()) {
241  if (Teuchos::is_null(newtonVecPtr_)) {
242  newtonVecPtr_ = Teuchos::rcp_dynamic_cast<Vector>
243  (source.newtonVecPtr_->clone(NOX::DeepCopy));
244  }
245  else
246  *newtonVecPtr_ = *(source.newtonVecPtr_);
247 
248  isValidNewton_ = true;
249  }
250 
251  return *this;
252 }
253 
254 //-----------------------------------------------------------------------------
255 // Function : N_NLS_LOCA::Group::setX
256 // Purpose :
257 // Special Notes :
258 // Scope : public
259 // Creator :
260 // Creation Date :
261 //-----------------------------------------------------------------------------
262 void Group::setX(const NOX::Abstract::Vector& input)
263 {
264  setX(dynamic_cast<const Vector&>(input));
265 }
266 
267 //-----------------------------------------------------------------------------
268 // Function : N_NLS_LOCA::Group::setX
269 // Purpose :
270 // Special Notes :
271 // Scope : public
272 // Creator :
273 // Creation Date :
274 //-----------------------------------------------------------------------------
275 void Group::setX(const Vector& input)
276 {
277  linearStatus_ = true;
278  resetIsValid_();
279  xVec_ = input;
280 }
281 
282 
283 //-----------------------------------------------------------------------------
284 // Function : N_NLS_LOCA::Group::computeX
285 // Purpose :
286 // Special Notes :
287 // Scope : public
288 // Creator :
289 // Creation Date :
290 //-----------------------------------------------------------------------------
291 void Group::computeX(const NOX::Abstract::Group& grp,
292  const NOX::Abstract::Vector& d,
293  double step)
294 {
295  computeX(dynamic_cast<const Group&>(grp), dynamic_cast<const Vector&>(d),
296  step);
297 }
298 
299 //-----------------------------------------------------------------------------
300 // Function : N_NLS_LOCA::Group::computeX
301 // Purpose :
302 // Special Notes :
303 // Scope : public
304 // Creator :
305 // Creation Date :
306 //-----------------------------------------------------------------------------
307 void Group::computeX(const Group& grp, const Vector& d, double step)
308 {
309  resetIsValid_();
310  xVec_.update(step, d, 1.0, grp.getX(), 0.0);
311 }
312 
313 //-----------------------------------------------------------------------------
314 // Function : N_NLS_LOCA::Group::computeF
315 // Purpose :
316 // Special Notes :
317 // Scope : public
318 // Creator :
319 // Creation Date :
320 //-----------------------------------------------------------------------------
321 NOX::Abstract::Group::ReturnType Group::computeF()
322 {
323  if( isF() ) return Ok;
324 
326 
327  // Xyce computes "-f" for efficiency of Newton solve:
328  // "Js = f" instead of "Js = -f" We need the real F!
329  fVec_.scale(-1.0);
330 
331  normF_ = fVec_.norm();
332 
333  return (isF()?Ok:Failed);
334 }
335 
336 //-----------------------------------------------------------------------------
337 // Function : N_NLS_LOCA::Group::computeJacobian
338 // Purpose :
339 // Special Notes :
340 // Scope : public
341 // Creator :
342 // Creation Date :
343 //-----------------------------------------------------------------------------
344 NOX::Abstract::Group::ReturnType Group::computeJacobian()
345 {
346  if (isJacobian()) return Ok;
347 
349 
350  haveSolverFactors_ = false;
351 
352  return (isJacobian()?Ok:Failed);
353 }
354 
355 //-----------------------------------------------------------------------------
356 // Function : N_NLS_LOCA::Group::computeGradient
357 // Purpose :
358 // Special Notes :
359 // Scope : public
360 // Creator :
361 // Creation Date :
362 //-----------------------------------------------------------------------------
363 NOX::Abstract::Group::ReturnType Group::computeGradient()
364 {
365  if (isGradient()) return Ok;
366 
367  if (!isF())
368  throwError("computeGradient", "F is not Valid!");
369 
370  if (!isJacobian())
371  throwError("computeGradient", "Jacobian is not Valid!");
372 
373  if (Teuchos::is_null(gradVecPtr_))
374  gradVecPtr_ = Teuchos::rcp_dynamic_cast<Vector>
375  (fVec_.clone(NOX::ShapeCopy));
376 
377  NOX::Abstract::Group::ReturnType status =
379 
380  //isValidGradient_ = sharedSystemPtr_->computeGradient(fVec_, *gradVecPtr_);
381  if (status == Ok)
382  isValidGradient_ = true;
383  else
384  isValidGradient_ = false;
385 
386  return (isGradient()?Ok:Failed);
387 }
388 
389 //-----------------------------------------------------------------------------
390 // Function : N_NLS_LOCA::Group::computeNewton
391 // Purpose :
392 // Special Notes :
393 // Scope : public
394 // Creator :
395 // Creation Date :
396 //-----------------------------------------------------------------------------
397 NOX::Abstract::Group::ReturnType Group::computeNewton(Teuchos::ParameterList& params)
398 {
399  if (isNewton()) return Ok;
400 
401  if (!isF())
402  throwError("computeNewton", "F is not Valid!");
403 
404  if (!isJacobian())
405  throwError("computeNewton", "Jacobian is not Valid!");
406 
407  if (Teuchos::is_null(newtonVecPtr_))
408  newtonVecPtr_ = Teuchos::rcp_dynamic_cast<Vector>
409  (fVec_.clone(NOX::ShapeCopy));
410 
412 
413  isValidNewton_ = true;
414 
415  haveSolverFactors_ = true;
416 
417  newtonVecPtr_->scale(-1.0);
418 
419  return (isNewton()?Ok:Failed);
420 }
421 
422 //-----------------------------------------------------------------------------
423 // Function : N_NLS_LOCA::Group::applyJacobian
424 // Purpose :
425 // Special Notes :
426 // Scope : public
427 // Creator :
428 // Creation Date :
429 //-----------------------------------------------------------------------------
430 NOX::Abstract::Group::ReturnType Group::applyJacobian(const NOX::Abstract::Vector& input, NOX::Abstract::Vector& result) const
431 {
432  return applyJacobian(dynamic_cast<const Vector&>(input), dynamic_cast<Vector&>(result));
433 }
434 
435 //-----------------------------------------------------------------------------
436 // Function : N_NLS_LOCA::Group::applyJacobian
437 // Purpose :
438 // Special Notes :
439 // Scope : public
440 // Creator :
441 // Creation Date :
442 //-----------------------------------------------------------------------------
443 NOX::Abstract::Group::ReturnType Group::applyJacobian(const Vector& input, Vector& result) const
444 {
445  if (!isJacobian()) {
446  throwError("applyJacobian", "Jacobian is not Valid!");
447 
448  //RPP Hack to get Homotopy working!!
449  //cout << "RPP: Inefficient Jacobian computation!!" << endl;
450  //(const_cast<Group*>(this))->computeF();
451  //(const_cast<Group*>(this))->computeJacobian();
452  }
453 
454  return (sharedSystemPtr_->applyJacobian(input, result)?Ok:Failed);
455 }
456 
457 //-----------------------------------------------------------------------------
458 // Function : N_NLS_LOCA::Group::applyJacobianTranspose
459 // Purpose :
460 // Special Notes :
461 // Scope : public
462 // Creator :
463 // Creation Date :
464 //-----------------------------------------------------------------------------
465 NOX::Abstract::Group::ReturnType Group::applyJacobianTranspose(const NOX::Abstract::Vector& input,
466  NOX::Abstract::Vector& result) const
467 {
468  return applyJacobianTranspose(dynamic_cast<const Vector&>(input),
469  dynamic_cast<Vector&>(result));
470 }
471 
472 //-----------------------------------------------------------------------------
473 // Function : N_NLS_LOCA::Group::applyJacobianTranspose
474 // Purpose :
475 // Special Notes :
476 // Scope : public
477 // Creator :
478 // Creation Date :
479 //-----------------------------------------------------------------------------
480 NOX::Abstract::Group::ReturnType Group::applyJacobianTranspose(const Vector& input, Vector& result) const
481 {
482  if (!isJacobian())
483  throwError("applyJacobianTranspose", "Jacobian is not Valid!");
484 
485  return (sharedSystemPtr_->applyJacobianTranspose(input, result)?Ok:Failed);
486 }
487 
488 //-----------------------------------------------------------------------------
489 // Function : N_NLS_LOCA::Group::applyJacobianInverse
490 // Purpose :
491 // Special Notes :
492 // Scope : public
493 // Creator :
494 // Creation Date :
495 //-----------------------------------------------------------------------------
496 NOX::Abstract::Group::ReturnType
497 Group::applyJacobianInverse(Teuchos::ParameterList& params,
498  const NOX::Abstract::Vector& input,
499  NOX::Abstract::Vector& result) const
500 {
501  return applyJacobianInverse(params, dynamic_cast<const Vector&>(input),
502  dynamic_cast<Vector&>(result));
503 }
504 
505 //-----------------------------------------------------------------------------
506 // Function : N_NLS_LOCA::Group::applyJacobianInverse
507 // Purpose :
508 // Special Notes :
509 // Scope : public
510 // Creator :
511 // Creation Date :
512 //-----------------------------------------------------------------------------
513 NOX::Abstract::Group::ReturnType
514 Group::applyJacobianInverse(Teuchos::ParameterList& params,
515  const Vector& input, Vector& result) const
516 {
517  if (!isJacobian())
518  throwError("applyJacobianInverse", "Jacobian is not Valid!");
519 
520  //bool status = sharedSystemPtr_->computeNewton(input, result, params);
521  bool status = true;
522 
523  // can't do this, because "const". Arrgh.
524  linearStatus_ = sharedSystemPtr_->computeNewton(input, result, params);
525 
526  haveSolverFactors_ = true;
527 
528  return (status ? Ok : Failed);
529 }
530 
531 //-----------------------------------------------------------------------------
532 // Function : N_NLS_LOCA::Group::applyRightPreconditioning
533 // Purpose :
534 // Special Notes :
535 // Scope : public
536 // Creator :
537 // Creation Date :
538 //-----------------------------------------------------------------------------
539 NOX::Abstract::Group::ReturnType
541  Teuchos::ParameterList& params,
542  const NOX::Abstract::Vector& input,
543  NOX::Abstract::Vector& result) const
544 {
545  return applyRightPreconditioning(useTranspose, params,
546  dynamic_cast<const Vector&>(input),
547  dynamic_cast<Vector&> (result));
548 }
549 
550 //-----------------------------------------------------------------------------
551 // Function : N_NLS_LOCA::Group::applyRightPreconditioning
552 // Purpose :
553 // Special Notes :
554 // Scope : public
555 // Creator :
556 // Creation Date :
557 //-----------------------------------------------------------------------------
558 NOX::Abstract::Group::ReturnType
560  Teuchos::ParameterList& params,
561  const Vector& input,
562  Vector& result) const
563 {
564  if (!isJacobian()) {
565  // throw error - Jacobian is not owned by this group
566  }
567 
568  if (!isValidPreconditioner_) {
570  isValidPreconditioner_ = true;
571  }
572  sharedSystemPtr_->applyRightPreconditioning(useTranspose, params,
573  input, result);
574 
575  return NOX::Abstract::Group::Ok;
576 }
577 
578 //-----------------------------------------------------------------------------
579 // Function : N_NLS_LOCA::Group::isF
580 // Purpose :
581 // Special Notes :
582 // Scope : public
583 // Creator :
584 // Creation Date :
585 //-----------------------------------------------------------------------------
586 bool Group::isF() const
587 {
588  return isValidF_;
589 }
590 
591 //-----------------------------------------------------------------------------
592 // Function : N_NLS_LOCA::Group::isJacobian
593 // Purpose :
594 // Special Notes :
595 // Scope : public
596 // Creator :
597 // Creation Date :
598 //-----------------------------------------------------------------------------
599 bool Group::isJacobian() const
600 {
602 }
603 
604 //-----------------------------------------------------------------------------
605 // Function : N_NLS_LOCA::Group::isGradient
606 // Purpose :
607 // Special Notes :
608 // Scope : public
609 // Creator :
610 // Creation Date :
611 //-----------------------------------------------------------------------------
612 bool Group::isGradient() const
613 {
614  return isValidGradient_;
615 }
616 
617 //-----------------------------------------------------------------------------
618 // Function : N_NLS_LOCA::Group::isNewton
619 // Purpose :
620 // Special Notes :
621 // Scope : public
622 // Creator :
623 // Creation Date :
624 //-----------------------------------------------------------------------------
625 bool Group::isNewton() const
626 {
627  return isValidNewton_;
628 }
629 
630 //-----------------------------------------------------------------------------
631 // Function : N_NLS_LOCA::Group::linearSolverStatus
632 // Purpose :
633 // Special Notes :
634 // Scope : public
635 // Creator :
636 // Creation Date :
637 //-----------------------------------------------------------------------------
639 {
640  return linearStatus_;
641 }
642 
643 //-----------------------------------------------------------------------------
644 // Function : N_NLS_LOCA::Group::getX
645 // Purpose :
646 // Special Notes :
647 // Scope : public
648 // Creator :
649 // Creation Date :
650 //-----------------------------------------------------------------------------
651 const NOX::Abstract::Vector& Group::getX() const
652 {
653  return xVec_;
654 }
655 
656 //-----------------------------------------------------------------------------
657 // Function : N_NLS_LOCA::Group::getF
658 // Purpose :
659 // Special Notes :
660 // Scope : public
661 // Creator :
662 // Creation Date :
663 //-----------------------------------------------------------------------------
664 const NOX::Abstract::Vector& Group::getF() const
665 {
666  if (!isF()) {
667  throwError("getF",
668  "F is not current with respect to the solution vector!");
669  }
670 
671  return fVec_;
672 }
673 
674 //-----------------------------------------------------------------------------
675 // Function : N_NLS_LOCA::Group::getNormF
676 // Purpose :
677 // Special Notes :
678 // Scope : public
679 // Creator :
680 // Creation Date :
681 //-----------------------------------------------------------------------------
682 double Group::getNormF() const
683 {
684  if (!isF()) {
685  //cout << "Group::getNormF() - F is not current "
686  // << "with respect to the solution vector!" << endl;
687  //throw "NOX Error";
688  (const_cast<Group*>(this))->computeF();
689  }
690 
691  return normF_;
692 }
693 
694 //-----------------------------------------------------------------------------
695 // Function : N_NLS_LOCA::Group::getGradient
696 // Purpose :
697 // Special Notes :
698 // Scope : public
699 // Creator :
700 // Creation Date :
701 //-----------------------------------------------------------------------------
702 const NOX::Abstract::Vector& Group::getGradient() const
703 {
704  if (Teuchos::is_null(gradVecPtr_))
705  throwError("getGradient", "gradVecPtr_ is 0!");
706 
707  return *gradVecPtr_;
708 }
709 
710 //-----------------------------------------------------------------------------
711 // Function : N_NLS_LOCA::Group::getNewton
712 // Purpose :
713 // Special Notes :
714 // Scope : public
715 // Creator :
716 // Creation Date :
717 //-----------------------------------------------------------------------------
718 const NOX::Abstract::Vector& Group::getNewton() const
719 {
720  if (Teuchos::is_null(newtonVecPtr_))
721  {
722  throwError("getNewton", "newtonVecPtr_ is 0!");
723  }
724  return *newtonVecPtr_;
725 }
726 
727 //-----------------------------------------------------------------------------
728 // Function : N_NLS_LOCA::Group::clone
729 // Purpose :
730 // Special Notes :
731 // Scope : public
732 // Creator :
733 // Creation Date :
734 //-----------------------------------------------------------------------------
735 Teuchos::RCP<NOX::Abstract::Group>
736 Group::clone(NOX::CopyType type) const
737 {
738  Teuchos::RCP<Group> ptr = Teuchos::rcp(new Group(*this, type));
739  return ptr;
740 }
741 
742 //-----------------------------------------------------------------------------
743 // Function : N_NLS_LOCA::Group::resetIsValid
744 // Purpose :
745 // Special Notes :
746 // Scope : public
747 // Creator :
748 // Creation Date :
749 //-----------------------------------------------------------------------------
750 // resets the isValid flags to false
752 {
753  isValidF_ = false;
754  isValidGradient_ = false;
755  isValidJacobian_ = false;
756  isValidNewton_ = false;
757  isValidPreconditioner_ = false;
758 }
759 
760 //-----------------------------------------------------------------------------
761 // Function : N_NLS_LOCA::Group::throwError
762 // Purpose :
763 // Special Notes :
764 // Scope : public
765 // Creator :
766 // Creation Date :
767 //-----------------------------------------------------------------------------
768 void Group::throwError(std::string method, std::string message) const
769 {
770  const std::string leader = "N_NLS::NOX::Group::";
771  const std::string fcn = "() - ";
772 
773  std::string error = leader + method + fcn + message;
774 
775  N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL, error);
776 }
777 
778 }}} // namespace N_NLS_NOX
const NOX::Abstract::Vector & getGradient() const
Teuchos::RCP< NOX::Abstract::Vector > clone(NOX::CopyType type=NOX::DeepCopy) const
bool areStateVectors(const Group *grp) const
void setX(const Vector &input)
bool applyJacobian(const Vector &input, Vector &result) const
const NOX::Abstract::Vector & getX() const
bool computeNewton(const Vector &F, Vector &Newton, Teuchos::ParameterList &params)
Pure virtual class to augment a linear system.
bool applyJacobianTranspose(const Vector &input, Vector &result) const
Teuchos::RCP< Vector > newtonVecPtr_
NOX::Abstract::Group::ReturnType computeF()
void computeX(const Group &grp, const Vector &d, double step)
NOX::Abstract::Group::ReturnType applyJacobianInverse(Teuchos::ParameterList &params, const Vector &input, Vector &result) const
NOX::Abstract::Vector & scale(double gamma)
NOX::Abstract::Group::ReturnType computeGradient()
bool applyRightPreconditioning(bool useTranspose, Teuchos::ParameterList &params, const Vector &input, Vector &result)
const NOX::Abstract::Vector & getF() const
NOX::Abstract::Group::ReturnType computeJacobian()
NOX::Abstract::Group::ReturnType computeNewton(Teuchos::ParameterList &params)
NOX::Abstract::Group::ReturnType applyRightPreconditioning(bool useTranspose, Teuchos::ParameterList &params, const Vector &input, Vector &result) const
NOX::Abstract::Group & operator=(const Group &source)
NOX::Abstract::Vector & update(double alpha, const Vector &a, double gamma=0.0)
Teuchos::RCP< Vector > gradVecPtr_
const Xyce::Linear::Matrix & getJacobian() const
double norm(NOX::Abstract::Vector::NormType type=NOX::Abstract::Vector::TwoNorm) const
NOX::Abstract::Group::ReturnType applyJacobian(const Vector &input, Vector &result) const
void error(const std::string &msg)
Definition: N_NLS_NOX.C:61
void throwError(std::string method, std::string message) const
bool isJacobianOwner(const Group *grp) const
bool computeF(const Vector &solution, Vector &F, const Group *grp)
Teuchos::RCP< NOX::Abstract::Group > clone(NOX::CopyType type=NOX::DeepCopy) const
const NOX::Abstract::Vector & getNewton() const
NOX::Abstract::Group::ReturnType applyJacobianTranspose(const Vector &input, Vector &result) const
Definition: N_NLS_fwd.h:108