Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
c826865f
Commit
c826865f
authored
Jan 11, 2009
by
Mark Olesen
Browse files
using .xfer() method instead of xferMoveTo<...> in a few places
parent
95dcb6de
Changes
21
Hide whitespace changes
Inline
Side-by-side
src/OSspecific/Unix/Unix.C
View file @
c826865f
...
...
@@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
UNIX versions of the functions decla
t
ed in OSspecific.H.
UNIX versions of the functions decla
r
ed in OSspecific.H.
\*---------------------------------------------------------------------------*/
...
...
src/OpenFOAM/fields/Fields/Field/Field.C
View file @
c826865f
...
...
@@ -155,6 +155,13 @@ Field<Type>::Field(Field<Type>& f, bool reUse)
{}
template
<
class
Type
>
Field
<
Type
>::
Field
(
const
Xfer
<
List
<
Type
>
>&
f
)
:
List
<
Type
>
(
f
)
{}
template
<
class
Type
>
Field
<
Type
>::
Field
(
const
Xfer
<
Field
<
Type
>
>&
f
)
:
...
...
src/OpenFOAM/fields/Fields/Field/Field.H
View file @
c826865f
...
...
@@ -114,6 +114,9 @@ public:
//- Construct as copy of a UList<Type>
explicit
Field
(
const
UList
<
Type
>&
);
//- Construct by transferring the List contents
explicit
Field
(
const
Xfer
<
List
<
Type
>
>&
);
//- Construct by 1 to 1 mapping from the given field
Field
(
...
...
src/dynamicMesh/polyMeshAdder/polyMeshAdder.H
View file @
c826865f
...
...
@@ -55,7 +55,7 @@ class IOobject;
class
polyTopoChange
;
/*---------------------------------------------------------------------------*\
Class polyMeshAdder Declaration
Class polyMeshAdder Declaration
\*---------------------------------------------------------------------------*/
class
polyMeshAdder
...
...
src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C
View file @
c826865f
...
...
@@ -2952,9 +2952,9 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::changeMesh
mesh
.
resetPrimitives
(
xferMove
(
renumberedMeshPoints
),
xferMoveTo
<
faceList
>
(
faces_
),
xferMoveTo
<
labelList
>
(
faceOwner_
),
xferMoveTo
<
labelList
>
(
faceNeighbour_
),
faces_
.
xfer
(
),
faceOwner_
.
xfer
(
),
faceNeighbour_
.
xfer
(
),
patchSizes
,
patchStarts
,
syncParallel
...
...
@@ -2968,9 +2968,9 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::changeMesh
mesh
.
resetPrimitives
(
xferMove
(
newPoints
),
xferMoveTo
<
faceList
>
(
faces_
),
xferMoveTo
<
labelList
>
(
faceOwner_
),
xferMoveTo
<
labelList
>
(
faceNeighbour_
),
faces_
.
xfer
(
),
faceOwner_
.
xfer
(
),
faceNeighbour_
.
xfer
(
),
patchSizes
,
patchStarts
,
syncParallel
...
...
@@ -3195,9 +3195,9 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::makeMesh
(
io
,
xferMove
(
newPoints
),
xferMoveTo
<
faceList
>
(
faces_
),
xferMoveTo
<
labelList
>
(
faceOwner_
),
xferMoveTo
<
labelList
>
(
faceNeighbour_
)
faces_
.
xfer
(
),
faceOwner_
.
xfer
(
),
faceNeighbour_
.
xfer
(
)
)
);
fvMesh
&
newMesh
=
newMeshPtr
();
...
...
src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
View file @
c826865f
...
...
@@ -110,7 +110,7 @@ bool Foam::surfaceIntersection::excludeEdgeHit
// << " e0Vec:" << e0Vec << " n:" << n
// << " normalComponent:" << (n & surf.faceNormals()[faceI])
// << " tol:" << tol << endl;
//
//
// return true;
// }
// else
...
...
@@ -399,7 +399,7 @@ void Foam::surfaceIntersection::classifyHit
{
// 4. Edge hits edge.
// Cut edge with new point (creates duplicates when
// Cut edge with new point (creates duplicates when
// doing the surf2 with surf1 intersection but these
// are merged later on)
...
...
@@ -509,7 +509,7 @@ void Foam::surfaceIntersection::classifyHit
<<
" coords:"
<<
surf1
.
localPoints
()[
e
.
start
()]
<<
surf1
.
localPoints
()[
e
.
end
()]
<<
endl
;
}
// Reclassify as normal edge-face pierce (see below)
allCutPoints
.
append
(
hitPt
);
...
...
@@ -533,7 +533,7 @@ void Foam::surfaceIntersection::classifyHit
<<
" since edge "
<<
e
<<
" on inside of surf2."
<<
" surf2 normal:"
<<
surf2
.
faceNormals
()[
surf2FaceI
]
<<
endl
;
}
}
}
}
else
...
...
@@ -636,7 +636,7 @@ void Foam::surfaceIntersection::doCutEdges
// Label of face on surface2 edgeI intersected
label
hitFaceI
=
pHit
.
index
();
if
if
(
!
excludeEdgeHit
(
...
...
@@ -803,8 +803,8 @@ Foam::surfaceIntersection::surfaceIntersection
// Transfer to straight label(List)List
transfer
(
edgeCuts2
,
surf2EdgeCuts_
);
transfer
(
allCutEdges
,
cutEdges_
);
transfer
(
allCutPoints
,
cutPoints_
);
cutEdges_
.
transfer
(
allCutEdges
);
cutPoints_
.
transfer
(
allCutPoints
);
if
(
debug
)
...
...
@@ -936,8 +936,8 @@ Foam::surfaceIntersection::surfaceIntersection
// Transfer to straight label(List)List
transfer
(
allCutEdges
,
cutEdges_
);
transfer
(
allCutPoints
,
cutPoints_
);
cutEdges_
.
transfer
(
allCutEdges
);
cutPoints_
.
transfer
(
allCutPoints
);
if
(
debug
)
...
...
@@ -1040,10 +1040,10 @@ Foam::surfaceIntersection::surfaceIntersection
// Transfer to straight label(List)List
transfer
(
edgeCuts1
,
surf1EdgeCuts_
);
transfer
(
allCutEdges
,
cutEdges_
);
transfer
(
allCutPoints
,
cutPoints_
);
cutEdges_
.
transfer
(
allCutEdges
);
cutPoints_
.
transfer
(
allCutPoints
);
// Shortcut.
// Shortcut.
if
(
cutPoints_
.
empty
()
&&
cutEdges_
.
empty
())
{
if
(
debug
)
...
...
@@ -1071,7 +1071,7 @@ Foam::surfaceIntersection::surfaceIntersection
// Merge points
labelList
pointMap
;
pointField
newPoints
;
bool
hasMerged
=
mergePoints
(
cutPoints_
,
...
...
src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.H
View file @
c826865f
...
...
@@ -120,10 +120,6 @@ class surfaceIntersection
Ostream
&
);
//- Transfer contents of DynamicList to straight List
template
<
class
T
>
static
void
transfer
(
DynamicList
<
T
>&
,
List
<
T
>&
);
//- Transfer contents of List<DynamicList<..> > to List<List<..>>
template
<
class
T
>
static
void
transfer
(
List
<
DynamicList
<
T
>
>&
,
List
<
List
<
T
>
>&
);
...
...
src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionTemplates.C
View file @
c826865f
...
...
@@ -34,27 +34,15 @@ Description
template
<
class
T
>
void
Foam
::
surfaceIntersection
::
transfer
(
DynamicList
<
T
>
&
dLi
st
,
List
<
T
>&
lLi
st
List
<
DynamicList
<
T
>
>&
srcL
st
,
List
<
List
<
T
>
>&
dstL
st
)
{
lList
.
transfer
(
dList
);
}
// Transfer contents of DynamicList to List
template
<
class
T
>
void
Foam
::
surfaceIntersection
::
transfer
(
List
<
DynamicList
<
T
>
>&
dList
,
List
<
List
<
T
>
>&
lList
)
{
lList
.
setSize
(
dList
.
size
());
dstLst
.
setSize
(
srcLst
.
size
());
forAll
(
dLi
st
,
elemI
)
forAll
(
srcL
st
,
elemI
)
{
transfer
(
dList
[
elemI
],
lLi
st
[
elemI
]);
dstLst
[
elemI
].
transfer
(
srcL
st
[
elemI
]);
}
}
...
...
src/surfMesh/BasicMeshedSurface/BasicMeshedSurface.C
View file @
c826865f
...
...
@@ -131,6 +131,29 @@ void Foam::BasicMeshedSurface<Face>::reset
}
template
<
class
Face
>
void
Foam
::
BasicMeshedSurface
<
Face
>::
reset
(
const
Xfer
<
List
<
point
>
>&
pointLst
,
const
Xfer
<
List
<
Face
>
>&
faceLst
)
{
ParentType
::
clearOut
();
// Take over new primitive data.
// Optimized to avoid overwriting data at all
if
(
&
pointLst
)
{
storedPoints
().
transfer
(
pointLst
());
}
if
(
&
faceLst
)
{
storedFaces
().
transfer
(
faceLst
());
}
}
// Remove badly degenerate faces, double faces.
template
<
class
Face
>
void
Foam
::
BasicMeshedSurface
<
Face
>::
cleanup
(
const
bool
verbose
)
...
...
src/surfMesh/BasicMeshedSurface/BasicMeshedSurface.H
View file @
c826865f
...
...
@@ -138,6 +138,13 @@ public:
const
Xfer
<
List
<
Face
>
>&
);
//- Transfer components (points, faces).
virtual
void
reset
(
const
Xfer
<
List
<
point
>
>&
,
const
Xfer
<
List
<
Face
>
>&
);
//- Remove invalid faces
virtual
void
cleanup
(
const
bool
verbose
);
...
...
src/surfMesh/MeshedSurface/MeshedSurfaceIO.C
View file @
c826865f
...
...
@@ -62,7 +62,7 @@ bool Foam::MeshedSurface<Face>::read(Istream& is)
surf
.
reset
(
Xfer
<
pointField
>::
null
(),
xferMove
(
faceLst
)
faceLst
.
xfer
(
)
);
surf
.
addPatches
(
patches_
);
...
...
src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C
View file @
c826865f
...
...
@@ -389,12 +389,7 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
}
sortFacesAndStore
(
xferMoveTo
<
List
<
Face
>
>
(
dynFaces
),
xferMoveTo
<
List
<
label
>
>
(
dynRegions
),
sorted
);
sortFacesAndStore
(
dynFaces
.
xfer
(),
dynRegions
.
xfer
(),
sorted
);
// add patches, culling empty groups
this
->
addPatches
(
dynSizes
,
names
,
true
);
...
...
src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C
View file @
c826865f
...
...
@@ -202,12 +202,7 @@ bool Foam::fileFormats::OBJsurfaceFormat<Face>::read
// transfer to normal lists
this
->
storedPoints
().
transfer
(
dynPoints
);
sortFacesAndStore
(
xferMoveTo
<
List
<
Face
>
>
(
dynFaces
),
xferMoveTo
<
List
<
label
>
>
(
dynRegions
),
sorted
);
sortFacesAndStore
(
dynFaces
.
xfer
(),
dynRegions
.
xfer
(),
sorted
);
// add patches, culling empty groups
this
->
addPatches
(
dynSizes
,
dynNames
,
true
);
...
...
src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.C
View file @
c826865f
...
...
@@ -143,11 +143,7 @@ bool Foam::fileFormats::OFFsurfaceFormat<Face>::read
}
// transfer to normal lists
reset
(
xferMove
(
pointLst
),
xferMoveTo
<
List
<
Face
>
>
(
dynFaces
)
);
reset
(
pointLst
.
xfer
(),
dynFaces
.
xfer
());
// no region information
this
->
onePatch
();
...
...
src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.C
View file @
c826865f
...
...
@@ -212,12 +212,7 @@ bool Foam::fileFormats::STARCDsurfaceFormat<Face>::read
}
mapPointId
.
clear
();
sortFacesAndStore
(
xferMoveTo
<
List
<
Face
>
>
(
dynFaces
),
xferMoveTo
<
List
<
label
>
>
(
dynRegions
),
sorted
);
sortFacesAndStore
(
dynFaces
.
xfer
(),
dynRegions
.
xfer
(),
sorted
);
// add patches, culling empty groups
this
->
addPatches
(
dynSizes
,
dynNames
,
true
);
...
...
src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.C
View file @
c826865f
...
...
@@ -293,9 +293,9 @@ bool Foam::fileFormats::STLsurfaceFormat<Face>::read
this
->
storedPoints
().
transfer
(
reader
.
points
());
// retrieve the original region information
List
<
word
>
names
(
xferMove
(
reader
.
names
()));
List
<
label
>
sizes
(
xferMove
(
reader
.
sizes
()));
List
<
label
>
regions
(
xferMove
(
reader
.
regions
()));
List
<
word
>
names
(
reader
.
names
()
.
xfer
(
));
List
<
label
>
sizes
(
reader
.
sizes
()
.
xfer
(
));
List
<
label
>
regions
(
reader
.
regions
()
.
xfer
(
));
// generate the (sorted) faces
List
<
Face
>
faceLst
(
regions
.
size
());
...
...
src/surfMesh/surfaceFormats/surfaceFormatsCore.C
View file @
c826865f
...
...
@@ -267,7 +267,7 @@ Foam::fileFormats::surfaceFormatsCore::checkSupport
else
if
(
verbose
)
{
wordList
toc
=
available
.
toc
();
SortableList
<
word
>
known
(
xferMove
(
toc
));
SortableList
<
word
>
known
(
toc
.
xfer
(
));
Info
<<
"Unknown file extension for "
<<
functionName
<<
" : "
<<
ext
<<
nl
...
...
src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.C
View file @
c826865f
...
...
@@ -88,8 +88,8 @@ bool Foam::fileFormats::TRIsurfaceFormat<Face>::read
this
->
storedPoints
().
transfer
(
reader
.
points
());
// retrieve the original region information
List
<
label
>
sizes
(
xferMove
(
reader
.
sizes
()));
List
<
label
>
regions
(
xferMove
(
reader
.
regions
()));
List
<
label
>
sizes
(
reader
.
sizes
()
.
xfer
(
));
List
<
label
>
regions
(
reader
.
regions
()
.
xfer
(
));
// generate the (sorted) faces
List
<
Face
>
faceLst
(
regions
.
size
());
...
...
src/triSurface/triSurface/interfaces/AC3D/readAC.C
View file @
c826865f
...
...
@@ -326,13 +326,10 @@ bool triSurface::readAC(const fileName& ACfileName)
}
}
points
.
shrink
();
faces
.
shrink
();
// Transfer DynamicLists to straight ones.
pointField
allPoints
;
allPoints
.
transfer
(
points
);
points
.
clear
();
pointField
allPoints
(
points
.
xfer
());
*
this
=
triSurface
(
faces
,
patches
,
allPoints
,
true
);
...
...
src/triSurface/triSurface/interfaces/NAS/readNAS.C
View file @
c826865f
...
...
@@ -353,11 +353,8 @@ bool triSurface::readNAS(const fileName& fName)
Info
<<
"patches:"
<<
patches
<<
endl
;
// Transfer DynamicLists to straight ones.
pointField
allPoints
;
allPoints
.
transfer
(
points
);
points
.
clear
();
pointField
allPoints
(
points
.
xfer
());
// Create triSurface
*
this
=
triSurface
(
faces
,
patches
,
allPoints
,
true
);
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment