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