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 "pointFieldDecomposer.H"
00027 
00028 
00029 
00030 namespace Foam
00031 {
00032 
00033 
00034     
00035 pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
00036 (
00037     const pointPatch& completeMeshPatch,
00038     const pointPatch& procMeshPatch,
00039     const labelList& directAddr
00040 )
00041 :
00042     pointPatchFieldMapperPatchRef
00043     (
00044         completeMeshPatch,
00045         procMeshPatch
00046     ),
00047     directAddressing_(procMeshPatch.size(), -1)
00048 {
00049     
00050     labelList pointMap(completeMeshPatch.boundaryMesh().mesh().size(), -1);
00051 
00052     const labelList& completeMeshPatchPoints = completeMeshPatch.meshPoints();
00053 
00054     forAll (completeMeshPatchPoints, pointi)
00055     {
00056         pointMap[completeMeshPatchPoints[pointi]] = pointi;
00057     }
00058 
00059     
00060     
00061     const labelList& procMeshPatchPoints = procMeshPatch.meshPoints();
00062 
00063     forAll (procMeshPatchPoints, pointi)
00064     {
00065         directAddressing_[pointi] =
00066             pointMap[directAddr[procMeshPatchPoints[pointi]]];
00067     }
00068 
00069     
00070     if (directAddressing_.size() && min(directAddressing_) < 0)
00071     {
00072         FatalErrorIn
00073         (
00074             "pointFieldDecomposer::patchFieldDecomposer()"
00075         )   << "Incomplete patch point addressing"
00076             << abort(FatalError);
00077     }
00078 }
00079 
00080 
00081 pointFieldDecomposer::pointFieldDecomposer
00082 (
00083     const pointMesh& completeMesh,
00084     const pointMesh& procMesh,
00085     const labelList& pointAddressing,
00086     const labelList& boundaryAddressing
00087 )
00088 :
00089     completeMesh_(completeMesh),
00090     procMesh_(procMesh),
00091     pointAddressing_(pointAddressing),
00092     boundaryAddressing_(boundaryAddressing),
00093     patchFieldDecomposerPtrs_
00094     (
00095         procMesh_.boundary().size(),
00096         static_cast<patchFieldDecomposer*>(NULL)
00097     )
00098 {
00099     forAll (boundaryAddressing_, patchi)
00100     {
00101         if (boundaryAddressing_[patchi] >= 0)
00102         {
00103             patchFieldDecomposerPtrs_[patchi] = new patchFieldDecomposer
00104             (
00105                 completeMesh_.boundary()[boundaryAddressing_[patchi]],
00106                 procMesh_.boundary()[patchi],
00107                 pointAddressing_
00108             );
00109         }
00110     }
00111 }
00112 
00113 
00114 
00115 
00116 pointFieldDecomposer::~pointFieldDecomposer()
00117 {
00118     forAll (patchFieldDecomposerPtrs_, patchi)
00119     {
00120         if (patchFieldDecomposerPtrs_[patchi])
00121         {
00122             delete patchFieldDecomposerPtrs_[patchi];
00123         }
00124     }
00125 }
00126 
00127 
00128 
00129 
00130 } 
00131 
00132