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
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hector Diaz
Nektar
Commits
92a9d46b
Commit
92a9d46b
authored
Jul 20, 2016
by
Dave Moxey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run new FieldUtils library through clang-format
parent
38c18f5b
Changes
88
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
88 changed files
with
4632 additions
and
4719 deletions
+4632
-4719
.clang-format
.clang-format
+0
-1
library/FieldUtils/Field.hpp
library/FieldUtils/Field.hpp
+256
-265
library/FieldUtils/FieldUtilsDeclspec.h
library/FieldUtils/FieldUtilsDeclspec.h
+7
-8
library/FieldUtils/InputModules/InputDat.cpp
library/FieldUtils/InputModules/InputDat.cpp
+40
-49
library/FieldUtils/InputModules/InputDat.h
library/FieldUtils/InputModules/InputDat.h
+20
-20
library/FieldUtils/InputModules/InputFld.cpp
library/FieldUtils/InputModules/InputFld.cpp
+67
-81
library/FieldUtils/InputModules/InputFld.h
library/FieldUtils/InputModules/InputFld.h
+16
-17
library/FieldUtils/InputModules/InputPts.cpp
library/FieldUtils/InputModules/InputPts.cpp
+10
-15
library/FieldUtils/InputModules/InputPts.h
library/FieldUtils/InputModules/InputPts.h
+16
-18
library/FieldUtils/InputModules/InputXml.cpp
library/FieldUtils/InputModules/InputXml.cpp
+99
-112
library/FieldUtils/InputModules/InputXml.h
library/FieldUtils/InputModules/InputXml.h
+16
-17
library/FieldUtils/Interpolator.cpp
library/FieldUtils/Interpolator.cpp
+22
-26
library/FieldUtils/Interpolator.h
library/FieldUtils/Interpolator.h
+15
-18
library/FieldUtils/Module.cpp
library/FieldUtils/Module.cpp
+96
-98
library/FieldUtils/Module.h
library/FieldUtils/Module.h
+201
-198
library/FieldUtils/OutputModules/OutputFld.cpp
library/FieldUtils/OutputModules/OutputFld.cpp
+69
-72
library/FieldUtils/OutputModules/OutputFld.h
library/FieldUtils/OutputModules/OutputFld.h
+16
-16
library/FieldUtils/OutputModules/OutputInfo.cpp
library/FieldUtils/OutputModules/OutputInfo.cpp
+14
-14
library/FieldUtils/OutputModules/OutputInfo.h
library/FieldUtils/OutputModules/OutputInfo.h
+16
-17
library/FieldUtils/OutputModules/OutputPts.cpp
library/FieldUtils/OutputModules/OutputPts.cpp
+3
-4
library/FieldUtils/OutputModules/OutputPts.h
library/FieldUtils/OutputModules/OutputPts.h
+1
-1
library/FieldUtils/OutputModules/OutputStdOut.h
library/FieldUtils/OutputModules/OutputStdOut.h
+1
-2
library/FieldUtils/OutputModules/OutputTecplot.cpp
library/FieldUtils/OutputModules/OutputTecplot.cpp
+260
-272
library/FieldUtils/OutputModules/OutputTecplot.h
library/FieldUtils/OutputModules/OutputTecplot.h
+24
-27
library/FieldUtils/OutputModules/OutputVtk.cpp
library/FieldUtils/OutputModules/OutputVtk.cpp
+137
-129
library/FieldUtils/OutputModules/OutputVtk.h
library/FieldUtils/OutputModules/OutputVtk.h
+17
-18
library/FieldUtils/OutputModules/OutputXml.cpp
library/FieldUtils/OutputModules/OutputXml.cpp
+4
-8
library/FieldUtils/OutputModules/OutputXml.h
library/FieldUtils/OutputModules/OutputXml.h
+6
-6
library/FieldUtils/ProcessModules/ProcessAddFld.cpp
library/FieldUtils/ProcessModules/ProcessAddFld.cpp
+49
-55
library/FieldUtils/ProcessModules/ProcessAddFld.h
library/FieldUtils/ProcessModules/ProcessAddFld.h
+16
-17
library/FieldUtils/ProcessModules/ProcessBoundaryExtract.cpp
library/FieldUtils/ProcessModules/ProcessBoundaryExtract.cpp
+36
-34
library/FieldUtils/ProcessModules/ProcessBoundaryExtract.h
library/FieldUtils/ProcessModules/ProcessBoundaryExtract.h
+14
-15
library/FieldUtils/ProcessModules/ProcessC0Projection.cpp
library/FieldUtils/ProcessModules/ProcessC0Projection.cpp
+88
-70
library/FieldUtils/ProcessModules/ProcessC0Projection.h
library/FieldUtils/ProcessModules/ProcessC0Projection.h
+16
-17
library/FieldUtils/ProcessModules/ProcessCombineAvg.cpp
library/FieldUtils/ProcessModules/ProcessCombineAvg.cpp
+62
-68
library/FieldUtils/ProcessModules/ProcessCombineAvg.h
library/FieldUtils/ProcessModules/ProcessCombineAvg.h
+18
-18
library/FieldUtils/ProcessModules/ProcessConcatenateFld.cpp
library/FieldUtils/ProcessModules/ProcessConcatenateFld.cpp
+19
-21
library/FieldUtils/ProcessModules/ProcessConcatenateFld.h
library/FieldUtils/ProcessModules/ProcessConcatenateFld.h
+14
-14
library/FieldUtils/ProcessModules/ProcessDeform.cpp
library/FieldUtils/ProcessModules/ProcessDeform.cpp
+30
-31
library/FieldUtils/ProcessModules/ProcessDeform.h
library/FieldUtils/ProcessModules/ProcessDeform.h
+2
-3
library/FieldUtils/ProcessModules/ProcessDisplacement.cpp
library/FieldUtils/ProcessModules/ProcessDisplacement.cpp
+207
-218
library/FieldUtils/ProcessModules/ProcessDisplacement.h
library/FieldUtils/ProcessModules/ProcessDisplacement.h
+2
-3
library/FieldUtils/ProcessModules/ProcessEquiSpacedOutput.cpp
...ary/FieldUtils/ProcessModules/ProcessEquiSpacedOutput.cpp
+288
-292
library/FieldUtils/ProcessModules/ProcessEquiSpacedOutput.h
library/FieldUtils/ProcessModules/ProcessEquiSpacedOutput.h
+23
-24
library/FieldUtils/ProcessModules/ProcessGrad.cpp
library/FieldUtils/ProcessModules/ProcessGrad.cpp
+59
-65
library/FieldUtils/ProcessModules/ProcessGrad.h
library/FieldUtils/ProcessModules/ProcessGrad.h
+15
-16
library/FieldUtils/ProcessModules/ProcessHomogeneousPlane.cpp
...ary/FieldUtils/ProcessModules/ProcessHomogeneousPlane.cpp
+12
-12
library/FieldUtils/ProcessModules/ProcessHomogeneousPlane.h
library/FieldUtils/ProcessModules/ProcessHomogeneousPlane.h
+0
-1
library/FieldUtils/ProcessModules/ProcessHomogeneousStretch.cpp
...y/FieldUtils/ProcessModules/ProcessHomogeneousStretch.cpp
+20
-20
library/FieldUtils/ProcessModules/ProcessHomogeneousStretch.h
...ary/FieldUtils/ProcessModules/ProcessHomogeneousStretch.h
+1
-2
library/FieldUtils/ProcessModules/ProcessInnerProduct.cpp
library/FieldUtils/ProcessModules/ProcessInnerProduct.cpp
+15
-29
library/FieldUtils/ProcessModules/ProcessInnerProduct.h
library/FieldUtils/ProcessModules/ProcessInnerProduct.h
+0
-1
library/FieldUtils/ProcessModules/ProcessInterpField.cpp
library/FieldUtils/ProcessModules/ProcessInterpField.cpp
+64
-75
library/FieldUtils/ProcessModules/ProcessInterpField.h
library/FieldUtils/ProcessModules/ProcessInterpField.h
+18
-18
library/FieldUtils/ProcessModules/ProcessInterpPointDataToFld.cpp
...FieldUtils/ProcessModules/ProcessInterpPointDataToFld.cpp
+28
-36
library/FieldUtils/ProcessModules/ProcessInterpPointDataToFld.h
...y/FieldUtils/ProcessModules/ProcessInterpPointDataToFld.h
+20
-21
library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp
library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp
+279
-238
library/FieldUtils/ProcessModules/ProcessInterpPoints.h
library/FieldUtils/ProcessModules/ProcessInterpPoints.h
+23
-24
library/FieldUtils/ProcessModules/ProcessIsoContour.cpp
library/FieldUtils/ProcessModules/ProcessIsoContour.cpp
+484
-476
library/FieldUtils/ProcessModules/ProcessIsoContour.h
library/FieldUtils/ProcessModules/ProcessIsoContour.h
+185
-190
library/FieldUtils/ProcessModules/ProcessJacobianEnergy.cpp
library/FieldUtils/ProcessModules/ProcessJacobianEnergy.cpp
+28
-29
library/FieldUtils/ProcessModules/ProcessJacobianEnergy.h
library/FieldUtils/ProcessModules/ProcessJacobianEnergy.h
+16
-17
library/FieldUtils/ProcessModules/ProcessMapping.cpp
library/FieldUtils/ProcessModules/ProcessMapping.cpp
+91
-100
library/FieldUtils/ProcessModules/ProcessMapping.h
library/FieldUtils/ProcessModules/ProcessMapping.h
+0
-1
library/FieldUtils/ProcessModules/ProcessMeanMode.cpp
library/FieldUtils/ProcessModules/ProcessMeanMode.cpp
+3
-3
library/FieldUtils/ProcessModules/ProcessMeanMode.h
library/FieldUtils/ProcessModules/ProcessMeanMode.h
+4
-5
library/FieldUtils/ProcessModules/ProcessMultiShear.cpp
library/FieldUtils/ProcessModules/ProcessMultiShear.cpp
+158
-137
library/FieldUtils/ProcessModules/ProcessMultiShear.h
library/FieldUtils/ProcessModules/ProcessMultiShear.h
+15
-16
library/FieldUtils/ProcessModules/ProcessNumModes.cpp
library/FieldUtils/ProcessModules/ProcessNumModes.cpp
+5
-4
library/FieldUtils/ProcessModules/ProcessNumModes.h
library/FieldUtils/ProcessModules/ProcessNumModes.h
+15
-16
library/FieldUtils/ProcessModules/ProcessPointDataToFld.cpp
library/FieldUtils/ProcessModules/ProcessPointDataToFld.cpp
+90
-79
library/FieldUtils/ProcessModules/ProcessPointDataToFld.h
library/FieldUtils/ProcessModules/ProcessPointDataToFld.h
+16
-16
library/FieldUtils/ProcessModules/ProcessPrintFldNorms.cpp
library/FieldUtils/ProcessModules/ProcessPrintFldNorms.cpp
+6
-10
library/FieldUtils/ProcessModules/ProcessPrintFldNorms.h
library/FieldUtils/ProcessModules/ProcessPrintFldNorms.h
+14
-16
library/FieldUtils/ProcessModules/ProcessQCriterion.cpp
library/FieldUtils/ProcessModules/ProcessQCriterion.cpp
+73
-101
library/FieldUtils/ProcessModules/ProcessQCriterion.h
library/FieldUtils/ProcessModules/ProcessQCriterion.h
+15
-16
library/FieldUtils/ProcessModules/ProcessQualityMetric.cpp
library/FieldUtils/ProcessModules/ProcessQualityMetric.cpp
+137
-120
library/FieldUtils/ProcessModules/ProcessQualityMetric.h
library/FieldUtils/ProcessModules/ProcessQualityMetric.h
+17
-18
library/FieldUtils/ProcessModules/ProcessScalGrad.cpp
library/FieldUtils/ProcessModules/ProcessScalGrad.cpp
+71
-59
library/FieldUtils/ProcessModules/ProcessScalGrad.h
library/FieldUtils/ProcessModules/ProcessScalGrad.h
+15
-15
library/FieldUtils/ProcessModules/ProcessScaleInFld.cpp
library/FieldUtils/ProcessModules/ProcessScaleInFld.cpp
+20
-20
library/FieldUtils/ProcessModules/ProcessScaleInFld.h
library/FieldUtils/ProcessModules/ProcessScaleInFld.h
+16
-17
library/FieldUtils/ProcessModules/ProcessSurfDistance.cpp
library/FieldUtils/ProcessModules/ProcessSurfDistance.cpp
+28
-28
library/FieldUtils/ProcessModules/ProcessSurfDistance.h
library/FieldUtils/ProcessModules/ProcessSurfDistance.h
+15
-16
library/FieldUtils/ProcessModules/ProcessVorticity.cpp
library/FieldUtils/ProcessModules/ProcessVorticity.cpp
+77
-81
library/FieldUtils/ProcessModules/ProcessVorticity.h
library/FieldUtils/ProcessModules/ProcessVorticity.h
+15
-16
library/FieldUtils/ProcessModules/ProcessWSS.cpp
library/FieldUtils/ProcessModules/ProcessWSS.cpp
+101
-95
library/FieldUtils/ProcessModules/ProcessWSS.h
library/FieldUtils/ProcessModules/ProcessWSS.h
+15
-15
No files found.
.clang-format
View file @
92a9d46b
...
...
@@ -14,4 +14,3 @@ IndentCaseLabels: true
Standard: Cpp03
AccessModifierOffset: -4
BinPackParameters: false
BinPackArguments: false
library/FieldUtils/Field.hpp
View file @
92a9d46b
This diff is collapsed.
Click to expand it.
library/FieldUtils/FieldUtilsDeclspec.h
View file @
92a9d46b
...
...
@@ -34,16 +34,15 @@
#define NEKTAR_FIELD_UTILS_DECLSPEC_H
#if defined(_MSC_VER)
#ifdef FIELD_UTILS_EXPORTS
#define FIELD_UTILS_EXPORT _declspec(dllexport)
#else
#define FIELD_UTILS_EXPORT _declspec(dllimport)
#endif
#ifdef FIELD_UTILS_EXPORTS
#define FIELD_UTILS_EXPORT _declspec(dllexport)
#else
#define FIELD_UTILS_EXPORT
#define FIELD_UTILS_EXPORT _declspec(dllimport)
#endif
#else
#define FIELD_UTILS_EXPORT
#endif
#define LOKI_CLASS_LEVEL_THREADING
#endif //NEKTAR_FIELD_UTILS_DECLSPEC_H
#endif // NEKTAR_FIELD_UTILS_DECLSPEC_H
library/FieldUtils/InputModules/InputDat.cpp
View file @
92a9d46b
...
...
@@ -33,12 +33,12 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <string>
#include <iostream>
#include <string>
using
namespace
std
;
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <tinyxml.h>
...
...
@@ -51,9 +51,9 @@ namespace FieldUtils
ModuleKey
InputDat
::
m_className
[
1
]
=
{
GetModuleFactory
().
RegisterCreatorFunction
(
ModuleKey
(
eInputModule
,
"dat"
),
InputDat
::
create
,
"Reads Tecplot dat file for FE block triangular format."
),
ModuleKey
(
eInputModule
,
"dat"
),
InputDat
::
create
,
"Reads Tecplot dat file for FE block triangular format."
),
};
/**
...
...
@@ -65,7 +65,6 @@ InputDat::InputDat(FieldSharedPtr f) : InputModule(f)
m_allowedFiles
.
insert
(
"dat"
);
}
/**
*
*/
...
...
@@ -73,29 +72,27 @@ InputDat::~InputDat()
{
}
/**
*
*/
void
InputDat
::
Process
(
po
::
variables_map
&
vm
)
{
if
(
m_f
->
m_verbose
)
if
(
m_f
->
m_verbose
)
{
if
(
m_f
->
m_comm
->
TreatAsRankZero
())
if
(
m_f
->
m_comm
->
TreatAsRankZero
())
{
cout
<<
"Processing input dat file"
<<
endl
;
}
}
string
line
,
word
,
tag
;
string
line
,
word
,
tag
;
std
::
ifstream
datFile
;
stringstream
s
;
// Open the file stream.
string
fname
=
m_f
->
m_inputfiles
[
"dat"
][
0
];
datFile
.
open
(
fname
.
c_str
());
if
(
!
datFile
.
good
())
{
...
...
@@ -111,17 +108,18 @@ void InputDat::Process(po::variables_map &vm)
{
getline
(
datFile
,
line
);
if
(
line
.
find
(
"VARIABLES"
)
!=
string
::
npos
)
if
(
line
.
find
(
"VARIABLES"
)
!=
string
::
npos
)
{
std
::
size_t
pos
=
line
.
find
(
'='
);
std
::
size_t
pos
=
line
.
find
(
'='
);
pos
++
;
// note this expects a comma separated list but
// does not work for white space separated lists!
bool
valid
=
ParseUtils
::
GenerateOrderedStringVector
(
line
.
substr
(
pos
).
c_str
(),
fieldNames
);
ASSERTL0
(
valid
,
"Unable to process list of field variable in "
" VARIABLES list: "
+
line
.
substr
(
pos
));
line
.
substr
(
pos
).
c_str
(),
fieldNames
);
ASSERTL0
(
valid
,
"Unable to process list of field variable in "
" VARIABLES list: "
+
line
.
substr
(
pos
));
// remove coordinates from fieldNames
fieldNames
.
erase
(
fieldNames
.
begin
(),
fieldNames
.
begin
()
+
dim
);
...
...
@@ -141,9 +139,9 @@ void InputDat::Process(po::variables_map &vm)
{
getline
(
datFile
,
line
);
if
((
line
.
find
(
"ZONE"
)
!=
string
::
npos
)
||
(
line
.
find
(
"Zone"
)
!=
string
::
npos
)
||
(
line
.
find
(
"zone"
)
!=
string
::
npos
))
if
((
line
.
find
(
"ZONE"
)
!=
string
::
npos
)
||
(
line
.
find
(
"Zone"
)
!=
string
::
npos
)
||
(
line
.
find
(
"zone"
)
!=
string
::
npos
))
{
ReadTecplotFEBlockZone
(
datFile
,
line
,
pts
,
ptsConn
);
}
...
...
@@ -151,88 +149,81 @@ void InputDat::Process(po::variables_map &vm)
datFile
.
close
();
m_f
->
m_fieldPts
=
MemoryManager
<
LibUtilities
::
PtsField
>::
AllocateSharedPtr
(
dim
,
fieldNames
,
pts
);
m_f
->
m_fieldPts
=
MemoryManager
<
LibUtilities
::
PtsField
>::
AllocateSharedPtr
(
dim
,
fieldNames
,
pts
);
m_f
->
m_fieldPts
->
SetPtsType
(
LibUtilities
::
ePtsTriBlock
);
m_f
->
m_fieldPts
->
SetConnectivity
(
ptsConn
);
}
/**
*
*/
void
InputDat
::
ReadTecplotFEBlockZone
(
std
::
ifstream
&
datFile
,
string
&
line
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
pts
,
vector
<
Array
<
OneD
,
int
>
>
&
ptsConn
)
void
InputDat
::
ReadTecplotFEBlockZone
(
std
::
ifstream
&
datFile
,
string
&
line
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
pts
,
vector
<
Array
<
OneD
,
int
>
>
&
ptsConn
)
{
ASSERTL0
(
line
.
find
(
"FEBlock"
)
!=
string
::
npos
,
"Routine only set up for FEBLock format"
);
ASSERTL0
(
line
.
find
(
"ET"
)
!=
string
::
npos
,
"Routine only set up TRIANLES"
);
ASSERTL0
(
line
.
find
(
"ET"
)
!=
string
::
npos
,
"Routine only set up TRIANLES"
);
// read the number of nodes
stringstream
s
;
string
tag
;
int
start
,
end
;
int
start
,
end
;
s
.
clear
();
s
.
str
(
line
);
tag
=
s
.
str
();
// read the number of vertices
start
=
tag
.
find
(
"N="
);
end
=
tag
.
find_first_of
(
','
,
start
);
int
nvert
=
atoi
(
tag
.
substr
(
start
+
2
,
end
).
c_str
());
start
=
tag
.
find
(
"N="
);
end
=
tag
.
find_first_of
(
','
,
start
);
int
nvert
=
atoi
(
tag
.
substr
(
start
+
2
,
end
).
c_str
());
// read the number of elements
start
=
tag
.
find
(
"E="
);
end
=
tag
.
find_first_of
(
','
,
start
);
int
nelmt
=
atoi
(
tag
.
substr
(
start
+
2
,
end
).
c_str
());
start
=
tag
.
find
(
"E="
);
end
=
tag
.
find_first_of
(
','
,
start
);
int
nelmt
=
atoi
(
tag
.
substr
(
start
+
2
,
end
).
c_str
());
// set-up or extend m_pts array;
int
norigpts
=
pts
[
0
].
num_elements
();
int
totfields
=
pts
.
num_elements
();
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
origpts
(
totfields
);
for
(
int
i
=
0
;
i
<
totfields
;
++
i
)
for
(
int
i
=
0
;
i
<
totfields
;
++
i
)
{
origpts
[
i
]
=
pts
[
i
];
pts
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
norigpts
+
nvert
);
pts
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
norigpts
+
nvert
);
}
NekDouble
value
;
for
(
int
n
=
0
;
n
<
totfields
;
++
n
)
for
(
int
n
=
0
;
n
<
totfields
;
++
n
)
{
for
(
int
i
=
0
;
i
<
norigpts
;
++
i
)
for
(
int
i
=
0
;
i
<
norigpts
;
++
i
)
{
pts
[
n
][
i
]
=
origpts
[
n
][
i
];
}
for
(
int
i
=
0
;
i
<
nvert
;
++
i
)
for
(
int
i
=
0
;
i
<
nvert
;
++
i
)
{
datFile
>>
value
;
pts
[
n
][
norigpts
+
i
]
=
value
;
pts
[
n
][
norigpts
+
i
]
=
value
;
}
}
// read connectivity and add to list
int
intvalue
;
Array
<
OneD
,
int
>
conn
(
3
*
nelmt
);
for
(
int
i
=
0
;
i
<
3
*
nelmt
;
++
i
)
Array
<
OneD
,
int
>
conn
(
3
*
nelmt
);
for
(
int
i
=
0
;
i
<
3
*
nelmt
;
++
i
)
{
datFile
>>
intvalue
;
intvalue
-=
1
;
// decrement intvalue by 1 for c array convention
intvalue
-=
1
;
// decrement intvalue by 1 for c array convention
conn
[
i
]
=
norigpts
+
intvalue
;
}
ptsConn
.
push_back
(
conn
);
getline
(
datFile
,
line
);
}
}
}
library/FieldUtils/InputModules/InputDat.h
View file @
92a9d46b
...
...
@@ -46,30 +46,30 @@ namespace FieldUtils
/// Input module for Xml files.
class
InputDat
:
public
InputModule
{
public:
InputDat
(
FieldSharedPtr
f
);
virtual
~
InputDat
();
virtual
void
Process
(
po
::
variables_map
&
vm
);
public:
InputDat
(
FieldSharedPtr
f
);
virtual
~
InputDat
();
virtual
void
Process
(
po
::
variables_map
&
vm
);
/// Creates an instance of this class
static
ModuleSharedPtr
create
(
FieldSharedPtr
f
)
{
return
MemoryManager
<
InputDat
>::
AllocateSharedPtr
(
f
);
}
/// %ModuleKey for class.
static
ModuleKey
m_className
[];
/// Creates an instance of this class
static
ModuleSharedPtr
create
(
FieldSharedPtr
f
)
{
return
MemoryManager
<
InputDat
>::
AllocateSharedPtr
(
f
);
}
/// %ModuleKey for class.
static
ModuleKey
m_className
[];
virtual
std
::
string
GetModuleName
()
{
return
"InputDat"
;
}
virtual
std
::
string
GetModuleName
()
{
return
"InputDat"
;
}
private:
void
ReadTecplotFEBlockZone
(
std
::
ifstream
&
datFile
,
string
&
line
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
pts
,
vector
<
Array
<
OneD
,
int
>
>
&
ptsConn
);
private:
void
ReadTecplotFEBlockZone
(
std
::
ifstream
&
datFile
,
string
&
line
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
pts
,
vector
<
Array
<
OneD
,
int
>
>
&
ptsConn
);
};
}
}
#endif
library/FieldUtils/InputModules/InputFld.cpp
View file @
92a9d46b
...
...
@@ -33,15 +33,15 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <string>
#include <iostream>
#include <string>
using
namespace
std
;
#include "InputFld.h"
using
namespace
Nektar
;
static
std
::
string
npts
=
LibUtilities
::
SessionReader
::
RegisterCmdLineArgument
(
"NumberOfPoints"
,
"n"
,
"Define number of points to dump output"
);
"NumberOfPoints"
,
"n"
,
"Define number of points to dump output"
);
namespace
Nektar
{
...
...
@@ -50,19 +50,17 @@ namespace FieldUtils
ModuleKey
InputFld
::
m_className
[
4
]
=
{
GetModuleFactory
().
RegisterCreatorFunction
(
ModuleKey
(
eInputModule
,
"fld"
),
InputFld
::
create
,
"Reads Fld file."
),
GetModuleFactory
().
RegisterCreatorFunction
(
ModuleKey
(
eInputModule
,
"chk"
),
InputFld
::
create
,
"Reads checkpoint file."
),
ModuleKey
(
eInputModule
,
"fld"
),
InputFld
::
create
,
"Reads Fld file."
),
GetModuleFactory
().
RegisterCreatorFunction
(
ModuleKey
(
eInputModule
,
"chk"
),
InputFld
::
create
,
"Reads checkpoint file."
),
GetModuleFactory
().
RegisterCreatorFunction
(
ModuleKey
(
eInputModule
,
"rst"
),
InputFld
::
create
,
"Reads restart file."
),
GetModuleFactory
().
RegisterCreatorFunction
(
ModuleKey
(
eInputModule
,
"rst"
),
InputFld
::
create
,
"Reads restart file."
),
GetModuleFactory
().
RegisterCreatorFunction
(
ModuleKey
(
eInputModule
,
"bse"
),
InputFld
::
create
,
"Reads stability base-flow file."
)
};
ModuleKey
(
eInputModule
,
"bse"
),
InputFld
::
create
,
"Reads stability base-flow file."
)};
/**
* @brief Set up InputFld object.
...
...
@@ -76,7 +74,6 @@ InputFld::InputFld(FieldSharedPtr f) : InputModule(f)
m_allowedFiles
.
insert
(
"bse"
);
}
/**
*
*/
...
...
@@ -84,29 +81,28 @@ InputFld::~InputFld()
{
}
/**
*
*/
void
InputFld
::
Process
(
po
::
variables_map
&
vm
)
{
if
(
m_f
->
m_verbose
)
if
(
m_f
->
m_verbose
)
{
if
(
m_f
->
m_comm
->
TreatAsRankZero
())
if
(
m_f
->
m_comm
->
TreatAsRankZero
())
{
cout
<<
"Processing input fld file"
<<
endl
;
}
}
int
i
,
j
;
int
i
,
j
;
string
fldending
;
//Determine appropriate field input
if
(
m_f
->
m_inputfiles
.
count
(
"fld"
)
!=
0
)
//
Determine appropriate field input
if
(
m_f
->
m_inputfiles
.
count
(
"fld"
)
!=
0
)
{
fldending
=
"fld"
;
}
else
if
(
m_f
->
m_inputfiles
.
count
(
"chk"
)
!=
0
)
else
if
(
m_f
->
m_inputfiles
.
count
(
"chk"
)
!=
0
)
{
fldending
=
"chk"
;
}
...
...
@@ -120,26 +116,27 @@ void InputFld::Process(po::variables_map &vm)
}
else
{
ASSERTL0
(
false
,
"no input file found"
);
ASSERTL0
(
false
,
"no input file found"
);
}
if
(
!
m_f
->
m_fld
)
if
(
!
m_f
->
m_fld
)
{
if
(
m_f
->
m_session
)
if
(
m_f
->
m_session
)
{
m_f
->
m_fld
=
MemoryManager
<
LibUtilities
::
FieldIO
>
::
AllocateSharedPtr
(
m_f
->
m_session
->
GetComm
());
m_f
->
m_fld
=
MemoryManager
<
LibUtilities
::
FieldIO
>::
AllocateSharedPtr
(
m_f
->
m_session
->
GetComm
());
}
else
// serial communicator
{
LibUtilities
::
CommSharedPtr
c
=
LibUtilities
::
GetCommFactory
().
CreateInstance
(
"Serial"
,
0
,
0
);
m_f
->
m_fld
=
MemoryManager
<
LibUtilities
::
FieldIO
>
::
AllocateSharedPtr
(
c
);
LibUtilities
::
CommSharedPtr
c
=
LibUtilities
::
GetCommFactory
().
CreateInstance
(
"Serial"
,
0
,
0
);
m_f
->
m_fld
=
MemoryManager
<
LibUtilities
::
FieldIO
>::
AllocateSharedPtr
(
c
);
}
}
if
(
m_f
->
m_graph
)
if
(
m_f
->
m_graph
)
{
if
(
m_f
->
m_data
.
size
()
==
0
)
{
...
...
@@ -147,20 +144,20 @@ void InputFld::Process(po::variables_map &vm)
// expansion list but it is re-arranged in expansion)
const
SpatialDomains
::
ExpansionMap
&
expansions
=
m_f
->
m_graph
->
GetExpansions
();
m_f
->
m_graph
->
GetExpansions
();
// if Range has been speficied it is possible to have a
// partition which is empty so check this and return if
// no elements present.
if
(
!
expansions
.
size
())
if
(
!
expansions
.
size
())
{
return
;
}
m_f
->
m_exp
.
resize
(
1
);
Array
<
OneD
,
int
>
ElementGIDs
(
expansions
.
size
());
Array
<
OneD
,
int
>
ElementGIDs
(
expansions
.
size
());
SpatialDomains
::
ExpansionMap
::
const_iterator
expIt
;
i
=
0
;
...
...
@@ -172,30 +169,25 @@ void InputFld::Process(po::variables_map &vm)
m_f
->
m_fielddef
.
clear
();
m_f
->
m_data
.
clear
();
m_f
->
m_fld
->
Import
(
m_f
->
m_inputfiles
[
fldending
][
0
],
m_f
->
m_fielddef
,
m_f
->
m_data
,
m_f
->
m_fieldMetaDataMap
,
m_f
->
m_fld
->
Import
(
m_f
->
m_inputfiles
[
fldending
][
0
],
m_f
->
m_fielddef
,
m_f
->
m_data
,
m_f
->
m_fieldMetaDataMap
,
ElementGIDs
);
}
}
else
// load all data.
{
m_f
->
m_fld
->
Import
(
m_f
->
m_inputfiles
[
fldending
][
0
],
m_f
->
m_fielddef
,
m_f
->
m_data
,
m_f
->
m_fieldMetaDataMap
);
m_f
->
m_fld
->
Import
(
m_f
->
m_inputfiles
[
fldending
][
0
],
m_f
->
m_fielddef
,
m_f
->
m_data
,
m_f
->
m_fieldMetaDataMap
);
}
// if m_exp defined presume we want to load all field into expansions
if
(
m_f
->
m_exp
.
size
())
if
(
m_f
->
m_exp
.
size
())
{
int
nfields
,
nstrips
;
int
nfields
,
nstrips
;
m_f
->
m_session
->
LoadParameter
(
"Strip_Z"
,
nstrips
,
1
);
m_f
->
m_session
->
LoadParameter
(
"Strip_Z"
,
nstrips
,
1
);
if
(
vm
.
count
(
"useSessionVariables"
))
if
(
vm
.
count
(
"useSessionVariables"
))
{
nfields
=
m_f
->
m_session
->
GetVariables
().
size
();
}
...
...
@@ -203,77 +195,72 @@ void InputFld::Process(po::variables_map &vm)
{
nfields
=
m_f
->
m_fielddef
[
0
]
->
m_fields
.
size
();
}
m_f
->
m_exp
.
resize
(
nfields
*
nstrips
);
m_f
->
m_exp
.
resize
(
nfields
*
nstrips
);
vector
<
string
>
vars
=
m_f
->
m_session
->
GetVariables
();
// declare other fields;
for
(
int
s
=
0
;
s
<
nstrips
;
++
s
)
//homogeneous strip varient
for
(
int
s
=
0
;
s
<
nstrips
;
++
s
)
//
homogeneous strip varient
{
for
(
i
=
0
;
i
<
nfields
;
++
i
)
{
if
(
i
<
vars
.
size
())
if
(
i
<
vars
.
size
())
{
// check to see if field already defined
if
(
!
m_f
->
m_exp
[
s
*
nfields
+
i
])
// check to see if field already defined
if
(
!
m_f
->
m_exp
[
s
*
nfields
+
i
])
{
m_f
->
m_exp
[
s
*
nfields
+
i
]
=
m_f
->
AppendExpList
(
m_f
->
m_fielddef
[
0
]
->
m_numHomogeneousDir
,
vars
[
i
]);
m_f
->
m_exp
[
s
*
nfields
+
i
]
=
m_f
->
AppendExpList
(
m_f
->
m_fielddef
[
0
]
->
m_numHomogeneousDir
,
vars
[
i
]);
}
}
else
{
if
(
vars
.
size
())
if
(
vars
.
size
())
{
m_f
->
m_exp
[
s
*
nfields
+
i
]
=
m_f
->
AppendExpList
(
m_f
->
m_fielddef
[
0
]
->
m_numHomogeneousDir
,
vars
[
0
]);
m_f
->
m_exp
[
s
*
nfields
+
i
]
=
m_f
->
AppendExpList
(
m_f
->
m_fielddef
[
0
]
->
m_numHomogeneousDir
,
vars
[
0
]);
}
else
{
m_f
->
m_exp
[
s
*
nfields
+
i
]
=
m_f
->
AppendExpList
(
m_f
->
m_fielddef
[
0
]
->
m_numHomogeneousDir
);
m_f
->
m_exp
[
s
*
nfields
+
i
]
=
m_f
->
AppendExpList
(
m_f
->
m_fielddef
[
0
]
->
m_numHomogeneousDir
);
}
}
}
}
// Extract data to coeffs and bwd transform
for
(
int
s
=
0
;
s
<
nstrips
;
++
s
)
//
homogeneous strip varient
for
(
int
s
=
0
;
s
<
nstrips
;
++
s
)
//
homogeneous strip varient
{
for
(
j
=
0
;
j
<
nfields
;
++
j
)
{
for
(
i
=
0
;
i
<
m_f
->
m_data
.
size
()
/
nstrips
;
++
i
)
for
(
i
=
0
;
i
<
m_f
->
m_data
.
size
()
/
nstrips
;
++
i
)
{
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
ExtractDataToCoeffs
(
m_f
->
m_fielddef
[
i
*
nstrips
+
s
],
m_f
->
m_data
[
i
*
nstrips
+
s
],
m_f
->
m_fielddef
[
i
*
nstrips
+
s
]
->
m_fields
[
j
],
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
UpdateCoeffs
());
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
ExtractDataToCoeffs
(
m_f
->
m_fielddef
[
i
*
nstrips
+
s
],
m_f
->
m_data
[
i
*
nstrips
+
s
],
m_f
->
m_fielddef
[
i
*
nstrips
+
s
]
->
m_fields
[
j
],
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
UpdateCoeffs
());
}
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
BwdTrans
(
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
GetCoeffs
(),
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
UpdatePhys
());
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
BwdTrans
(
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
GetCoeffs
(),
m_f
->
m_exp
[
s
*
nfields
+
j
]
->
UpdatePhys
());
}
}
// reset output field in case Import loaded elements that are not
// in the expansion (because of range option of partitioning)
std
::
vector
<
LibUtilities
::
FieldDefinitionsSharedPtr
>
FieldDef
=
m_f
->
m_exp
[
0
]
->
GetFieldDefinitions
();
std
::
vector
<
LibUtilities
::
FieldDefinitionsSharedPtr
>
FieldDef
=
m_f
->
m_exp
[
0
]
->
GetFieldDefinitions
();
std
::
vector
<
std
::
vector
<
NekDouble
>
>
FieldData
(
FieldDef
.
size
());