本文整理汇总了C++中CoordinateSystem::jacobian方法的典型用法代码示例。如果您正苦于以下问题:C++ CoordinateSystem::jacobian方法的具体用法?C++ CoordinateSystem::jacobian怎么用?C++ CoordinateSystem::jacobian使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoordinateSystem
的用法示例。
在下文中一共展示了CoordinateSystem::jacobian方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GaussianQuadrature
void L2Projector::init(const DiscreteSpace& space,
const CoordinateSystem& coordSys,
const Expr& expr,
const LinearSolver<double>& solver)
{
TEST_FOR_EXCEPTION(space.basis().size() != expr.size(),
RuntimeError,
"mismatched vector structure between basis and expr");
TEST_FOR_EXCEPTION(space.basis().size() == 0,
RuntimeError,
"Empty basis?");
Expr v = new TestFunction(space.basis()[0], "dummy_v[0]");
Expr u = new UnknownFunction(space.basis()[0], "dummy_u[0]");
for (int i=1; i<space.basis().size(); i++)
{
v.append(new TestFunction(space.basis()[i], "dummy_v["
+ Teuchos::toString(i)+"]"));
u.append(new UnknownFunction(space.basis()[i], "dummy_u["
+ Teuchos::toString(i)+"]"));
}
CellFilter interior = new MaximalCellFilter();
Expr eqn = 0.0;
Expr J = coordSys.jacobian();
for (int i=0; i<space.basis().size(); i++)
{
eqn = eqn + Integral(space.cellFilters(i),
J*v[i]*(u[i]-expr[i]),
new GaussianQuadrature(4));
}
Expr bc;
prob_ = LinearProblem(space.mesh(), eqn, bc, v, u, space.vecType());
solver_ = solver;
}