use direct mapping

This commit is contained in:
mattijs
2009-06-01 13:24:10 +01:00
parent 107893383a
commit da89474c3b
2 changed files with 15 additions and 28 deletions

View File

@ -56,13 +56,12 @@ processorVolPatchFieldDecomposer
const unallocLabelList& addressingSlice const unallocLabelList& addressingSlice
) )
: :
addressing_(addressingSlice.size()), directAddressing_(addressingSlice.size())
weights_(addressingSlice.size())
{ {
const labelList& own = mesh.faceOwner(); const labelList& own = mesh.faceOwner();
const labelList& neighb = mesh.faceNeighbour(); const labelList& neighb = mesh.faceNeighbour();
forAll (addressing_, i) forAll (directAddressing_, i)
{ {
// Subtract one to align addressing. // Subtract one to align addressing.
label ai = mag(addressingSlice[i]) - 1; label ai = mag(addressingSlice[i]) - 1;
@ -74,18 +73,14 @@ processorVolPatchFieldDecomposer
// on the parallel boundary. // on the parallel boundary.
// Give face the value of the neighbour. // Give face the value of the neighbour.
addressing_[i].setSize(1);
weights_[i].setSize(1);
weights_[i][0] = 1.0;
if (addressingSlice[i] >= 0) if (addressingSlice[i] >= 0)
{ {
// I have the owner so use the neighbour value // I have the owner so use the neighbour value
addressing_[i][0] = neighb[ai]; directAddressing_[i] = neighb[ai];
} }
else else
{ {
addressing_[i][0] = own[ai]; directAddressing_[i] = own[ai];
} }
} }
else else
@ -96,12 +91,7 @@ processorVolPatchFieldDecomposer
// up the different (face) list of data), so I will // up the different (face) list of data), so I will
// just grab the value from the owner cell // just grab the value from the owner cell
addressing_[i].setSize(1); directAddressing_[i] = own[ai];
weights_[i].setSize(1);
addressing_[i][0] = own[ai];
weights_[i][0] = 1.0;
} }
} }
} }

View File

@ -96,15 +96,16 @@ public:
}; };
//- Processor patch field decomposer class //- Processor patch field decomposer class. Maps either owner or
// neighbour data (no interpolate anymore - processorFvPatchField
// holds neighbour data)
class processorVolPatchFieldDecomposer class processorVolPatchFieldDecomposer
: :
public fvPatchFieldMapper public fvPatchFieldMapper
{ {
// Private data // Private data
labelListList addressing_; labelList directAddressing_;
scalarListList weights_;
public: public:
@ -120,27 +121,23 @@ public:
label size() const label size() const
{ {
return addressing_.size(); return directAddressing_.size();
} }
bool direct() const bool direct() const
{ {
return false; return true;
} }
const labelListList& addressing() const const unallocLabelList& directAddressing() const
{ {
return addressing_; return directAddressing_;
}
const scalarListList& weights() const
{
return weights_;
} }
}; };
//- Processor patch field decomposer class //- Processor patch field decomposer class. Surface field is assumed
// to have direction (so manipulates sign when mapping)
class processorSurfacePatchFieldDecomposer class processorSurfacePatchFieldDecomposer
: :
public fvPatchFieldMapper public fvPatchFieldMapper