Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-vtk
Commits
1db890f8
Commit
1db890f8
authored
Dec 16, 2018
by
Praetorius, Simon
Browse files
problems with alugrid in dune 2.7
parent
e6a25e28
Changes
3
Hide whitespace changes
Inline
Side-by-side
dune/vtk/datacollectors/continuousdatacollector.hh
View file @
1db890f8
...
...
@@ -70,7 +70,6 @@ public:
std
::
vector
<
std
::
uint64_t
>
data
;
data
.
reserve
(
numPoints_
);
GlobalIndexSet
<
GridView
>
globalIndexSet
(
gridView_
,
dim
);
auto
const
&
indexSet
=
gridView_
.
indexSet
();
for
(
auto
const
&
vertex
:
vertices
(
gridView_
,
partition
))
{
data
.
emplace_back
(
globalIndexSet
.
index
(
vertex
));
}
...
...
src/test/parallel_reader_writer_test.cc
View file @
1db890f8
...
...
@@ -11,6 +11,7 @@
#include
<dune/common/parallel/mpihelper.hh>
// An initializer of MPI
#include
<dune/common/filledarray.hh>
#include
<dune/common/std/type_traits.hh>
#include
<dune/common/test/testsuite.hh>
#include
<dune/grid/uggrid.hh>
...
...
@@ -67,11 +68,11 @@ bool compare_files (std::string const& fn1, std::string const& fn2)
}
template
<
class
G
>
struct
HasParallelGridFactory
:
std
::
false_type
{};
#if DUNE_VERSION_GT(DUNE_GRID,2,6) && HAVE_DUNE_ALUGRID
template
<
int
dim
,
int
dimworld
,
Dune
::
ALUGridElementType
elType
,
Dune
::
ALUGridRefinementType
refineType
,
class
Comm
>
struct
HasParallelGridFactory
<
Dune
::
ALUGrid
<
dim
,
dimworld
,
elType
,
refineType
,
Comm
>>
:
std
::
true_type
{};
#endif
template
<
class
G
F
>
using
HasParallelGridFactoryImpl
=
decltype
(
std
::
declval
<
GF
>
().
createGrid
(
true
,
true
,
std
::
string
(
""
),
true
));
template
<
class
G
>
using
HasParallelGridFactory
=
Std
::
is_detected
<
HasParallelGridFactoryImpl
,
GridFactory
<
G
>>
;
template
<
class
Test
>
...
...
@@ -107,7 +108,6 @@ void reader_writer_test(MPIHelper& mpi, TestSuite& test, std::string const& test
auto
numElements
=
filledArray
<
dim
,
unsigned
int
>
(
4
);
auto
gridPtr
=
StructuredGridFactory
<
Grid
>::
createSimplexGrid
(
lowerLeft
,
upperRight
,
numElements
);
gridPtr
->
loadBalance
();
// std::cout << "write1\n";
writer_test
(
gridPtr
->
leafGridView
(),
base_name
);
}
...
...
@@ -115,7 +115,6 @@ void reader_writer_test(MPIHelper& mpi, TestSuite& test, std::string const& test
// Step 2: read the grid from file1 and write it back to file2
{
GridFactory
<
Grid
>
factory
;
// std::cout << "read1\n";
VtkReader
<
Grid
,
Creator
>
reader
{
factory
};
reader
.
readFromFile
(
base_name
+
ext
);
...
...
@@ -185,13 +184,15 @@ int main (int argc, char** argv)
#endif
#if HAVE_DUNE_ALUGRID
// Test VtkWriter for ALUGrid.
reader_writer_test
<
ALUGridType
<
2
>
,
SerialGridCreator
<
ALUGridType
<
2
>>>
(
mpi
,
test
,
"ALUGridType<2>"
);
reader_writer_test
<
ALUGridType
<
3
>
,
Seria
lGridCreator
<
ALUGridType
<
3
>>>
(
mpi
,
test
,
"ALUGridType<
3>"
);
reader_writer_test
<
ALUGridType
<
2
>
,
Paralle
lGridCreator
<
ALUGridType
<
2
>>>
(
mpi
,
test
,
"ALUGridType<
2, Parallel>"
,
false
);
if
(
HasParallelGridFactory
<
ALUGridType
<
2
>>
{})
reader_writer_test
<
ALUGridType
<
2
>
,
ParallelGridCreator
<
ALUGridType
<
2
>>>
(
mpi
,
test
,
"ALUGridType<2, Parallel>"
,
false
);
if
(
HasParallelGridFactory
<
ALUGridType
<
3
>>
{})
reader_writer_test
<
ALUGridType
<
3
>
,
ParallelGridCreator
<
ALUGridType
<
3
>>>
(
mpi
,
test
,
"ALUGridType<3, Parallel>"
,
false
);
reader_writer_test
<
ALUGridType
<
3
>
,
SerialGridCreator
<
ALUGridType
<
3
>>>
(
mpi
,
test
,
"ALUGridType<3>"
);
#if DUNE_VERSION_LT(DUNE_GRID,2,7)
// Currently the 2.7 branch is not working, due to a new bisection compatibility check in 3d
reader_writer_test
<
ALUGridType
<
3
>
,
ParallelGridCreator
<
ALUGridType
<
3
>>>
(
mpi
,
test
,
"ALUGridType<3, Parallel>"
,
false
);
#endif
#endif
return
test
.
exit
();
...
...
src/test/reader_writer_test.cc
View file @
1db890f8
...
...
@@ -91,19 +91,10 @@ void writer_test (GridView const& gridView)
}
}
template
<
class
G
>
struct
IsALUGrid
:
std
::
false_type
{};
#if DUNE_VERSION_GT(DUNE_GRID,2,6) && HAVE_DUNE_ALUGRID
template
<
int
dim
,
int
dimworld
,
Dune
::
ALUGridElementType
elType
,
Dune
::
ALUGridRefinementType
refineType
,
class
Comm
>
struct
IsALUGrid
<
Dune
::
ALUGrid
<
dim
,
dimworld
,
elType
,
refineType
,
Comm
>>
:
std
::
true_type
{};
#endif
template
<
class
Grid
,
class
Test
>
void
reader_test
(
MPIHelper
&
mpi
,
Test
&
test
)
{
std
::
string
ext
=
".vtu"
;
if
(
mpi
.
size
()
>
1
)
ext
=
".pvtu"
;
for
(
auto
const
&
test_case
:
test_cases
)
{
std
::
vector
<
std
::
string
>
pieces1
,
pieces2
;
...
...
@@ -112,11 +103,8 @@ void reader_test (MPIHelper& mpi, Test& test)
VtkReader
<
Grid
>
reader
{
factory
};
reader
.
readFromFile
(
"reader_writer_test_"
+
std
::
get
<
0
>
(
test_case
)
+
ext
);
std
::
unique_ptr
<
Grid
>
grid
{
Hybrid
::
ifElse
(
IsALUGrid
<
Grid
>
{},
[
&
](
auto
id
)
{
return
id
(
factory
).
createGrid
(
std
::
true_type
{});
},
[
&
](
auto
id
)
{
return
id
(
factory
).
createGrid
();
})
};
pieces1
=
mpi
.
size
()
>
1
?
reader
.
pieces
()
:
std
::
vector
<
std
::
string
>
{
"reader_writer_test_"
+
std
::
get
<
0
>
(
test_case
)
+
".vtu"
};
std
::
unique_ptr
<
Grid
>
grid
{
factory
.
createGrid
()};
pieces1
=
reader
.
pieces
();
VtkUnstructuredGridWriter
<
typename
Grid
::
LeafGridView
>
vtkWriter
(
grid
->
leafGridView
(),
std
::
get
<
1
>
(
test_case
),
std
::
get
<
2
>
(
test_case
));
...
...
@@ -127,8 +115,7 @@ void reader_test (MPIHelper& mpi, Test& test)
GridFactory
<
Grid
>
factory2
;
VtkReader
<
Grid
>
reader2
{
factory2
};
reader2
.
readFromFile
(
"reader_writer_test_"
+
std
::
get
<
0
>
(
test_case
)
+
"_2"
+
ext
,
false
);
pieces2
=
mpi
.
size
()
>
1
?
reader2
.
pieces
()
:
std
::
vector
<
std
::
string
>
{
"reader_writer_test_"
+
std
::
get
<
0
>
(
test_case
)
+
"_2.vtu"
};
pieces2
=
reader2
.
pieces
();
}
test
.
check
(
pieces1
.
size
()
==
pieces2
.
size
(),
"pieces1.size == pieces2.size"
);
...
...
@@ -153,7 +140,6 @@ int main (int argc, char** argv)
#if HAVE_UG
// Test VtkWriter for UGGrid
if
(
mpi
.
size
()
==
1
)
{
Hybrid
::
forEach
(
std
::
make_tuple
(
int_
<
2
>
{},
int_
<
3
>
{}),
[
&
test
,
&
mpi
](
auto
dim
)
{
using
GridType
=
UGGrid
<
dim
.
value
>
;
...
...
@@ -169,11 +155,9 @@ int main (int argc, char** argv)
reader_test
<
GridType
>
(
mpi
,
test
);
});
}
#endif
// DUNE_VERSION_LT(DUNE_GRID,2,7) &&
#if HAVE_DUNE_ALUGRID
#if DUNE_VERSION_LT(DUNE_GRID,2,7) && HAVE_DUNE_ALUGRID
// Test VtkWriter for ALUGrid. Currently the 2.7 branch is not working.
Hybrid
::
forEach
(
std
::
make_tuple
(
int_
<
2
>
{},
int_
<
3
>
{}),
[
&
test
,
&
mpi
](
auto
dim
)
{
...
...
Write
Preview
Supports
Markdown
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