本文整理汇总了C++中Tpetra_Vector::get1dViewNonConst方法的典型用法代码示例。如果您正苦于以下问题:C++ Tpetra_Vector::get1dViewNonConst方法的具体用法?C++ Tpetra_Vector::get1dViewNonConst怎么用?C++ Tpetra_Vector::get1dViewNonConst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tpetra_Vector
的用法示例。
在下文中一共展示了Tpetra_Vector::get1dViewNonConst方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Scalar
void
twoD_diffusion_problem<Scalar,MeshScalar,BasisScalar,LocalOrdinal,GlobalOrdinal,
Node>::
computeResponse(const Tpetra_Vector& x,
const Tpetra_Vector& p,
Tpetra_Vector& g)
{
// g = average of x
Teuchos::ArrayRCP<Scalar> g_view = g.get1dViewNonConst();
x.meanValue(g_view());
g_view[0] *= Scalar(x.getGlobalLength()) / Scalar(mesh.size());
}
示例2:
void Albany::AlbanyPeridigmOBCFunctional::
evaluateResponseT(const double current_time,
const Tpetra_Vector* xdotT,
const Tpetra_Vector* xdotdotT,
const Tpetra_Vector& xT,
const Teuchos::Array<ParamVec>& p,
Tpetra_Vector& gT)
{
LCM::PeridigmManager& peridigmManager = *LCM::PeridigmManager::self();
Teuchos::ArrayRCP<ST> gT_nonconstView = gT.get1dViewNonConst();
peridigmManager.obcOverlappingElementSearch();
gT_nonconstView[0] = peridigmManager.obcEvaluateFunctional();
}
示例3:
void
Albany::SolutionTwoNormResponseFunction::
evaluateResponseT(const double current_time,
const Tpetra_Vector* xdotT,
const Tpetra_Vector* xdotdotT,
const Tpetra_Vector& xT,
const Teuchos::Array<ParamVec>& p,
Tpetra_Vector& gT)
{
Teuchos::ScalarTraits<ST>::magnitudeType twonorm = xT.norm2();
Teuchos::ArrayRCP<ST> gT_nonconstView = gT.get1dViewNonConst();
gT_nonconstView[0] = twonorm;
}
示例4: computeMaxValueT
void
Albany::SolutionMaxValueResponseFunction::
evaluateResponseT(const double current_time,
const Tpetra_Vector* xdotT,
const Tpetra_Vector* xdotdotT,
const Tpetra_Vector& xT,
const Teuchos::Array<ParamVec>& p,
Tpetra_Vector& gT)
{
int index;
Teuchos::ArrayRCP<ST> gT_nonconstView = gT.get1dViewNonConst();
computeMaxValueT(xT, gT_nonconstView[0], index);
}
示例5:
void
Albany::SolutionAverageResponseFunction::
evaluateResponseT(const double current_time,
const Tpetra_Vector* xdotT,
const Tpetra_Vector* xdotdotT,
const Tpetra_Vector& xT,
const Teuchos::Array<ParamVec>& p,
Tpetra_Vector& gT)
{
ST mean = xT.meanValue();
Teuchos::ArrayRCP<ST> gT_nonconstView = gT.get1dViewNonConst();
gT_nonconstView[0] = mean;
}