OpenFOAM网格分区资料整理

本文详细介绍了OpenFOAM中用于并行运行的网格分区技术,特别是使用Foam::distributionMap进行数据交换的过程,包括如何处理点、边数据以及避免全局操作。同时提及了PstreamBuffers在处理器间通信中的作用。
摘要由CSDN通过智能技术生成

OpenFOAM网格分区资料整理


Foam::distributionMap

Foam::mapDistribute

Foam::ProcessorTopology

Foam::processorMeshes

Foam::globalIndex

Foam::globalIndexAndTransform

Foam::globalMeshData

Detailed Description
Various mesh related information for a parallel run. Upon construction, constructs all info using parallel communication.

Requires:

all processor patches to have correct ordering.
all processorPatches to have their transforms set.
The shared point and edge addressing calculates addressing for points and edges on coupled patches. In the ‘old’ way a distinction was made between points/edges that are only on two processors and those that are on multiple processors. The problem is that those on multiple processors do not allow any transformations and require a global reduction on the master processor.

The alternative is to have an exchange schedule (through a ‘distributionMap’) which sends all point/edge data (no distinction is made between those on two and those on more than two coupled patches) to the local ‘master’. This master then does any calculation and sends the result back to the ‘slave’ points/edges. This only needs to be done on points on coupled faces. Any transformation is done using a predetermined set of transformations - since transformations have to be space filling only a certain number of transformation is supported.

The exchange needs

a field of data
a distributionMap which does all parallel exchange and transformations This appends remote data to the end of the field.
a set of indices which indicate where to get untransformed data in the field
a set of indices which indicate where to get transformed data in the field
Note:

compared to 17x nTotalFaces, nTotalPoints do not compensate for shared points since this would trigger full connectivity analysis
most calculation is demand driven and uses parallel communication so make sure to invoke on all processors at the same time
old sharedEdge calculation: currently an edge is considered shared if it uses two shared points and is used more than once. This is not correct on processor patches but it only slightly overestimates the number of shared edges. Doing full analysis of how many patches use the edge would be too complicated


Foam::syncTools


Foam::Map

Foam::PstreamBuffers

Buffers for inter-processor communications streams

 PstreamBuffers pBuffers(Pstream::commsTypes::nonBlocking);

 for (label proci = 0; proci < Pstream::nProcs(); proci++)
 {
	 if (proci != Pstream::myProcNo())
	 {
		 someObject vals;

		 UOPstream str(proci, pBuffers);
		 str << vals;
	 }
 }

 pBuffers.finishedSends();   // no-op for blocking

 for (label proci = 0; proci < Pstream::nProcs(); proci++)
 {
	 if (proci != Pstream::myProcNo())
	 {
		 UIPstream str(proci, pBuffers);
		 someObject vals(str);
	 }
 }

  • 14
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值