当前位置: 首页>>代码示例>>C++>>正文


C++ GridFunction::MultiplyGridFunctions方法代码示例

本文整理汇总了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);

}
开发者ID:jp90,项目名称:src,代码行数:59,代码来源:derivatives.cpp

示例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);
}
开发者ID:jp90,项目名称:src,代码行数:58,代码来源:derivatives.cpp


注:本文中的GridFunction::MultiplyGridFunctions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。