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 #include "pointFieldReconstructor.H"
00027
00028
00029
00030 Foam::pointFieldReconstructor::pointFieldReconstructor
00031 (
00032 const pointMesh& mesh,
00033 const PtrList<pointMesh>& procMeshes,
00034 const PtrList<labelIOList>& pointProcAddressing,
00035 const PtrList<labelIOList>& boundaryProcAddressing
00036 )
00037 :
00038 mesh_(mesh),
00039 procMeshes_(procMeshes),
00040 pointProcAddressing_(pointProcAddressing),
00041 boundaryProcAddressing_(boundaryProcAddressing),
00042 patchPointAddressing_(procMeshes.size())
00043 {
00044
00045 labelList pointMap(mesh_.size(), -1);
00046
00047
00048 forAll(procMeshes_, proci)
00049 {
00050 const pointMesh& procMesh = procMeshes_[proci];
00051
00052 patchPointAddressing_[proci].setSize(procMesh.boundary().size());
00053
00054 forAll(procMesh.boundary(), patchi)
00055 {
00056 if (boundaryProcAddressing_[proci][patchi] >= 0)
00057 {
00058 labelList& procPatchAddr = patchPointAddressing_[proci][patchi];
00059 procPatchAddr.setSize(procMesh.boundary()[patchi].size(), -1);
00060
00061 const labelList& patchPointLabels =
00062 mesh_.boundary()[boundaryProcAddressing_[proci][patchi]]
00063 .meshPoints();
00064
00065
00066 forAll (patchPointLabels, pointi)
00067 {
00068 pointMap[patchPointLabels[pointi]] = pointi;
00069 }
00070
00071 const labelList& procPatchPoints =
00072 procMesh.boundary()[patchi].meshPoints();
00073
00074 forAll (procPatchPoints, pointi)
00075 {
00076 procPatchAddr[pointi] =
00077 pointMap
00078 [
00079 pointProcAddressing_[proci][procPatchPoints[pointi]]
00080 ];
00081 }
00082
00083 if (procPatchAddr.size() && min(procPatchAddr) < 0)
00084 {
00085 FatalErrorIn
00086 (
00087 "pointFieldReconstructor::pointFieldReconstructor"
00088 "(\n"
00089 " const pointMesh& mesh,\n"
00090 " const PtrList<pointMesh>& procMeshes,\n"
00091 " const PtrList<labelIOList>& pointProcAddressing,\n"
00092 " const PtrList<labelIOList>& "
00093 "boundaryProcAddressing\n"
00094 ")"
00095 ) << "Incomplete patch point addressing"
00096 << abort(FatalError);
00097 }
00098 }
00099 }
00100 }
00101 }
00102
00103
00104