64 have_probe(false), linObjFactory_(linObjFact)
93 double glbValue = Sacado::scalarValue(value);
96 int locProc = have_probe ? this->getComm()->getRank() : this->getComm()->getSize();
98 Teuchos::reduceAll(*this->getComm(), Teuchos::REDUCE_MIN, Thyra::Ordinal(1), &locProc, &glbProc);
100 TEUCHOS_ASSERT(glbProc < this->getComm()->getSize());
103 Teuchos::broadcast(*this->getComm(), glbProc, Thyra::Ordinal(1), &glbValue);
108#ifdef PANZER_HAVE_EPETRA_STACK
109 if(this->useEpetra()) {
111 this->getEpetraVector()[0] = glbValue;
117 TEUCHOS_ASSERT(this->useThyra());
119 this->getThyraVector()[0] = glbValue;
127 using Teuchos::rcp_dynamic_cast;
129 Teuchos::RCP<Thyra::MultiVectorBase<double> > dgdx_unique = getDerivative();
131 uniqueContainer_ = linObjFactory_->buildLinearObjContainer();
132 Teuchos::rcp_dynamic_cast<ThyraObjContainer<double> >(uniqueContainer_)->set_x_th(dgdx_unique->col(0));
136 uniqueContainer_ = Teuchos::null;
144 using Teuchos::rcp_dynamic_cast;
146 Teuchos::RCP<Thyra::MultiVectorBase<double> > dgdx_unique = getDerivative();
148 uniqueContainer_ = linObjFactory_->buildLinearObjContainer();
149 Teuchos::rcp_dynamic_cast<ThyraObjContainer<double> >(uniqueContainer_)->set_x_th(dgdx_unique->col(0));
153 uniqueContainer_ = Teuchos::null;
161 const int n = value.size();
162 const int num_deriv = this->numDeriv();
163 TEUCHOS_ASSERT(n == 0 || n == num_deriv);
165 value.resize(num_deriv);
169 int locProc = have_probe ? this->getComm()->getRank() : this->getComm()->getSize();
171 Teuchos::reduceAll(*this->getComm(), Teuchos::REDUCE_MIN, Thyra::Ordinal(1), &locProc, &glbProc);
173 TEUCHOS_ASSERT(glbProc < this->getComm()->getSize());
176 Teuchos::broadcast(*this->getComm(), glbProc, Thyra::Ordinal(num_deriv), &value.fastAccessDx(0));
180#ifdef PANZER_HAVE_EPETRA_STACK
181 if(this->useEpetra()) {
184 for (
int i=0; i<num_deriv; ++i)
185 deriv[i][0] = value.dx(i);
191 TEUCHOS_ASSERT(this->useThyra());
192 Thyra::ArrayRCP< Thyra::ArrayRCP<double> > deriv = this->getThyraMultiVector();
193 for (
int i=0; i<num_deriv; ++i)
194 deriv[i][0] = value.dx(i);