Skip to content

Commit

Permalink
💻 Fix pdstrain parallel vtp
Browse files Browse the repository at this point in the history
  • Loading branch information
kks32 committed Jan 17, 2020
1 parent 74bc628 commit 8d7ee0a
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 301 deletions.
File renamed without changes.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ link_libraries (${CMAKE_THREAD_LIBS_INIT})
# MKL
find_package(MKL)
if (MKL_FOUND)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
link_libraries(iomp5)
include_directories(${MKL_INCLUDE_DIR})
link_libraries(${MKL_LIBRARIES})
add_definitions("-DUSE_MKL")
endif()
include_directories(${MKL_INCLUDE_DIR})
link_libraries(${MKL_LIBRARIES})
add_definitions("-DUSE_MKL")
endif()


Expand Down
6 changes: 3 additions & 3 deletions clang-tools/format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
find ../include/ -iname *.h -o -iname *.tcc | xargs clang-format -i
find ../src/ -iname *.h -o -iname *.cc | xargs clang-format -i
find ../tests/ -iname *.h -o -iname *.cc | xargs clang-format -i
find ../include/ -iname *.h -o -iname *.tcc | xargs clang-format -style=file -i
find ../src/ -iname *.h -o -iname *.cc | xargs clang-format -style=file -i
find ../tests/ -iname *.h -o -iname *.cc | xargs clang-format -style=file -i
47 changes: 0 additions & 47 deletions include/elements/.clang-format

This file was deleted.

47 changes: 0 additions & 47 deletions include/elements/2d/.clang-format

This file was deleted.

47 changes: 0 additions & 47 deletions include/elements/3d/.clang-format

This file was deleted.

47 changes: 0 additions & 47 deletions include/material/.clang-format

This file was deleted.

4 changes: 2 additions & 2 deletions include/mpm_base.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ void mpm::MPMBase<Tdim>::write_vtk(mpm::Index step, mpm::Index max_steps) {
auto parallel_file = io_->output_file(attribute, ".pvtp", uuid_, step,
max_steps, write_mpi_rank)
.string();

unsigned ncomponents = 1;
vtk_writer->write_parallel_vtk(parallel_file, attribute, mpi_size, step,
max_steps);
max_steps, ncomponents);
}
#endif
}
Expand Down
47 changes: 0 additions & 47 deletions src/.clang-format

This file was deleted.

13 changes: 6 additions & 7 deletions src/io/vtk_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,14 @@ void VtkWriter::write_parallel_vtk(const std::string& filename,
data_type + "=\"" + attribute +
"\">\n\t\t<PDataArray "
"type=\"Float64\" Name=\"" +
attribute +
"\" "
"NumberOfComponents=\"" +
std::to_string(ncomponents) +
"\"/>\n\t</"
attribute + "\"";
if (ncomponents != 1)
ppolydata += " NumberOfComponents=\"" + std::to_string(ncomponents) + "\"";
ppolydata +=
"/>\n\t</"
"PPointData>\n\n\t<PPoints>\n\t\t<PDataArray "
"type=\"Float32\" Name=\"Points\" "
"NumberOfComponents=\"" +
std::to_string(ncomponents) + "\"/>\n\t</PPoints>\n";
"NumberOfComponents=\"3\"/>\n\t</PPoints>\n";

for (unsigned i = 0; i < mpi_size; ++i) {
std::stringstream file_name;
Expand Down
47 changes: 0 additions & 47 deletions tests/.clang-format

This file was deleted.

5 changes: 2 additions & 3 deletions tests/io/vtk_writer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ TEST_CASE("VTK Writer is checked", "[vtk][writer]") {
"\">\n\t\t<PDataArray "
"type=\"Float64\" Name=\"" +
attribute +
"\" "
"NumberOfComponents=\"1\"/>\n\t</"
"\"/>\n\t</"
"PPointData>\n\n\t<PPoints>\n\t\t<PDataArray "
"type=\"Float32\" Name=\"Points\" "
"NumberOfComponents=\"1\"/>\n\t</PPoints>\n";
"NumberOfComponents=\"3\"/>\n\t</PPoints>\n";

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

0 comments on commit 8d7ee0a

Please sign in to comment.