// @HEADER // ***************************************************************************** // LOCA: Library of Continuation Algorithms Package // // Copyright 2001-2005 NTESS and the LOCA contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #include "BrusselatorProblemInterface.H" #include "LOCA_Parameter_Vector.H" #include "NOX_LAPACK_Vector.H" #include "NOX_LAPACK_Matrix.H" #include "LOCA_GlobalData.H" #include "NOX_Utils.H" BrusselatorProblemInterface::BrusselatorProblemInterface( const Teuchos::RCP& global_data, int N, double a, double b, double d1, double d2, std::ofstream& file) : globalData(global_data), initialGuess(2*N), alpha(a), beta(b), D1(d1), D2(d2), n(N), outputFile(file) { for (int i=0; i& J, const NOX::LAPACK::Vector & x) { double h = 1.0 / double(n-1); double hh = h*h; J(0,0) = 1.0; for (int i=1; i& A) { bool res = true; if (alpha != 0.0) { res = computeJacobian(A, x); A.scale(alpha); } else A.scale(0.0); if (beta != 0.0) { // Note: the mass matrix terms for the BCs are zero for (int i=1; ilocaUtils->isPrintType(NOX::Utils::StepperDetails)) { globalData->locaUtils->out() << "At parameter value: " << globalData->locaUtils->sciformat(conParam) << " the solution vector is\n"; for (int i=0; i<6; i++) globalData->locaUtils->out() << " " << globalData->locaUtils->sciformat(x(i)); globalData->locaUtils->out() << " ..."; for (int i=n-2; ilocaUtils->out() << " " << globalData->locaUtils->sciformat(x(i)); globalData->locaUtils->out() << std::endl; for (int i=n; ilocaUtils->out() << " " << globalData->locaUtils->sciformat(x(i)); globalData->locaUtils->out() << " ..."; for (int i=2*n-2; i<2*n; i++) globalData->locaUtils->out() << " " << globalData->locaUtils->sciformat(x(i)); globalData->locaUtils->out() << std::endl; } outputFile << conParam << " "; for (int i=0; i<2*n; i++) outputFile << x(i) << " "; outputFile << std::endl << std::endl; }