Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Nektar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
87
Issues
87
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
44
Merge Requests
44
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nektar
Nektar
Commits
845fa910
Commit
845fa910
authored
Jul 04, 2017
by
David Moxey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process NekMesh to eliminate last iterators
parent
7b9539c6
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
490 additions
and
741 deletions
+490
-741
library/Collections/Collection.h
library/Collections/Collection.h
+0
-2
library/LibUtilities/BasicUtils/Concepts.hpp
library/LibUtilities/BasicUtils/Concepts.hpp
+0
-62
library/LibUtilities/CMakeLists.txt
library/LibUtilities/CMakeLists.txt
+0
-1
library/LibUtilities/LinearAlgebra/NekPoint.hpp
library/LibUtilities/LinearAlgebra/NekPoint.hpp
+0
-4
library/LibUtilities/LinearAlgebra/ScaledMatrix.hpp
library/LibUtilities/LinearAlgebra/ScaledMatrix.hpp
+0
-2
library/SpatialDomains/Geometry2D.cpp
library/SpatialDomains/Geometry2D.cpp
+0
-1
utilities/NekMesh/InputModules/InputGmsh.cpp
utilities/NekMesh/InputModules/InputGmsh.cpp
+13
-21
utilities/NekMesh/InputModules/InputMCF.cpp
utilities/NekMesh/InputModules/InputMCF.cpp
+4
-8
utilities/NekMesh/InputModules/InputNek.cpp
utilities/NekMesh/InputModules/InputNek.cpp
+12
-22
utilities/NekMesh/InputModules/InputNek5000.cpp
utilities/NekMesh/InputModules/InputNek5000.cpp
+4
-7
utilities/NekMesh/InputModules/InputNekpp.cpp
utilities/NekMesh/InputModules/InputNekpp.cpp
+0
-2
utilities/NekMesh/InputModules/InputSem.cpp
utilities/NekMesh/InputModules/InputSem.cpp
+3
-4
utilities/NekMesh/InputModules/InputStar.cpp
utilities/NekMesh/InputModules/InputStar.cpp
+4
-6
utilities/NekMesh/InputModules/InputStarTec.cpp
utilities/NekMesh/InputModules/InputStarTec.cpp
+5
-7
utilities/NekMesh/OutputModules/OutputGmsh.cpp
utilities/NekMesh/OutputModules/OutputGmsh.cpp
+12
-20
utilities/NekMesh/OutputModules/OutputNekpp.cpp
utilities/NekMesh/OutputModules/OutputNekpp.cpp
+89
-134
utilities/NekMesh/OutputModules/OutputSTL.cpp
utilities/NekMesh/OutputModules/OutputSTL.cpp
+4
-7
utilities/NekMesh/OutputModules/OutputVtk.cpp
utilities/NekMesh/OutputModules/OutputVtk.cpp
+1
-4
utilities/NekMesh/ProcessModules/ProcessBL.cpp
utilities/NekMesh/ProcessModules/ProcessBL.cpp
+11
-17
utilities/NekMesh/ProcessModules/ProcessDetectSurf.cpp
utilities/NekMesh/ProcessModules/ProcessDetectSurf.cpp
+10
-14
utilities/NekMesh/ProcessModules/ProcessExtractSurf.cpp
utilities/NekMesh/ProcessModules/ProcessExtractSurf.cpp
+18
-25
utilities/NekMesh/ProcessModules/ProcessExtractTetPrismInterface.cpp
...ekMesh/ProcessModules/ProcessExtractTetPrismInterface.cpp
+9
-11
utilities/NekMesh/ProcessModules/ProcessExtrude.cpp
utilities/NekMesh/ProcessModules/ProcessExtrude.cpp
+10
-13
utilities/NekMesh/ProcessModules/ProcessInsertSurface.cpp
utilities/NekMesh/ProcessModules/ProcessInsertSurface.cpp
+8
-9
utilities/NekMesh/ProcessModules/ProcessLinear.cpp
utilities/NekMesh/ProcessModules/ProcessLinear.cpp
+11
-21
utilities/NekMesh/ProcessModules/ProcessLinkCheck.cpp
utilities/NekMesh/ProcessModules/ProcessLinkCheck.cpp
+4
-8
utilities/NekMesh/ProcessModules/ProcessOptiExtract.cpp
utilities/NekMesh/ProcessModules/ProcessOptiExtract.cpp
+35
-41
utilities/NekMesh/ProcessModules/ProcessPerAlign.cpp
utilities/NekMesh/ProcessModules/ProcessPerAlign.cpp
+11
-14
utilities/NekMesh/ProcessModules/ProcessSpherigon.cpp
utilities/NekMesh/ProcessModules/ProcessSpherigon.cpp
+59
-85
utilities/NekMesh/ProcessModules/ProcessTetSplit.cpp
utilities/NekMesh/ProcessModules/ProcessTetSplit.cpp
+2
-6
utilities/NekMesh/ProcessModules/ProcessVarOpti/Evaluator.hxx
...ities/NekMesh/ProcessModules/ProcessVarOpti/Evaluator.hxx
+47
-49
utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.cpp
utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.cpp
+3
-4
utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.h
utilities/NekMesh/ProcessModules/ProcessVarOpti/NodeOpti.h
+7
-8
utilities/NekMesh/ProcessModules/ProcessVarOpti/PreProcessing.cpp
...s/NekMesh/ProcessModules/ProcessVarOpti/PreProcessing.cpp
+89
-95
utilities/NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.cpp
.../NekMesh/ProcessModules/ProcessVarOpti/ProcessVarOpti.cpp
+5
-7
No files found.
library/Collections/Collection.h
View file @
845fa910
...
...
@@ -45,8 +45,6 @@
#include <Collections/Operator.h>
#include <Collections/CoalescedGeomData.h>
#include <boost/unordered_map.hpp>
namespace
Nektar
{
namespace
Collections
{
...
...
library/LibUtilities/BasicUtils/Concepts.hpp
deleted
100644 → 0
View file @
7b9539c6
////////////////////////////////////////////////////////////////////////////////
//
// File: Concepts.hpp
//
// For more information, please see: http://www.nektar.info/
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Defines concepts for the boost concept checking library.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_LIB_UTILITIES_CONCEPTS_HPP
#define NEKTAR_LIB_UTILITIES_CONCEPTS_HPP
namespace
Nektar
{
template
<
typename
DataType
>
class
AssignableConcept
{
public:
void
constraints
()
{
DataType
*
lhs
=
NULL
;
DataType
*
rhs
=
NULL
;
*
lhs
=
*
rhs
;
const_constraints
(
*
rhs
);
}
void
const_constraints
(
const
DataType
&
rhs
)
{
DataType
*
lhs
=
NULL
;
(
*
lhs
)
=
rhs
;
}
};
}
#endif
library/LibUtilities/CMakeLists.txt
View file @
845fa910
...
...
@@ -8,7 +8,6 @@ SET(BasicConstHeaders
SET
(
BasicUtilsHeaders
./BasicUtils/ArrayPolicies.hpp
./BasicUtils/BoostUtil.hpp
./BasicUtils/Concepts.hpp
./BasicUtils/ConsistentObjectAccess.hpp
./BasicUtils/CompressData.h
./BasicUtils/Equation.h
...
...
library/LibUtilities/LinearAlgebra/NekPoint.hpp
View file @
845fa910
...
...
@@ -37,10 +37,8 @@
#define NEKTAR_LIB_UTILITIES_NEK_POINT_HPP
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <LibUtilities/BasicUtils/Concepts.hpp>
#include <LibUtilities/BasicConst/NektarUnivTypeDefs.hpp>
#include <boost/concept_check.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/tokenizer.hpp>
#include <boost/call_traits.hpp>
...
...
@@ -91,8 +89,6 @@ namespace Nektar
explicit
NekPoint
(
typename
boost
::
call_traits
<
DataType
>::
const_reference
a
)
{
boost
::
function_requires
<
Nektar
::
AssignableConcept
<
DataType
>
>
();
for
(
unsigned
int
i
=
0
;
i
<
dim
::
Value
;
++
i
)
{
m_data
[
i
]
=
a
;
...
...
library/LibUtilities/LinearAlgebra/ScaledMatrix.hpp
View file @
845fa910
...
...
@@ -41,8 +41,6 @@
#include <LibUtilities/LinearAlgebra/MatrixBase.hpp>
#include <LibUtilities/LinearAlgebra/NekVector.hpp>
#include <boost/shared_ptr.hpp>
namespace
Nektar
{
template
<
typename
DataType
,
typename
InnerMatrixType
>
...
...
library/SpatialDomains/Geometry2D.cpp
View file @
845fa910
...
...
@@ -35,7 +35,6 @@
////////////////////////////////////////////////////////////////////////////////
#include <SpatialDomains/Geometry2D.h>
#include <SpatialDomains/SegGeom.h>
#include <boost/shared_ptr.hpp>
#include <iomanip>
...
...
utilities/NekMesh/InputModules/InputGmsh.cpp
View file @
845fa910
...
...
@@ -729,13 +729,10 @@ void InputGmsh::Process()
int
prevId
=
-
1
;
int
maxTagId
=
-
1
;
map
<
unsigned
int
,
ElmtConfig
>::
iterator
it
;
// This map takes each element ID and maps it to a permutation map
// that is required to take Gmsh element node orderings and map them
// to Nektar++ orderings.
std
::
unordered_map
<
int
,
vector
<
int
>
>
orderingMap
;
std
::
unordered_map
<
int
,
vector
<
int
>
>::
iterator
oIt
;
if
(
m_mesh
->
m_verbose
)
{
...
...
@@ -803,7 +800,7 @@ void InputGmsh::Process()
st
>>
id
>>
elm_type
>>
num_tag
;
id
-=
1
;
// counter starts at 0
it
=
elmMap
.
find
(
elm_type
);
auto
it
=
elmMap
.
find
(
elm_type
);
if
(
it
==
elmMap
.
end
())
{
cerr
<<
"Error: element type "
<<
elm_type
...
...
@@ -835,7 +832,7 @@ void InputGmsh::Process()
}
// Look up reordering.
oIt
=
orderingMap
.
find
(
elm_type
);
auto
oIt
=
orderingMap
.
find
(
elm_type
);
// If it's not created, then create it.
if
(
oIt
==
orderingMap
.
end
())
...
...
@@ -872,8 +869,6 @@ void InputGmsh::Process()
// Go through element and remap tags if necessary.
map
<
int
,
map
<
LibUtilities
::
ShapeType
,
int
>
>
compMap
;
map
<
int
,
map
<
LibUtilities
::
ShapeType
,
int
>
>::
iterator
cIt
;
map
<
LibUtilities
::
ShapeType
,
int
>::
iterator
sIt
;
for
(
int
i
=
0
;
i
<
m_mesh
->
m_element
[
m_mesh
->
m_expDim
].
size
();
++
i
)
{
...
...
@@ -883,7 +878,7 @@ void InputGmsh::Process()
vector
<
int
>
tags
=
el
->
GetTagList
();
int
tag
=
tags
[
0
];
cIt
=
compMap
.
find
(
tag
);
auto
cIt
=
compMap
.
find
(
tag
);
if
(
cIt
==
compMap
.
end
())
{
...
...
@@ -892,7 +887,7 @@ void InputGmsh::Process()
}
// Reset tag for this element.
sIt
=
cIt
->
second
.
find
(
type
);
auto
sIt
=
cIt
->
second
.
find
(
type
);
if
(
sIt
==
cIt
->
second
.
end
())
{
maxTagId
++
;
...
...
@@ -908,9 +903,9 @@ void InputGmsh::Process()
}
bool
printInfo
=
false
;
for
(
cIt
=
compMap
.
begin
();
cIt
!=
compMap
.
end
();
++
cIt
)
for
(
auto
&
cIt
:
compMap
)
{
if
(
cIt
->
second
.
size
()
>
1
)
if
(
cIt
.
second
.
size
()
>
1
)
{
printInfo
=
true
;
break
;
...
...
@@ -920,16 +915,16 @@ void InputGmsh::Process()
if
(
printInfo
)
{
cout
<<
"Multiple elements in composite detected; remapped:"
<<
endl
;
for
(
cIt
=
compMap
.
begin
();
cIt
!=
compMap
.
end
();
++
cIt
)
for
(
auto
&
cIt
:
compMap
)
{
if
(
cIt
->
second
.
size
()
>
1
)
if
(
cIt
.
second
.
size
()
>
1
)
{
sIt
=
cIt
->
second
.
begin
();
cout
<<
"- Tag "
<<
cIt
->
first
<<
" => "
<<
sIt
->
second
<<
" ("
auto
sIt
=
cIt
.
second
.
begin
();
cout
<<
"- Tag "
<<
cIt
.
first
<<
" => "
<<
sIt
->
second
<<
" ("
<<
LibUtilities
::
ShapeTypeMap
[
sIt
->
first
]
<<
")"
;
sIt
++
;
for
(;
sIt
!=
cIt
->
second
.
end
();
++
sIt
)
for
(;
sIt
!=
cIt
.
second
.
end
();
++
sIt
)
{
cout
<<
", "
<<
sIt
->
second
<<
" ("
<<
LibUtilities
::
ShapeTypeMap
[
sIt
->
first
]
<<
")"
;
...
...
@@ -954,9 +949,8 @@ void InputGmsh::Process()
int
InputGmsh
::
GetNnodes
(
unsigned
int
InputGmshEntity
)
{
int
nNodes
;
map
<
unsigned
int
,
ElmtConfig
>::
iterator
it
;
it
=
elmMap
.
find
(
InputGmshEntity
);
auto
it
=
elmMap
.
find
(
InputGmshEntity
);
if
(
it
==
elmMap
.
end
())
{
...
...
@@ -1010,9 +1004,7 @@ int InputGmsh::GetNnodes(unsigned int InputGmshEntity)
*/
vector
<
int
>
InputGmsh
::
CreateReordering
(
unsigned
int
InputGmshEntity
)
{
map
<
unsigned
int
,
ElmtConfig
>::
iterator
it
;
it
=
elmMap
.
find
(
InputGmshEntity
);
auto
it
=
elmMap
.
find
(
InputGmshEntity
);
if
(
it
==
elmMap
.
end
())
{
...
...
utilities/NekMesh/InputModules/InputMCF.cpp
View file @
845fa910
...
...
@@ -170,9 +170,7 @@ void InputMCF::ParseFile(string nm)
}
}
map
<
string
,
string
>::
iterator
it
;
it
=
information
.
find
(
"CADFile"
);
auto
it
=
information
.
find
(
"CADFile"
);
ASSERTL0
(
it
!=
information
.
end
(),
"no cadfile defined"
);
m_cadfile
=
it
->
second
;
...
...
@@ -263,8 +261,7 @@ void InputMCF::ParseFile(string nm)
m_nacadomain
=
ss
.
str
();
}
set
<
string
>::
iterator
sit
;
sit
=
boolparameters
.
find
(
"SurfaceOptimiser"
);
auto
sit
=
boolparameters
.
find
(
"SurfaceOptimiser"
);
m_surfopti
=
sit
!=
boolparameters
.
end
();
sit
=
boolparameters
.
find
(
"WriteOctree"
);
m_woct
=
sit
!=
boolparameters
.
end
();
...
...
@@ -523,14 +520,13 @@ void InputMCF::Process()
vector
<
string
>
lines
;
boost
::
split
(
lines
,
m_periodic
,
boost
::
is_any_of
(
":"
));
for
(
vector
<
string
>::
iterator
il
=
lines
.
begin
();
il
!=
lines
.
end
();
++
il
)
for
(
auto
&
il
:
lines
)
{
module
=
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"peralign"
),
m_mesh
);
vector
<
string
>
tmp
(
2
);
boost
::
split
(
tmp
,
*
il
,
boost
::
is_any_of
(
","
));
boost
::
split
(
tmp
,
il
,
boost
::
is_any_of
(
","
));
module
->
RegisterConfig
(
"surf1"
,
tmp
[
0
]);
}
...
...
utilities/NekMesh/InputModules/InputNek.cpp
View file @
845fa910
...
...
@@ -292,8 +292,7 @@ void InputNek::Process()
for
(
j
=
0
;
j
<
tmp
.
size
();
++
j
)
{
vector
<
int
>
tags
;
map
<
LibUtilities
::
ShapeType
,
int
>::
iterator
compIt
=
domainComposite
.
find
(
elType
);
auto
compIt
=
domainComposite
.
find
(
elType
);
if
(
compIt
==
domainComposite
.
end
())
{
tags
.
push_back
(
nComposite
);
...
...
@@ -311,8 +310,7 @@ void InputNek::Process()
for
(
k
=
0
;
k
<
nodeList
.
size
();
++
k
)
{
pair
<
NodeSet
::
iterator
,
bool
>
testIns
=
m_mesh
->
m_vertexSet
.
insert
(
nodeList
[
k
]);
auto
testIns
=
m_mesh
->
m_vertexSet
.
insert
(
nodeList
[
k
]);
if
(
!
testIns
.
second
)
{
...
...
@@ -397,8 +395,6 @@ void InputNek::Process()
int
nCurvedSides
;
int
faceId
,
elId
;
map
<
string
,
pair
<
NekCurve
,
string
>
>::
iterator
it
;
HOSurfSet
::
iterator
hoIt
;
s
.
clear
();
s
.
str
(
line
);
...
...
@@ -438,7 +434,7 @@ void InputNek::Process()
faceId
=
t
->
m_orientationMap
[
faceId
];
}
it
=
curveTags
.
find
(
word
);
auto
it
=
curveTags
.
find
(
word
);
if
(
it
==
curveTags
.
end
())
{
cerr
<<
"Unrecognised curve tag "
<<
word
<<
" in curved lines"
...
...
@@ -488,8 +484,7 @@ void InputNek::Process()
for
(
j
=
0
;
j
<
tmp
.
size
();
++
j
)
{
int
id
=
tmp
[(
j
+
offset
)
%
tmp
.
size
()]
->
m_id
;
std
::
unordered_map
<
int
,
Node
>::
iterator
vIt
=
m_mesh
->
m_vertexNormals
.
find
(
id
);
auto
vIt
=
m_mesh
->
m_vertexNormals
.
find
(
id
);
if
(
vIt
==
m_mesh
->
m_vertexNormals
.
end
())
{
...
...
@@ -556,7 +551,7 @@ void InputNek::Process()
HOSurfSharedPtr
hs
=
std
::
shared_ptr
<
HOSurf
>
(
new
HOSurf
(
vertId
));
// Find vertex combination in hoData.
hoIt
=
hoData
[
word
].
find
(
hs
);
auto
hoIt
=
hoData
[
word
].
find
(
hs
);
if
(
hoIt
==
hoData
[
word
].
end
())
{
...
...
@@ -781,12 +776,10 @@ void InputNek::Process()
// Now attempt to find this boundary condition inside
// m_mesh->condition. This is currently a linear search and should
// probably be made faster!
ConditionMap
::
iterator
it
;
bool
found
=
false
;
for
(
it
=
m_mesh
->
m_condition
.
begin
();
it
!=
m_mesh
->
m_condition
.
end
();
++
it
)
for
(
auto
&
it
:
m_mesh
->
m_condition
)
{
if
(
c
==
it
->
second
)
if
(
c
==
it
.
second
)
{
found
=
true
;
break
;
...
...
@@ -893,9 +886,7 @@ void InputNek::Process()
else
{
// Otherwise find existing composite inside surfaceCompMap.
map
<
int
,
vector
<
pair
<
int
,
LibUtilities
::
ShapeType
>
>
>::
iterator
it2
;
it2
=
surfaceCompMap
.
find
(
it
->
first
);
auto
it2
=
surfaceCompMap
.
find
(
it
->
first
);
found
=
false
;
if
(
it2
==
surfaceCompMap
.
end
())
...
...
@@ -958,17 +949,16 @@ void InputNek::Process()
*/
void
InputNek
::
LoadHOSurfaces
()
{
map
<
string
,
pair
<
NekCurve
,
string
>
>::
iterator
it
;
int
nodeId
=
m_mesh
->
GetNumEntities
();
for
(
it
=
curveTags
.
begin
();
it
!=
curveTags
.
end
();
++
it
)
for
(
auto
&
it
:
curveTags
)
{
ifstream
hsf
;
string
line
,
fileName
=
it
->
second
.
second
;
string
line
,
fileName
=
it
.
second
.
second
;
size_t
pos
;
int
N
,
Nface
,
dot
;
if
(
it
->
second
.
first
!=
eFile
)
if
(
it
.
second
.
first
!=
eFile
)
{
continue
;
}
...
...
@@ -1109,7 +1099,7 @@ void InputNek::LoadHOSurfaces()
abort
();
}
hoData
[
it
->
first
].
insert
(
hoData
[
it
.
first
].
insert
(
HOSurfSharedPtr
(
new
HOSurf
(
nodeIds
,
faceMap
[
i
])));
}
...
...
utilities/NekMesh/InputModules/InputNek5000.cpp
View file @
845fa910
...
...
@@ -219,8 +219,7 @@ void InputNek5000::Process()
nodeList
[
k
]
=
std
::
shared_ptr
<
Node
>
(
new
Node
(
0
,
vertex
[
k
][
0
],
vertex
[
k
][
1
],
vertex
[
k
][
2
]));
pair
<
NodeSet
::
iterator
,
bool
>
testIns
=
m_mesh
->
m_vertexSet
.
insert
(
nodeList
[
k
]);
auto
testIns
=
m_mesh
->
m_vertexSet
.
insert
(
nodeList
[
k
]);
if
(
!
testIns
.
second
)
{
...
...
@@ -671,15 +670,13 @@ void InputNek5000::Process()
// Now attempt to find this boundary condition inside
// m_mesh->condition. This is currently a linear search and should
// probably be made faster!
ConditionMap
::
iterator
it
;
bool
found
=
false
;
for
(
it
=
m_mesh
->
m_condition
.
begin
();
it
!=
m_mesh
->
m_condition
.
end
();
++
it
)
for
(
auto
&
it
:
m_mesh
->
m_condition
)
{
if
(
c
==
it
->
second
)
if
(
c
==
it
.
second
)
{
found
=
true
;
c
=
it
->
second
;
c
=
it
.
second
;
break
;
}
}
...
...
utilities/NekMesh/InputModules/InputNekpp.cpp
View file @
845fa910
...
...
@@ -91,9 +91,7 @@ void InputNekpp::Process()
}
map
<
int
,
EdgeSharedPtr
>
eIdMap
;
map
<
int
,
EdgeSharedPtr
>::
iterator
itEmap
;
map
<
int
,
FaceSharedPtr
>
fIdMap
;
map
<
int
,
FaceSharedPtr
>::
iterator
itFmap
;
// Load up all edges from graph
{
...
...
utilities/NekMesh/InputModules/InputSem.cpp
View file @
845fa910
...
...
@@ -85,7 +85,6 @@ void InputSem::Process()
}
// Read through input file and populate the section map.
map
<
string
,
streampos
>::
iterator
it
;
string
fileContents
,
line
,
word
;
stringstream
ss
,
ssFile
;
streampos
linePos
;
...
...
@@ -112,11 +111,11 @@ void InputSem::Process()
// Iterate over all tokens and see if section exists on this
// line.
for
(
it
=
sectionMap
.
begin
();
it
!=
sectionMap
.
end
();
++
it
)
for
(
auto
&
it
:
sectionMap
)
{
if
(
word
==
"<"
+
it
->
first
||
word
==
"<"
+
it
->
first
+
">"
)
if
(
word
==
"<"
+
it
.
first
||
word
==
"<"
+
it
.
first
+
">"
)
{
sectionMap
[
it
->
first
]
=
linePos
;
sectionMap
[
it
.
first
]
=
linePos
;
}
}
}
...
...
utilities/NekMesh/InputModules/InputStar.cpp
View file @
845fa910
...
...
@@ -222,7 +222,6 @@ void InputStar::ResetNodes(vector<NodeSharedPtr> &Vnodes,
vector
<
vector
<
int
>
>
FaceToPrisms
(
FaceNodes
.
size
());
vector
<
vector
<
int
>
>
PrismToFaces
(
ElementFaces
.
num_elements
());
map
<
int
,
int
>
Prisms
;
map
<
int
,
int
>::
iterator
PrismIt
;
// generate map of prism-faces to prisms and prism to
// triangular-faces as well as ids of each prism.
...
...
@@ -260,11 +259,10 @@ void InputStar::ResetNodes(vector<NodeSharedPtr> &Vnodes,
// For every prism find the list of prismatic elements
// that represent an aligned block of cells. Then renumber
// these blocks consecutativiesly
for
(
PrismIt
=
Prisms
.
begin
();
PrismIt
!=
Prisms
.
end
();
++
PrismIt
)
for
(
auto
&
PrismIt
:
Prisms
)
{
int
elmtid
=
PrismIt
->
first
;
int
elmtid
=
PrismIt
.
first
;
map
<
int
,
int
>
facelist
;
map
<
int
,
int
>::
iterator
faceIt
;
if
(
PrismDone
[
elmtid
])
{
...
...
@@ -277,9 +275,9 @@ void InputStar::ResetNodes(vector<NodeSharedPtr> &Vnodes,
elmtid
,
facelist
,
FaceToPrisms
,
PrismToFaces
,
PrismDone
);
// loop over faces and number vertices of associated prisms.
for
(
faceIt
=
facelist
.
begin
();
faceIt
!=
facelist
.
end
();
faceIt
++
)
for
(
auto
&
faceIt
:
facelist
)
{
int
faceid
=
faceIt
->
second
;
int
faceid
=
faceIt
.
second
;
for
(
i
=
0
;
i
<
FaceToPrisms
[
faceid
].
size
();
++
i
)
{
...
...
utilities/NekMesh/InputModules/InputStarTec.cpp
View file @
845fa910
...
...
@@ -394,7 +394,7 @@ void InputTec::ReadZone(int &nComposite)
// identify
for
(
i
=
0
;
i
<
Nodes
.
size
();
++
i
)
{
NodeSet
::
iterator
it
=
m_mesh
->
m_vertexSet
.
find
(
Nodes
[
i
]);
auto
it
=
m_mesh
->
m_vertexSet
.
find
(
Nodes
[
i
]);
if
(
it
==
m_mesh
->
m_vertexSet
.
end
())
{
...
...
@@ -436,7 +436,6 @@ void InputTec::ResetNodes(vector<NodeSharedPtr> &Vnodes,
vector
<
vector
<
int
>
>
FaceToPrisms
(
FaceNodes
.
size
());
vector
<
vector
<
int
>
>
PrismToFaces
(
ElementFaces
.
num_elements
());
map
<
int
,
int
>
Prisms
;
map
<
int
,
int
>::
iterator
PrismIt
;
// generate map of prism-faces to prisms and prism to
// triangular-faces as well as ids of each prism.
...
...
@@ -474,11 +473,10 @@ void InputTec::ResetNodes(vector<NodeSharedPtr> &Vnodes,
// For every prism find the list of prismatic elements
// that represent an aligned block of cells. Then renumber
// these blocks consecutativiesly
for
(
PrismIt
=
Prisms
.
begin
();
PrismIt
!=
Prisms
.
end
();
++
PrismIt
)
for
(
auto
&
PrismIt
:
Prisms
)
{
int
elmtid
=
PrismIt
->
first
;
int
elmtid
=
PrismIt
.
first
;
map
<
int
,
int
>
facelist
;
map
<
int
,
int
>::
iterator
faceIt
;
if
(
PrismDone
[
elmtid
])
{
...
...
@@ -491,9 +489,9 @@ void InputTec::ResetNodes(vector<NodeSharedPtr> &Vnodes,
elmtid
,
facelist
,
FaceToPrisms
,
PrismToFaces
,
PrismDone
);
// loop over faces and number vertices of associated prisms.
for
(
faceIt
=
facelist
.
begin
();
faceIt
!=
facelist
.
end
();
faceIt
++
)
for
(
auto
&
faceIt
:
facelist
)
{
int
faceid
=
faceIt
->
second
;
int
faceid
=
faceIt
.
second
;
for
(
i
=
0
;
i
<
FaceToPrisms
[
faceid
].
size
();
++
i
)
{
...
...
utilities/NekMesh/OutputModules/OutputGmsh.cpp
View file @
845fa910
...
...
@@ -55,14 +55,11 @@ ModuleKey OutputGmsh::className =
OutputGmsh
::
OutputGmsh
(
MeshSharedPtr
m
)
:
OutputModule
(
m
)
{
map
<
unsigned
int
,
ElmtConfig
>
igelmap
=
InputGmsh
::
GenElmMap
();
map
<
unsigned
int
,
ElmtConfig
>::
iterator
it
;
// Populate #InputGmsh::elmMap and use this to construct an
// inverse mapping from %ElmtConfig to Gmsh ID.
for
(
it
=
igelmap
.
begin
();
it
!=
igelmap
.
end
();
++
it
)
for
(
auto
&
it
:
InputGmsh
::
GenElmMap
()
)
{
elmMap
[
it
->
second
]
=
it
->
first
;
elmMap
[
it
.
second
]
=
it
.
first
;
}
m_config
[
"order"
]
=
ConfigOption
(
false
,
"-1"
,
"Enforce a polynomial order"
);
...
...
@@ -90,7 +87,6 @@ void OutputGmsh::Process()
}
std
::
unordered_map
<
int
,
vector
<
int
>
>
orderingMap
;
std
::
unordered_map
<
int
,
vector
<
int
>
>::
iterator
oIt
;
// Open the file stream.
OpenStream
();
...
...
@@ -135,19 +131,16 @@ void OutputGmsh::Process()
m_mesh
->
MakeOrder
(
order
,
LibUtilities
::
ePolyEvenlySpaced
);
// Add edge- and face-interior nodes to vertex set.
EdgeSet
::
iterator
eIt
;
FaceSet
::
iterator
fIt
;
for
(
eIt
=
m_mesh
->
m_edgeSet
.
begin
();
eIt
!=
m_mesh
->
m_edgeSet
.
end
();
++
eIt
)
for
(
auto
&
eIt
:
m_mesh
->
m_edgeSet
)
{
m_mesh
->
m_vertexSet
.
insert
(
(
*
eIt
)
->
m_edgeNodes
.
begin
(),
(
*
eIt
)
->
m_edgeNodes
.
end
());
m_mesh
->
m_vertexSet
.
insert
(
eIt
->
m_edgeNodes
.
begin
(),
eIt
->
m_edgeNodes
.
end
());
}
for
(
fIt
=
m_mesh
->
m_faceSet
.
begin
();
fIt
!=
m_mesh
->
m_faceSet
.
end
();
++
fI
t
)
for
(
auto
&
fIt
:
m_mesh
->
m_faceSe
t
)
{
m_mesh
->
m_vertexSet
.
insert
(
(
*
fIt
)
->
m_faceNodes
.
begin
(),
(
*
fIt
)
->
m_faceNodes
.
end
());
m_mesh
->
m_vertexSet
.
insert
(
fIt
->
m_faceNodes
.
begin
(),
fIt
->
m_faceNodes
.
end
());
}
// Do second pass over elements for volume nodes.
...
...
@@ -162,17 +155,16 @@ void OutputGmsh::Process()
}
// Create ordered set of nodes - not required but looks nicer.
std
::
set
<
NodeSharedPtr
>::
iterator
it
;
std
::
set
<
NodeSharedPtr
>
tmp
(
m_mesh
->
m_vertexSet
.
begin
(),
m_mesh
->
m_vertexSet
.
end
());
// Write out nodes section.
m_mshFile
<<
"$Nodes"
<<
endl
<<
m_mesh
->
m_vertexSet
.
size
()
<<
endl
;
for
(
it
=
tmp
.
begin
();
it
!=
tmp
.
end
();
++
it
)
for
(
auto
&
it
:
tmp
)
{
m_mshFile
<<
(
*
it
)
->
m_id
+
1
<<
" "
<<
scientific
<<
setprecision
(
10
)
<<
(
*
it
)
->
m_x
<<
" "
<<
(
*
it
)
->
m_y
<<
" "
<<
(
*
it
)
->
m_z
m_mshFile
<<
it
->
m_id
+
1
<<
" "
<<
scientific
<<
setprecision
(
10
)
<<
it
->
m_x
<<
" "
<<
it
->
m_y
<<
" "
<<
it
->
m_z
<<
endl
;
}
...
...
@@ -290,7 +282,7 @@ void OutputGmsh::Process()
// Construct inverse of input reordering. First try to find it in
// our cache.
oIt
=
orderingMap
.
find
(
elmtType
);
auto
oIt
=
orderingMap
.
find
(
elmtType
);
// If it's not created, then create it.
if
(
oIt
==
orderingMap
.
end
())
...
...
utilities/NekMesh/OutputModules/OutputNekpp.cpp
View file @
845fa910
This diff is collapsed.
Click to expand it.
utilities/NekMesh/OutputModules/OutputSTL.cpp
View file @
845fa910
...
...
@@ -69,19 +69,16 @@ void OutputSTL::Process()
m_mshFile
<<
std
::
scientific
<<
setprecision
(
8
);
CompositeMap
::
iterator
it
;