Skip to content

Commit 89ad542

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents b385347 + d561b4d commit 89ad542

File tree

136 files changed

+19674
-2622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+19674
-2622
lines changed

.travis.yml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
1-
sudo: required
2-
language:
3-
- cpp
1+
language: c++
42

5-
os:
6-
#Too many slow builds on Travis OSX images causing build errors. Turning off to speed up turn around. We can investigate later. For now, main developers should build on Mac before merging.
7-
#- osx
8-
- linux
9-
10-
compiler:
11-
- clang
12-
# TODO: gcc chokes on a boost pthread usage, disabling for now.
13-
#- gcc
14-
15-
#matrix:
16-
# exclude:
17-
# - os: osx
18-
# compiler: g++
3+
matrix:
4+
include:
5+
- os: linux
6+
dist: trusty
7+
sudo: required
8+
compiler: gcc
9+
- os: linux
10+
dist: trusty
11+
sudo: required
12+
compiler: clang
13+
# - os: osx
14+
# osx_image: xcode7.2
1915

2016
# check environment (copied from libgit2sharp)
2117
before_install:
2218
- date -u
2319
- uname -a
24-
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./ci/linux_before_install.sh; fi
25-
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./ci/osx_before_install.sh; fi
26-
27-
# make sure cmake is installed, set up latest GCC C++ compiler if necessary
28-
install:
29-
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./ci/linux_install.sh; fi
30-
# - if [ "${TRAVIS_OS_NAME}" = "linux" -a "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
31-
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./ci/osx_install.sh; fi
20+
#- sudo apt-get update -qq
3221

3322
# TODO: could move script to separate file
3423
# Not running unit tests at the moment, so turn off testing, which will
3524
# hopefully make OS X builds a bit faster
3625
script:
3726
- cd bin
3827
- cmake -DDOWNLOAD_TOOLKITS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF ../Superbuild
39-
- make -j8
28+
- make -j4 1> /dev/null
4029
# make SCIRunTestData_external
4130
# && make test
4231

ci/linux_before_install.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

ci/linux_install.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

ci/osx_before_install.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

ci/osx_install.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/Core/Algorithms/Field/ReportFieldInfoAlgorithm.cc

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,17 @@ using namespace SCIRun;
4343

4444
ReportFieldInfoAlgorithm::Outputs ReportFieldInfoAlgorithm::update_input_attributes(FieldHandle f) const
4545
{
46-
VField* vfield = f->vfield();
47-
VMesh* vmesh = f->vmesh();
46+
auto vfield = f->vfield();
47+
auto vmesh = f->vmesh();
4848

49-
ReportFieldInfoAlgorithm::Outputs output;
49+
Outputs output;
5050

5151
if (vfield && vmesh)
5252
{
53-
// Get name of field
54-
//std::string fldname;
55-
//if (f->get_property("name",fldname))
56-
//{
57-
// gui_fldname_.set(fldname);
58-
//}
59-
//else
60-
//{
61-
// gui_fldname_.set("--- Name Not Assigned ---");
62-
//}
63-
64-
// Generation
65-
//gui_generation_.set(to_string(f->generation));
66-
67-
// Typename
6853
auto td = f->get_type_description();
6954
if (td)
7055
{
71-
const std::string &tname = td->get_name();
56+
const auto& tname = td->get_name();
7257
output.type = tname;
7358
}
7459
else
@@ -99,7 +84,7 @@ ReportFieldInfoAlgorithm::Outputs ReportFieldInfoAlgorithm::update_input_attribu
9984
Point center;
10085
Vector size;
10186

102-
const BBox bbox = vmesh->get_bounding_box();
87+
const auto bbox = vmesh->get_bounding_box();
10388
if (bbox.valid())
10489
{
10590
size = bbox.diagonal();
@@ -111,7 +96,7 @@ ReportFieldInfoAlgorithm::Outputs ReportFieldInfoAlgorithm::update_input_attribu
11196
{
11297
warning("Input Field is empty.");
11398

114-
const double nan = std::numeric_limits<double>::quiet_NaN();
99+
const auto nan = std::numeric_limits<double>::quiet_NaN();
115100
output.center = Point(nan,nan,nan);
116101
output.size = Vector(nan, nan, nan);
117102

@@ -133,7 +118,7 @@ ReportFieldInfoAlgorithm::Outputs ReportFieldInfoAlgorithm::update_input_attribu
133118
output.dims[p] = static_cast<double>(dim[p]);
134119

135120
output.geometricSize = 0.0;
136-
for (VMesh::Elem::index_type idx=0; idx< output.numelements_; idx++)
121+
for (VMesh::Elem::index_type idx=0; idx< output.numelements_; ++idx)
137122
{
138123
output.geometricSize += vmesh->get_size(idx);
139124
}

src/Core/Algorithms/Field/ReportFieldInfoAlgorithm.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#define ALGORITHMS_MATH_REPORTFIELDINFO_H
3131

3232
#include <Core/Algorithms/Base/AlgorithmBase.h>
33-
#include <Core/Algorithms/Base/AlgorithmMacros.h>
3433
#include <Core/GeometryPrimitives/Vector.h>
3534
#include <Core/GeometryPrimitives/Point.h>
3635
#include <Core/Algorithms/Field/share.h>
@@ -43,7 +42,7 @@ namespace Fields {
4342
class SCISHARE ReportFieldInfoAlgorithm : public AlgorithmBase
4443
{
4544
public:
46-
typedef SCIRun::FieldHandle Inputs;
45+
typedef FieldHandle Inputs;
4746

4847
struct SCISHARE Outputs
4948
{
@@ -61,10 +60,10 @@ namespace Fields {
6160

6261
static std::string summarize(const Outputs& info);
6362

64-
AlgorithmOutput run(const AlgorithmInput& input) const;
63+
AlgorithmOutput run(const AlgorithmInput& input) const override;
6564

6665
private:
67-
Outputs update_input_attributes(SCIRun::FieldHandle f) const;
66+
Outputs update_input_attributes(FieldHandle f) const;
6867
};
6968

7069
}}}}

src/Core/Algorithms/FiniteElements/Tests/BuildFEMatrixTests.cc

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <Core/Datatypes/Legacy/Field/FieldInformation.h>
3232
#include <Core/Datatypes/MatrixTypeConversions.h>
3333
#include <Core/Algorithms/Base/AlgorithmPreconditions.h>
34+
#include <Core/Algorithms/Base/AlgorithmVariableNames.h>
3435
#include <Core/Algorithms/Legacy/FiniteElements/BuildMatrix/BuildFEMatrix.h>
3536
#include <Core/Algorithms/DataIO/ReadMatrix.h>
3637
#include <Testing/Utils/SCIRunUnitTests.h>
@@ -70,18 +71,16 @@ namespace FEInputData
7071

7172
DenseMatrixHandle nullConductivityMatrix()
7273
{
73-
return DenseMatrixHandle();
74+
return nullptr;
7475
}
7576
}
7677

7778
TEST(BuildFEMatrixAlgorithmTests, ThrowsForNullMesh)
7879
{
7980
using namespace FEInputData;
8081
BuildFEMatrixAlgo algo;
81-
SparseRowMatrixHandle output;
8282

83-
EXPECT_FALSE(algo.run(FieldHandle(), nullConductivityMatrix(), output));
84-
/// @todo: consider throwing an exception instead of returning false
83+
EXPECT_THROW(algo.run(withInputData((Variables::InputField, nullptr))), AlgorithmProcessingException);
8584
}
8685

8786
TEST(BuildFEMatrixAlgorithmTests, TestMeshSize1e1)
@@ -94,7 +93,10 @@ TEST(BuildFEMatrixAlgorithmTests, TestMeshSize1e1)
9493

9594
BuildFEMatrixAlgo algo;
9695
SparseRowMatrixHandle output;
97-
ASSERT_TRUE(algo.run(mesh, nullConductivityMatrix(), output));
96+
ASSERT_NO_THROW(
97+
auto out = algo.run(withInputData((Variables::InputField, mesh)));
98+
output = out.get<SparseRowMatrix>(BuildFEMatrixAlgo::Stiffness_Matrix);
99+
);
98100

99101
ASSERT_THAT(output, NotNull());
100102

@@ -117,7 +119,10 @@ TEST(BuildFEMatrixAlgorithmTests, TestMeshSize1e3)
117119

118120
BuildFEMatrixAlgo algo;
119121
SparseRowMatrixHandle output;
120-
ASSERT_TRUE(algo.run(mesh, nullConductivityMatrix(), output));
122+
ASSERT_NO_THROW(
123+
auto out = algo.run(withInputData((Variables::InputField, mesh)));
124+
output = out.get<SparseRowMatrix>(BuildFEMatrixAlgo::Stiffness_Matrix);
125+
);
121126

122127
ASSERT_THAT(output, NotNull());
123128

@@ -140,7 +145,10 @@ TEST(BuildFEMatrixAlgorithmTests, TestMeshSize1e4)
140145

141146
BuildFEMatrixAlgo algo;
142147
SparseRowMatrixHandle output;
143-
ASSERT_TRUE(algo.run(mesh, nullConductivityMatrix(), output));
148+
ASSERT_NO_THROW(
149+
auto out = algo.run(withInputData((Variables::InputField, mesh)));
150+
output = out.get<SparseRowMatrix>(BuildFEMatrixAlgo::Stiffness_Matrix);
151+
);
144152

145153
ASSERT_THAT(output, NotNull());
146154

@@ -164,7 +172,10 @@ TEST(BuildFEMatrixAlgorithmTests, DISABLED_TestMeshSize1e5)
164172

165173
BuildFEMatrixAlgo algo;
166174
SparseRowMatrixHandle output;
167-
ASSERT_TRUE(algo.run(mesh, nullConductivityMatrix(), output));
175+
ASSERT_NO_THROW(
176+
auto out = algo.run(withInputData((Variables::InputField, mesh)));
177+
output = out.get<SparseRowMatrix>(BuildFEMatrixAlgo::Stiffness_Matrix);
178+
);
168179

169180
ASSERT_THAT(output, NotNull());
170181

@@ -188,7 +199,10 @@ TEST(BuildFEMatrixAlgorithmTests, DISABLED_TestMeshSize1e6)
188199

189200
BuildFEMatrixAlgo algo;
190201
SparseRowMatrixHandle output;
191-
ASSERT_TRUE(algo.run(mesh, nullConductivityMatrix(), output));
202+
ASSERT_NO_THROW(
203+
auto out = algo.run(withInputData((Variables::InputField, mesh)));
204+
output = out.get<SparseRowMatrix>(BuildFEMatrixAlgo::Stiffness_Matrix);
205+
);
192206

193207
ASSERT_THAT(output, NotNull());
194208

0 commit comments

Comments
 (0)