From 8d7ee0a376538f55abcb3b0a827b0cf407ed2516 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Date: Fri, 17 Jan 2020 15:43:27 -0600 Subject: [PATCH] :computer: Fix pdstrain parallel vtp --- include/.clang-format => .clang-format | 0 CMakeLists.txt | 8 ++--- clang-tools/format.sh | 6 ++-- include/elements/.clang-format | 47 -------------------------- include/elements/2d/.clang-format | 47 -------------------------- include/elements/3d/.clang-format | 47 -------------------------- include/material/.clang-format | 47 -------------------------- include/mpm_base.tcc | 4 +-- src/.clang-format | 47 -------------------------- src/io/vtk_writer.cc | 13 ++++--- tests/.clang-format | 47 -------------------------- tests/io/vtk_writer_test.cc | 5 ++- 12 files changed, 17 insertions(+), 301 deletions(-) rename include/.clang-format => .clang-format (100%) delete mode 100644 include/elements/.clang-format delete mode 100644 include/elements/2d/.clang-format delete mode 100644 include/elements/3d/.clang-format delete mode 100644 include/material/.clang-format delete mode 100644 src/.clang-format delete mode 100644 tests/.clang-format diff --git a/include/.clang-format b/.clang-format similarity index 100% rename from include/.clang-format rename to .clang-format diff --git a/CMakeLists.txt b/CMakeLists.txt index 25e7c6df4..2648a38d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/clang-tools/format.sh b/clang-tools/format.sh index 8826a0545..87a114b13 100644 --- a/clang-tools/format.sh +++ b/clang-tools/format.sh @@ -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 diff --git a/include/elements/.clang-format b/include/elements/.clang-format deleted file mode 100644 index 7605de044..000000000 --- a/include/elements/.clang-format +++ /dev/null @@ -1,47 +0,0 @@ ---- -# BasedOnStyle: CUED GeoMechanics -AccessModifierOffset: -1 -ConstructorInitializerIndentWidth: 4 -AlignEscapedNewlinesLeft: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true -AlwaysBreakTemplateDeclarations: true -AlwaysBreakBeforeMultilineStrings: true -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BinPackParameters: true -ColumnLimit: 80 -ConstructorInitializerAllOnOneLineOrOnePerLine: true -DerivePointerBinding: false -ExperimentalAutoDetectBinPacking: false -IndentCaseLabels: true -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCSpaceBeforeProtocolList: false -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerBindsToType: true -SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: true -Standard: Auto -IndentWidth: 2 -TabWidth: 8 -UseTab: Never -BreakBeforeBraces: Attach -IndentFunctionDeclarationAfterType: true -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 -... - diff --git a/include/elements/2d/.clang-format b/include/elements/2d/.clang-format deleted file mode 100644 index 7605de044..000000000 --- a/include/elements/2d/.clang-format +++ /dev/null @@ -1,47 +0,0 @@ ---- -# BasedOnStyle: CUED GeoMechanics -AccessModifierOffset: -1 -ConstructorInitializerIndentWidth: 4 -AlignEscapedNewlinesLeft: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true -AlwaysBreakTemplateDeclarations: true -AlwaysBreakBeforeMultilineStrings: true -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BinPackParameters: true -ColumnLimit: 80 -ConstructorInitializerAllOnOneLineOrOnePerLine: true -DerivePointerBinding: false -ExperimentalAutoDetectBinPacking: false -IndentCaseLabels: true -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCSpaceBeforeProtocolList: false -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerBindsToType: true -SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: true -Standard: Auto -IndentWidth: 2 -TabWidth: 8 -UseTab: Never -BreakBeforeBraces: Attach -IndentFunctionDeclarationAfterType: true -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 -... - diff --git a/include/elements/3d/.clang-format b/include/elements/3d/.clang-format deleted file mode 100644 index 7605de044..000000000 --- a/include/elements/3d/.clang-format +++ /dev/null @@ -1,47 +0,0 @@ ---- -# BasedOnStyle: CUED GeoMechanics -AccessModifierOffset: -1 -ConstructorInitializerIndentWidth: 4 -AlignEscapedNewlinesLeft: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true -AlwaysBreakTemplateDeclarations: true -AlwaysBreakBeforeMultilineStrings: true -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BinPackParameters: true -ColumnLimit: 80 -ConstructorInitializerAllOnOneLineOrOnePerLine: true -DerivePointerBinding: false -ExperimentalAutoDetectBinPacking: false -IndentCaseLabels: true -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCSpaceBeforeProtocolList: false -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerBindsToType: true -SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: true -Standard: Auto -IndentWidth: 2 -TabWidth: 8 -UseTab: Never -BreakBeforeBraces: Attach -IndentFunctionDeclarationAfterType: true -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 -... - diff --git a/include/material/.clang-format b/include/material/.clang-format deleted file mode 100644 index 7605de044..000000000 --- a/include/material/.clang-format +++ /dev/null @@ -1,47 +0,0 @@ ---- -# BasedOnStyle: CUED GeoMechanics -AccessModifierOffset: -1 -ConstructorInitializerIndentWidth: 4 -AlignEscapedNewlinesLeft: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true -AlwaysBreakTemplateDeclarations: true -AlwaysBreakBeforeMultilineStrings: true -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BinPackParameters: true -ColumnLimit: 80 -ConstructorInitializerAllOnOneLineOrOnePerLine: true -DerivePointerBinding: false -ExperimentalAutoDetectBinPacking: false -IndentCaseLabels: true -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCSpaceBeforeProtocolList: false -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerBindsToType: true -SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: true -Standard: Auto -IndentWidth: 2 -TabWidth: 8 -UseTab: Never -BreakBeforeBraces: Attach -IndentFunctionDeclarationAfterType: true -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 -... - diff --git a/include/mpm_base.tcc b/include/mpm_base.tcc index b664a8b7a..027d5145a 100644 --- a/include/mpm_base.tcc +++ b/include/mpm_base.tcc @@ -526,9 +526,9 @@ void mpm::MPMBase::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 } diff --git a/src/.clang-format b/src/.clang-format deleted file mode 100644 index 7605de044..000000000 --- a/src/.clang-format +++ /dev/null @@ -1,47 +0,0 @@ ---- -# BasedOnStyle: CUED GeoMechanics -AccessModifierOffset: -1 -ConstructorInitializerIndentWidth: 4 -AlignEscapedNewlinesLeft: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true -AlwaysBreakTemplateDeclarations: true -AlwaysBreakBeforeMultilineStrings: true -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BinPackParameters: true -ColumnLimit: 80 -ConstructorInitializerAllOnOneLineOrOnePerLine: true -DerivePointerBinding: false -ExperimentalAutoDetectBinPacking: false -IndentCaseLabels: true -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCSpaceBeforeProtocolList: false -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerBindsToType: true -SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: true -Standard: Auto -IndentWidth: 2 -TabWidth: 8 -UseTab: Never -BreakBeforeBraces: Attach -IndentFunctionDeclarationAfterType: true -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 -... - diff --git a/src/io/vtk_writer.cc b/src/io/vtk_writer.cc index 33d1f25aa..43ac987d9 100644 --- a/src/io/vtk_writer.cc +++ b/src/io/vtk_writer.cc @@ -189,15 +189,14 @@ void VtkWriter::write_parallel_vtk(const std::string& filename, data_type + "=\"" + attribute + "\">\n\t\t\n\t\n\t\n\n\t\n\t\t\n\t\n"; + "NumberOfComponents=\"3\"/>\n\t\n"; for (unsigned i = 0; i < mpi_size; ++i) { std::stringstream file_name; diff --git a/tests/.clang-format b/tests/.clang-format deleted file mode 100644 index 7605de044..000000000 --- a/tests/.clang-format +++ /dev/null @@ -1,47 +0,0 @@ ---- -# BasedOnStyle: CUED GeoMechanics -AccessModifierOffset: -1 -ConstructorInitializerIndentWidth: 4 -AlignEscapedNewlinesLeft: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true -AlwaysBreakTemplateDeclarations: true -AlwaysBreakBeforeMultilineStrings: true -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BinPackParameters: true -ColumnLimit: 80 -ConstructorInitializerAllOnOneLineOrOnePerLine: true -DerivePointerBinding: false -ExperimentalAutoDetectBinPacking: false -IndentCaseLabels: true -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCSpaceBeforeProtocolList: false -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PointerBindsToType: true -SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: true -Standard: Auto -IndentWidth: 2 -TabWidth: 8 -UseTab: Never -BreakBeforeBraces: Attach -IndentFunctionDeclarationAfterType: true -SpacesInParentheses: false -SpacesInAngles: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -SpaceBeforeAssignmentOperators: true -ContinuationIndentWidth: 4 -... - diff --git a/tests/io/vtk_writer_test.cc b/tests/io/vtk_writer_test.cc index 44e673232..e881454a0 100644 --- a/tests/io/vtk_writer_test.cc +++ b/tests/io/vtk_writer_test.cc @@ -77,11 +77,10 @@ TEST_CASE("VTK Writer is checked", "[vtk][writer]") { "\">\n\t\t\n\t\n\t\n\n\t\n\t\t\n\t\n"; + "NumberOfComponents=\"3\"/>\n\t\n"; for (unsigned i = 0; i < mpi_size; ++i) ppolydata += "\n\t