本文整理汇总了C++中GridFunction::MultiplyGridFunctions方法的典型用法代码示例。如果您正苦于以下问题:C++ GridFunction::MultiplyGridFunctions方法的具体用法?C++ GridFunction::MultiplyGridFunctions怎么用?C++ GridFunction::MultiplyGridFunctions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridFunction
的用法示例。
在下文中一共展示了GridFunction::MultiplyGridFunctions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VVy
void VVy(GridFunction& output, GridFunction& v, const RealType alpha,
const PointType& h) {
MultiIndexType begin, end;
begin[0] = 1;
end[0] = v.griddimension[0] - 2;
begin[1] = 1;
end[1] = v.griddimension[1] - 3;
Stencil stencil_1(3, h);
stencil_1.setVVy_1Stencil();
stencil_1.ApplyStencilOperator(begin, end, begin, end, v, output);
output.MultiplyGridFunctions(begin, end, output);
GridFunction branch_2(v.griddimension);
Stencil stencil_2(3, h);
stencil_2.setVVy_2Stencil();
stencil_2.ApplyStencilOperator(begin, end, begin, end, v, branch_2);
branch_2.MultiplyGridFunctions(begin, end, branch_2);
output.AddToGridFunction(begin, end, -1.0, branch_2);
output.ScaleGridFunction(begin, end, 1.0 / h[1]);
GridFunction branch_3(v.griddimension);
Stencil stencil_3(3, h);
stencil_3.setVVy_3Stencil();
stencil_3.ApplyStencilOperator(begin, end, begin, end, v, branch_3);
branch_3.MultiplyGridFunctions(begin, end, branch_3);
GridFunction branch_4(v.griddimension);
Stencil stencil_4(3, h);
stencil_4.setVVy_4Stencil();
stencil_4.ApplyStencilOperator(begin, end, begin, end, v, branch_4);
branch_4.MultiplyGridFunctions(begin, end, branch_4);
branch_3.MultiplyGridFunctions(begin, end, branch_4);
GridFunction branch_5(v.griddimension);
Stencil stencil_5(3, h);
stencil_5.setVVy_5Stencil();
stencil_5.ApplyStencilOperator(begin, end, begin, end, v, branch_5);
branch_5.MultiplyGridFunctions(begin, end, branch_5);
GridFunction branch_6(v.griddimension);
Stencil stencil_6(3, h);
stencil_6.setVVy_6Stencil();
stencil_6.ApplyStencilOperator(begin, end, begin, end, v, branch_6);
branch_6.MultiplyGridFunctions(begin, end, branch_6);
branch_5.MultiplyGridFunctions(begin, end, branch_6);
branch_3.AddToGridFunction(begin, end, -1.0, branch_5);
branch_3.ScaleGridFunction(begin, end, alpha / h[1]);
output.AddToGridFunction(begin, end, 1.0, branch_3);
}
示例2: UVx
void UVx(GridFunction& output, GridFunction& u, GridFunction& v,
const RealType alpha, const PointType& h) {
MultiIndexType begin, end;
begin[0] = 1;
end[0] = u.griddimension[0] - 2;
begin[1] = 1;
end[1] = u.griddimension[1] - 3;
Stencil stencil_1(3, h);
stencil_1.setUVx_1Stencil();
stencil_1.ApplyStencilOperator(begin, end, begin, end, u, output);
GridFunction branch_2(u.griddimension);
Stencil stencil_2(3, h);
stencil_2.setUVx_2Stencil();
stencil_2.ApplyStencilOperator(begin, end, begin, end, v, branch_2);
output.MultiplyGridFunctions(begin, end, branch_2);
GridFunction branch_3(u.griddimension);
Stencil stencil_3(3, h);
stencil_3.setUVx_3Stencil();
stencil_3.ApplyStencilOperator(begin, end, begin, end, u, branch_3);
GridFunction branch_4(u.griddimension);
Stencil stencil_4(3, h);
stencil_4.setUVx_4Stencil();
stencil_4.ApplyStencilOperator(begin, end, begin, end, v, branch_4);
branch_3.MultiplyGridFunctions(begin, end, branch_4);
output.AddToGridFunction(begin, end, -1.0, branch_3);
output.ScaleGridFunction(begin, end, 1.0 / h[0]);
//bis hier 1. Zeile
GridFunction branch_5(u.griddimension);
Stencil stencil_5(3, h);
stencil_5.setUVx_5Stencil();
stencil_5.ApplyStencilOperator(begin, end, begin, end, u, branch_5);
GridFunction branch_6(u.griddimension);
Stencil stencil_6(3, h);
stencil_6.setUVx_6Stencil();
stencil_6.ApplyStencilOperator(begin, end, begin, end, v, branch_6);
branch_5.MultiplyGridFunctions(begin, end, branch_6);
GridFunction branch_7(u.griddimension);
Stencil stencil_7(3, h);
stencil_7.setUVx_7Stencil();
stencil_7.ApplyStencilOperator(begin, end, begin, end, u, branch_7);
GridFunction branch_8(u.griddimension);
Stencil stencil_8(3, h);
stencil_8.setUVx_8Stencil();
stencil_8.ApplyStencilOperator(begin, end, begin, end, v, branch_8);
branch_7.MultiplyGridFunctions(begin, end, branch_8);
branch_5.AddToGridFunction(begin, end, -1.0, branch_7);
branch_5.ScaleGridFunction(begin, end, alpha * 1.0 / h[0]);
//bis hier 2. Zeile
output.AddToGridFunction(begin, end, 1.0, branch_5);
}