diff --git a/packages/blackdynamite.cmake b/packages/blackdynamite.cmake new file mode 100644 index 000000000..109db5a83 --- /dev/null +++ b/packages/blackdynamite.cmake @@ -0,0 +1,71 @@ +#=============================================================================== +# @file blackdynamite.cmake +# +# @author Nicolas Richart +# +# @date Tue Nov 29 15:16:35 2011 +# +# @brief package description for BlackDynamite support +# +# @section LICENSE +# +# Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) +# Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) +# +# Akantu is free software: you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) any +# later version. +# +# Akantu is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Akantu. If not, see . +# +#=============================================================================== + +option(AKANTU_USE_BLACKDYNAMITE "Use cpp-array library" OFF) +find_package(Subversion) + +if(SUBVERSION_FOUND) + mark_as_advanced(AKANTU_BLACKDYNAMITE) + if(AKANTU_USE_BLACKDYNAMITE) + set(BLACKDYNAMITE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/third-party/blackdynamite) + + if(EXISTS ${BLACKDYNAMITE_SOURCE_DIR}) + execute_process( + COMMAND ${Subversion_SVN_EXECUTABLE} up ${BLACKDYNAMITE_SOURCE_DIR} + OUTPUT_VARIABLE _revision) + string(REGEX REPLACE ".*At revision ([0-9]*)\\..*" "\\1" _rev "${_revision}") + message(STATUS "Updating BlackDynamite: r${_rev} dynamite! dynamite!") + else() + message(STATUS "Checking out BlackDynamite: Can you digg it!") + execute_process( + COMMAND ${Subversion_SVN_EXECUTABLE} co svn+ssh://lsmssrv1.epfl.ch/space/repositories/SimulPack/BlackDynamite ${BLACKDYNAMITE_SOURCE_DIR} + OUTPUT_QUIET) + endif() + + + set(BLACKDYNAMITE_TARGETS_EXPORT ${AKANTU_TARGETS_EXPORT}) + add_subdirectory(third-party/blackdynamite) + + list(APPEND AKANTU_EXTERNAL_LIBRARIES blackdynamite) + list(APPEND AKANTU_EXTERNAL_LIB_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/third-party/blackdynamite/src) + + list(APPEND AKANTU_EXPORT_LIST blackdynamite) + list(APPEND AKANTU_OPTION_LIST BLACKDYNAMITE) + + set(AKANTU_BLACKDYNAMITE_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/third-party/blackdynamite/src) + + set(AKANTU_BLACKDYNAMITE ON) + else() + set(AKANTU_BLACKDYNAMITE OFF) + endif() +else() + add_optional_external_package(BlackDynamite "Add BlackDynamite support in akantu" OFF PREFIX BlackDynamite) +endif() + +mark_as_advanced(AKANTU_BLACKDYNAMITE) \ No newline at end of file diff --git a/src/synchronizer/mpi_type_wrapper.hh b/src/synchronizer/mpi_type_wrapper.hh new file mode 100644 index 000000000..35a684484 --- /dev/null +++ b/src/synchronizer/mpi_type_wrapper.hh @@ -0,0 +1,78 @@ +/** + * @file mpi_type_wrapper.hh + * + * @author Nicolas Richart + * + * @date Mon Oct 28 13:53:32 2013 + * + * @brief Wrapper on MPI types to have a better separation between libraries + * + * @section LICENSE + * + * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) + * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) + * + * Akantu is free software: you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Akantu. If not, see . + * + */ + +/* -------------------------------------------------------------------------- */ +#include +/* -------------------------------------------------------------------------- */ +#include "aka_common.hh" +#include "static_communicator_mpi.hh" +/* -------------------------------------------------------------------------- */ + +#ifndef __AKANTU_MPI_TYPE_WRAPPER_HH__ +#define __AKANTU_MPI_TYPE_WRAPPER_HH__ + +__BEGIN_AKANTU__ + +class MPITypeWrapper { +public: + MPITypeWrapper(StaticCommunicatorMPI & static_comm) : static_comm(static_comm) { + } + + template + static inline MPI_Datatype getMPIDatatype(); + + inline void setMPICommunicator(MPI_Comm comm) { + communicator = comm; + Int prank, psize; + MPI_Comm_rank(communicator, &prank); + MPI_Comm_size(communicator, &psize); + + static_comm.setRank(prank); + static_comm.setSize(psize); + } + + inline MPI_Comm getMPICommunicator() const { + return communicator; + } + + static MPI_Op getMPISynchronizerOperation(const SynchronizerOperation & op) { + return synchronizer_operation_to_mpi_op[op]; + } + +private: + StaticCommunicatorMPI & static_comm; + + MPI_Comm communicator; + + static MPI_Op synchronizer_operation_to_mpi_op[_so_null + 1]; +}; + +__END_AKANTU__ + +#endif /* __AKANTU_MPI_TYPE_WRAPPER_HH__ */ diff --git a/test/test_model/test_solid_mechanics_model/patch_tests/data/_pentahedron_6.msh b/test/test_model/test_solid_mechanics_model/patch_tests/data/_pentahedron_6.msh new file mode 100644 index 000000000..342fde160 --- /dev/null +++ b/test/test_model/test_solid_mechanics_model/patch_tests/data/_pentahedron_6.msh @@ -0,0 +1,116 @@ +$MeshFormat +2.2 0 8 +$EndMeshFormat +$Nodes +27 +1 0 0 0 +2 1 0 0 +3 1 1 0 +4 0 1 0 +5 0 0 1 +6 1 0 1 +7 1 1 1 +8 0 1 1 +9 0.4000000004956805 0 1 +10 1 0.4000000004956805 1 +11 0.5999999995046822 1 1 +12 0 0.5999999995046822 1 +13 0.4000000004956805 0 0 +14 1 0.4000000004956805 0 +15 0.5999999995046822 1 0 +16 0 0.5999999995046822 0 +17 0 0 0.5999999995046822 +18 0 1 0.4000000004956805 +19 1 0 0.5999999995046822 +20 1 1 0.4000000004956805 +21 0.4800000001984172 0.5199999998019453 1 +22 1 0.4000000004956805 0.5199999998019454 +23 0.5199999998020179 0.5199999998019454 0 +24 0 0.5999999995046822 0.4800000001983448 +25 0.5999999995046822 1 0.4000000004956805 +26 0.4000000004956805 0 0.5999999995046822 +27 0.4960000000596703 0.5199999998019451 0.4960000000596124 +$EndNodes +$Elements +80 +1 15 2 0 1 1 +2 15 2 0 2 2 +3 15 2 0 3 3 +4 15 2 0 4 4 +5 15 2 0 5 5 +6 15 2 0 6 6 +7 15 2 0 7 7 +8 15 2 0 8 8 +9 1 2 0 1 5 9 +10 1 2 0 1 9 6 +11 1 2 0 2 6 10 +12 1 2 0 2 10 7 +13 1 2 0 3 7 11 +14 1 2 0 3 11 8 +15 1 2 0 4 8 12 +16 1 2 0 4 12 5 +17 1 2 0 5 1 13 +18 1 2 0 5 13 2 +19 1 2 0 6 2 14 +20 1 2 0 6 14 3 +21 1 2 0 7 3 15 +22 1 2 0 7 15 4 +23 1 2 0 8 4 16 +24 1 2 0 8 16 1 +25 1 2 0 9 5 17 +26 1 2 0 9 17 1 +27 1 2 0 10 4 18 +28 1 2 0 10 18 8 +29 1 2 0 11 6 19 +30 1 2 0 11 19 2 +31 1 2 0 12 3 20 +32 1 2 0 12 20 7 +33 2 2 0 22 3 15 20 +34 2 2 0 22 15 25 20 +35 2 2 0 22 15 18 25 +36 2 2 0 22 18 15 4 +37 2 2 0 22 20 11 7 +38 2 2 0 22 11 20 25 +39 2 2 0 22 25 18 11 +40 2 2 0 22 18 8 11 +41 2 2 0 24 5 17 9 +42 2 2 0 24 9 17 26 +43 2 2 0 24 9 26 19 +44 2 2 0 24 19 6 9 +45 2 2 0 24 17 1 13 +46 2 2 0 24 13 26 17 +47 2 2 0 24 26 13 19 +48 2 2 0 24 19 13 2 +49 3 2 0 14 5 9 21 12 +50 3 2 0 14 12 21 11 8 +51 3 2 0 14 9 6 10 21 +52 3 2 0 14 21 10 7 11 +53 3 2 0 16 6 19 22 10 +54 3 2 0 16 10 22 20 7 +55 3 2 0 16 19 2 14 22 +56 3 2 0 16 22 14 3 20 +57 3 2 0 18 4 15 23 16 +58 3 2 0 18 15 3 14 23 +59 3 2 0 18 16 23 13 1 +60 3 2 0 18 23 14 2 13 +61 3 2 0 20 8 18 24 12 +62 3 2 0 20 18 4 16 24 +63 3 2 0 20 12 24 17 5 +64 3 2 0 20 24 16 1 17 +65 6 2 0 26 17 5 9 24 12 21 +66 6 2 0 26 9 26 17 21 27 24 +67 6 2 0 26 24 12 21 18 8 11 +68 6 2 0 26 21 27 24 11 25 18 +69 6 2 0 26 26 9 6 27 21 10 +70 6 2 0 26 6 19 26 10 22 27 +71 6 2 0 26 27 21 10 25 11 7 +72 6 2 0 26 10 22 27 7 20 25 +73 6 2 0 26 1 17 26 16 24 27 +74 6 2 0 26 26 13 1 27 23 16 +75 6 2 0 26 16 24 27 4 18 25 +76 6 2 0 26 27 23 16 25 15 4 +77 6 2 0 26 13 26 19 23 27 22 +78 6 2 0 26 19 2 13 22 14 23 +79 6 2 0 26 23 27 22 15 25 20 +80 6 2 0 26 22 14 23 20 3 15 +$EndElements