Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
d016590b
Commit
d016590b
authored
Aug 18, 2017
by
Andrew Heather
Browse files
ENH: AMIInterpolation - updated to perform face triangulation once only; code clean-up
parent
2be17edc
Changes
23
Hide whitespace changes
Inline
Side-by-side
applications/utilities/preProcessing/mapFieldsPar/mapFieldsPar.C
View file @
d016590b
...
...
@@ -233,10 +233,10 @@ int main(int argc, char *argv[])
meshToMesh
::
interpolationMethod
method
=
meshToMesh
::
interpolationMethodNames_
[
mapMethod
];
patchMapMethod
=
AMIPatchToPatchInterpolation
::
interpolationMethod
ToWord
(
patchMapMethod
=
AMIPatchToPatchInterpolation
::
interpolationMethod
Names_
[
meshToMesh
::
interpolationMethodAMI
(
method
)
)
;
]
;
}
// Optionally override
...
...
src/functionObjects/field/mapFields/mapFields.C
View file @
d016590b
...
...
@@ -89,10 +89,10 @@ void Foam::functionObjects::mapFields::createInterpolation
// Lookup corresponding AMI method
word
patchMapMethodName
=
AMIPatchToPatchInterpolation
::
interpolationMethod
ToWord
(
AMIPatchToPatchInterpolation
::
interpolationMethod
Names_
[
meshToMesh
::
interpolationMethodAMI
(
mapMethod
)
)
;
]
;
// Optionally override
if
(
dict
.
readIfPresent
(
"patchMapMethod"
,
patchMapMethodName
))
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
View file @
d016590b
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-201
6
OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-201
8
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -46,26 +46,8 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolationMethodNames_
};
template
<
class
SourcePatch
,
class
TargetPatch
>
Foam
::
word
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
interpolationMethodToWord
(
const
interpolationMethod
&
im
)
{
return
interpolationMethodNames_
[
im
];
}
template
<
class
SourcePatch
,
class
TargetPatch
>
typename
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
interpolationMethod
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
wordTointerpolationMethod
(
const
word
&
im
)
{
return
interpolationMethodNames_
[
im
];
}
bool
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
cacheIntersections_
=
false
;
template
<
class
SourcePatch
,
class
TargetPatch
>
template
<
class
Patch
>
...
...
@@ -156,7 +138,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::projectPointsToSurface
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
normaliseWeights
(
const
scalar
Field
&
patchAreas
,
const
scalar
List
&
patchAreas
,
const
word
&
patchName
,
const
labelListList
&
addr
,
scalarListList
&
wght
,
...
...
@@ -237,14 +219,14 @@ template<class SourcePatch, class TargetPatch>
void
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
agglomerate
(
const
autoPtr
<
mapDistribute
>&
targetMapPtr
,
const
scalar
Field
&
fineSrcMagSf
,
const
scalar
List
&
fineSrcMagSf
,
const
labelListList
&
fineSrcAddress
,
const
scalarListList
&
fineSrcWeights
,
const
labelList
&
sourceRestrictAddressing
,
const
labelList
&
targetRestrictAddressing
,
scalar
Field
&
srcMagSf
,
scalar
List
&
srcMagSf
,
labelListList
&
srcAddress
,
scalarListList
&
srcWeights
,
scalarField
&
srcWeightsSum
,
...
...
@@ -339,9 +321,9 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::agglomerate
labelList
oldToNew
(
targetCoarseSize
,
-
1
);
label
newi
=
0
;
for
All
(
elems
,
i
)
for
(
const
label
elemi
:
elems
)
{
label
fineElem
=
elemsMap
[
elem
s
[
i
]
];
label
fineElem
=
elemsMap
[
elem
i
];
label
coarseElem
=
allRestrict
[
fineElem
];
if
(
oldToNew
[
coarseElem
]
==
-
1
)
{
...
...
@@ -375,9 +357,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::agglomerate
// reachable elements (using the local constructMap)
const
labelList
&
elemsMap
=
map
.
constructMap
()[
Pstream
::
myProcNo
()];
for
All
(
elemsMap
,
i
)
for
(
const
label
fineElem
:
elemsMap
)
{
label
fineElem
=
elemsMap
[
i
];
label
coarseElem
=
allRestrict
[
fineElem
];
tgtCompactMap
[
fineElem
]
=
coarseElem
;
}
...
...
@@ -403,12 +384,12 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::agglomerate
// Get the maximum target coarse size for this set of
// received data.
label
remoteTargetCoarseSize
=
labelMin
;
for
All
(
elems
,
i
)
for
(
const
label
elemi
:
elems
)
{
remoteTargetCoarseSize
=
max
(
remoteTargetCoarseSize
,
allRestrict
[
elem
s
[
i
]
]
allRestrict
[
elemi
]
);
}
remoteTargetCoarseSize
+=
1
;
...
...
@@ -417,9 +398,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::agglomerate
labelList
oldToNew
(
remoteTargetCoarseSize
,
-
1
);
label
newi
=
0
;
for
All
(
elems
,
i
)
for
(
const
label
fineElem
:
elems
)
{
label
fineElem
=
elems
[
i
];
// fineElem now points to section from proci
label
coarseElem
=
allRestrict
[
fineElem
];
if
(
oldToNew
[
coarseElem
]
==
-
1
)
...
...
@@ -563,9 +543,9 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::constructFromSurface
if
(
debug
)
{
OFstream
os
(
"amiSrcPoints.obj"
);
for
All
(
srcPoints
,
i
)
for
(
const
point
&
pt
:
srcPoints
)
{
meshTools
::
writeOBJ
(
os
,
srcPoints
[
i
]
);
meshTools
::
writeOBJ
(
os
,
pt
);
}
}
...
...
@@ -584,9 +564,9 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::constructFromSurface
if
(
debug
)
{
OFstream
os
(
"amiTgtPoints.obj"
);
for
All
(
tgtPoints
,
i
)
for
(
const
point
&
pt
:
tgtPoints
)
{
meshTools
::
writeOBJ
(
os
,
t
gtPoints
[
i
]
);
meshTools
::
writeOBJ
(
os
,
p
t
);
}
}
...
...
@@ -620,7 +600,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
const
bool
reverseTarget
)
:
methodName_
(
interpolationMethod
ToWord
(
method
)
),
methodName_
(
interpolationMethod
Names_
[
method
]
),
reverseTarget_
(
reverseTarget
),
requireMatch_
(
requireMatch
),
singlePatchProc_
(
-
999
),
...
...
@@ -683,7 +663,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
const
bool
reverseTarget
)
:
methodName_
(
interpolationMethod
ToWord
(
method
)
),
methodName_
(
interpolationMethod
Names_
[
method
]
),
reverseTarget_
(
reverseTarget
),
requireMatch_
(
requireMatch
),
singlePatchProc_
(
-
999
),
...
...
@@ -870,10 +850,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
<<
tgtTotalSize
<<
" target faces"
<<
endl
;
// Calculate face areas
srcMagSf_
=
patchMagSf
(
srcPatch
,
triMode_
);
tgtMagSf_
=
patchMagSf
(
tgtPatch
,
triMode_
);
// Calculate if patches present on multiple processors
singlePatchProc_
=
calcDistribution
(
srcPatch
,
tgtPatch
);
...
...
@@ -919,13 +895,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
newTgtPoints
);
scalarField
newTgtMagSf
(
newTgtPatch
.
size
());
forAll
(
newTgtPatch
,
facei
)
{
newTgtMagSf
[
facei
]
=
newTgtPatch
[
facei
].
mag
(
newTgtPatch
.
points
());
}
// Calculate AMI interpolation
autoPtr
<
AMIMethod
<
SourcePatch
,
TargetPatch
>>
AMIPtr
(
...
...
@@ -934,8 +903,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
methodName_
,
srcPatch
,
newTgtPatch
,
srcMagSf_
,
newTgtMagSf
,
triMode_
,
reverseTarget_
,
requireMatch_
&&
(
lowWeightCorrection_
<
0
)
...
...
@@ -950,6 +917,12 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
tgtWeights_
);
// Note: using patch face areas calculated by the AMI method
// - TODO: should move into the calculate method
srcMagSf_
.
transfer
(
AMIPtr
->
srcMagSf
());
tgtMagSf_
.
transfer
(
AMIPtr
->
tgtMagSf
());
map
.
reverseDistribute
(
tgtPatch
.
size
(),
tgtMagSf_
);
// Now
// ~~~
// srcAddress_ : per srcPatch face a list of the newTgtPatch (not
...
...
@@ -967,21 +940,19 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for
All
(
srcAddress_
,
i
)
for
(
labelList
&
addressing
:
srcAddress_
)
{
labelList
&
addressing
=
srcAddress_
[
i
];
forAll
(
addressing
,
addri
)
for
(
label
&
addr
:
addressing
)
{
addr
essing
[
addri
]
=
tgtFaceIDs
[
addr
essing
[
addri
]
];
addr
=
tgtFaceIDs
[
addr
];
}
}
for
All
(
tgtAddress_
,
i
)
for
(
labelList
&
addressing
:
tgtAddress_
)
{
labelList
&
addressing
=
tgtAddress_
[
i
];
forAll
(
addressing
,
addri
)
for
(
label
&
addr
:
addressing
)
{
addr
essing
[
addri
]
=
globalSrcFaces
.
toGlobal
(
addr
essing
[
addri
]
);
addr
=
globalSrcFaces
.
toGlobal
(
addr
);
}
}
...
...
@@ -1036,8 +1007,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
methodName_
,
srcPatch
,
tgtPatch
,
srcMagSf_
,
tgtMagSf_
,
triMode_
,
reverseTarget_
,
requireMatch_
&&
(
lowWeightCorrection_
<
0
)
...
...
@@ -1052,6 +1021,9 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
tgtWeights_
);
srcMagSf_
.
transfer
(
AMIPtr
->
srcMagSf
());
tgtMagSf_
.
transfer
(
AMIPtr
->
tgtMagSf
());
AMIPtr
->
normaliseWeights
(
true
,
*
this
);
}
...
...
@@ -1623,9 +1595,8 @@ const
nearest
.
setDistance
(
GREAT
);
label
nearestFacei
=
-
1
;
for
All
(
addr
,
i
)
for
(
const
label
srcFacei
:
addr
)
{
const
label
srcFacei
=
addr
[
i
];
const
face
&
f
=
srcPatch
[
srcFacei
];
pointHit
ray
=
f
.
ray
(
tgtPoint
,
n
,
srcPoints
);
...
...
@@ -1672,9 +1643,8 @@ const
// Target face addresses that intersect source face srcFacei
const
labelList
&
addr
=
srcAddress_
[
srcFacei
];
for
All
(
addr
,
i
)
for
(
const
label
tgtFacei
:
addr
)
{
const
label
tgtFacei
=
addr
[
i
];
const
face
&
f
=
tgtPatch
[
tgtFacei
];
pointHit
ray
=
f
.
ray
(
srcPoint
,
n
,
tgtPoints
);
...
...
@@ -1719,9 +1689,8 @@ const
const
labelList
&
addr
=
srcAddress
[
i
];
const
point
&
srcPt
=
srcPatch
.
faceCentres
()[
i
];
for
All
(
addr
,
j
)
for
(
const
label
tgtPti
:
addr
)
{
label
tgtPti
=
addr
[
j
];
const
point
&
tgtPt
=
tgtPatch
.
faceCentres
()[
tgtPti
];
meshTools
::
writeOBJ
(
os
,
srcPt
);
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H
View file @
d016590b
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016
-2018
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -95,17 +95,7 @@ public:
static
const
Enum
<
interpolationMethod
>
interpolationMethodNames_
;
//- Convert interpolationMethod to word representation
static
word
interpolationMethodToWord
(
const
interpolationMethod
&
method
);
//- Convert word to interpolationMethod
static
interpolationMethod
wordTointerpolationMethod
(
const
word
&
method
);
static
bool
cacheIntersections_
;
//- Calculate the patch face magnitudes for the given tri-mode
template
<
class
Patch
>
...
...
@@ -142,7 +132,7 @@ private:
// Source patch
//- Source face areas
scalar
Field
srcMagSf_
;
scalar
List
srcMagSf_
;
//- Addresses of target faces per source face
labelListList
srcAddress_
;
...
...
@@ -157,7 +147,7 @@ private:
// Target patch
//- Target face areas
scalar
Field
tgtMagSf_
;
scalar
List
tgtMagSf_
;
//- Addresses of source faces per target face
labelListList
tgtAddress_
;
...
...
@@ -250,7 +240,7 @@ private:
// numerical error!
static
void
normaliseWeights
(
const
scalar
Field
&
patchAreas
,
const
scalar
List
&
patchAreas
,
const
word
&
patchName
,
const
labelListList
&
addr
,
scalarListList
&
wght
,
...
...
@@ -266,14 +256,14 @@ private:
static
void
agglomerate
(
const
autoPtr
<
mapDistribute
>&
targetMap
,
const
scalar
Field
&
fineSrcMagSf
,
const
scalar
List
&
fineSrcMagSf
,
const
labelListList
&
fineSrcAddress
,
const
scalarListList
&
fineSrcWeights
,
const
labelList
&
sourceRestrictAddressing
,
const
labelList
&
targetRestrictAddressing
,
scalar
Field
&
srcMagSf
,
scalar
List
&
srcMagSf
,
labelListList
&
srcAddress
,
scalarListList
&
srcWeights
,
scalarField
&
srcWeightsSum
,
...
...
@@ -311,7 +301,7 @@ public:
const
faceAreaIntersect
::
triangulationMode
&
triMode
,
const
bool
requireMatch
=
true
,
const
word
&
methodName
=
interpolationMethod
ToWord
(
imFaceAreaWeight
)
,
interpolationMethod
Names_
[
imFaceAreaWeight
]
,
const
scalar
lowWeightCorrection
=
-
1
,
const
bool
reverseTarget
=
false
);
...
...
@@ -338,7 +328,7 @@ public:
const
faceAreaIntersect
::
triangulationMode
&
triMode
,
const
bool
requireMatch
=
true
,
const
word
&
methodName
=
interpolationMethod
ToWord
(
imFaceAreaWeight
)
,
interpolationMethod
Names_
[
imFaceAreaWeight
]
,
const
scalar
lowWeightCorrection
=
-
1
,
const
bool
reverseTarget
=
false
);
...
...
@@ -381,10 +371,10 @@ public:
// Source patch
//- Return const access to source patch face areas
inline
const
scalar
Field
&
srcMagSf
()
const
;
inline
const
List
<
scalar
>
&
srcMagSf
()
const
;
//- Return access to source patch face areas
inline
scalar
Field
&
srcMagSf
();
inline
List
<
scalar
>
&
srcMagSf
();
//- Return const access to source patch addressing
inline
const
labelListList
&
srcAddress
()
const
;
...
...
@@ -415,10 +405,10 @@ public:
// Target patch
//- Return const access to target patch face areas
inline
const
scalar
Field
&
tgtMagSf
()
const
;
inline
const
List
<
scalar
>
&
tgtMagSf
()
const
;
//- Return access to target patch face areas
inline
scalar
Field
&
tgtMagSf
();
inline
List
<
scalar
>
&
tgtMagSf
();
//- Return const access to target patch addressing
inline
const
labelListList
&
tgtAddress
()
const
;
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationI.H
View file @
d016590b
...
...
@@ -49,7 +49,7 @@ applyLowWeightCorrection() const
template
<
class
SourcePatch
,
class
TargetPatch
>
inline
const
Foam
::
scalar
Field
&
inline
const
Foam
::
List
<
Foam
::
scalar
>
&
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
srcMagSf
()
const
{
return
srcMagSf_
;
...
...
@@ -57,7 +57,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::srcMagSf() const
template
<
class
SourcePatch
,
class
TargetPatch
>
inline
Foam
::
scalar
Field
&
inline
Foam
::
List
<
Foam
::
scalar
>
&
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
srcMagSf
()
{
return
srcMagSf_
;
...
...
@@ -121,7 +121,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::srcMap() const
template
<
class
SourcePatch
,
class
TargetPatch
>
inline
const
Foam
::
scalar
Field
&
inline
const
Foam
::
List
<
Foam
::
scalar
>
&
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
tgtMagSf
()
const
{
return
tgtMagSf_
;
...
...
@@ -129,7 +129,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::tgtMagSf() const
template
<
class
SourcePatch
,
class
TargetPatch
>
inline
Foam
::
scalar
Field
&
inline
Foam
::
List
<
Foam
::
scalar
>
&
Foam
::
AMIInterpolation
<
SourcePatch
,
TargetPatch
>::
tgtMagSf
()
{
return
tgtMagSf_
;
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationParallelOps.C
View file @
d016590b
...
...
@@ -100,9 +100,9 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs
{
const
treeBoundBoxList
&
bbp
=
procBb
[
proci
];
for
All
(
bbp
,
bb
i
)
for
(
const
treeBoundBox
&
tbb
:
bb
p
)
{
if
(
bb
p
[
bbi
]
.
overlaps
(
bb
))
if
(
t
bb
.
overlaps
(
bb
))
{
overlaps
[
proci
]
=
true
;
nOverlaps
++
;
...
...
@@ -128,7 +128,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributePatches
{
PstreamBuffers
pBufs
(
Pstream
::
commsTypes
::
nonBlocking
);
for
(
label
domain
=
0
;
domain
<
Pstream
::
nProcs
();
domain
++
)
for
(
label
domain
=
0
;
domain
<
Pstream
::
nProcs
();
++
domain
)
{
const
labelList
&
sendElems
=
map
.
subMap
()[
domain
];
...
...
@@ -195,7 +195,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributePatches
}
// Consume
for
(
label
domain
=
0
;
domain
<
Pstream
::
nProcs
();
domain
++
)
for
(
label
domain
=
0
;
domain
<
Pstream
::
nProcs
();
++
domain
)
{
const
labelList
&
recvElems
=
map
.
constructMap
()[
domain
];
...
...
@@ -251,9 +251,8 @@ distributeAndMergePatches
SubList
<
label
>
(
tgtFaceIDs
,
faceIDs
.
size
())
=
faceIDs
;
const
faceList
&
fcs
=
allFaces
[
Pstream
::
myProcNo
()];
for
All
(
fcs
,
i
)
for
(
const
face
&
f
:
fcs
)
{
const
face
&
f
=
fcs
[
i
];
face
&
newF
=
tgtFaces
[
nFaces
++
];
newF
.
setSize
(
f
.
size
());
forAll
(
f
,
fp
)
...
...
@@ -263,9 +262,9 @@ distributeAndMergePatches
}
const
pointField
&
pts
=
allPoints
[
Pstream
::
myProcNo
()];
for
All
(
pts
,
i
)
for
(
const
point
&
pt
:
pts
)
{
tgtPoints
[
nPoints
++
]
=
pt
s
[
i
]
;
tgtPoints
[
nPoints
++
]
=
pt
;
}
}
...
...
@@ -279,9 +278,8 @@ distributeAndMergePatches
SubList
<
label
>
(
tgtFaceIDs
,
faceIDs
.
size
(),
nFaces
)
=
faceIDs
;
const
faceList
&
fcs
=
allFaces
[
proci
];
for
All
(
fcs
,
i
)
for
(
const
face
&
f
:
fcs
)
{
const
face
&
f
=
fcs
[
i
];
face
&
newF
=
tgtFaces
[
nFaces
++
];
newF
.
setSize
(
f
.
size
());
forAll
(
f
,
fp
)
...
...
@@ -291,9 +289,9 @@ distributeAndMergePatches
}
const
pointField
&
pts
=
allPoints
[
proci
];
for
All
(
pts
,
i
)
for
(
const
point
&
pt
:
pts
)
{
tgtPoints
[
nPoints
++
]
=
pt
s
[
i
]
;
tgtPoints
[
nPoints
++
]
=
pt
;
}
}
}
...
...
@@ -319,9 +317,9 @@ distributeAndMergePatches
}
tgtPoints
.
transfer
(
newTgtPoints
);
for
All
(
tgtFaces
,
i
)
for
(
face
&
f
:
tgtFaces
)
{
inplaceRenumber
(
oldToNew
,
tgtFaces
[
i
]
);
inplaceRenumber
(
oldToNew
,
f
);
}
}
}
...
...
@@ -447,7 +445,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcProcMap
label
nRecv
=
sendSizes
[
proci
][
Pstream
::
myProcNo
()];
constructMap
[
proci
].
setSize
(
nRecv
);
for
(
label
i
=
0
;
i
<
nRecv
;
i
++
)
for
(
label
i
=
0
;
i
<
nRecv
;
++
i
)
{
constructMap
[
proci
][
i
]
=
segmentI
++
;
}
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C
View file @
d016590b
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015
-2018
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -167,9 +167,9 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::writeIntersectionOBJ
OFstream
os
(
"areas"
+
name
(
count
)
+
".obj"
);
for
All
(
f1pts
,
i
)
for
(
const
point
&
pt
:
f1pts
)
{
meshTools
::
writeOBJ
(
os
,
f1pts
[
i
]
);
meshTools
::
writeOBJ
(
os
,
pt
);
}
os
<<
"l"
;
forAll
(
f1pts
,
i
)
...
...
@@ -178,19 +178,19 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::writeIntersectionOBJ
}
os
<<
" 1"
<<
endl
;
forAll
(
f2pts
,
i
)
for
(
const
point
&
pt
:
f2pts
)
{
meshTools
::
writeOBJ
(
os
,
f2pts
[
i
]
);
meshTools
::
writeOBJ
(
os
,
pt
);
}
os
<<
"l"
;
const
label
n
=
f1pts
.
size
();
forAll
(
f2pts
,
i
)
{
os
<<
" "
<<
f1pts
.
size
()
+
i
+
1
;
os
<<
" "
<<
n
+
i
+
1
;
}
os
<<
" "
<<
f1pts
.
size
()
+
1
<<
endl
;
os
<<
" "
<<
n
+
1
<<
endl
;
count
++
;
++
count
;
}