32 have_probe(false), linObjFactory_(linObjFact)
61 double glbValue = Sacado::scalarValue(value);
64 int locProc = have_probe ? this->getComm()->getRank() : this->getComm()->getSize();
66 Teuchos::reduceAll(*this->getComm(), Teuchos::REDUCE_MIN, Thyra::Ordinal(1), &locProc, &glbProc);
68 TEUCHOS_ASSERT(glbProc < this->getComm()->getSize());
71 Teuchos::broadcast(*this->getComm(), glbProc, Thyra::Ordinal(1), &glbValue);
76#ifdef PANZER_HAVE_EPETRA_STACK
77 if(this->useEpetra()) {
79 this->getEpetraVector()[0] = glbValue;
85 TEUCHOS_ASSERT(this->useThyra());
87 this->getThyraVector()[0] = glbValue;
95 using Teuchos::rcp_dynamic_cast;
97 Teuchos::RCP<Thyra::MultiVectorBase<double> > dgdx_unique = getDerivative();
99 uniqueContainer_ = linObjFactory_->buildLinearObjContainer();
100 Teuchos::rcp_dynamic_cast<ThyraObjContainer<double> >(uniqueContainer_)->set_x_th(dgdx_unique->col(0));
104 uniqueContainer_ = Teuchos::null;
112 using Teuchos::rcp_dynamic_cast;
114 Teuchos::RCP<Thyra::MultiVectorBase<double> > dgdx_unique = getDerivative();
116 uniqueContainer_ = linObjFactory_->buildLinearObjContainer();
117 Teuchos::rcp_dynamic_cast<ThyraObjContainer<double> >(uniqueContainer_)->set_x_th(dgdx_unique->col(0));
121 uniqueContainer_ = Teuchos::null;
129 const int n = value.size();
130 const int num_deriv = this->numDeriv();
131 TEUCHOS_ASSERT(n == 0 || n == num_deriv);
133 value.resize(num_deriv);
137 int locProc = have_probe ? this->getComm()->getRank() : this->getComm()->getSize();
139 Teuchos::reduceAll(*this->getComm(), Teuchos::REDUCE_MIN, Thyra::Ordinal(1), &locProc, &glbProc);
141 TEUCHOS_ASSERT(glbProc < this->getComm()->getSize());
144 Teuchos::broadcast(*this->getComm(), glbProc, Thyra::Ordinal(num_deriv), &value.fastAccessDx(0));
148#ifdef PANZER_HAVE_EPETRA_STACK
149 if(this->useEpetra()) {
152 for (
int i=0; i<num_deriv; ++i)
153 deriv[i][0] = value.dx(i);
159 TEUCHOS_ASSERT(this->useThyra());
160 Thyra::ArrayRCP< Thyra::ArrayRCP<double> > deriv = this->getThyraMultiVector();
161 for (
int i=0; i<num_deriv; ++i)
162 deriv[i][0] = value.dx(i);