00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "LOCA_Hopf_MinimallyAugmented_Constraint.H"
00043 #include "LOCA_Hopf_MinimallyAugmented_AbstractGroup.H"
00044 #include "LOCA_BorderedSolver_AbstractStrategy.H"
00045 #include "LOCA_Parameter_SublistParser.H"
00046 #include "LOCA_GlobalData.H"
00047 #include "LOCA_ErrorCheck.H"
00048 #include "LOCA_Factory.H"
00049 #include "NOX_Utils.H"
00050 #include "Teuchos_ParameterList.hpp"
00051 #include "LOCA_Hopf_ComplexMultiVector.H"
00052 #include "LOCA_BorderedSolver_ComplexOperator.H"
00053
00054 LOCA::Hopf::MinimallyAugmented::Constraint::
00055 Constraint(
00056 const Teuchos::RCP<LOCA::GlobalData>& global_data,
00057 const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
00058 const Teuchos::RCP<Teuchos::ParameterList>& hpfParams,
00059 const Teuchos::RCP<LOCA::Hopf::MinimallyAugmented::AbstractGroup>& g,
00060 bool is_symmetric,
00061 const NOX::Abstract::Vector& a_real,
00062 const NOX::Abstract::Vector& a_imag,
00063 const NOX::Abstract::Vector* b_real,
00064 const NOX::Abstract::Vector* b_imag,
00065 int bif_param,
00066 double freq) :
00067 globalData(global_data),
00068 parsedParams(topParams),
00069 hopfParams(hpfParams),
00070 grpPtr(g),
00071 a_vector(a_real.createMultiVector(2, NOX::ShapeCopy)),
00072 b_vector(),
00073 w_vector(a_real.createMultiVector(2, NOX::ShapeCopy)),
00074 v_vector(a_real.createMultiVector(2, NOX::ShapeCopy)),
00075 Cv_vector(a_real.createMultiVector(2, NOX::ShapeCopy)),
00076 sigma_x(a_real.createMultiVector(2, NOX::ShapeCopy)),
00077 constraints(2, 1),
00078 borderedSolver(),
00079 dn(static_cast<double>(a_vector->length())),
00080 sigma_scale(1.0),
00081 isSymmetric(is_symmetric),
00082 isValidConstraints(false),
00083 isValidDX(false),
00084 bifParamID(1),
00085 omega(freq),
00086 updateVectorsEveryContinuationStep(true),
00087 updateVectorsEveryIteration(false)
00088 {
00089
00090 borderedSolver =
00091 globalData->locaFactory->createBorderedSolverStrategy(parsedParams,
00092 hopfParams);
00093
00094 (*a_vector)[0] = a_real;
00095 (*a_vector)[1] = a_imag;
00096 if (!isSymmetric) {
00097 b_vector = b_real->createMultiVector(2, NOX::ShapeCopy);
00098 (*b_vector)[0] = *b_real;
00099 (*b_vector)[1] = *b_imag;
00100 }
00101 else {
00102 b_vector = a_vector->clone(NOX::DeepCopy);
00103 }
00104
00105
00106 updateVectorsEveryContinuationStep =
00107 hopfParams->get("Update Null Vectors Every Continuation Step",
00108 true);
00109 updateVectorsEveryIteration =
00110 hopfParams->get("Update Null Vectors Every Nonlinear Iteration",
00111 false);
00112 }
00113
00114 LOCA::Hopf::MinimallyAugmented::Constraint::
00115 Constraint(const LOCA::Hopf::MinimallyAugmented::Constraint& source,
00116 NOX::CopyType type) :
00117 globalData(source.globalData),
00118 parsedParams(source.parsedParams),
00119 hopfParams(source.hopfParams),
00120 grpPtr(Teuchos::null),
00121 a_vector(source.a_vector->clone(type)),
00122 b_vector(source.b_vector->clone(type)),
00123 w_vector(source.w_vector->clone(type)),
00124 v_vector(source.v_vector->clone(type)),
00125 Cv_vector(source.Cv_vector->clone(type)),
00126 sigma_x(source.sigma_x->clone(type)),
00127 constraints(source.constraints),
00128 borderedSolver(),
00129 dn(source.dn),
00130 sigma_scale(source.sigma_scale),
00131 isSymmetric(source.isSymmetric),
00132 isValidConstraints(false),
00133 isValidDX(false),
00134 bifParamID(source.bifParamID),
00135 omega(source.omega),
00136 updateVectorsEveryContinuationStep(source.updateVectorsEveryContinuationStep),
00137 updateVectorsEveryIteration(source.updateVectorsEveryIteration)
00138 {
00139 if (source.isValidConstraints && type == NOX::DeepCopy)
00140 isValidConstraints = true;
00141 if (source.isValidDX && type == NOX::DeepCopy)
00142 isValidDX = true;
00143
00144
00145 borderedSolver =
00146 globalData->locaFactory->createBorderedSolverStrategy(parsedParams,
00147 hopfParams);
00148
00149
00150
00151 }
00152
00153 LOCA::Hopf::MinimallyAugmented::Constraint::
00154 ~Constraint()
00155 {
00156 }
00157
00158 void
00159 LOCA::Hopf::MinimallyAugmented::Constraint::
00160 setGroup(const Teuchos::RCP<LOCA::Hopf::MinimallyAugmented::AbstractGroup>& g)
00161 {
00162 grpPtr = g;
00163 }
00164
00165 void
00166 LOCA::Hopf::MinimallyAugmented::Constraint::
00167 setFrequency(double freq)
00168 {
00169 omega = freq;
00170 isValidConstraints = false;
00171 isValidDX = false;
00172 }
00173
00174 Teuchos::RCP<const NOX::Abstract::Vector>
00175 LOCA::Hopf::MinimallyAugmented::Constraint::
00176 getLeftNullVecReal() const
00177 {
00178 return Teuchos::rcp(&(*w_vector)[0], false);
00179 }
00180
00181 Teuchos::RCP<const NOX::Abstract::Vector>
00182 LOCA::Hopf::MinimallyAugmented::Constraint::
00183 getLeftNullVecImag() const
00184 {
00185 return Teuchos::rcp(&(*w_vector)[1], false);
00186 }
00187
00188 Teuchos::RCP<const NOX::Abstract::Vector>
00189 LOCA::Hopf::MinimallyAugmented::Constraint::
00190 getRightNullVecReal() const
00191 {
00192 return Teuchos::rcp(&(*v_vector)[0], false);
00193 }
00194
00195 Teuchos::RCP<const NOX::Abstract::Vector>
00196 LOCA::Hopf::MinimallyAugmented::Constraint::
00197 getRightNullVecImag() const
00198 {
00199 return Teuchos::rcp(&(*v_vector)[1], false);
00200 }
00201
00202 double
00203 LOCA::Hopf::MinimallyAugmented::Constraint::
00204 getSigmaReal() const
00205 {
00206 return constraints(0,0);
00207 }
00208
00209 double
00210 LOCA::Hopf::MinimallyAugmented::Constraint::
00211 getSigmaImag() const
00212 {
00213 return constraints(1,0);
00214 }
00215
00216 void
00217 LOCA::Hopf::MinimallyAugmented::Constraint::
00218 copy(const LOCA::MultiContinuation::ConstraintInterface& src)
00219 {
00220 const LOCA::Hopf::MinimallyAugmented::Constraint& source =
00221 dynamic_cast<const LOCA::Hopf::MinimallyAugmented::Constraint&>(src);
00222
00223 if (this != &source) {
00224 globalData = source.globalData;
00225 parsedParams = source.parsedParams;
00226 hopfParams = source.hopfParams;
00227 *a_vector = *(source.a_vector);
00228 *b_vector = *(source.b_vector);
00229 *w_vector = *(source.w_vector);
00230 *v_vector = *(source.v_vector);
00231 *Cv_vector = *(source.Cv_vector);
00232 *sigma_x = *(source.sigma_x);
00233 constraints.assign(source.constraints);
00234 dn = source.dn;
00235 sigma_scale = source.sigma_scale;
00236 isSymmetric = source.isSymmetric;
00237 isValidConstraints = source.isValidConstraints;
00238 isValidDX = source.isValidDX;
00239 bifParamID = source.bifParamID;
00240 omega = source.omega;
00241 updateVectorsEveryContinuationStep =
00242 source.updateVectorsEveryContinuationStep;
00243 updateVectorsEveryIteration =
00244 source.updateVectorsEveryIteration;
00245
00246
00247 borderedSolver =
00248 globalData->locaFactory->createBorderedSolverStrategy(parsedParams,
00249 hopfParams);
00250
00251
00252
00253 }
00254 }
00255
00256 Teuchos::RCP<LOCA::MultiContinuation::ConstraintInterface>
00257 LOCA::Hopf::MinimallyAugmented::Constraint::
00258 clone(NOX::CopyType type) const
00259 {
00260 return Teuchos::rcp(new Constraint(*this, type));
00261 }
00262
00263 int
00264 LOCA::Hopf::MinimallyAugmented::Constraint::
00265 numConstraints() const
00266 {
00267 return 2;
00268 }
00269
00270 void
00271 LOCA::Hopf::MinimallyAugmented::Constraint::
00272 setX(const NOX::Abstract::Vector& y)
00273 {
00274 grpPtr->setX(y);
00275 isValidConstraints = false;
00276 isValidDX = false;
00277 }
00278
00279 void
00280 LOCA::Hopf::MinimallyAugmented::Constraint::
00281 setParam(int paramID, double val)
00282 {
00283 grpPtr->setParam(paramID, val);
00284 isValidConstraints = false;
00285 isValidDX = false;
00286 }
00287
00288 void
00289 LOCA::Hopf::MinimallyAugmented::Constraint::
00290 setParams(const vector<int>& paramIDs,
00291 const NOX::Abstract::MultiVector::DenseMatrix& vals)
00292 {
00293 grpPtr->setParamsMulti(paramIDs, vals);
00294 isValidConstraints = false;
00295 isValidDX = false;
00296 }
00297
00298 NOX::Abstract::Group::ReturnType
00299 LOCA::Hopf::MinimallyAugmented::Constraint::
00300 computeConstraints()
00301 {
00302 if (isValidConstraints)
00303 return NOX::Abstract::Group::Ok;
00304
00305 string callingFunction =
00306 "LOCA::Hopf::MinimallyAugmented::Constraint::computeConstraints()";
00307 NOX::Abstract::Group::ReturnType status;
00308 NOX::Abstract::Group::ReturnType finalStatus = NOX::Abstract::Group::Ok;
00309
00310
00311 status = grpPtr->computeComplex(omega);
00312 finalStatus =
00313 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00314 finalStatus,
00315 callingFunction);
00316
00317
00318 Teuchos::RCP<LOCA::Hopf::ComplexMultiVector> A =
00319 Teuchos::rcp(new LOCA::Hopf::ComplexMultiVector(globalData,
00320 (*a_vector)[0], 2));
00321 (*(A->getRealMultiVec()))[0] = (*a_vector)[0];
00322 (*(A->getImagMultiVec()))[0] = (*a_vector)[1];
00323 (*(A->getRealMultiVec()))[1] = (*a_vector)[1];
00324 (*(A->getImagMultiVec()))[1] = (*a_vector)[0];
00325 (*(A->getRealMultiVec()))[1].scale(-1.0);
00326
00327 Teuchos::RCP<LOCA::Hopf::ComplexMultiVector> B =
00328 Teuchos::rcp(new LOCA::Hopf::ComplexMultiVector(globalData,
00329 (*b_vector)[0], 2));
00330 (*(B->getRealMultiVec()))[0] = (*b_vector)[0];
00331 (*(B->getImagMultiVec()))[0] = (*b_vector)[1];
00332 (*(B->getRealMultiVec()))[1] = (*b_vector)[1];
00333 (*(B->getImagMultiVec()))[1] = (*b_vector)[0];
00334 (*(B->getRealMultiVec()))[1].scale(-1.0);
00335
00336
00337 Teuchos::RCP<const LOCA::BorderedSolver::ComplexOperator> op =
00338 Teuchos::rcp(new LOCA::BorderedSolver::ComplexOperator(grpPtr, omega));
00339 borderedSolver->setMatrixBlocksMultiVecConstraint(op, A, B,
00340 Teuchos::null);
00341
00342
00343 NOX::Abstract::MultiVector::DenseMatrix one(2,1);
00344 one(0,0) = dn;
00345 one(1,0) = 0.0;
00346
00347
00348 Teuchos::RCP<Teuchos::ParameterList> linear_solver_params =
00349 parsedParams->getSublist("Linear Solver");
00350
00351
00352 NOX::Abstract::MultiVector::DenseMatrix s1(2,1);
00353 Teuchos::RCP<LOCA::Hopf::ComplexMultiVector> V =
00354 Teuchos::rcp(new LOCA::Hopf::ComplexMultiVector(globalData,
00355 (*v_vector)[0], 1));
00356 (*(V->getRealMultiVec()))[0] = (*v_vector)[0];
00357 (*(V->getImagMultiVec()))[0] = (*v_vector)[1];
00358 status = borderedSolver->initForSolve();
00359 finalStatus =
00360 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00361 finalStatus,
00362 callingFunction);
00363 status = borderedSolver->applyInverse(*linear_solver_params,
00364 NULL,
00365 &one,
00366 *V,
00367 s1);
00368 finalStatus =
00369 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00370 finalStatus,
00371 callingFunction);
00372 (*v_vector)[0] = (*(V->getRealMultiVec()))[0];
00373 (*v_vector)[1] = (*(V->getImagMultiVec()))[0];
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407 NOX::Abstract::MultiVector::DenseMatrix s2(2,1);
00408 Teuchos::RCP<LOCA::Hopf::ComplexMultiVector> W =
00409 Teuchos::rcp(new LOCA::Hopf::ComplexMultiVector(globalData,
00410 (*w_vector)[0], 1));
00411 (*(W->getRealMultiVec()))[0] = (*w_vector)[0];
00412 (*(W->getImagMultiVec()))[0] = (*w_vector)[1];
00413 if (!isSymmetric) {
00414 status = borderedSolver->initForTransposeSolve();
00415 finalStatus =
00416 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00417 finalStatus,
00418 callingFunction);
00419 status = borderedSolver->applyInverseTranspose(*linear_solver_params,
00420 NULL,
00421 &one,
00422 *W,
00423 s2);
00424 finalStatus =
00425 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00426 finalStatus,
00427 callingFunction);
00428
00429 (*w_vector)[0] = (*(W->getRealMultiVec()))[0];
00430 (*w_vector)[1] = (*(W->getImagMultiVec()))[0];
00431
00432 }
00433 else {
00434 *w_vector = *v_vector;
00435 s2.assign(s1);
00436 }
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470 status = grpPtr->applyComplex((*v_vector)[0], (*v_vector)[1],
00471 (*Cv_vector)[0], (*Cv_vector)[1]);
00472 finalStatus =
00473 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00474 finalStatus,
00475 callingFunction);
00476 NOX::Abstract::MultiVector::DenseMatrix tmp(2,2);
00477 Cv_vector->multiply(-1.0, *w_vector, tmp);
00478 constraints(0,0) = tmp(0,0) + tmp(1,1);
00479 constraints(1,0) = tmp(0,1) - tmp(1,0);
00480
00481
00482 sigma_scale = dn;
00483 constraints.scale(1.0/sigma_scale);
00484
00485 if (globalData->locaUtils->isPrintType(NOX::Utils::OuterIteration)) {
00486 globalData->locaUtils->out() <<
00487 "\n\tEstimate for singularity of Complex Jacobian (sigma1) =\n\t\t" <<
00488 globalData->locaUtils->sciformat(s1(0,0));
00489 if (s1(1,0) > 0.0)
00490 globalData->locaUtils->out() << " + i ";
00491 else
00492 globalData->locaUtils->out() << " - i ";
00493 globalData->locaUtils->out() <<
00494 globalData->locaUtils->sciformat(std::fabs(s1(1,0)));
00495 globalData->locaUtils->out() <<
00496 "\n\tEstimate for singularity of Complex Jacobian (sigma2) =\n\t\t" <<
00497 globalData->locaUtils->sciformat(s2(0,0));
00498 if (s2(1,0) > 0.0)
00499 globalData->locaUtils->out() << " + i ";
00500 else
00501 globalData->locaUtils->out() << " - i ";
00502 globalData->locaUtils->out() <<
00503 globalData->locaUtils->sciformat(std::fabs(s2(1,0)));
00504 globalData->locaUtils->out() <<
00505 "\n\tEstimate for singularity of Complex Jacobian (sigma ) =\n\t\t" <<
00506 globalData->locaUtils->sciformat(constraints(0,0));
00507 if (constraints(1,0) > 0.0)
00508 globalData->locaUtils->out() << " + i ";
00509 else
00510 globalData->locaUtils->out() << " - i ";
00511 globalData->locaUtils->out() <<
00512 globalData->locaUtils->sciformat(std::fabs(constraints(1,0))) << std::endl;
00513 }
00514
00515 isValidConstraints = true;
00516
00517
00518 if (updateVectorsEveryIteration) {
00519 if (globalData->locaUtils->isPrintType(NOX::Utils::OuterIteration)) {
00520 globalData->locaUtils->out() <<
00521 "\n\tUpdating null vectors for the next nonlinear iteration" <<
00522 std::endl;
00523 }
00524 *a_vector = *w_vector;
00525 *b_vector = *v_vector;
00526
00527 double a1n = (*a_vector)[0].norm();
00528 double a2n = (*a_vector)[1].norm();
00529 double b1n = (*b_vector)[0].norm();
00530 double b2n = (*b_vector)[1].norm();
00531 a_vector->scale(std::sqrt(dn) / std::sqrt(a1n*a1n + a2n*a2n));
00532 b_vector->scale(std::sqrt(dn) / std::sqrt(b1n*b1n + b2n*b2n));
00533 }
00534
00535 return finalStatus;
00536 }
00537
00538 NOX::Abstract::Group::ReturnType
00539 LOCA::Hopf::MinimallyAugmented::Constraint::
00540 computeDX()
00541 {
00542 if (isValidDX)
00543 return NOX::Abstract::Group::Ok;
00544
00545 string callingFunction =
00546 "LOCA::Hopf::MinimallyAugmented::Constraint::computeDX()";
00547 NOX::Abstract::Group::ReturnType status;
00548 NOX::Abstract::Group::ReturnType finalStatus = NOX::Abstract::Group::Ok;
00549
00550
00551 if (!isValidConstraints) {
00552 status = computeConstraints();
00553 finalStatus =
00554 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00555 finalStatus,
00556 callingFunction);
00557 }
00558
00559
00560 status = grpPtr->computeDwtCeDx((*w_vector)[0], (*w_vector)[1],
00561 (*v_vector)[0], (*v_vector)[1],
00562 omega,
00563 (*sigma_x)[0], (*sigma_x)[1]);
00564 finalStatus =
00565 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00566 finalStatus,
00567 callingFunction);
00568 sigma_x->scale(-1.0/sigma_scale);
00569
00570 isValidDX = true;
00571
00572 return finalStatus;
00573 }
00574
00575 NOX::Abstract::Group::ReturnType
00576 LOCA::Hopf::MinimallyAugmented::Constraint::
00577 computeDP(const vector<int>& paramIDs,
00578 NOX::Abstract::MultiVector::DenseMatrix& dgdp,
00579 bool isValidG)
00580 {
00581 string callingFunction =
00582 "LOCA::Hopf::MinimallyAugmented::Constraint::computeDP()";
00583 NOX::Abstract::Group::ReturnType status;
00584 NOX::Abstract::Group::ReturnType finalStatus = NOX::Abstract::Group::Ok;
00585
00586
00587 if (!isValidConstraints) {
00588 status = computeConstraints();
00589 finalStatus =
00590 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00591 finalStatus,
00592 callingFunction);
00593 }
00594
00595
00596 NOX::Abstract::MultiVector::DenseMatrix dgdp_real(Teuchos::View, dgdp,
00597 1, paramIDs.size()+1,
00598 0, 0);
00599 NOX::Abstract::MultiVector::DenseMatrix dgdp_imag(Teuchos::View, dgdp,
00600 1, paramIDs.size()+1,
00601 1, 0);
00602 status = grpPtr->computeDwtCeDp(paramIDs,
00603 (*w_vector)[0], (*w_vector)[1],
00604 (*v_vector)[0], (*v_vector)[1],
00605 omega,
00606 dgdp_real, dgdp_imag, false);
00607 finalStatus =
00608 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00609 finalStatus,
00610 callingFunction);
00611 dgdp.scale(-1.0/sigma_scale);
00612
00613
00614 dgdp(0,0) = constraints(0,0);
00615 dgdp(1,0) = constraints(1,0);
00616
00617 return finalStatus;
00618 }
00619
00620 bool
00621 LOCA::Hopf::MinimallyAugmented::Constraint::
00622 isConstraints() const
00623 {
00624 return isValidConstraints;
00625 }
00626
00627 bool
00628 LOCA::Hopf::MinimallyAugmented::Constraint::
00629 isDX() const
00630 {
00631 return isValidDX;
00632 }
00633
00634 const NOX::Abstract::MultiVector::DenseMatrix&
00635 LOCA::Hopf::MinimallyAugmented::Constraint::
00636 getConstraints() const
00637 {
00638 return constraints;
00639 }
00640
00641 const NOX::Abstract::MultiVector*
00642 LOCA::Hopf::MinimallyAugmented::Constraint::
00643 getDX() const
00644 {
00645 return sigma_x.get();
00646 }
00647
00648 bool
00649 LOCA::Hopf::MinimallyAugmented::Constraint::
00650 isDXZero() const
00651 {
00652 return false;
00653 }
00654
00655 void
00656 LOCA::Hopf::MinimallyAugmented::Constraint::
00657 postProcessContinuationStep(LOCA::Abstract::Iterator::StepStatus stepStatus)
00658 {
00659 if (stepStatus == LOCA::Abstract::Iterator::Successful &&
00660 updateVectorsEveryContinuationStep) {
00661 if (globalData->locaUtils->isPrintType(NOX::Utils::StepperDetails)) {
00662 globalData->locaUtils->out() <<
00663 "\n\tUpdating null vectors for the next continuation step" << std::endl;
00664 }
00665 *a_vector = *w_vector;
00666 *b_vector = *v_vector;
00667
00668 double a1n = (*a_vector)[0].norm();
00669 double a2n = (*a_vector)[1].norm();
00670 double b1n = (*b_vector)[0].norm();
00671 double b2n = (*b_vector)[1].norm();
00672 a_vector->scale(std::sqrt(dn) / std::sqrt(a1n*a1n + a2n*a2n));
00673 b_vector->scale(std::sqrt(dn) / std::sqrt(b1n*b1n + b2n*b2n));
00674 }
00675 }
00676
00677 NOX::Abstract::Group::ReturnType
00678 LOCA::Hopf::MinimallyAugmented::Constraint::
00679 computeDOmega(NOX::Abstract::MultiVector::DenseMatrix& domega)
00680 {
00681 string callingFunction =
00682 "LOCA::Hopf::MinimallyAugmented::Constraint::computeDOmega()";
00683 NOX::Abstract::Group::ReturnType status;
00684 NOX::Abstract::Group::ReturnType finalStatus = NOX::Abstract::Group::Ok;
00685
00686
00687 if (!isValidConstraints) {
00688 status = computeConstraints();
00689 finalStatus =
00690 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00691 finalStatus,
00692 callingFunction);
00693 }
00694
00695
00696 status = grpPtr->computeShiftedMatrix(0.0, 1.0);
00697 finalStatus =
00698 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00699 finalStatus,
00700 callingFunction);
00701
00702
00703 Teuchos::RCP<NOX::Abstract::MultiVector> tmp_vector =
00704 v_vector->clone(NOX::ShapeCopy);
00705 status = grpPtr->applyShiftedMatrixMultiVector(*v_vector, *tmp_vector);
00706 finalStatus =
00707 globalData->locaErrorCheck->combineAndCheckReturnTypes(status,
00708 finalStatus,
00709 callingFunction);
00710
00711
00712 NOX::Abstract::MultiVector::DenseMatrix tmp_mat(2,2);
00713 tmp_vector->multiply(1.0, *w_vector, tmp_mat);
00714
00715
00716 domega(0,0) = tmp_mat(0,1) - tmp_mat(1,0);
00717 domega(1,0) = -(tmp_mat(0,0) + tmp_mat(1,1));
00718
00719 domega.scale(1.0/sigma_scale);
00720
00721 return finalStatus;
00722 }