pointFieldReconstructor.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "pointFieldReconstructor.H"
00028
00029
00030
00031 Foam::pointFieldReconstructor::pointFieldReconstructor
00032 (
00033 const pointMesh& mesh,
00034 const PtrList<pointMesh>& procMeshes,
00035 const PtrList<labelIOList>& pointProcAddressing,
00036 const PtrList<labelIOList>& boundaryProcAddressing
00037 )
00038 :
00039 mesh_(mesh),
00040 procMeshes_(procMeshes),
00041 pointProcAddressing_(pointProcAddressing),
00042 boundaryProcAddressing_(boundaryProcAddressing),
00043 patchPointAddressing_(procMeshes.size())
00044 {
00045
00046 labelList pointMap(mesh_.size(), -1);
00047
00048
00049 forAll(procMeshes_, proci)
00050 {
00051 const pointMesh& procMesh = procMeshes_[proci];
00052
00053 patchPointAddressing_[proci].setSize(procMesh.boundary().size());
00054
00055 forAll(procMesh.boundary(), patchi)
00056 {
00057 if (boundaryProcAddressing_[proci][patchi] >= 0)
00058 {
00059 labelList& procPatchAddr = patchPointAddressing_[proci][patchi];
00060 procPatchAddr.setSize(procMesh.boundary()[patchi].size(), -1);
00061
00062 const labelList& patchPointLabels =
00063 mesh_.boundary()[boundaryProcAddressing_[proci][patchi]]
00064 .meshPoints();
00065
00066
00067 forAll (patchPointLabels, pointi)
00068 {
00069 pointMap[patchPointLabels[pointi]] = pointi;
00070 }
00071
00072 const labelList& procPatchPoints =
00073 procMesh.boundary()[patchi].meshPoints();
00074
00075 forAll (procPatchPoints, pointi)
00076 {
00077 procPatchAddr[pointi] =
00078 pointMap
00079 [
00080 pointProcAddressing_[proci][procPatchPoints[pointi]]
00081 ];
00082 }
00083
00084 if (procPatchAddr.size() && min(procPatchAddr) < 0)
00085 {
00086 FatalErrorIn
00087 (
00088 "pointFieldReconstructor::pointFieldReconstructor"
00089 "(\n"
00090 " const pointMesh& mesh,\n"
00091 " const PtrList<pointMesh>& procMeshes,\n"
00092 " const PtrList<labelIOList>& pointProcAddressing,\n"
00093 " const PtrList<labelIOList>& "
00094 "boundaryProcAddressing\n"
00095 ")"
00096 ) << "Incomplete patch point addressing"
00097 << abort(FatalError);
00098 }
00099 }
00100 }
00101 }
00102 }
00103
00104
00105
Copyright © 2000-2009 OpenCFD Ltd