Skip to content

Commit 8d7ee0a

Browse files
committed
💻 Fix pdstrain parallel vtp
1 parent 74bc628 commit 8d7ee0a

12 files changed

+17
-301
lines changed
File renamed without changes.

CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ link_libraries (${CMAKE_THREAD_LIBS_INIT})
9292
# MKL
9393
find_package(MKL)
9494
if (MKL_FOUND)
95-
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
95+
if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
9696
link_libraries(iomp5)
97+
include_directories(${MKL_INCLUDE_DIR})
98+
link_libraries(${MKL_LIBRARIES})
99+
add_definitions("-DUSE_MKL")
97100
endif()
98-
include_directories(${MKL_INCLUDE_DIR})
99-
link_libraries(${MKL_LIBRARIES})
100-
add_definitions("-DUSE_MKL")
101101
endif()
102102

103103

clang-tools/format.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
find ../include/ -iname *.h -o -iname *.tcc | xargs clang-format -i
3-
find ../src/ -iname *.h -o -iname *.cc | xargs clang-format -i
4-
find ../tests/ -iname *.h -o -iname *.cc | xargs clang-format -i
2+
find ../include/ -iname *.h -o -iname *.tcc | xargs clang-format -style=file -i
3+
find ../src/ -iname *.h -o -iname *.cc | xargs clang-format -style=file -i
4+
find ../tests/ -iname *.h -o -iname *.cc | xargs clang-format -style=file -i

include/elements/.clang-format

-47
This file was deleted.

include/elements/2d/.clang-format

-47
This file was deleted.

include/elements/3d/.clang-format

-47
This file was deleted.

include/material/.clang-format

-47
This file was deleted.

include/mpm_base.tcc

+2-2
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ void mpm::MPMBase<Tdim>::write_vtk(mpm::Index step, mpm::Index max_steps) {
526526
auto parallel_file = io_->output_file(attribute, ".pvtp", uuid_, step,
527527
max_steps, write_mpi_rank)
528528
.string();
529-
529+
unsigned ncomponents = 1;
530530
vtk_writer->write_parallel_vtk(parallel_file, attribute, mpi_size, step,
531-
max_steps);
531+
max_steps, ncomponents);
532532
}
533533
#endif
534534
}

src/.clang-format

-47
This file was deleted.

src/io/vtk_writer.cc

+6-7
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,14 @@ void VtkWriter::write_parallel_vtk(const std::string& filename,
189189
data_type + "=\"" + attribute +
190190
"\">\n\t\t<PDataArray "
191191
"type=\"Float64\" Name=\"" +
192-
attribute +
193-
"\" "
194-
"NumberOfComponents=\"" +
195-
std::to_string(ncomponents) +
196-
"\"/>\n\t</"
192+
attribute + "\"";
193+
if (ncomponents != 1)
194+
ppolydata += " NumberOfComponents=\"" + std::to_string(ncomponents) + "\"";
195+
ppolydata +=
196+
"/>\n\t</"
197197
"PPointData>\n\n\t<PPoints>\n\t\t<PDataArray "
198198
"type=\"Float32\" Name=\"Points\" "
199-
"NumberOfComponents=\"" +
200-
std::to_string(ncomponents) + "\"/>\n\t</PPoints>\n";
199+
"NumberOfComponents=\"3\"/>\n\t</PPoints>\n";
201200

202201
for (unsigned i = 0; i < mpi_size; ++i) {
203202
std::stringstream file_name;

tests/.clang-format

-47
This file was deleted.

tests/io/vtk_writer_test.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ TEST_CASE("VTK Writer is checked", "[vtk][writer]") {
7777
"\">\n\t\t<PDataArray "
7878
"type=\"Float64\" Name=\"" +
7979
attribute +
80-
"\" "
81-
"NumberOfComponents=\"1\"/>\n\t</"
80+
"\"/>\n\t</"
8281
"PPointData>\n\n\t<PPoints>\n\t\t<PDataArray "
8382
"type=\"Float32\" Name=\"Points\" "
84-
"NumberOfComponents=\"1\"/>\n\t</PPoints>\n";
83+
"NumberOfComponents=\"3\"/>\n\t</PPoints>\n";
8584

8685
for (unsigned i = 0; i < mpi_size; ++i)
8786
ppolydata += "\n\t<Piece Source=\"" + attribute + "-" +

0 commit comments

Comments
 (0)