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
88
Issues
88
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
43
Merge Requests
43
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
39029706
Commit
39029706
authored
Apr 15, 2019
by
David Moxey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for Chris' comments
parent
3e3f1e50
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
39 deletions
+78
-39
library/Demos/LibUtilities/ErrorStream.cpp
library/Demos/LibUtilities/ErrorStream.cpp
+2
-9
library/LibUtilities/BasicUtils/ErrorUtil.hpp
library/LibUtilities/BasicUtils/ErrorUtil.hpp
+4
-3
library/LibUtilities/BasicUtils/NekFactory.hpp
library/LibUtilities/BasicUtils/NekFactory.hpp
+4
-6
library/MultiRegions/SubStructuredGraph.cpp
library/MultiRegions/SubStructuredGraph.cpp
+2
-3
library/NekMeshUtils/CADSystem/OCE/CADSurfOCE.cpp
library/NekMeshUtils/CADSystem/OCE/CADSurfOCE.cpp
+0
-1
library/NekMeshUtils/CADSystem/OCE/CADSystemOCE.cpp
library/NekMeshUtils/CADSystem/OCE/CADSystemOCE.cpp
+2
-3
tests/Metric.h
tests/Metric.h
+4
-12
tests/TestData.cpp
tests/TestData.cpp
+1
-2
tests/TestException.hpp
tests/TestException.hpp
+59
-0
No files found.
library/Demos/LibUtilities/ErrorStream.cpp
View file @
39029706
...
...
@@ -55,16 +55,9 @@ int main(int argc, char *argv[])
// with missing file.
try
{
std
::
vector
<
std
::
string
>
arguments
=
{
"ErrorStream"
,
"missing.xml"
};
std
::
vector
<
char
*>
argv
;
for
(
const
auto
&
arg
:
arguments
)
{
argv
.
push_back
((
char
*
)
arg
.
data
());
}
argv
.
push_back
(
nullptr
);
char
const
*
fake_argv
[
2
]
=
{
"ErrorStream"
,
"missing.xml"
};
LibUtilities
::
SessionReaderSharedPtr
session
=
LibUtilities
::
SessionReader
::
CreateInstance
(
2
,
&
argv
[
0
]);
LibUtilities
::
SessionReader
::
CreateInstance
(
2
,
&
fake_
argv
[
0
]);
session
->
InitSession
();
}
catch
(
const
ErrorUtil
::
NekError
&
e
)
...
...
library/LibUtilities/BasicUtils/ErrorUtil.hpp
View file @
39029706
...
...
@@ -52,8 +52,9 @@
namespace
Nektar
{
struct
ErrorUtil
class
ErrorUtil
{
public:
class
NekError
:
public
std
::
runtime_error
{
public:
...
...
@@ -75,7 +76,7 @@ struct ErrorUtil
inline
static
bool
HasCustomErrorStream
()
{
return
m_outStream
=
=
&
std
::
cerr
;
return
m_outStream
!
=
&
std
::
cerr
;
}
inline
static
void
Error
(
ErrType
type
,
...
...
@@ -94,7 +95,7 @@ struct ErrorUtil
" assertion violation
\n
"
;
#if defined(NEKTAR_DEBUG) || defined(NEKTAR_FULLDEBUG)
baseMsg
+=
"Where : "
+
std
::
string
(
routine
)
+
"["
+
std
::
to_string
(
lineNumber
)
+
"]
\n
"
;
std
::
to_string
(
lineNumber
)
+
"]
\n
Message :
"
;
#endif
baseMsg
+=
std
::
string
(
msg
);
...
...
library/LibUtilities/BasicUtils/NekFactory.hpp
View file @
39029706
...
...
@@ -104,8 +104,6 @@ template <typename tKey, // reference tag (e.g. string, int)
class
NekFactory
{
public:
/// Description datatype
typedef
std
::
string
tDescription
;
/// Comparison predicator of key
typedef
std
::
less
<
tKey
>
tPredicator
;
/// Shared pointer to an object of baseclass type.
...
...
@@ -117,7 +115,7 @@ public:
/// Define a struct to hold the information about a module.
struct
ModuleEntry
{
ModuleEntry
(
CreatorFunction
pFunc
,
const
tDescription
pDesc
)
ModuleEntry
(
CreatorFunction
pFunc
,
const
std
::
string
pDesc
)
:
m_func
(
pFunc
),
m_desc
(
pDesc
)
{
...
...
@@ -126,7 +124,7 @@ public:
/// Function used to create instance of class.
CreatorFunction
m_func
;
/// Description of class for use in listing available classes.
tDescription
m_desc
;
std
::
string
m_desc
;
};
/// Factory map between key and module data.
...
...
@@ -200,7 +198,7 @@ public:
* @returns The given key \c idKey.
*/
tKey
RegisterCreatorFunction
(
tKey
idKey
,
CreatorFunction
classCreator
,
tDescription
pDesc
=
""
)
std
::
string
pDesc
=
""
)
{
#ifdef NEKTAR_USE_THREAD_SAFETY
WriteLock
vWriteLock
(
m_mutex
);
...
...
@@ -261,7 +259,7 @@ public:
/**
* @brief Retrieves a key, given a description
*/
tKey
GetKey
(
tDescription
pDesc
)
tKey
GetKey
(
std
::
string
pDesc
)
{
#ifdef NEKTAR_USE_THREAD_SAFETY
ReadLock
vReadLock
(
m_mutex
);
...
...
library/MultiRegions/SubStructuredGraph.cpp
View file @
39029706
...
...
@@ -40,7 +40,6 @@
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <boost/lexical_cast.hpp>
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/cuthill_mckee_ordering.hpp>
...
...
@@ -838,7 +837,7 @@ namespace Nektar
boost
::
replace_all
(
strat_str
,
"<BBAL>"
,
"0.1"
);
boost
::
replace_all
(
strat_str
,
"<TSTS>"
,
"vert>"
+
boost
::
lexical_cast
<
std
::
string
>
(
mdswitch
));
"vert>"
+
std
::
to_string
(
mdswitch
));
// Set up the re-ordering strategy.
SCOTCH_Strat
strat
;
...
...
@@ -931,7 +930,7 @@ namespace Nektar
for
(
i
=
0
;
i
<
nGraphVerts
;
++
i
)
{
ASSERTL1
(
perm
[
iperm
[
i
]]
==
i
,
"Perm error "
+
boost
::
lexical_cast
<
std
::
string
>
(
i
));
+
std
::
to_string
(
i
));
}
// If we were passed a graph with disconnected regions, we need
...
...
library/NekMeshUtils/CADSystem/OCE/CADSurfOCE.cpp
View file @
39029706
...
...
@@ -34,7 +34,6 @@
////////////////////////////////////////////////////////////////////////////////
#include <NekMeshUtils/CADSystem/OCE/CADSurfOCE.h>
#include <boost/lexical_cast.hpp>
using
namespace
std
;
...
...
library/NekMeshUtils/CADSystem/OCE/CADSystemOCE.cpp
View file @
39029706
...
...
@@ -43,7 +43,6 @@
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
using
namespace
std
;
...
...
@@ -418,7 +417,7 @@ TopoDS_Shape CADSystemOCE::BuildNACA(string naca)
ParseUtils
::
GenerateVector
(
m_naca
,
data
);
ASSERTL0
(
data
.
size
()
==
5
,
"not a vaild domain"
);
int
n
=
boost
::
lexical_cast
<
int
>
(
naca
);
int
n
=
std
::
stoi
(
naca
);
NekDouble
T
=
(
n
%
100
)
/
100.0
;
n
/=
100
;
NekDouble
P
=
(
n
%
10
)
/
10.0
;
...
...
@@ -577,7 +576,7 @@ TopoDS_Shape CADSystemOCE::BuildGeo(string geo)
string
type
=
tmp2
[
0
];
boost
::
erase_all
(
tmp2
[
1
],
")"
);
boost
::
erase_all
(
tmp2
[
1
],
" "
);
int
id
=
boost
::
lexical_cast
<
int
>
(
tmp2
[
1
]);
int
id
=
std
::
stoi
(
tmp2
[
1
]);
boost
::
erase_all
(
tmp1
[
1
],
" "
);
boost
::
erase_all
(
tmp1
[
1
],
"{"
);
...
...
tests/Metric.h
View file @
39029706
...
...
@@ -40,15 +40,8 @@
#include <string>
#include <map>
#include <boost/filesystem.hpp>
#include <exception>
struct
TesterException
:
public
std
::
runtime_error
{
TesterException
(
const
std
::
string
&
msg
)
:
std
::
runtime_error
(
msg
)
{}
};
#define ASSERTL0(condition, msg) \
if (!(condition)) { throw TesterException(msg); }
#include <TestException.hpp>
namespace
fs
=
boost
::
filesystem
;
...
...
@@ -56,7 +49,6 @@ std::string PortablePath(const boost::filesystem::path& path);
namespace
Nektar
{
/**
* @brief Check to see whether the given string @p s is empty (or null).
*/
...
...
@@ -88,7 +80,7 @@ namespace Nektar
{
return
m_id
;
}
protected:
/// Stores the ID of this metric.
int
m_id
;
...
...
@@ -110,8 +102,9 @@ namespace Nektar
/// Datatype of the NekFactory used to instantiate classes derived from the
/// Advection class.
struct
MetricFactory
class
MetricFactory
{
public:
typedef
MetricSharedPtr
(
*
CreatorFunction
)(
TiXmlElement
*
,
bool
);
std
::
string
RegisterCreatorFunction
(
std
::
string
key
,
CreatorFunction
func
)
...
...
@@ -133,5 +126,4 @@ namespace Nektar
MetricFactory
&
GetMetricFactory
();
}
#endif
tests/TestData.cpp
View file @
39029706
...
...
@@ -37,8 +37,7 @@
#include <boost/algorithm/string.hpp>
#include <TestData.h>
#define ASSERTL0(condition,msg)
#include <TestException.hpp>
using
namespace
std
;
...
...
tests/TestException.hpp
0 → 100644
View file @
39029706
///////////////////////////////////////////////////////////////////////////////
//
// File: Metric.h
//
// 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: Definition of the metric base class.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_TESTS_TESTEXCEPTION_H
#define NEKTAR_TESTS_TESTEXCEPTION_H
#include <exception>
namespace
Nektar
{
/**
* @brief Subclass of std::runtime_error to handle exceptions raised by Tester.
*/
struct
TesterException
:
public
std
::
runtime_error
{
TesterException
(
const
std
::
string
&
msg
)
:
std
::
runtime_error
(
msg
)
{
}
};
#define ASSERTL0(condition, msg) \
if (!(condition)) { throw TesterException(msg); }
}
#endif
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