├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── Doxyfile.in ├── Doxygen └── bibliography.bib ├── LICENSE ├── README.md ├── cmake ├── config │ ├── pidomusConfig.cmake.in │ └── pidomusConfigVersion.cmake.in └── pidomus_invoke_autopilot.cmake ├── docker └── Dockerfile ├── examples ├── CMakeLists.txt └── heat-equation │ ├── CMakeLists.txt │ ├── heat.cc │ ├── heat.prm │ └── heat_interface.h ├── include ├── base_interface.h ├── copy_data.h ├── interfaces │ ├── ALE_navier_stokes.h │ ├── cahn-hilliard.h │ ├── compressible_neo_hookean.h │ ├── compressible_neo_hookean_nitsche.h │ ├── eikonal_equation.h │ ├── eikonal_equation_two_steps.h │ ├── hydrogels_one_field.h │ ├── hydrogels_three_fields.h │ ├── hydrogels_two_fields_transient.h │ ├── navier_stokes.h │ ├── neo_hookean_two_fields.h │ ├── neo_hookean_two_fields_nitsche.h │ ├── poisson_problem.h │ ├── poisson_problem_nitsche.h │ ├── poisson_problem_signals.h │ ├── scalar_reaction_diffusion_convection.h │ ├── scalar_reaction_diffusion_convection_stabilized.h │ ├── stokes.h │ ├── template.h │ └── turbulence_k_omega.h ├── lac │ ├── lac_initializer.h │ └── lac_type.h ├── old_interfaces │ ├── conservative.h │ ├── conservative │ │ ├── compressible_neo_hookean.h │ │ ├── compressible_neo_hookean_direct.h │ │ ├── free_swelling_three_fields.h │ │ ├── heat_equation.h │ │ └── neo_hookean_two_fields.h │ ├── non_conservative.h │ └── old_interface.h ├── pde_system_interface.h ├── pidomus.h ├── pidomus_lambdas.h ├── pidomus_macros.h ├── pidomus_signals.h ├── simulator_access.h └── tria_helper.h ├── main ├── fluid-dynamics.cc ├── hydrogels.cc ├── scalar_reaction_diffusion_convection.cc └── turbulence.cc ├── scripts ├── analytical_stokes │ ├── analytical_stokes_3d.py │ ├── io_tools.py │ └── nabla.py ├── astyle.rc ├── build_documentation.sh ├── check_indentation.sh ├── check_test ├── dr.sh ├── indent ├── run_travis_commands.sh └── setup_astyle.sh ├── source ├── base_interface.cc ├── pidomus.cc ├── pidomus_assemble.cc ├── pidomus_boundary_conditions_and_forcing_terms.cc ├── pidomus_eigen.cc ├── pidomus_helper_functions.cc ├── pidomus_lambdas.cc ├── pidomus_mesh_refinement.cc ├── pidomus_parameters.cc ├── simulator_access.cc └── tria_helper.cc ├── tests ├── CMakeLists.txt ├── arpack_01.cc ├── arpack_01.with_arpack=on.with_zz=on.output ├── cahn-hilliard_01.cc ├── cahn-hilliard_01.output ├── compressible_neo_hookean_01.cc ├── compressible_neo_hookean_01.output ├── compressible_neo_hookean_02.cc ├── compressible_neo_hookean_02.output ├── compressible_neo_hookean_03.cc ├── compressible_neo_hookean_03.output ├── compressible_neo_hookean_04.cc ├── compressible_neo_hookean_04.output ├── compressible_neo_hookean_05.cc ├── compressible_neo_hookean_05.output ├── eikonal_equation_01.cc ├── eikonal_equation_01.output ├── eikonal_equation_02.cc ├── eikonal_equation_02.output ├── eikonal_equation_03.cc ├── eikonal_equation_03.output ├── eikonal_equation_04.cc ├── eikonal_equation_04.output ├── hydrogels_one_field_01.cc ├── hydrogels_one_field_01.output ├── hydrogels_one_field_02.cc ├── hydrogels_one_field_02.output ├── hydrogels_three_fields_01.cc ├── hydrogels_three_fields_01.output ├── hydrogels_three_fields_02.cc ├── hydrogels_three_fields_02.output ├── hydrogels_three_fields_03.cc ├── hydrogels_three_fields_03.with_zz=on.output ├── hydrogels_two_fields_transient_01.cc ├── hydrogels_two_fields_transient_01.output ├── incompressible_neo_hookean_two_fields_01.cc ├── incompressible_neo_hookean_two_fields_01.output ├── incompressible_neo_hookean_two_fields_02.cc ├── incompressible_neo_hookean_two_fields_02.with_zz=on.output ├── incompressible_neo_hookean_two_fields_03.cc ├── incompressible_neo_hookean_two_fields_03.output ├── navier_stokes_00.cc ├── navier_stokes_00.output ├── navier_stokes_01.cc ├── navier_stokes_01.output ├── navier_stokes_02.cc ├── navier_stokes_02.output ├── navier_stokes_03.cc ├── navier_stokes_03.output ├── navier_stokes_04.cc ├── navier_stokes_04.output ├── navier_stokes_05.cc ├── navier_stokes_05.output ├── parameters │ ├── arpack_01.prm │ ├── cahn_hilliard_01.prm │ ├── compressible_neo_hookean_01.prm │ ├── compressible_neo_hookean_02.prm │ ├── compressible_neo_hookean_03.prm │ ├── compressible_neo_hookean_04.prm │ ├── compressible_neo_hookean_05.prm │ ├── eikonal_equation_01.prm │ ├── eikonal_equation_02.prm │ ├── eikonal_equation_03.prm │ ├── eikonal_equation_04.prm │ ├── hydrogels_one_field_01.prm │ ├── hydrogels_one_field_02.prm │ ├── hydrogels_three_fields_01.prm │ ├── hydrogels_three_fields_02.prm │ ├── hydrogels_three_fields_03.prm │ ├── hydrogels_two_fields_transient_01.prm │ ├── incompressible_neo_hookean_two_fields_01.prm │ ├── incompressible_neo_hookean_two_fields_02.prm │ ├── incompressible_neo_hookean_two_fields_03.prm │ ├── k_omega_00.prm │ ├── navier_stokes_00.prm │ ├── navier_stokes_01.prm │ ├── navier_stokes_02.prm │ ├── navier_stokes_03.prm │ ├── navier_stokes_04.prm │ ├── navier_stokes_05.prm │ ├── parpack_01.prm │ ├── poisson_nitsche_01.prm │ ├── poisson_problem_01.prm │ ├── poisson_problem_02.prm │ ├── poisson_problem_03.prm │ ├── stokes_00.prm │ ├── stokes_01.prm │ ├── stokes_02.prm │ ├── stokes_03.prm │ ├── stokes_04.prm │ └── stokes_05.prm ├── parpack_01.cc ├── parpack_01.with_parpack=on.with_mpi=on.mpirun=4.output ├── poisson_01.cc ├── poisson_01.output ├── poisson_02.cc ├── poisson_02.output ├── poisson_03.cc ├── poisson_03.output ├── poisson_nitsche_01.cc ├── poisson_nitsche_01.output ├── set_constrained_to_zero.cc ├── set_constrained_to_zero.with_mpi=on.mpirun=2.output ├── signals_01.cc ├── signals_01.output ├── stokes_00.cc ├── stokes_00.output ├── stokes_01.cc ├── stokes_01.output ├── stokes_02.cc ├── stokes_02.output ├── stokes_03.cc ├── stokes_03.output ├── stokes_04.cc ├── stokes_04.output ├── stokes_05.cc ├── stokes_05.output ├── tests.h └── tests_to_check │ ├── ale_navier_stokes_00.cc │ ├── ale_navier_stokes_00.output │ ├── ale_navier_stokes_01.cc │ ├── ale_navier_stokes_01.output │ ├── ale_navier_stokes_02.cc │ ├── ale_navier_stokes_02.output │ ├── compressible_neo_hookean_01.cc │ ├── compressible_neo_hookean_01.output │ ├── compressible_neo_hookean_02.cc │ ├── compressible_neo_hookean_02.output │ ├── compressible_neo_hookean_03.cc │ ├── compressible_neo_hookean_03.output │ ├── design_01.cc │ ├── design_01.output │ ├── free_swelling_three_fields_01.cc │ ├── free_swelling_three_fields_01.output │ ├── free_swelling_three_fields_02.cc │ ├── free_swelling_three_fields_02.output │ ├── free_swelling_three_fields_03.cc │ ├── free_swelling_three_fields_03.output │ ├── free_swelling_three_fields_04.cc │ ├── free_swelling_three_fields_04.output │ ├── heat_equation_01.cc │ ├── heat_equation_01.output │ ├── heat_equation_02.cc │ ├── heat_equation_02.output │ ├── heat_equation_03.cc │ ├── heat_equation_03.output │ ├── heat_equation_04.cc │ ├── heat_equation_04.output │ ├── heat_equation_05.cc │ ├── heat_equation_05.output │ ├── heat_equation_06.cc │ ├── heat_equation_06.output │ ├── heat_equation_07.cc │ ├── heat_equation_07.output │ ├── heat_equation_08.cc │ ├── heat_equation_08.output │ ├── heat_equation_09.cc │ ├── heat_equation_09.output │ ├── heat_equation_10.cc │ ├── heat_equation_10.output │ ├── heat_equation_11.cc │ ├── heat_equation_11.output │ ├── incompressible_neo_hookean_two_fields.cc │ ├── incompressible_neo_hookean_two_fields.output │ ├── linear_operator_00.cc │ ├── linear_operator_01.cc │ ├── linear_operator_01.output │ ├── linear_operator_01.with_mpi=on,mpirun=2.output │ ├── navier_stokes_01.cc │ ├── navier_stokes_01.output │ ├── navier_stokes_02.cc │ ├── navier_stokes_02.output │ ├── ode_argument_trilinos_01.cc │ ├── ode_argument_trilinos_01.with_mpi=on.mpirun=2.output │ ├── old_prm │ ├── ale_navier_stokes_00.prm │ ├── ale_navier_stokes_00_old.prm │ ├── ale_navier_stokes_01.prm │ ├── ale_navier_stokes_02.prm │ ├── compressible_neo_hookean.prm │ ├── compressible_neo_hookean_01.prm │ ├── compressible_neo_hookean_02.prm │ ├── compressible_neo_hookean_03.prm │ ├── free_swelling_01.prm │ ├── free_swelling_02.prm │ ├── free_swelling_03.prm │ ├── free_swelling_04.prm │ ├── heat_equation_01.prm │ ├── heat_equation_02.prm │ ├── heat_equation_03.prm │ ├── heat_equation_04.prm │ ├── heat_equation_05.prm │ ├── heat_equation_06.prm │ ├── heat_equation_07.prm │ ├── heat_equation_08.prm │ ├── heat_equation_09.prm │ ├── heat_equation_10.prm │ ├── heat_equation_11.prm │ ├── incompressible_neo_hookean_two_fields.prm │ ├── n_fields_problem_01.prm │ ├── navier_stokes_01.prm │ ├── navier_stokes_02.prm │ ├── ode_argument_trilinos.prm │ ├── output.gnuplot │ ├── poiseuille.prm │ ├── stokes_01.prm │ ├── stokes_forcing_01.prm │ ├── stokes_forcing_02.prm │ └── stokes_unit_force_x.prm │ ├── params.prm │ ├── pidomus_01.cc │ ├── pidomus_01.output │ ├── poiseuille.cc │ ├── poiseuille.output │ ├── stokes_forcing_01.cc │ ├── stokes_forcing_01.output │ ├── stokes_forcing_02.cc │ ├── stokes_forcing_02.output │ ├── stokes_unit_x_force.cc │ ├── stokes_unit_x_force.output │ ├── utilities_07.cc │ └── utilities_07.output └── utilities ├── grids ├── 2D │ ├── rectangle_with_circular_hole.inp │ └── rectangle_with_circular_hole.ucd ├── 3D │ ├── hyper_rectangle_with_cylinder_hole.msh │ └── hyper_rectangle_with_cylinder_hole.ucd ├── rectangle_with_two_circular_holes.ucd └── rectangle_with_two_circular_holes.ucd_old └── prm ├── hydrogels ├── constrained-swelling-one-field.prm ├── constrained-swelling-three-fields.prm ├── free-swelling-one-field.prm ├── free-swelling-three-fields.prm ├── wrinkling-one-field.prm └── wrinkling-three-fields.prm ├── navier_stokes ├── ALE_test.prm ├── default.prm ├── flow_past_a_cylinder_2D_00.prm ├── flow_past_a_cylinder_2D_01.prm ├── flow_past_a_cylinder_3D.prm ├── flow_past_two_cylinders.prm ├── lid_cavity_2D.prm └── lid_cavity_3D.prm └── turbulence └── k_omega_2D.prm /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore OS X auxiliary files 2 | *.DS_Store 3 | 4 | *.vtu 5 | *.vtk 6 | *.pvtu 7 | *.visit 8 | .ycm_extra_conf.py 9 | Testing/ 10 | build/ 11 | TAGS 12 | doc/ 13 | *~ 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | - BUILD_TYPE=Release 3 | - BUILD_TYPE=Debug 4 | 5 | language: cpp 6 | 7 | services: 8 | - docker 9 | 10 | notifications: 11 | email: false 12 | 13 | before_install: 14 | - docker build -t pidomus docker --build-arg BUILD_TYPE=$BUILD_TYPE 15 | - test -d build-travis || mkdir build-travis; sudo chown -R 1000:1000 build-travis 16 | - ./scripts/dr.sh "cd pi-DoMUS; ./scripts/check_indentation.sh" 17 | 18 | script: 19 | - ./scripts/dr.sh "cd pi-DoMUS/build-travis; cmake -GNinja -DENABLE_DOCUMENTATION=OFF -DENABLE_ALL_EXECUTABLES=OFF -DCMAKE_INSTALL_PREFIX=./pi-domus-install -DCMAKE_BUILD_TYPE=$BUILD_TYPE ../; ninja -j2 install" 20 | - ./scripts/dr.sh "cd pi-DoMUS/build-travis; ctest -j2 -V" 21 | -------------------------------------------------------------------------------- /Doxygen/bibliography.bib: -------------------------------------------------------------------------------- 1 | @article {FLD:FLD1650080802, 2 | author = {Cahouet, J. and Chabard, J.-P.}, 3 | title = {Some fast 3D finite element solvers for the generalized Stokes problem}, 4 | journal = {International Journal for Numerical Methods in Fluids}, 5 | volume = {8}, 6 | number = {8}, 7 | publisher = {John Wiley & Sons, Ltd}, 8 | issn = {1097-0363}, 9 | url = {http://dx.doi.org/10.1002/fld.1650080802}, 10 | doi = {10.1002/fld.1650080802}, 11 | pages = {869--895}, 12 | keywords = {3D Stokes problem, Mixed finite element methods, Primitive variables, Gradient methods, Convergence analysis}, 13 | year = {1988}, 14 | } 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pi-DoMUS [![Build Status](https://travis-ci.org/mathLab/pi-DoMUS.svg?branch=master)](https://travis-ci.org/mathLab/pi-DoMUS) 2 | Parallel-Deal.II MUlti-physics Solver 3 | 4 | # Required Packages 5 | - Trilinos (https://trilinos.org) 6 | - deal.II (www.dealii.org) 7 | - deal2lkit (https://github.com/mathlab/deal2lkit) 8 | - Sundials (http://computation.llnl.gov/casc/sundials/main.html) 9 | 10 | 11 | # Installation Instructions 12 | 13 | Compile and install pidomus: 14 | 15 | git clone git@github.com:mathLab/pi-DoMUS.git 16 | 17 | cd pi-DoMUS 18 | mkdir build 19 | cd build 20 | 21 | cmake -DCMAKE_INSTALL_PREFIX=/some/where/pidomus .. 22 | make 23 | make install 24 | 25 | and then start working with one of its examples by e.g. copying it 26 | 27 | cp -r /some/where/pidomus/examples/name-of-example /some/other/place/my-app 28 | cd /some/other/place/my-app 29 | cmake -DPIDOMUS_DIR=/some/where/pidomus . 30 | make run 31 | 32 | if you have an environment variable called `PIDOMUS_DIR` it will look into that directory and you do not have to specify it as option (`-DPIDOMUS_DIR`). 33 | -------------------------------------------------------------------------------- /cmake/config/pidomusConfig.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | include("@CMAKE_INSTALL_PREFIX@/lib/cmake/pidomus/pidomusTargets.cmake") 3 | 4 | set(PIDOMUS_VERSION "@pidomus_VERSION@") 5 | set(PIDOMUS_BUILD_TYPE "@CMAKE_BUILD_TYPE@") 6 | 7 | set(PACKAGE_NAME "pidomus") 8 | 9 | include ("@CMAKE_INSTALL_PREFIX@/lib/cmake/pidomus/pidomus_invoke_autopilot.cmake") 10 | 11 | message(STATUS 12 | "Using the ${PACKAGE_NAME}-${PIDOMUS_VERSION} installation found at @CMAKE_INSTALL_PREFIX@") 13 | -------------------------------------------------------------------------------- /cmake/config/pidomusConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@pidomus_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | 13 | -------------------------------------------------------------------------------- /cmake/pidomus_invoke_autopilot.cmake: -------------------------------------------------------------------------------- 1 | ## This macro is a wrapper for the DEAL_II_INVOKE_AUTOPILOT() CMake 2 | ## macro written by the deal.II authors. We report it's documentation 3 | 4 | ## --------------------------------------------------------------------- 5 | ## 6 | ## Copyright (C) 2012 - 2016 by the deal.II authors 7 | ## 8 | ## This file is part of the deal.II library. 9 | ## 10 | ## The deal.II library is free software; you can use it, redistribute 11 | ## it, and/or modify it under the terms of the GNU Lesser General 12 | ## Public License as published by the Free Software Foundation; either 13 | ## version 2.1 of the License, or (at your option) any later version. 14 | ## The full text of the license can be found in the file LICENSE at 15 | ## the top level of the deal.II distribution. 16 | ## 17 | ## --------------------------------------------------------------------- 18 | 19 | # 20 | # This file implements the DEAL_II_INVOKE_AUTOPILOT macro, which is 21 | # part of the deal.II library. 22 | # 23 | # Usage: 24 | # DEAL_II_INVOKE_AUTOPILOT() 25 | # 26 | # where it is assumed that the following variables are defined: 27 | # 28 | # TARGET - a string used for the project and target name 29 | # TARGET_SRC - a list of source file to compile for target 30 | # ${TARGET} 31 | # TARGET_RUN - (optional) the command line that should be 32 | # invoked by "make run", will be set to default 33 | # values if undefined. If no run target should be 34 | # created, set it to an empty string. 35 | # CLEAN_UP_FILES - (optional) a list of files (globs) that will be 36 | # removed with "make runclean" and "make 37 | # distclean", will be set to default values if 38 | # empty 39 | 40 | #### specific for the pidomus library 41 | 42 | # PARAMTER_FILE - the parameter file which has to be sourced. If 43 | # the executable is built and run in a different 44 | # folder (e.g. build) a symlink is done 45 | # 46 | macro(PIDOMUS_INVOKE_AUTOPILOT) 47 | 48 | DEAL_II_INVOKE_AUTOPILOT() 49 | 50 | SET(_d2_build_types "Release" "Debug") 51 | SET(Release_postfix "") 52 | SET(Debug_postfix ".g") 53 | 54 | FOREACH(_build_type ${_d2_build_types}) 55 | SET(_p "${${_build_type}_postfix}") 56 | 57 | # Only build this type, if deal.II was compiled with it. 58 | IF(CMAKE_BUILD_TYPE MATCHES "${_build_type}" AND 59 | PIDOMUS_BUILD_TYPE MATCHES "${_build_type}") 60 | 61 | # set(exe "${_exe}${_p}") 62 | # add_executable(${TARGET} ${TARGET_SRC}) 63 | # SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON) 64 | 65 | string(TOUPPER "${_build_type}" _BUILD_TYPE) 66 | 67 | 68 | D2K_SETUP_TARGET(${TARGET} ${_BUILD_TYPE}) 69 | set(_lib "pidomus-lib${_p}") 70 | target_link_libraries(${TARGET} ${_lib}) 71 | endif() 72 | endforeach() 73 | 74 | # if we build out of source (e.g. build) we create a link to the 75 | # parameter file 76 | if(NOT EXISTS "${CMAKE_BINARY_DIR}/${PARAMETER_FILE}") 77 | execute_process(COMMAND 78 | ln -s ${CMAKE_SOURCE_DIR}/${PARAMETER_FILE} 79 | ${CMAKE_BINARY_DIR}/${PARAMETER_FILE}) 80 | endif() 81 | 82 | endmacro() 83 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mathlab/deal2lkit-base 2 | 3 | MAINTAINER luca.heltai@gmail.com 4 | 5 | ARG BUILD_TYPE=DebugRelease 6 | ARG VER=master 7 | 8 | RUN \ 9 | git clone https://github.com/mathLab/deal2lkit/ deal2lkit-$VER-src && \ 10 | cd deal2lkit-$VER-src && git checkout $VER && \ 11 | mkdir build && cd build && \ 12 | cmake -DCMAKE_INSTALL_PREFIX=$HOME/libs/deal2lkit-$VER\ 13 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ 14 | -DD2K_COMPONENT_DOCUMENTATION=OFF \ 15 | -GNinja \ 16 | ../ && \ 17 | ninja -j4 && ninja install && \ 18 | cd $HOME/deal2lkit-$VER-src/ && \ 19 | cd $HOME && rm -rf deal2lkit-$VER-src 20 | 21 | ENV D2K_DIR $HOME/libs/deal2lkit-master 22 | ENV DEAL2LKIT_DIR $HOME/libs/deal2lkit-master 23 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | message(STATUS "Setting up examples") 2 | 3 | install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ 4 | DESTINATION examples 5 | # COMPONENT examples 6 | FILES_MATCHING 7 | # 8 | # Exclude folder structures: doc, doxygen, CMakeFiles,... 9 | # 10 | PATTERN "CMakeFiles*" EXCLUDE 11 | PATTERN "doc*" EXCLUDE 12 | PATTERN "build*" EXCLUDE 13 | # 14 | # Glob Includes: 15 | # 16 | PATTERN "*.cc" 17 | PATTERN "*.h" 18 | PATTERN "*.prm" 19 | PATTERN "*.inp" 20 | PATTERN "*.output" 21 | # 22 | # All CMakeLists.txt except the one in examples/ 23 | # 24 | PATTERN "heat-equation/CMakeLists.txt" 25 | # 26 | # Special files: 27 | # 28 | # PATTERN "grid-2.2.ucd" # e.g. 29 | ) 30 | 31 | MESSAGE(STATUS "Setting up examples - Done") 32 | -------------------------------------------------------------------------------- /examples/heat-equation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0) 2 | SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) 3 | 4 | set(TARGET "heat") 5 | set(TARGET_SRC heat.cc heat_interface.h) 6 | set(PARAMETER_FILE "heat.prm") 7 | 8 | set(CLEAN_UP_FILES "*.vtu" used_parameters.prm) 9 | 10 | FIND_PACKAGE(deal.II 8.5 REQUIRED 11 | HINTS ${deal.II_DIR} ${DEAL_II_DIR} $ENV{DEAL_II_DIR} 12 | ) 13 | 14 | DEAL_II_INITIALIZE_CACHED_VARIABLES() 15 | 16 | FIND_PACKAGE(deal2lkit 8.5 REQUIRED 17 | HINTS ${D2K_DIR} ${DEAL2LKIT_DIR} $ENV{D2K_DIR} $ENV{DEAL2LKIT_DIR} 18 | ) 19 | D2K_INITIALIZE_CACHED_VARIABLES() 20 | 21 | find_package(pidomus 8.5 REQUIRED 22 | HINTS ${PIDOMUS_DIR} $ENV{PIDOMUS_DIR}) 23 | 24 | project(${TARGET}) 25 | 26 | PIDOMUS_INVOKE_AUTOPILOT() 27 | -------------------------------------------------------------------------------- /examples/heat-equation/heat.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "heat_interface.h" 3 | 4 | int main (int argc, char *argv[]) 5 | { 6 | 7 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 8 | numbers::invalid_unsigned_int); 9 | 10 | 11 | const int dim = 2; 12 | const int spacedim = 2; 13 | 14 | // for serial version using a direct solver use uncomment these two 15 | // lines 16 | // HeatEquation problem; 17 | // piDoMUS solver ("pidomus",problem); 18 | 19 | // for parallel version using an iterative solver uncomment these 20 | // two lines 21 | HeatEquation problem; 22 | piDoMUS solver ("pidomus",problem); 23 | 24 | ParameterAcceptor::initialize("heat.prm", "used_parameters.prm"); 25 | 26 | solver.run (); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /examples/heat-equation/heat_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef _pidoums_poisson_h_ 2 | #define _pidoums_poisson_h_ 3 | 4 | #include "pde_system_interface.h" 5 | 6 | 7 | template 8 | class HeatEquation : public PDESystemInterface, LAC> 9 | { 10 | 11 | public: 12 | virtual ~HeatEquation () {} 13 | HeatEquation (); 14 | 15 | // interface with the PDESystemInterface :) 16 | 17 | 18 | template 19 | void energies_and_residuals(const typename DoFHandler::active_cell_iterator &cell, 20 | FEValuesCache &scratch, 21 | std::vector &energies, 22 | std::vector > &local_residuals, 23 | bool compute_only_system_terms) const; 24 | 25 | 26 | void compute_system_operators(const std::vector >&, 27 | LinearOperator &, 28 | LinearOperator &, 29 | LinearOperator &) const override; 30 | 31 | private: 32 | mutable shared_ptr preconditioner; 33 | 34 | }; 35 | 36 | template 37 | HeatEquation:: 38 | HeatEquation(): 39 | PDESystemInterface, LAC >("Poisson problem", 40 | 1,1, 41 | "FESystem[FE_Q(1)]", 42 | "u","1") 43 | {} 44 | 45 | 46 | 47 | template 48 | template 49 | void 50 | HeatEquation:: 51 | energies_and_residuals(const typename DoFHandler::active_cell_iterator &cell, 52 | FEValuesCache &fe_cache, 53 | std::vector &, 54 | std::vector > &local_residuals, 55 | bool compute_only_system_terms) const 56 | { 57 | 58 | const FEValuesExtractors::Scalar s(0); 59 | 60 | ResidualType rt = 0; // dummy number to define the type of variables 61 | this->reinit (rt, cell, fe_cache); 62 | auto &uts = fe_cache.get_values("solution_dot", "u", s, rt); 63 | auto &gradus = fe_cache.get_gradients("solution", "u", s, rt); 64 | 65 | const unsigned int n_q_points = uts.size(); 66 | auto &JxW = fe_cache.get_JxW_values(); 67 | 68 | auto &fev = fe_cache.get_current_fe_values(); 69 | 70 | for (unsigned int q=0; q 93 | void 94 | HeatEquation::compute_system_operators(const std::vector > &matrices, 95 | LinearOperator &system_op, 96 | LinearOperator &prec_op, 97 | LinearOperator &) const 98 | { 99 | 100 | preconditioner.reset (new TrilinosWrappers::PreconditionJacobi()); 101 | preconditioner->initialize(matrices[0]->block(0,0)); 102 | 103 | auto A = linear_operator( matrices[0]->block(0,0) ); 104 | 105 | LinearOperator P_inv; 106 | 107 | P_inv = linear_operator(matrices[0]->block(0,0), *preconditioner); 108 | 109 | auto P00 = P_inv; 110 | 111 | // ASSEMBLE THE PROBLEM: 112 | system_op = block_operator<1, 1, LATrilinos::VectorType>({{ 113 | {{ A }} 114 | } 115 | }); 116 | 117 | prec_op = block_operator<1, 1, LATrilinos::VectorType>({{ 118 | {{ P00}} , 119 | } 120 | }); 121 | } 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /include/copy_data.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Assembly 3 | * 4 | * This namespace contains two sub namespaces: Scratch and CopyData. 5 | * 6 | * Goal: provide two structs data required in comunication process 7 | * like WorkStream. 8 | */ 9 | 10 | #ifndef _pidomus_copy_data_h 11 | #define _pidomus_copy_data_h 12 | 13 | #include 14 | #include 15 | 16 | using namespace dealii; 17 | using namespace deal2lkit; 18 | namespace pidomus 19 | { 20 | struct CopyData 21 | { 22 | CopyData (const unsigned int &dofs_per_cell, 23 | const unsigned int &n_matrices) 24 | : 25 | local_dof_indices (dofs_per_cell), 26 | local_residual (dofs_per_cell), 27 | local_matrices (n_matrices, 28 | FullMatrix(dofs_per_cell, 29 | dofs_per_cell)) 30 | {} 31 | 32 | CopyData (const CopyData &data) 33 | : 34 | local_dof_indices (data.local_dof_indices), 35 | local_residual (data.local_residual), 36 | local_matrices (data.local_matrices) 37 | {} 38 | 39 | ~CopyData() 40 | {} 41 | 42 | std::vector local_dof_indices; 43 | std::vector local_residual; 44 | std::vector > local_matrices; 45 | }; 46 | 47 | struct CopyMass 48 | { 49 | CopyMass (const unsigned int &dofs_per_cell) 50 | : 51 | local_dof_indices (dofs_per_cell), 52 | local_matrix (FullMatrix(dofs_per_cell, 53 | dofs_per_cell)) 54 | {} 55 | 56 | CopyMass (const CopyMass &data) 57 | : 58 | local_dof_indices (data.local_dof_indices), 59 | local_matrix (data.local_matrix) 60 | {} 61 | 62 | ~CopyMass() 63 | {} 64 | 65 | std::vector local_dof_indices; 66 | FullMatrix local_matrix; 67 | }; 68 | 69 | 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /include/interfaces/cahn-hilliard.h: -------------------------------------------------------------------------------- 1 | /*! \addtogroup equations 2 | * @{ 3 | */ 4 | 5 | #ifndef _cahn_hilliard_h 6 | #define _cahn_hilliard_h 7 | 8 | #include "pde_system_interface.h" 9 | #include 10 | 11 | 12 | 13 | 14 | template 15 | class CahnHilliard : public PDESystemInterface, LAC> 16 | { 17 | public: 18 | 19 | ~CahnHilliard() {} 20 | 21 | CahnHilliard(); 22 | 23 | template 24 | void energies_and_residuals(const typename DoFHandler::active_cell_iterator &cell, 25 | FEValuesCache &scratch, 26 | std::vector &energies, 27 | std::vector > &local_residuals, 28 | bool compute_only_system_terms) const; 29 | 30 | 31 | private: 32 | const double lambda = 1.0e-2; 33 | 34 | }; 35 | 36 | template 37 | CahnHilliard::CahnHilliard() : 38 | PDESystemInterface, LAC>( 39 | "Cahn-Hilliard problem", 40 | 2,1, 41 | "FESystem[FE_Q(1)-FE_Q(1)]", 42 | "c,mu","1,0" 43 | ) 44 | {} 45 | 46 | template 47 | template 48 | void 49 | CahnHilliard:: 50 | energies_and_residuals(const typename DoFHandler::active_cell_iterator &cell, 51 | FEValuesCache &fe_cache, 52 | std::vector &, 53 | std::vector > &local_residuals, 54 | bool ) const 55 | { 56 | ResidualType alpha = 0; 57 | this->reinit(alpha, cell, fe_cache); 58 | 59 | const FEValuesExtractors::Scalar concentration(0); 60 | const FEValuesExtractors::Scalar aux(1); 61 | 62 | 63 | auto &cs_dot = fe_cache.get_values("solution_dot", "c", concentration, alpha); 64 | auto &cs = fe_cache.get_values("solution", "c", concentration, alpha); 65 | auto &grad_cs = fe_cache.get_gradients("solution", "c", concentration, alpha); 66 | 67 | auto &mus = fe_cache.get_values("solution", "mu", aux, alpha); 68 | auto &grad_mus = fe_cache.get_gradients("solution", "mu", aux, alpha); 69 | 70 | 71 | const unsigned int n_q_points = cs.size(); 72 | 73 | auto &JxW = fe_cache.get_JxW_values(); 74 | auto &fev = fe_cache.get_current_fe_values(); 75 | 76 | for (unsigned int q=0; q &grad_c = grad_cs[q]; 82 | const Tensor<1,dim,ResidualType> &grad_mu = grad_mus[q]; 83 | 84 | 85 | const ResidualType &c_dot = cs_dot[q]; 86 | 87 | // f = 100*c^2*(1-c)^2 88 | // f_prime = df/dc 89 | ResidualType f_prime = 200.*(c-1.)*(c-1.)*c + 200.*(c-1.)*c*c; 90 | 91 | for (unsigned int i=0; i 8 | class PoissonProblem : public PDESystemInterface, LAC> 9 | { 10 | 11 | public: 12 | ~PoissonProblem () {}; 13 | PoissonProblem (); 14 | 15 | // interface with the PDESystemInterface :) 16 | 17 | 18 | template 19 | void energies_and_residuals(const typename DoFHandler::active_cell_iterator &cell, 20 | FEValuesCache &scratch, 21 | std::vector &energies, 22 | std::vector > &local_residuals, 23 | bool compute_only_system_terms) const; 24 | 25 | 26 | void compute_system_operators(const std::vector > &, 27 | LinearOperator &, 28 | LinearOperator &, 29 | LinearOperator &) const; 30 | 31 | private: 32 | mutable shared_ptr preconditioner; 33 | 34 | }; 35 | 36 | template 37 | PoissonProblem:: 38 | PoissonProblem(): 39 | PDESystemInterface, LAC >("Poisson problem", 40 | 1,1, 41 | "FESystem[FE_Q(1)]", 42 | "u","1") 43 | {} 44 | 45 | 46 | 47 | template 48 | template 49 | void 50 | PoissonProblem:: 51 | energies_and_residuals(const typename DoFHandler::active_cell_iterator &cell, 52 | FEValuesCache &fe_cache, 53 | std::vector &, 54 | std::vector > &local_residuals, 55 | bool compute_only_system_terms) const 56 | { 57 | 58 | const FEValuesExtractors::Scalar s(0); 59 | 60 | ResidualType rt = 0; // dummy number to define the type of variables 61 | this->reinit (rt, cell, fe_cache); 62 | auto &uts = fe_cache.get_values("solution_dot", "u", s, rt); 63 | auto &gradus = fe_cache.get_gradients("solution", "u", s, rt); 64 | 65 | const unsigned int n_q_points = uts.size(); 66 | auto &JxW = fe_cache.get_JxW_values(); 67 | 68 | auto &fev = fe_cache.get_current_fe_values(); 69 | 70 | for (unsigned int q=0; q 93 | void 94 | PoissonProblem::compute_system_operators(const std::vector > &matrices, 95 | LinearOperator &system_op, 96 | LinearOperator &prec_op, 97 | LinearOperator &) const 98 | { 99 | 100 | preconditioner.reset (new TrilinosWrappers::PreconditionJacobi()); 101 | preconditioner->initialize(matrices[0]->block(0,0)); 102 | 103 | auto A = linear_operator( matrices[0]->block(0,0) ); 104 | 105 | LinearOperator P_inv; 106 | 107 | P_inv = linear_operator(matrices[0]->block(0,0), *preconditioner); 108 | 109 | auto P00 = P_inv; 110 | 111 | // ASSEMBLE THE PROBLEM: 112 | system_op = block_operator<1, 1, LATrilinos::VectorType>({{ 113 | {{ A }} 114 | } 115 | }); 116 | 117 | prec_op = block_operator<1, 1, LATrilinos::VectorType>({{ 118 | {{ P00}} , 119 | } 120 | }); 121 | } 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /include/lac/lac_initializer.h: -------------------------------------------------------------------------------- 1 | #ifndef _LAC_INITIALIZER_H_ 2 | #define _LAC_INITIALIZER_H_ 3 | 4 | // This includes all types we know of. 5 | #include "lac/lac_type.h" 6 | #include 7 | 8 | /** 9 | * General class, used to initialize different types of Vectors, Matrices and 10 | * Sparsity Patterns using a common interface. 11 | */ 12 | class ScopedLACInitializer 13 | { 14 | public: 15 | ScopedLACInitializer(const std::vector &dofs_per_block, 16 | const std::vector &owned, 17 | const std::vector &relevant, 18 | const MPI_Comm &comm = MPI_COMM_WORLD): 19 | dofs_per_block(dofs_per_block), 20 | owned(owned), 21 | relevant(relevant), 22 | comm(comm) 23 | {}; 24 | 25 | /** 26 | * Initialize a non ghosted TrilinosWrappers::MPI::BlockVector. 27 | */ 28 | void operator() (TrilinosWrappers::MPI::BlockVector &v, bool fast=false) 29 | { 30 | v.reinit(owned, comm, fast); 31 | }; 32 | 33 | 34 | /** 35 | * Initialize a ghosted TrilinosWrappers::MPI::BlockVector. 36 | */ 37 | void ghosted(TrilinosWrappers::MPI::BlockVector &v, bool fast=false) 38 | { 39 | v.reinit(owned, relevant, comm, fast); 40 | }; 41 | 42 | /** 43 | * Initialize a serial BlockVector. 44 | */ 45 | void operator() (BlockVector &v, bool fast=false) 46 | { 47 | v.reinit(dofs_per_block, fast); 48 | }; 49 | 50 | 51 | /** 52 | * Initiale a ghosted BlockVector. Will throw an exception and 53 | * should not be called... 54 | */ 55 | void ghosted(BlockVector &, bool fast=false) 56 | { 57 | Assert(false, ExcInternalError("You tried to create a ghosted vector in a serial run.")); 58 | (void)fast; 59 | }; 60 | 61 | /** 62 | * Initialize a Trilinos Sparsity Pattern. 63 | */ 64 | template 65 | void operator() (TrilinosWrappers::BlockSparsityPattern &s, 66 | const DoFHandler &dh, 67 | const ConstraintMatrix &cm, 68 | const Table<2,DoFTools::Coupling> &coupling) 69 | { 70 | s.reinit(owned, owned, relevant, comm); 71 | DoFTools::make_sparsity_pattern (dh, 72 | coupling, s, 73 | cm, false, 74 | Utilities::MPI::this_mpi_process(comm)); 75 | s.compress(); 76 | } 77 | 78 | /** 79 | * Initialize a Deal.II Sparsity Pattern. 80 | */ 81 | template 82 | void operator() (dealii::BlockSparsityPattern &s, 83 | const DoFHandler &dh, 84 | const ConstraintMatrix &cm, 85 | const Table<2,DoFTools::Coupling> &coupling) 86 | { 87 | dealii::BlockDynamicSparsityPattern csp(dofs_per_block, dofs_per_block); 88 | 89 | DoFTools::make_sparsity_pattern (dh, 90 | coupling, csp, 91 | cm, false); 92 | csp.compress(); 93 | s.copy_from(csp); 94 | } 95 | 96 | private: 97 | /** 98 | * Dofs per block. 99 | */ 100 | const std::vector &dofs_per_block; 101 | 102 | /** 103 | * Owned dofs per block. 104 | */ 105 | const std::vector &owned; 106 | 107 | /** 108 | * Relevant dofs per block. 109 | */ 110 | const std::vector &relevant; 111 | 112 | /** 113 | * MPI Communicator. 114 | */ 115 | const MPI_Comm &comm; 116 | }; 117 | 118 | 119 | // A few useful functions 120 | inline void compress(TrilinosWrappers::BlockSparseMatrix &m, 121 | VectorOperation::values op) 122 | { 123 | m.compress(op); 124 | } 125 | 126 | inline void compress(dealii::BlockSparseMatrix &, 127 | VectorOperation::values ) 128 | { 129 | } 130 | #endif 131 | -------------------------------------------------------------------------------- /include/lac/lac_type.h: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | // 3 | // Copyright (C) 2008 - 2015 by the deal.II authors 4 | // 5 | // This file is part of the deal.II library. 6 | // 7 | // The deal.II library is free software; you can use it, redistribute 8 | // it, and/or modify it under the terms of the GNU Lesser General 9 | // Public License as published by the Free Software Foundation; either 10 | // version 2.1 of the License, or (at your option) any later version. 11 | // The full text of the license can be found in the file LICENSE at 12 | // the top level of the deal.II distribution. 13 | // 14 | // --------------------------------------------------------------------- 15 | #ifndef _LAC_TYPE_H_ 16 | #define _LAC_TYPE_H_ 17 | 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | using namespace dealii; 31 | //using namespace deal2lkit; 32 | 33 | enum TriaType {serial, distributed}; 34 | 35 | class LADealII 36 | { 37 | public: 38 | typedef BlockVector VectorType; 39 | typedef BlockSparseMatrix BlockMatrix; 40 | typedef dealii::BlockSparsityPattern BlockSparsityPattern; 41 | static const TriaType triatype = serial; 42 | }; 43 | 44 | 45 | #ifdef DEAL_II_WITH_PETSC 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | /** 54 | * A namespace in which the wrappers to the PETSc linear algebra classes are 55 | * typedef'ed to generic names. There are similar namespaces 56 | * LinearAlgebraDealII and LinearAlgebraTrilinos for typedefs to deal.II's own 57 | * classes and classes that interface with Trilinos. 58 | */ 59 | class LAPETSc 60 | { 61 | public: 62 | /** 63 | * Typedef for the type used to describe vectors that consist of multiple 64 | * blocks. 65 | */ 66 | typedef PETScWrappers::MPI::BlockVector VectorType; 67 | 68 | /** 69 | * Typedef for the type used to describe sparse matrices that consist of 70 | * multiple blocks. 71 | */ 72 | typedef PETScWrappers::MPI::BlockSparseMatrix BlockMatrix; 73 | 74 | typedef dealii::BlockSparsityPattern BlockSparsityPattern; 75 | 76 | static const TriaType triatype = distributed; 77 | }; 78 | 79 | #endif // DEAL_II_WITH_PETSC 80 | 81 | #ifdef DEAL_II_WITH_TRILINOS 82 | 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | 89 | /** 90 | * A namespace in which the wrappers to the Trilinos linear algebra classes 91 | * are typedef'ed to generic names. There are similar namespaces 92 | * LinearAlgebraDealII and LinearAlgebraPETSc for typedefs to deal.II's own 93 | * classes and classes that interface with PETSc. 94 | */ 95 | class LATrilinos 96 | { 97 | public: 98 | /** 99 | * Typedef for the vector type used. 100 | */ 101 | typedef TrilinosWrappers::MPI::BlockVector VectorType; 102 | 103 | /** 104 | * Typedef for the type used to describe sparse matrices that consist of 105 | * multiple blocks. 106 | */ 107 | typedef TrilinosWrappers::BlockSparseMatrix BlockMatrix; 108 | 109 | typedef TrilinosWrappers::BlockSparsityPattern BlockSparsityPattern; 110 | 111 | static const TriaType triatype = distributed; 112 | 113 | }; 114 | 115 | #endif // DEAL_II_WITH_TRILINOS 116 | 117 | 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /include/old_interfaces/conservative.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Conservative Interface 3 | * 4 | * This class is a child of interface.h 5 | * 6 | * It is used to define a problem in the case whole the problem 7 | * could be stated in terms of energy and this energy can be derived 8 | * in ordert ot find a solution to the problem. 9 | * 10 | */ 11 | 12 | #ifndef _conservative_interface_h 13 | #define _conservative_interface_h 14 | 15 | #include "interfaces/interface.h" 16 | 17 | using namespace deal2lkit; 18 | 19 | template 20 | class ConservativeInterface : public Interface 21 | { 22 | 23 | typedef FEValuesCache Scratch; 24 | typedef Assembly::CopyData::piDoMUSPreconditioner CopyPreconditioner; 25 | typedef Assembly::CopyData::piDoMUSSystem CopySystem; 26 | 27 | public: 28 | 29 | virtual ~ConservativeInterface() {}; 30 | virtual void declare_parameters(ParameterHandler &prm) 31 | { 32 | Interface::declare_parameters(prm); 33 | } 34 | virtual void parse_parameters_call_back() 35 | { 36 | Interface::parse_parameters_call_back(); 37 | } 38 | 39 | 40 | ConservativeInterface(const std::string &name="", 41 | const std::string &default_fe="FE_Q(1)", 42 | const std::string &default_component_names="u", 43 | const std::string &default_coupling="", 44 | const std::string &default_preconditioner_coupling="", 45 | const std::string &default_differential_components="") : 46 | Interface(name, default_fe, default_component_names, 47 | default_coupling, default_preconditioner_coupling, 48 | default_differential_components) {}; 49 | 50 | virtual void get_system_energy(const typename DoFHandler::active_cell_iterator &c, 51 | Scratch &s, 52 | CopySystem &d, 53 | Sdouble &e) const 54 | { 55 | static_cast(this)->system_energy(c,s,d,e); 56 | } 57 | 58 | 59 | virtual void get_system_energy(const typename DoFHandler::active_cell_iterator &c, 60 | Scratch &s, 61 | CopySystem &d, 62 | SSdouble &e) const 63 | { 64 | static_cast(this)->system_energy(c,s,d,e); 65 | } 66 | 67 | 68 | virtual void get_preconditioner_energy(const typename DoFHandler::active_cell_iterator &c, 69 | Scratch &s, 70 | CopySystem &d, 71 | Sdouble &e) const 72 | { 73 | static_cast(this)->preconditioner_energy(c,s,d,e); 74 | } 75 | 76 | 77 | virtual void get_preconditioner_energy(const typename DoFHandler::active_cell_iterator &c, 78 | Scratch &s, 79 | CopyPreconditioner &d, 80 | SSdouble &e) const 81 | { 82 | static_cast(this)->preconditioner_energy(c,s,d,e); 83 | } 84 | }; 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /include/old_interfaces/conservative/heat_equation.h: -------------------------------------------------------------------------------- 1 | /*! \addtogroup equations 2 | * @{ 3 | */ 4 | 5 | #ifndef _heat_equation_derived_interface_h_ 6 | #define _heat_equation_derived_interface_h_ 7 | 8 | #include "interfaces/conservative.h" 9 | #include 10 | 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | #include "data/assembly.h" 25 | #include "lac/lac_type.h" 26 | 27 | 28 | template 29 | class HeatEquation : public ConservativeInterface, LAC > 30 | { 31 | typedef FEValuesCache Scratch; 32 | typedef Assembly::CopyData::piDoMUSPreconditioner CopyPreconditioner; 33 | typedef Assembly::CopyData::piDoMUSSystem CopySystem; 34 | typedef BlockSparseMatrix MAT; 35 | 36 | public: 37 | 38 | 39 | /* specific and useful functions for this very problem */ 40 | HeatEquation() : 41 | ConservativeInterface, LAC >("Heat Equation", 42 | "FESystem[FE_Q(2)]", 43 | "u", "1", "0","1") 44 | {}; 45 | 46 | 47 | UpdateFlags get_preconditioner_flags() const 48 | { 49 | return update_default; 50 | }; 51 | 52 | 53 | template 54 | void preconditioner_energy(const typename DoFHandler::active_cell_iterator &, 55 | Scratch &, 56 | CopyPreconditioner &, 57 | Number &) const 58 | { 59 | }; 60 | 61 | template 62 | void system_energy(const typename DoFHandler::active_cell_iterator &cell, 63 | Scratch &fe_cache, 64 | CopySystem &data, 65 | Number &energy) const 66 | { 67 | Number alpha = this->alpha; 68 | this->reinit(alpha, cell, fe_cache); 69 | 70 | auto &JxW = fe_cache.get_JxW_values(); 71 | 72 | const FEValuesExtractors::Scalar scalar(0); 73 | 74 | auto &us = fe_cache.get_values("solution", "u", scalar, alpha); 75 | auto &us_dot = fe_cache.get_values("solution_dot", "u_dot", scalar, alpha); 76 | auto &grad_us = fe_cache.get_gradients("solution", "gradu", scalar, alpha); 77 | 78 | energy = 0; 79 | for (unsigned int q=0; q &grad_u = grad_us[q]; 84 | 85 | energy += (u_dot*u + 0.5*(grad_u*grad_u))*JxW[q]; 86 | } 87 | }; 88 | }; 89 | 90 | 91 | #endif 92 | /*! @} */ 93 | -------------------------------------------------------------------------------- /include/old_interfaces/non_conservative.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Non Conservative Interface 3 | * 4 | * This class is a child of interface.h 5 | * 6 | * It is used to define a problem in the case whole the problem 7 | * could not be stated in terms of energy. 8 | * 9 | */ 10 | 11 | #ifndef _non_conservative_interface_h 12 | #define _non_conservative_interface_h 13 | 14 | #include "interfaces/interface.h" 15 | 16 | using namespace deal2lkit; 17 | 18 | template 19 | class NonConservativeInterface : public Interface 20 | { 21 | 22 | typedef FEValuesCache Scratch; 23 | typedef Assembly::CopyData::piDoMUSPreconditioner CopyPreconditioner; 24 | typedef Assembly::CopyData::piDoMUSSystem CopySystem; 25 | public: 26 | 27 | virtual ~NonConservativeInterface() {}; 28 | 29 | NonConservativeInterface(const std::string &name="", 30 | const std::string &default_fe="FE_Q(1)", 31 | const std::string &default_component_names="u", 32 | const std::string &default_coupling="", 33 | const std::string &default_preconditioner_coupling="", 34 | const std::string &default_differential_components="") : 35 | Interface(name, default_fe, default_component_names, 36 | default_coupling, default_preconditioner_coupling, 37 | default_differential_components) {}; 38 | 39 | virtual void declare_parameters(ParameterHandler &prm) 40 | { 41 | Interface::declare_parameters(prm); 42 | } 43 | virtual void parse_parameters_call_back() 44 | { 45 | Interface::parse_parameters_call_back(); 46 | } 47 | 48 | virtual void get_system_residual (const typename DoFHandler::active_cell_iterator &cell, 49 | Scratch &scratch, 50 | CopySystem &data, 51 | std::vector &local_residual) const 52 | { 53 | static_cast(this)->system_residual(cell, scratch, data, local_residual); 54 | } 55 | 56 | virtual void get_system_residual (const typename DoFHandler::active_cell_iterator &cell, 57 | Scratch &scratch, 58 | CopySystem &data, 59 | std::vector &local_residual) const 60 | { 61 | static_cast(this)->system_residual(cell, scratch, data, local_residual); 62 | } 63 | 64 | virtual void get_preconditioner_residual (const typename DoFHandler::active_cell_iterator &cell, 65 | Scratch &scratch, 66 | CopyPreconditioner &data, 67 | std::vector &local_residual) const 68 | { 69 | static_cast(this)->preconditioner_residual(cell, scratch, data, local_residual); 70 | } 71 | 72 | // aux matrices //////////////////////////////////////////////////////////////// 73 | 74 | virtual void get_aux_matrix_residuals (const typename DoFHandler::active_cell_iterator &cell, 75 | Scratch &scratch, 76 | CopyPreconditioner &data, 77 | std::vector > &local_residuals) const 78 | { 79 | static_cast(this)->aux_matrix_residuals(cell, scratch, data, local_residuals); 80 | } 81 | 82 | virtual void get_aux_matrix_residuals (const typename DoFHandler::active_cell_iterator &cell, 83 | Scratch &scratch, 84 | CopyPreconditioner &data, 85 | std::vector > &local_residuals) const 86 | { 87 | static_cast(this)->aux_matrix_residuals(cell, scratch, data, local_residuals); 88 | } 89 | }; 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /include/pidomus_macros.h: -------------------------------------------------------------------------------- 1 | #ifndef _pidomus_macros_h 2 | #define _pidomus_macros_h 3 | 4 | /** 5 | * A macro used for instantiating pi-DoMUS classes 6 | * and functions. 7 | */ 8 | #define PIDOMUS_INSTANTIATE(INSTANTIATIONS) \ 9 | INSTANTIATIONS(2,2,LATrilinos) \ 10 | INSTANTIATIONS(2,3,LATrilinos) \ 11 | INSTANTIATIONS(3,3,LATrilinos) \ 12 | INSTANTIATIONS(2,2,LADealII) \ 13 | INSTANTIATIONS(2,3,LADealII) \ 14 | INSTANTIATIONS(3,3,LADealII) 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /include/tria_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __pidomus_tria_helper_h 2 | #define __pidomus_tria_helper_h 3 | 4 | 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace dealii; 12 | using namespace deal2lkit; 13 | 14 | /** 15 | * this class helps pidomus in creating the appropriate triangulation 16 | * i.e. serial or parallel::distributed 17 | */ 18 | template 19 | class TriaHelper 20 | { 21 | public: 22 | 23 | /** 24 | * constructor 25 | */ 26 | #ifdef DEAL_II_WITH_MPI 27 | TriaHelper(const MPI_Comm comm=MPI_COMM_WORLD); 28 | ~TriaHelper(); 29 | #else 30 | TriaHelper(); 31 | #endif 32 | 33 | /** 34 | * @brief generate the triangulation according to the LAC::TriaType 35 | * and set the corresponding shared_ptr 36 | */ 37 | void make_grid(); 38 | 39 | /** 40 | * @brief return a pointer to the triangulation 41 | */ 42 | Triangulation *get_tria() const; 43 | 44 | private: 45 | #ifdef DEAL_II_WITH_MPI 46 | MPI_Comm comm; 47 | #endif 48 | ParsedGridGenerator pgg; 49 | std::shared_ptr > p_serial; 50 | 51 | #ifdef DEAL_II_WITH_MPI 52 | std::shared_ptr > p_parallel; 53 | #endif 54 | }; 55 | 56 | #endif // __pidomus_tria_helper_h 57 | -------------------------------------------------------------------------------- /scripts/analytical_stokes/analytical_stokes_3d.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | from sympy import * 4 | 5 | from nabla import Nabla 6 | 7 | import io_tools 8 | 9 | 10 | x,y,z = symbols('x y z') 11 | 12 | init_printing(use_unicode=True) 13 | 14 | X = Matrix([[x],[y],[z]]) 15 | 16 | print X 17 | 18 | nabla = Nabla(X) 19 | 20 | 21 | psi = zeros(3,1) 22 | 23 | # nico sol 24 | #psi[0,0] = x**2*(1-x)**2*(sin(2*pi*y))**2*(sin(2*pi*z))**2 25 | #psi[2,0] = (sin(2*pi*x))**2*(sin(2*pi*y))**2*z**2*(1-z)**2 26 | 27 | #nico-evans sol 28 | #psi[0,0] = sin(2*pi*x)*y**2*(1-y)**2*z**2*(1-z)**2 29 | #psi[2,0] = x**2*(1-x)**2*y**2*(1-y)**2*sin(2*pi*z) 30 | 31 | #testing sol 32 | psi[0,0] = x**2*(1-x)**2*y**2*(1-y)**2*(sin(pi*z))**2 33 | psi[2,0] = x**2*(1-x)**2*y**2*(1-y)**2*z**2*(1-z)**2 34 | 35 | #evans sol 36 | #psi[0,0] = x*(1-x)*y**2*(1-y)**2*z**2*(1-z)**2 37 | #psi[2,0] = x**2*(1-x)**2*y**2*(1-y)**2*z*(1-z) 38 | 39 | print psi 40 | 41 | u = nabla.curl(psi) 42 | 43 | print u 44 | 45 | div_u = diff(u[0],X[0])+diff(u[1],X[1])+diff(u[2],X[2]) 46 | 47 | print 'div_u = ' 48 | print simplify(div_u) 49 | 50 | print 'boundary conditions:' 51 | print u.subs(x,0) 52 | print u.subs(x,1) 53 | print u.subs(y,0) 54 | print u.subs(y,1) 55 | print u.subs(z,0) 56 | print u.subs(z,1) 57 | 58 | u_p = u.subs(x,.1) 59 | u_p = u_p.subs(y,.3) 60 | u_p = u_p.subs(z,.2) 61 | 62 | print u_p.evalf() 63 | 64 | p = zeros(1,1) 65 | 66 | p[0] = sin(pi*x)*sin(pi*y)*sin(pi*z)-8/(pi**3) 67 | print p 68 | p_avg = integrate(p,(x,0,1),(y,0,1),(z,0,1)) 69 | print p_avg 70 | 71 | p_force = nabla.apply_to(p) 72 | p_force = p_force.transpose() 73 | print p_force.shape 74 | print p_force 75 | 76 | laplacian_u = zeros(3,1) 77 | 78 | for i in range (0,3): 79 | laplacian_u[i,0] = diff(u[i],X[0,0],2)+diff(u[i],X[1,0],2)+diff(u[i],X[2,0],2) 80 | 81 | laplacian_u = simplify(laplacian_u) 82 | 83 | #laplacian_u = nabla.square(u) 84 | #print laplacian_u 85 | 86 | r = symbols('r') 87 | 88 | force = -1/r*laplacian_u + p_force 89 | #force = -1/r*laplacian_u 90 | #force = p_force 91 | force = simplify(force) 92 | 93 | print '-------------------' 94 | print 'pressure:' 95 | print ccode(p[0]) 96 | print '-------------------' 97 | 98 | 99 | for i in range(0,u.shape[0]): 100 | print '-------------------' 101 | print 'velocity component '+str(i)+':' 102 | print ccode(u[i,0]) 103 | print '-------------------' 104 | 105 | for i in range(0,u.shape[0]): 106 | print '-------------------' 107 | print 'force component '+str(i)+':' 108 | print ccode(force[i,0]) 109 | print '-------------------' 110 | 111 | filename = 'stk_force_3d' 112 | classname = 'StkForce3d' 113 | directory = './' 114 | func = force 115 | io_tools.function_to_cpp_source(func,directory,filename,classname) 116 | 117 | dim_domain = 3 118 | filename = 'stk_vel_3d' 119 | classname = 'StkVelocity3d' 120 | func = u 121 | io_tools.function_to_cpp_header(dim_domain,func,directory,filename,classname) 122 | 123 | dim_domain = 3 124 | filename = 'stk_prex_3d' 125 | classname = 'StkPressure3d' 126 | func = p 127 | io_tools.function_to_cpp_header(dim_domain,func,directory,filename,classname) 128 | 129 | -------------------------------------------------------------------------------- /scripts/analytical_stokes/io_tools.py: -------------------------------------------------------------------------------- 1 | #import PetscBinaryIO 2 | import numpy as np 3 | from sympy import * 4 | 5 | def function_to_cpp_source(func,directory,filename,classname): 6 | dim = func.shape[0] 7 | template = '<'+str(dim)+','+str(dim)+','+'1'+'>' 8 | out_file = open (directory+filename+'.cpp', 'w') 9 | out_file.write('/*\n') 10 | out_file.write(' * stk_force_3d.cpp\n') 11 | out_file.write(' *\n') 12 | out_file.write(' * Created on: Mar 24, 2014\n') 13 | out_file.write(' * Author: nicola\n') 14 | out_file.write(' */\n') 15 | out_file.write('#include "'+filename+'.h"\n') 16 | 17 | out_file.write('void '+classname+'::evaluate(const std::vector< typename Function'+template+'::PointType > & points,\n') 18 | out_file.write(' std::vector< typename Function'+template+'::ValueType > & values) const\n') 19 | out_file.write('{\n') 20 | out_file.write(' for (uint i =0; i' 34 | out_file = open (directory+filename+'.h', 'w') 35 | out_file.write('/*\n') 36 | out_file.write(' * '+filename+'.h\n') 37 | out_file.write(' *\n') 38 | out_file.write(' * Created on: Mar 24, 2014\n') 39 | out_file.write(' * Author: nicola\n') 40 | out_file.write(' */\n') 41 | out_file.write('\n') 42 | out_file.write('#ifndef '+filename+'_h_\n') 43 | out_file.write('#define '+filename+'_h_\n') 44 | out_file.write('\n') 45 | out_file.write('#include \n') 46 | out_file.write('\n') 47 | out_file.write('using namespace iga;\n') 48 | out_file.write('using namespace std;\n') 49 | out_file.write('\n') 50 | out_file.write('class '+classname+' : public Function'+template+'\n') 51 | out_file.write('{\n') 52 | out_file.write('\n') 53 | out_file.write('public:\n') 54 | out_file.write(' '+classname+' () : Function'+template+'() {}\n') 55 | out_file.write('\n') 56 | out_file.write(' void evaluate(const ValueVector< typename Function'+template+'::Point > &points,\n') 57 | out_file.write(' ValueVector< typename Function'+template+'::Value > &values) const\n') 58 | out_file.write(' {\n') 59 | out_file.write(' for (uint i =0; i\n') 70 | out_file.write(' create()\n') 71 | out_file.write(' {\n') 72 | out_file.write(' return(shared_ptr(new '+classname+'())) ;\n') 73 | out_file.write(' }\n') 74 | out_file.write('};\n') 75 | out_file.write('\n') 76 | out_file.write('#endif /* '+filename+'_h_ */\n') 77 | out_file = open (directory+filename+'.cpp', 'w') 78 | out_file.write('/*\n') 79 | out_file.write(' * '+filename+'.cpp\n') 80 | out_file.write(' *\n') 81 | out_file.write(' * Created on: Mar 24, 2014\n') 82 | out_file.write(' * Author: nicola\n') 83 | out_file.write(' */\n') 84 | out_file.write('#include "'+filename+'.h"\n') 85 | return 86 | -------------------------------------------------------------------------------- /scripts/analytical_stokes/nabla.py: -------------------------------------------------------------------------------- 1 | from sympy import * 2 | 3 | class Nabla: 4 | # 5 | # nabla dimension is the covariant dimension 6 | # nabla applies to something of contravariant dimension 7 | # 8 | def __init__(self,X): 9 | self.X = X 10 | self.dim_cov = self.X.shape[0] 11 | 12 | def apply_to(self,u): 13 | dim_contra = u.shape[0] 14 | grad_u = zeros(dim_contra,self.dim_cov) 15 | 16 | for i in range(0,dim_contra): 17 | for j in range(0,self.dim_cov): 18 | grad_u[i,j] = diff(u[i,0],self.X[j,0]) 19 | 20 | grad_u = simplify(grad_u) 21 | 22 | return grad_u 23 | 24 | def curl(self,u): 25 | dim_contra = u.shape[0] 26 | 27 | curl_u = zeros(dim_contra,1) 28 | 29 | if dim_contra == 3 & self.dim_cov == 3 : 30 | curl_u[0] = diff(u[2,0],self.X[1,0]) - diff(u[1,0],self.X[2,0]) 31 | curl_u[1] = diff(u[0,0],self.X[2,0]) - diff(u[2,0],self.X[0,0]) 32 | curl_u[2] = diff(u[1,0],self.X[0,0]) - diff(u[0,0],self.X[1,0]) 33 | 34 | else: 35 | assert False,'Nabla.curl not implemented for this dimensions' 36 | 37 | curl_u = simplify(curl_u) 38 | 39 | return curl_u 40 | 41 | def cdot(self,u): 42 | dim_contra = u.shape[0] 43 | div_u = zeros(1,1) 44 | 45 | for i in range(0,dim_contra): 46 | div_u[0,0] += diff(u[i,0],self.X[i,0]) 47 | 48 | return div_u 49 | 50 | 51 | def square(self,u): 52 | dim_contra = u.shape[0] 53 | 54 | square_u = zeros(dim_contra,1) 55 | 56 | x = self.X[0,0] 57 | 58 | for i in range(0,dim_contra): 59 | component = 0*x 60 | for j in range(0,self.dim_cov): 61 | component += diff(u[i,0],self.X[j,0],2) 62 | square_u[i] = component 63 | 64 | return simplify(square_u) -------------------------------------------------------------------------------- /scripts/astyle.rc: -------------------------------------------------------------------------------- 1 | ## --------------------------------------------------------------------- 2 | ## 3 | ## Copyright (C) 2012 - 2013 by the deal.II authors 4 | ## 5 | ## This file is part of the deal.II library. 6 | ## 7 | ## The deal.II library is free software; you can use it, redistribute 8 | ## it, and/or modify it under the terms of the GNU Lesser General 9 | ## Public License as published by the Free Software Foundation; either 10 | ## version 2.1 of the License, or (at your option) any later version. 11 | ## The full text of the license can be found in the file LICENSE at 12 | ## the top level of the deal.II distribution. 13 | ## 14 | ## --------------------------------------------------------------------- 15 | 16 | # astyle 2.02 indentation style for deal.II 17 | 18 | --style=gnu 19 | 20 | --convert-tabs 21 | --indent-preprocessor 22 | --indent=spaces=2 23 | --indent-namespaces 24 | --min-conditional-indent=0 25 | --pad-header 26 | 27 | # write things as 'char *p' 28 | --align-pointer=name 29 | --align-reference=name 30 | 31 | --max-instatement-indent=60 32 | --suffix=none 33 | --quiet 34 | -------------------------------------------------------------------------------- /scripts/build_documentation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Settings 4 | REPO_PATH=git@github.com:mathLab/pi-DoMUS.git 5 | HTML_PATH=../doc/html 6 | COMMIT_USER="Documentation Builder" 7 | COMMIT_EMAIL="luca.heltai@gmail.com" 8 | CHANGESET=$(git rev-parse --verify HEAD) 9 | 10 | # Get a clean version of the HTML documentation repo. 11 | rm -rf ${HTML_PATH} 12 | mkdir -p ${HTML_PATH} 13 | git clone -b gh-pages "${REPO_PATH}" --single-branch ${HTML_PATH} 14 | 15 | # rm all the files through git to prevent stale files. 16 | cd ${HTML_PATH} 17 | git rm -rf . 18 | cd - 19 | 20 | # Generate the HTML documentation. 21 | wget http://www.dealii.org/developer/doxygen/deal.tag 22 | ninja doc 23 | 24 | # Create and commit the documentation repo. 25 | cd ${HTML_PATH} 26 | git add . 27 | git config user.name "${COMMIT_USER}" 28 | git config user.email "${COMMIT_EMAIL}" 29 | git commit -m "Automated documentation build for changeset ${CHANGESET}." 30 | git pull --rebase origin gh-pages 31 | git push origin gh-pages 32 | cd - 33 | -------------------------------------------------------------------------------- /scripts/check_indentation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then 4 | echo "Running indentation test on master merge." 5 | else 6 | echo "Running indentation test on Pull Request #${TRAVIS_PULL_REQUEST}" 7 | fi 8 | 9 | export PATH=`pwd`/astyle/build/gcc/bin:$PATH 10 | 11 | ./scripts/indent 12 | git diff 13 | git diff-files --quiet 14 | -------------------------------------------------------------------------------- /scripts/check_test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$1" ]; then 4 | echo "Usage: 5 | $0 regexp 6 | 7 | Will check the generated output with the expected output using 8 | cwdiff, and give you the opportunity to accept new results. 9 | " 10 | exit 0 11 | fi 12 | 13 | FILE=`ctest -N | grep $1 | head -n 1 | awk '{print $NF}'` 14 | 15 | if [ -z "$FILE" ]; then 16 | echo "Using $1, I could not find any corresponding test..." 17 | exit 18 | fi 19 | 20 | echo Processing file $FILE: 21 | SRC=`grep SOURCE_DIR CMakeCache.txt | awk -F"=" '{print $2}'` 22 | CMP=$SRC/${FILE/debug/output} 23 | CMP=${CMP/release/output} 24 | 25 | if [ ! -f $FILE/output ]; then 26 | echo "File $FILE/output does not exist. Some other problem occurred." 27 | echo "Running ctest in verbose mode:" 28 | ctest -V -R $FILE 29 | exit 30 | fi 31 | 32 | if [ ! -f $CMP ]; then 33 | prompt="Please select a file to compare to:" 34 | PS3="$prompt " 35 | options=(`ls ${CMP/output/}*output`) 36 | select opt in "${options[@]}" "Quit" ; do 37 | if (( REPLY == 1 + ${#options[@]} )) ; then 38 | exit 39 | 40 | elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then 41 | echo "Comparing with $opt:" 42 | CMP=$opt 43 | break 44 | else 45 | echo "Invalid option. Try another one." 46 | fi 47 | done 48 | fi 49 | 50 | cwdiff ${FILE}/output $CMP 51 | 52 | PS3="Accept new version ($FILE)?" 53 | select opt in "Yes" "No"; do 54 | if ((REPLY == 1)) ; then 55 | echo "You said yes. Very well." 56 | cp ${FILE}/output $CMP 57 | exit 58 | else 59 | echo "You said no. :( " 60 | exit 61 | fi 62 | done 63 | -------------------------------------------------------------------------------- /scripts/dr.sh: -------------------------------------------------------------------------------- 1 | docker run -t --rm -P -v `pwd`:/home/dealii/pi-DoMUS:rw pidomus /bin/sh -c "$@" 2 | -------------------------------------------------------------------------------- /scripts/indent: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## --------------------------------------------------------------------- 3 | ## 4 | ## Copyright (C) 2012 - 2013, 2015 by the deal.II authors 5 | ## 6 | ## This file is part of the deal.II library. 7 | ## 8 | ## The deal.II library is free software; you can use it, redistribute 9 | ## it, and/or modify it under the terms of the GNU Lesser General 10 | ## Public License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## The full text of the license can be found in the file LICENSE at 13 | ## the top level of the deal.II distribution. 14 | ## 15 | ## --------------------------------------------------------------------- 16 | 17 | if test ! -d source -o ! -d include ; then 18 | echo "*** This script must be run from the top-level directory of pi-DoMUS." 19 | exit 20 | fi 21 | 22 | if test ! -f scripts/astyle.rc ; then 23 | echo "*** No style file scripts/astyle.rc found." 24 | exit 25 | fi 26 | 27 | 28 | # loop over all directories in which we may have source files; 29 | # collect a list of files and then spawn a parallel process to 30 | # indent all of them 31 | echo "--- Indenting all header and source files" 32 | for dir in source include tests main; do 33 | files=`find $dir | egrep '\.(cc|h)$'` ; 34 | if test -n "$files" ; then 35 | (astyle --options=scripts/astyle.rc $files ) & 36 | fi 37 | done 38 | 39 | wait 40 | -------------------------------------------------------------------------------- /scripts/run_travis_commands.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec 2> /dev/null 4 | EI=0 5 | 6 | # If you want to simulate what will be run, just pass echo on the command 7 | # line. 8 | PREPEND_COMMANDS="$1" 9 | 10 | # The script runs all commands in the before_install and script sections 11 | # of the .travis.yml file, one time for each env variable set 12 | 13 | while ENVSET=`cat .travis.yml | shyaml get-value env.$EI`; do 14 | echo $ENVSET 15 | eval "$ENVSET" 16 | ((EI++)) 17 | for section in before_install script; do 18 | echo ============================================================ 19 | echo ============================================================ 20 | echo "Current phase: $section" 21 | echo ============================================================ 22 | echo ============================================================ 23 | BI=0 24 | while CMD=`cat .travis.yml | shyaml get-value $section.$BI`; do 25 | ((BI++)) 26 | echo "Executing: $CMD" 27 | echo ============================================================ 28 | if ! eval "$PREPEND_COMMANDS $CMD"; then 29 | echo ************************************************************ 30 | echo ************************************************************ 31 | echo "FAILED" 32 | echo ************************************************************ 33 | echo ************************************************************ 34 | exit 1 35 | else 36 | echo ============================================================ 37 | echo "SUCCESS" 38 | echo ============================================================ 39 | fi 40 | done 41 | done 42 | done 43 | 44 | -------------------------------------------------------------------------------- /scripts/setup_astyle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PRG=$PWD/programs 4 | CASA=$PWD 5 | 6 | if [ ! -d programs ] 7 | then 8 | echo "create folder $PRG" 9 | mkdir $PRG 10 | else 11 | # touch all files to avoid cache to be deleted 12 | find $PRG -exec touch {} \; 13 | fi 14 | 15 | # astyle 16 | if [ ! -d $PRG/astyle ] 17 | then 18 | echo "Downloading and installing astyle." 19 | mkdir $PRG/astyle 20 | wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz > /dev/null 21 | tar xfz astyle_2.04_linux.tar.gz -C $PRG > /dev/null 22 | cd $PRG/astyle/build/gcc 23 | make -j4 > /dev/null 24 | cd $CASA 25 | fi 26 | -------------------------------------------------------------------------------- /source/pidomus_boundary_conditions_and_forcing_terms.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "pidomus_macros.h" 3 | 4 | using namespace dealii; 5 | using namespace deal2lkit; 6 | 7 | // This file contains the implementation of the functions 8 | // called for applying Dirichlet and Neumann BCs and forcing 9 | // terms specified **in the parameter file**. 10 | 11 | 12 | template 13 | void 14 | piDoMUS:: 15 | apply_neumann_bcs ( 16 | const typename DoFHandler::active_cell_iterator &cell, 17 | FEValuesCache &scratch, 18 | std::vector &local_residual) const 19 | { 20 | 21 | double dummy = 0.0; 22 | 23 | for (unsigned int face=0; face < GeometryInfo::faces_per_cell; ++face) 24 | { 25 | unsigned int face_id = cell->face(face)->boundary_id(); 26 | if (cell->face(face)->at_boundary() && neumann_bcs.acts_on_id(face_id)) 27 | { 28 | interface.reinit(dummy, cell, face, scratch); 29 | 30 | auto &fev = scratch.get_current_fe_values(); 31 | auto &q_points = scratch.get_quadrature_points(); 32 | auto &JxW = scratch.get_JxW_values(); 33 | 34 | for (unsigned int q=0; q T(interface.n_components); 37 | neumann_bcs.get_mapped_function(face_id)->vector_value(q_points[q], T); 38 | 39 | for (unsigned int i=0; iat_boundary 48 | 49 | }// end loop over faces 50 | 51 | }// end function definition 52 | 53 | 54 | 55 | template 56 | void 57 | piDoMUS:: 58 | apply_forcing_terms (const typename DoFHandler::active_cell_iterator &cell, 59 | FEValuesCache &scratch, 60 | std::vector &local_residual) const 61 | { 62 | unsigned cell_id = cell->material_id(); 63 | if (forcing_terms.acts_on_id(cell_id)) 64 | { 65 | double dummy = 0.0; 66 | interface.reinit(dummy, cell, scratch); 67 | 68 | auto &fev = scratch.get_current_fe_values(); 69 | auto &q_points = scratch.get_quadrature_points(); 70 | auto &JxW = scratch.get_JxW_values(); 71 | for (unsigned int q=0; qvalue(q_points[q],c); 76 | local_residual[i] -= B*fev.shape_value_component(i,q,c)*JxW[q]; 77 | } 78 | } 79 | } 80 | 81 | 82 | template 83 | void 84 | piDoMUS:: 85 | apply_dirichlet_bcs (const DoFHandler &dof_handler, 86 | const ParsedDirichletBCs &bc, 87 | ConstraintMatrix &constraints) const 88 | { 89 | try 90 | { 91 | bc.interpolate_boundary_values(interface.get_bc_mapping(),dof_handler,constraints); 92 | } 93 | catch (...) 94 | { 95 | AssertThrow(!we_are_parallel, 96 | ExcMessage("You called VectorTools::project_boundary_values(), which is not \n" 97 | "currently supported on deal.II in parallel settings.\n" 98 | "Feel free to submit a patch :)")); 99 | const QGauss quad(fe->degree+1); 100 | bc.project_boundary_values(interface.get_bc_mapping(),dof_handler,quad,constraints); 101 | } 102 | unsigned int codim = spacedim - dim; 103 | if (codim == 0) 104 | bc.compute_nonzero_normal_flux_constraints(dof_handler,interface.get_bc_mapping(),constraints); 105 | } 106 | 107 | 108 | 109 | #define INSTANTIATE(dim,spacedim,LAC) \ 110 | template class piDoMUS; 111 | 112 | 113 | PIDOMUS_INSTANTIATE(INSTANTIATE) 114 | 115 | -------------------------------------------------------------------------------- /source/pidomus_lambdas.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus_lambdas.h" 2 | #include "pidomus.h" 3 | #include "pidomus_macros.h" 4 | 5 | template 6 | Lambdas::Lambdas () 7 | {} 8 | 9 | 10 | template 11 | Lambdas:: 12 | Lambdas (piDoMUS &simulator_object) 13 | : 14 | simulator (&simulator_object) 15 | {} 16 | 17 | 18 | template 19 | Lambdas::~Lambdas () 20 | {} 21 | 22 | 23 | template 24 | void 25 | Lambdas:: 26 | initialize_simulator (piDoMUS &simulator_object) 27 | { 28 | simulator = &simulator_object; 29 | } 30 | 31 | 32 | template 33 | void 34 | Lambdas:: 35 | set_functions_to_default() 36 | { 37 | create_new_vector = [this]() ->shared_ptr 38 | { 39 | return this->simulator->create_new_vector(); 40 | }; 41 | 42 | residual = [this](const double t, 43 | const typename LAC::VectorType &y, 44 | const typename LAC::VectorType &y_dot, 45 | typename LAC::VectorType &residual) ->int 46 | { 47 | int ret = this->simulator->residual(t,y,y_dot,residual); 48 | this->simulator->set_constrained_dofs_to_zero(residual); 49 | return ret; 50 | }; 51 | 52 | setup_jacobian = [this](const double t, 53 | const typename LAC::VectorType &y, 54 | const typename LAC::VectorType &y_dot, 55 | const double alpha) ->int 56 | { 57 | return this->simulator->setup_jacobian(t,y,y_dot,alpha); 58 | }; 59 | 60 | solve_jacobian_system = [this](const typename LAC::VectorType &rhs, 61 | typename LAC::VectorType &dst) ->int 62 | { 63 | return this->simulator->solve_jacobian_system(rhs,dst); 64 | }; 65 | 66 | output_step = [this](const double t, 67 | const typename LAC::VectorType &y, 68 | const typename LAC::VectorType &y_dot, 69 | const unsigned int step_number) 70 | { 71 | this->simulator->output_step(t,y,y_dot,step_number); 72 | }; 73 | 74 | solver_should_restart = [this](const double t, 75 | typename LAC::VectorType &y, 76 | typename LAC::VectorType &y_dot) ->bool 77 | { 78 | return this->simulator->solver_should_restart(t,y,y_dot); 79 | }; 80 | 81 | differential_components = [this]() ->typename LAC::VectorType & 82 | { 83 | return this->simulator->differential_components(); 84 | }; 85 | 86 | get_local_tolerances = [this]() ->typename LAC::VectorType & 87 | { 88 | AssertThrow(false, ExcPureFunctionCalled("Please implement get_local_tolerances function.")); 89 | static auto lt = this->create_new_vector(); 90 | return *lt; 91 | }; 92 | 93 | get_lumped_mass_matrix = [&]() ->typename LAC::VectorType & 94 | { 95 | static shared_ptr lm; 96 | lm = this->create_new_vector(); 97 | this->simulator->get_lumped_mass_matrix(*lm); 98 | return *lm; 99 | }; 100 | 101 | jacobian_vmult = [this](const typename LAC::VectorType &src, 102 | typename LAC::VectorType &dst) ->int 103 | { 104 | return this->simulator->jacobian_vmult(src,dst); 105 | }; 106 | 107 | vector_norm = [this](const typename LAC::VectorType &vector) ->double 108 | { 109 | return this->simulator->vector_norm(vector); 110 | }; 111 | 112 | } 113 | 114 | #define INSTANTIATE(dim,spacedim,LAC) \ 115 | template class Lambdas; 116 | 117 | PIDOMUS_INSTANTIATE(INSTANTIATE) 118 | -------------------------------------------------------------------------------- /source/tria_helper.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus_macros.h" 2 | #include 3 | #include 4 | 5 | #ifdef DEAL_II_WITH_MPI 6 | template 7 | TriaHelper::TriaHelper(const MPI_Comm _comm): 8 | comm(Utilities::MPI::duplicate_communicator(_comm)), 9 | pgg("Domain"), 10 | p_serial(nullptr), 11 | p_parallel(nullptr) 12 | {} 13 | 14 | template 15 | TriaHelper::~TriaHelper() 16 | { 17 | p_serial.reset(); 18 | p_parallel.reset(); 19 | MPI_Comm_free(&comm); 20 | } 21 | 22 | #else 23 | template 24 | TriaHelper::TriaHelper() 25 | : 26 | pgg("Domain"), 27 | p_serial(nullptr), 28 | {} 29 | #endif 30 | 31 | template 32 | void TriaHelper::make_grid() 33 | { 34 | if (LAC::triatype == TriaType::serial) 35 | p_serial = shared_ptr >(pgg.serial()); 36 | #ifdef DEAL_II_WITH_MPI 37 | else 38 | p_parallel = shared_ptr >(pgg.distributed(comm)); 39 | #endif 40 | } 41 | 42 | template 43 | Triangulation * 44 | TriaHelper::get_tria() const 45 | { 46 | if (LAC::triatype == TriaType::serial) 47 | return p_serial.get(); 48 | #ifdef DEAL_II_WITH_MPI 49 | return p_parallel.get(); 50 | #endif 51 | } 52 | 53 | #define INSTANTIATE(dim,spacedim,LAC) \ 54 | template class TriaHelper; 55 | 56 | 57 | PIDOMUS_INSTANTIATE(INSTANTIATE) 58 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) 2 | INCLUDE_DIRECTORIES(${D2K_INCLUDE_DIRS}) 3 | DEAL_II_PICKUP_TESTS() 4 | -------------------------------------------------------------------------------- /tests/arpack_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/poisson_problem.h" 3 | #include "tests.h" 4 | 5 | #include 6 | 7 | 8 | // helper function for sorting the eigenvalues 9 | bool myfunction(std::complex i, std::complex j) 10 | { 11 | double a = i.real(); 12 | double b = j.real(); 13 | 14 | return (a p; 32 | piDoMUS solver ("pidomus",p); 33 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/arpack_01.prm", "used_parameters.prm"); 34 | 35 | 36 | solver.solve_eigenproblem (); 37 | 38 | auto eigenvalues = solver.get_eigenvalues(); 39 | 40 | std::sort(eigenvalues.begin(), eigenvalues.end(), myfunction); 41 | 42 | for (unsigned int i=0; i< eigenvalues.size(); ++ i) 43 | deallog << eigenvalues[i].real()/(numbers::PI*numbers::PI) 44 | << std::endl; 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /tests/arpack_01.with_arpack=on.with_zz=on.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL::2.00000 3 | DEAL::5.00000 4 | DEAL::5.00000 5 | DEAL::8.00000 6 | DEAL::10.0000 7 | DEAL::10.0000 8 | DEAL::13.0000 9 | DEAL::13.0000 10 | DEAL::17.0000 11 | DEAL::17.0000 12 | DEAL::18.0000 13 | DEAL::20.0000 14 | -------------------------------------------------------------------------------- /tests/cahn-hilliard_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/cahn-hilliard.h" 3 | #include "tests.h" 4 | #include 5 | 6 | using namespace dealii; 7 | int main (int argc, char *argv[]) 8 | { 9 | 10 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 11 | numbers::invalid_unsigned_int); 12 | 13 | initlog(); 14 | deallog.depth_file(1); 15 | 16 | const int dim = 2; 17 | 18 | CahnHilliard p; 19 | piDoMUS solver ("pidomus",p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/cahn_hilliard_01.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i cnh_body; 19 | piDoMUS solver ("",cnh_body); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_01.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i cnh_body; 19 | piDoMUS solver ("",cnh_body); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_02.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i cnh_body; 19 | piDoMUS solver ("",cnh_body); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_03.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i cnh_body; 19 | piDoMUS solver ("",cnh_body); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_04.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i cnh_body; 19 | piDoMUS solver ("",cnh_body); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_05.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i p; 19 | piDoMUS solver ("pidomus", p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/eikonal_equation_01.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i p; 19 | piDoMUS solver ("pidomus", p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/eikonal_equation_02.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i p; 19 | piDoMUS solver ("pidomus", p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/eikonal_equation_03.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i p; 19 | piDoMUS solver ("pidomus", p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/eikonal_equation_04.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i gel; 19 | piDoMUS solver ("piDoMUS",gel); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/hydrogels_one_field_01.prm", 21 | "used_parameters.prm"); 22 | 23 | 24 | solver.run (); 25 | 26 | auto &sol = solver.get_solution(); 27 | for (unsigned int i = 0; i gel; 19 | piDoMUS solver ("piDoMUS",gel); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/hydrogels_one_field_02.prm", 21 | "used_parameters.prm"); 22 | 23 | 24 | solver.run (); 25 | 26 | auto &sol = solver.get_solution(); 27 | for (unsigned int i = 0; i gel; 19 | piDoMUS solver ("piDoMUS",gel); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/hydrogels_three_fields_01.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i gel; 19 | piDoMUS solver ("piDoMUS",gel); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/hydrogels_three_fields_02.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i gel; 19 | piDoMUS solver ("piDoMUS",gel); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/hydrogels_three_fields_03.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i 5 | 6 | using namespace dealii; 7 | int main (int argc, char *argv[]) 8 | { 9 | 10 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 11 | numbers::invalid_unsigned_int); 12 | 13 | initlog(); 14 | deallog.depth_file(1); 15 | 16 | const int dim = 3; 17 | const int spacedim = 3; 18 | 19 | HydroGelTwoFieldsTransient gel; 20 | piDoMUS solver ("piDoMUS",gel); 21 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/hydrogels_two_fields_transient_01.prm", 22 | "used_parameters.prm"); 23 | 24 | 25 | solver.run (); 26 | 27 | auto &sol = solver.get_solution(); 28 | for (unsigned int i = 0; i energy; 20 | piDoMUS n_problem ("",energy); 21 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/incompressible_neo_hookean_two_fields_01.prm", "used_parameters.prm"); 22 | 23 | n_problem.run (); 24 | 25 | auto &sol = n_problem.get_solution(); 26 | for (unsigned int i = 0; i energy; 20 | piDoMUS n_problem ("",energy); 21 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/incompressible_neo_hookean_two_fields_02.prm", "used_parameters.prm"); 22 | 23 | n_problem.run (); 24 | 25 | auto &sol = n_problem.get_solution(); 26 | for (unsigned int i = 0; i energy; 20 | piDoMUS n_problem ("",energy); 21 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/incompressible_neo_hookean_two_fields_03.prm", "used_parameters.prm"); 22 | 23 | n_problem.run (); 24 | 25 | auto &sol = n_problem.get_solution(); 26 | for (unsigned int i = 0; i energy(false); 27 | piDoMUS<2,2,LADealII> navier_stokes ("",energy); 28 | ParameterAcceptor::initialize( 29 | SOURCE_DIR "/parameters/navier_stokes_00.prm", 30 | "used_parameters.prm"); 31 | 32 | navier_stokes.run (); 33 | 34 | auto &sol = navier_stokes.get_solution(); 35 | for (unsigned int i = 0 ; i energy(false); 27 | piDoMUS<2,2> navier_stokes ("",energy); 28 | ParameterAcceptor::initialize( 29 | SOURCE_DIR "/parameters/navier_stokes_01.prm", 30 | "used_parameters.prm"); 31 | 32 | navier_stokes.run (); 33 | 34 | auto &sol = navier_stokes.get_solution(); 35 | for (unsigned int i = 0 ; i energy(false); 26 | piDoMUS<2,2> navier_stokes ("",energy); 27 | ParameterAcceptor::initialize( 28 | SOURCE_DIR "/parameters/navier_stokes_02.prm", 29 | "used_parameters.prm"); 30 | 31 | navier_stokes.run (); 32 | 33 | auto &sol = navier_stokes.get_solution(); 34 | for (unsigned int i = 0 ; i energy(false); 27 | piDoMUS<2,2> navier_stokes ("",energy); 28 | ParameterAcceptor::initialize( 29 | SOURCE_DIR "/parameters/navier_stokes_03.prm", 30 | "used_parameters.prm"); 31 | 32 | navier_stokes.run (); 33 | 34 | auto &sol = navier_stokes.get_solution(); 35 | for (unsigned int i = 0 ; i energy(false); 27 | piDoMUS<2,2> navier_stokes ("",energy); 28 | ParameterAcceptor::initialize( 29 | SOURCE_DIR "/parameters/navier_stokes_04.prm", 30 | "used_parameters.prm"); 31 | 32 | navier_stokes.run (); 33 | 34 | auto &sol = navier_stokes.get_solution(); 35 | for (unsigned int i = 0 ; i energy(true); 26 | piDoMUS<2,2> navier_stokes ("",energy); 27 | ParameterAcceptor::initialize( 28 | SOURCE_DIR "/parameters/navier_stokes_05.prm", 29 | "used_parameters.prm"); 30 | 31 | navier_stokes.run (); 32 | 33 | auto &sol = navier_stokes.get_solution(); 34 | for (unsigned int i = 0 ; i 1 = 0,0 42 | set Optional Point 2 = 1,1 43 | set Optional double 1 = 1.0 44 | set Optional double 2 = 0.5 45 | set Optional double 3 = 1.5 46 | set Optional int 1 = 1 47 | set Optional int 2 = 2 48 | set Optional vector of dim int = 1,1 49 | set Output grid file name = 50 | end 51 | 52 | subsection IMEX Parameters 53 | set Final time = 1.0 54 | set Initial time = 0.0 55 | 56 | set Maximum number of inner nonlinear iterations = 10 57 | set Maximum number of outer nonlinear iterations = 15 58 | set Newton relaxation parameter = 1 59 | 60 | set Absolute error tolerance = 1.0e-8 61 | set Intervals between outputs = 1 62 | set Relative error tolerance = 1.0e-6 63 | set Step size = 1.0e-1 64 | set Update continuously Jacobian = true 65 | end 66 | 67 | subsection Amg preconditioner for velocity 68 | set Aggregation threshold = 1.5 69 | set Coarse type = Amesos-KLU 70 | set Elliptic = false 71 | set High Order Elements = true 72 | set Number of cycles = 1 73 | set Output details = false 74 | set Smoother overlap = 0 75 | set Smoother sweeps = 2 76 | set Smoother type = Chebyshev 77 | set Variable related to constant modes = u 78 | set w-cycle = false 79 | end 80 | -------------------------------------------------------------------------------- /tests/parameters/stokes_05.prm: -------------------------------------------------------------------------------- 1 | # Parameter file generated with 2 | # D2K_GIT_BRANCH= master 3 | # D2K_GIT_SHORTREV= e091146 4 | # DEAL_II_GIT_BRANCH= master 5 | # DEAL_II_GIT_SHORTREV= af6f8d1 6 | 7 | subsection pi-DoMUS 8 | set Adaptive refinement = false 9 | set Initial global refinement = 1 10 | set Number of cycles = 3 11 | set Overwrite Newton's iterations = true 12 | set Print some useful informations about processes = false 13 | set Time stepper = euler 14 | set Use direct solver if available = false 15 | end 16 | 17 | subsection Amg preconditioner for velocity 18 | set Aggregation threshold = 1.5 19 | set Coarse type = Amesos-KLU 20 | set Elliptic = false 21 | set High Order Elements = true 22 | set Number of cycles = 1 23 | set Output details = false 24 | set Smoother overlap = 0 25 | set Smoother sweeps = 2 26 | set Smoother type = Chebyshev 27 | set Variable related to constant modes = u 28 | set w-cycle = false 29 | end 30 | 31 | subsection Initial solution 32 | set Function constants = 33 | set Function expression = t*cos(pi*x)*cos(pi*y); t*sin(pi*x)*sin(pi*y); 0 34 | set Variable names = x,y,t 35 | end 36 | 37 | subsection Initial solution_dot 38 | set Function constants = 39 | set Function expression = cos(pi*x)*cos(pi*y); sin(pi*x)*sin(pi*y); 0 40 | set Variable names = x,y,t 41 | end 42 | 43 | subsection Exact solution 44 | set Function constants = 45 | set Function expression = t*cos(pi*x)*cos(pi*y); t*sin(pi*x)*sin(pi*y); 0 46 | set Variable names = x,y,t 47 | end 48 | 49 | subsection Forcing terms 50 | set IDs and component masks = 0=u 51 | set IDs and expressions = 0=cos(pi*x)*cos(pi*y)+t*(pi^2)*cos(pi*x)*cos(pi*y); sin(pi*x)*sin(pi*y) + t*(pi^2)*sin(pi*x)*sin(pi*y); 0 52 | set Known component names = u,u,p 53 | set Used constants = k=1 54 | end 55 | 56 | subsection Dirichlet boundary conditions 57 | set IDs and component masks = 0=u % 1=u % 2=u % 3=ALL 58 | set IDs and expressions = 0=t*cos(pi*x)*cos(pi*y); t*sin(pi*x)*sin(pi*y); 0 % \ 59 | 1=t*cos(pi*x)*cos(pi*y); t*sin(pi*x)*sin(pi*y); 0 % \ 60 | 2=t*cos(pi*x)*cos(pi*y); t*sin(pi*x)*sin(pi*y); 0 % \ 61 | 3=t*cos(pi*x)*cos(pi*y); t*sin(pi*x)*sin(pi*y); 0 62 | set Known component names = u,u,p 63 | set Used constants = k=1 64 | end 65 | 66 | subsection Domain 67 | set Colorize = false 68 | set Grid to generate = rectangle 69 | set Input grid file name = 70 | set Mesh smoothing algorithm = none 71 | set Optional Point 1 = 0,0 72 | set Optional Point 2 = 1,1 73 | set Optional double 1 = 1.0 74 | set Optional double 2 = 0.5 75 | set Optional double 3 = 1.5 76 | set Optional int 1 = 1 77 | set Optional int 2 = 2 78 | set Optional vector of dim int = 1,1 79 | set Output grid file name = 80 | end 81 | 82 | subsection Error Tables 83 | set Compute error = true 84 | set Error file format = tex 85 | set Error precision = 3 86 | set Output error tables = true 87 | set Solution names = u,u,p 88 | set Solution names for latex = u,u,p 89 | set Table names = error 90 | set Write error files = false 91 | subsection Table 0 92 | set Add convergence rates = true 93 | set Extra terms = cells,dofs 94 | set Latex table caption = error 95 | set List of error norms to compute = L2, Linfty, H1; AddUp; L2 96 | set Rate key = 97 | end 98 | end 99 | 100 | 101 | subsection IMEX Parameters 102 | set Final time = 1.0 103 | set Initial time = 0.0 104 | 105 | set Maximum number of inner nonlinear iterations = 10 106 | set Maximum number of outer nonlinear iterations = 15 107 | set Newton relaxation parameter = 0.333 108 | 109 | set Absolute error tolerance = 1.0e-3 110 | set Intervals between outputs = 1 111 | set Relative error tolerance = 0.0 112 | set Step size = 1.0e-1 113 | set Update continuously Jacobian = false 114 | end 115 | 116 | -------------------------------------------------------------------------------- /tests/parpack_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/poisson_problem.h" 3 | #include "tests.h" 4 | 5 | #include 6 | 7 | 8 | // helper function for sorting the eigenvalues 9 | bool myfunction(std::complex i, std::complex j) 10 | { 11 | double a = i.real(); 12 | double b = j.real(); 13 | 14 | return (a p; 32 | piDoMUS solver ("pidomus",p); 33 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/parpack_01.prm", "used_parameters.prm"); 34 | 35 | 36 | solver.solve_eigenproblem (); 37 | 38 | if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)==0) 39 | { 40 | auto eigenvalues = solver.get_eigenvalues(); 41 | 42 | std::sort(eigenvalues.begin(), eigenvalues.end(), myfunction); 43 | 44 | for (unsigned int i=0; i< eigenvalues.size(); ++ i) 45 | deallog << eigenvalues[i].real()/(numbers::PI*numbers::PI) 46 | << std::endl; 47 | } 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /tests/parpack_01.with_parpack=on.with_mpi=on.mpirun=4.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL:0::2.00000 3 | DEAL:0::5.00000 4 | DEAL:0::5.00000 5 | DEAL:0::8.00000 6 | DEAL:0::10.0000 7 | DEAL:0::10.0000 8 | DEAL:0::13.0000 9 | DEAL:0::13.0000 10 | DEAL:0::17.0000 11 | DEAL:0::17.0000 12 | DEAL:0::18.0000 13 | DEAL:0::20.0000 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/poisson_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/poisson_problem.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | deallog.depth_file(1); 14 | 15 | const int dim = 2; 16 | const int spacedim = 3; 17 | 18 | PoissonProblem p; 19 | piDoMUS solver ("pidomus",p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/poisson_problem_01.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i p; 19 | piDoMUS solver ("pidomus",p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/poisson_problem_02.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i p; 19 | piDoMUS solver ("pidomus",p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/poisson_problem_03.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i p; 19 | piDoMUS solver ("pidomus",p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/poisson_nitsche_01.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i 7 | void test(piDoMUS &pi_foo) 8 | { 9 | pi_foo.train_constraints[0]->clear(); 10 | pi_foo.train_constraints[0]->add_line(0); 11 | pi_foo.train_constraints[0]->close(); 12 | 13 | pi_foo.global_partitioning.clear(); 14 | pi_foo.global_partitioning.set_size(2); 15 | 16 | if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)==0) 17 | pi_foo.global_partitioning.add_index(0); 18 | else 19 | pi_foo.global_partitioning.add_index(1); 20 | pi_foo.global_partitioning.compress(); 21 | LATrilinos::VectorType foo_vector(std::vector (1,pi_foo.global_partitioning),MPI_COMM_WORLD); 22 | foo_vector = 0; 23 | if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)==0) 24 | foo_vector[0] = 1.; 25 | else 26 | foo_vector[1] = 1.; 27 | foo_vector.compress(VectorOperation::insert); 28 | 29 | pi_foo.set_constrained_dofs_to_zero(foo_vector); 30 | if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)==0) 31 | foo_vector[0] += 1.; 32 | else 33 | foo_vector[1] += 1.; 34 | foo_vector.compress(VectorOperation::add); 35 | if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)==0) 36 | deallog << foo_vector[0]< p; 56 | piDoMUS solver ("pidomus",p); 57 | test(solver); 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /tests/set_constrained_to_zero.with_mpi=on.mpirun=2.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL:0::1.00000 3 | 4 | DEAL:1::2.00000 5 | 6 | -------------------------------------------------------------------------------- /tests/signals_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/poisson_problem_signals.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | deallog.depth_file(1); 14 | 15 | const int dim = 2; 16 | const int spacedim = 2; 17 | 18 | PoissonProblem p; 19 | piDoMUS solver ("pidomus",p); 20 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/poisson_problem_03.prm", "used_parameters.prm"); 21 | 22 | 23 | solver.run (); 24 | 25 | auto &sol = solver.get_solution(); 26 | for (unsigned int i = 0; i interface; 27 | piDoMUS<2,2,LATrilinos> stokes ("pi-DoMUS",interface); 28 | ParameterAcceptor::initialize( 29 | SOURCE_DIR "/parameters/stokes_00.prm", 30 | "used_parameters.prm"); 31 | 32 | stokes.run (); 33 | 34 | auto &sol = stokes.get_solution(); 35 | for (unsigned int i = 0 ; i interface; 27 | piDoMUS<2,2,LATrilinos> stokes ("pi-DoMUS",interface); 28 | ParameterAcceptor::initialize( 29 | SOURCE_DIR "/parameters/stokes_01.prm", 30 | "used_parameters.prm"); 31 | 32 | stokes.run (); 33 | 34 | auto &sol = stokes.get_solution(); 35 | for (unsigned int i = 0 ; i interface; 27 | piDoMUS<2,2,LATrilinos> stokes ("pi-DoMUS",interface); 28 | ParameterAcceptor::initialize( 29 | SOURCE_DIR "/parameters/stokes_02.prm", 30 | "used_parameters.prm"); 31 | 32 | stokes.run (); 33 | 34 | auto &sol = stokes.get_solution(); 35 | for (unsigned int i = 0 ; i interface; 23 | piDoMUS<2,2,LATrilinos> stokes ("pi-DoMUS",interface); 24 | ParameterAcceptor::initialize( 25 | SOURCE_DIR "/parameters/stokes_03.prm", 26 | "used_parameters.prm"); 27 | 28 | stokes.run (); 29 | 30 | auto &sol = stokes.get_solution(); 31 | for (unsigned int i = 0 ; i interface; 23 | piDoMUS<2,2,LATrilinos> stokes ("pi-DoMUS",interface); 24 | ParameterAcceptor::initialize( 25 | SOURCE_DIR "/parameters/stokes_04.prm", 26 | "used_parameters.prm"); 27 | 28 | stokes.run (); 29 | 30 | auto &sol = stokes.get_solution(); 31 | for (unsigned int i = 0 ; i interface; 23 | piDoMUS<2,2,LATrilinos> stokes ("pi-DoMUS",interface); 24 | ParameterAcceptor::initialize( 25 | SOURCE_DIR "/parameters/stokes_05.prm", 26 | "used_parameters.prm"); 27 | 28 | stokes.run (); 29 | 30 | auto &sol = stokes.get_solution(); 31 | for (unsigned int i = 0 ; i energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/ale_navier_stokes_00.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/ale_navier_stokes_00.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/ale_navier_stokes_00.output -------------------------------------------------------------------------------- /tests/tests_to_check/ale_navier_stokes_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/ale_navier_stokes.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | const int spacedim = 2; 16 | 17 | ALENavierStokes energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/ale_navier_stokes_01.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/ale_navier_stokes_01.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/ale_navier_stokes_01.output -------------------------------------------------------------------------------- /tests/tests_to_check/ale_navier_stokes_02.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/ale_navier_stokes.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | const int spacedim = 2; 16 | 17 | ALENavierStokes energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/ale_navier_stokes_02.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/ale_navier_stokes_02.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/ale_navier_stokes_02.output -------------------------------------------------------------------------------- /tests/tests_to_check/compressible_neo_hookean_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/compressible_neo_hookean.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 3; 15 | const int spacedim = 3; 16 | 17 | CompressibleNeoHookeanInterface energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_01.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/compressible_neo_hookean_02.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/compressible_neo_hookean.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 3; 15 | const int spacedim = 3; 16 | 17 | CompressibleNeoHookeanInterface energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_02.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/compressible_neo_hookean_03.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/compressible_neo_hookean.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 3; 15 | const int spacedim = 3; 16 | 17 | CompressibleNeoHookeanInterface energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/compressible_neo_hookean_03.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/design_01.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/design_01.output -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/free_swelling_three_fields.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); 10 | // numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 3; 15 | const int spacedim = 3; 16 | 17 | FreeSwellingThreeFields energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/free_swelling_01.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_01.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/free_swelling_three_fields_01.output -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_02.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/free_swelling_three_fields.h" 3 | #include "tests.h" 4 | #include "lac_type.h" 5 | 6 | template 7 | void test(piDoMUS &pb) 8 | { 9 | for (pb.current_cycle=0; pb.current_cycle energy; 58 | piDoMUS n_problem (energy); 59 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/free_swelling_02.prm", "used_parameters.prm"); 60 | 61 | 62 | test(n_problem); 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_02.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/free_swelling_three_fields_02.output -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_03.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/free_swelling_three_fields.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 3; 15 | const int spacedim = 3; 16 | 17 | FreeSwellingThreeFields energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/free_swelling_03.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_03.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/free_swelling_three_fields_03.output -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_04.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/free_swelling_three_fields.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | deallog.depth_file(0); 14 | 15 | 16 | const int dim = 3; 17 | const int spacedim = 3; 18 | 19 | FreeSwellingThreeFields energy; 20 | piDoMUS n_problem (energy); 21 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/free_swelling_04.prm", "used_parameters.prm"); 22 | 23 | 24 | n_problem.run (); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /tests/tests_to_check/free_swelling_three_fields_04.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/free_swelling_three_fields_04.output -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include 4 | #include "tests.h" 5 | 6 | typedef TrilinosWrappers::MPI::BlockVector VEC; 7 | 8 | 9 | template 10 | void test(piDoMUS &pb) 11 | { 12 | pb.make_grid_fe(); 13 | pb.setup_dofs(); 14 | 15 | std::vector m(1,true); 16 | ComponentMask mask(m); 17 | 18 | VEC &d = pb.differential_components(); 19 | 20 | 21 | d.block(0) = 11; 22 | d.print(deallog.get_file_stream()); 23 | 24 | 25 | } 26 | 27 | 28 | using namespace dealii; 29 | int main (int argc, char *argv[]) 30 | { 31 | 32 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 33 | numbers::invalid_unsigned_int); 34 | 35 | initlog(); 36 | 37 | const int dim = 2; 38 | 39 | HeatEquation energy; 40 | piDoMUS n_problem (energy); 41 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_01.prm", "used_parameters.prm"); 42 | 43 | deallog << "All dofs on boundary, set BC => all zeros" << std::endl; 44 | 45 | test(n_problem); 46 | 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_01.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL::All dofs on boundary, set BC => all zeros 3 | C0:0.000e+00 0.000e+00 0.000e+00 0.000e+00 4 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_02.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | typedef TrilinosWrappers::MPI::BlockVector VEC; 6 | 7 | 8 | template 9 | void test(piDoMUS &pb) 10 | { 11 | pb.make_grid_fe(); 12 | pb.setup_dofs(); 13 | 14 | 15 | VEC &d = pb.differential_components(); 16 | VEC sol = pb.solution; 17 | VEC sol_dot = pb.solution_dot; 18 | VEC residual(sol); 19 | 20 | deallog << "differential components" < energy; 51 | piDoMUS n_problem (energy); 52 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_02.prm", "used_parameters.prm"); 53 | 54 | test(n_problem); 55 | 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_02.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL::########################################## 3 | DEAL:: NO BC APPLIED! 4 | DEAL::########################################## 5 | DEAL:: yp = 1, F = 1 6 | DEAL::########################################## 7 | DEAL::differential components 8 | C0:1.000e+00 1.000e+00 1.000e+00 1.000e+00 9 | DEAL::solution 10 | C0:0.000e+00 0.000e+00 0.000e+00 0.000e+00 11 | DEAL::solution_dot 12 | C0:1.000e+00 1.000e+00 1.000e+00 1.000e+00 13 | DEAL::residual 14 | C0:0.000e+00 0.000e+00 0.000e+00 0.000e+00 15 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_03.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | typedef TrilinosWrappers::MPI::BlockVector VEC; 6 | 7 | 8 | template 9 | void test(piDoMUS &pb) 10 | { 11 | pb.make_grid_fe(); 12 | pb.setup_dofs(); 13 | 14 | 15 | VEC &d = pb.differential_components(); 16 | VEC &sol = pb.solution; 17 | VEC &sol_dot = pb.solution_dot; 18 | VEC residual(sol); 19 | 20 | deallog << "differential components" < energy; 50 | piDoMUS n_problem (energy); 51 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_03.prm", "used_parameters.prm"); 52 | 53 | test(n_problem); 54 | 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_03.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL::########################################## 3 | DEAL:: BC = x^2, sol = x^2, sol_dot = 0, F = -2 4 | DEAL::########################################## 5 | DEAL::differential components 6 | C0:0.000e+00 0.000e+00 0.000e+00 1.000e+00 0.000e+00 1.000e+00 0.000e+00 1.000e+00 1.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 1.000e+00 1.000e+00 0.000e+00 0.000e+00 0.000e+00 1.000e+00 0.000e+00 1.000e+00 0.000e+00 0.000e+00 0.000e+00 1.000e+00 7 | DEAL::solution 8 | C0:0.000e+00 2.500e-01 0.000e+00 2.500e-01 0.000e+00 2.500e-01 6.250e-02 6.250e-02 6.250e-02 1.000e+00 1.000e+00 1.000e+00 5.625e-01 5.625e-01 5.625e-01 0.000e+00 2.500e-01 0.000e+00 2.500e-01 6.250e-02 6.250e-02 1.000e+00 1.000e+00 5.625e-01 5.625e-01 9 | DEAL::solution_dot 10 | C0:0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 11 | DEAL::residual 12 | C0:0.000e+00 0.000e+00 0.000e+00 -1.527e-16 0.000e+00 -1.110e-16 0.000e+00 1.041e-17 4.163e-17 0.000e+00 0.000e+00 0.000e+00 0.000e+00 2.116e-16 4.163e-17 0.000e+00 0.000e+00 0.000e+00 -1.110e-16 0.000e+00 4.163e-17 0.000e+00 0.000e+00 0.000e+00 4.163e-17 13 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_04.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | typedef TrilinosWrappers::MPI::BlockVector VEC; 6 | 7 | 8 | template 9 | void test(piDoMUS &pb) 10 | { 11 | pb.make_grid_fe(); 12 | pb.setup_dofs(); 13 | 14 | 15 | VEC &d = pb.differential_components(); 16 | VEC &sol = pb.solution; 17 | VEC &sol_dot = pb.solution_dot; 18 | VEC residual(sol); 19 | 20 | deallog << "differential components" < energy; 46 | piDoMUS n_problem (energy); 47 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_04.prm", "used_parameters.prm"); 48 | 49 | deallog << "##########################################"< 9 | void test(piDoMUS &pb) 10 | { 11 | pb.make_grid_fe(); 12 | pb.setup_dofs(); 13 | 14 | VEC &d = pb.differential_components(); 15 | VEC &sol = pb.solution; 16 | VEC &sol_dot = pb.solution_dot; 17 | VEC residual(sol); 18 | 19 | deallog << "differential components" < energy; 45 | piDoMUS n_problem (energy); 46 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_05.prm", "used_parameters.prm"); 47 | 48 | test(n_problem); 49 | 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_05.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL::differential components 3 | C0:0.000e+00 0.000e+00 0.000e+00 1.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 4 | DEAL::solution 5 | C0:0.000e+00 2.500e-01 0.000e+00 2.500e-01 1.000e+00 1.000e+00 0.000e+00 2.500e-01 1.000e+00 6 | DEAL::solution_dot 7 | C0:0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 8 | DEAL::residual 9 | C0:0.000e+00 0.000e+00 0.000e+00 -1.110e-16 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 10 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_06.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | #include 6 | 7 | typedef TrilinosWrappers::MPI::BlockVector VEC; 8 | 9 | 10 | template 11 | void test(piDoMUS &pb) 12 | { 13 | pb.make_grid_fe(); 14 | pb.setup_dofs(); 15 | 16 | 17 | VEC &d = pb.differential_components(); 18 | VEC &sol = pb.solution; 19 | VEC &sol_dot = pb.solution_dot; 20 | VEC residual(sol); 21 | VEC new_sol(sol); 22 | 23 | deallog << "differential components" < energy; 58 | piDoMUS n_problem (energy); 59 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_06.prm", "used_parameters.prm"); 60 | 61 | deallog << "##########################################"< 9 | void test(piDoMUS &pb) 10 | { 11 | // pb.make_grid_fe(); 12 | // pb.setup_dofs(); 13 | // 14 | // VEC &d = pb.differential_components(); 15 | // 16 | // d.print(deallog.get_file_stream()); 17 | pb.run(); 18 | 19 | } 20 | 21 | 22 | using namespace dealii; 23 | int main (int argc, char *argv[]) 24 | { 25 | 26 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 27 | numbers::invalid_unsigned_int); 28 | 29 | initlog(); 30 | 31 | const int dim = 2; 32 | 33 | HeatEquation energy; 34 | piDoMUS n_problem (energy); 35 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_07.prm", "used_parameters.prm"); 36 | 37 | 38 | test(n_problem); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_07.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/heat_equation_07.output -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_08.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | typedef TrilinosWrappers::MPI::BlockVector VEC; 6 | 7 | 8 | template 9 | void test(piDoMUS &pb) 10 | { 11 | // pb.make_grid_fe(); 12 | // pb.setup_dofs(); 13 | // 14 | // VEC &d = pb.differential_components(); 15 | // 16 | // d.print(deallog.get_file_stream()); 17 | pb.run(); 18 | 19 | } 20 | 21 | 22 | using namespace dealii; 23 | int main (int argc, char *argv[]) 24 | { 25 | 26 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 27 | numbers::invalid_unsigned_int); 28 | 29 | initlog(); 30 | 31 | const int dim = 2; 32 | 33 | HeatEquation energy; 34 | piDoMUS n_problem (energy); 35 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_08.prm", "used_parameters.prm"); 36 | 37 | 38 | test(n_problem); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_08.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/heat_equation_08.output -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_09.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | typedef TrilinosWrappers::MPI::BlockVector VEC; 6 | 7 | 8 | template 9 | void test(piDoMUS &pb) 10 | { 11 | // pb.make_grid_fe(); 12 | // pb.setup_dofs(); 13 | // 14 | // VEC &d = pb.differential_components(); 15 | // 16 | // d.print(deallog.get_file_stream()); 17 | pb.run(); 18 | 19 | } 20 | 21 | 22 | using namespace dealii; 23 | int main (int argc, char *argv[]) 24 | { 25 | 26 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 27 | numbers::invalid_unsigned_int); 28 | 29 | initlog(); 30 | 31 | const int dim = 2; 32 | 33 | HeatEquation energy; 34 | piDoMUS n_problem (energy); 35 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_09.prm", "used_parameters.prm"); 36 | 37 | 38 | test(n_problem); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_09.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/heat_equation_09.output -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_10.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | typedef TrilinosWrappers::MPI::BlockVector VEC; 6 | 7 | 8 | template 9 | void test(piDoMUS &pb) 10 | { 11 | // pb.make_grid_fe(); 12 | // pb.setup_dofs(); 13 | // 14 | // VEC &d = pb.differential_components(); 15 | // 16 | // d.print(deallog.get_file_stream()); 17 | pb.run(); 18 | 19 | } 20 | 21 | 22 | using namespace dealii; 23 | int main (int argc, char *argv[]) 24 | { 25 | 26 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 27 | numbers::invalid_unsigned_int); 28 | 29 | initlog(); 30 | 31 | const int dim = 2; 32 | 33 | HeatEquation energy; 34 | piDoMUS n_problem (energy); 35 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_10.prm", "used_parameters.prm"); 36 | 37 | 38 | test(n_problem); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_10.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/heat_equation_10.output -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_11.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/heat_equation.h" 3 | #include "tests.h" 4 | 5 | typedef TrilinosWrappers::MPI::BlockVector VEC; 6 | 7 | 8 | 9 | using namespace dealii; 10 | int main (int argc, char *argv[]) 11 | { 12 | 13 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 14 | numbers::invalid_unsigned_int); 15 | 16 | initlog(); 17 | 18 | const int dim = 2; 19 | 20 | HeatEquation energy; 21 | piDoMUS n_problem (energy); 22 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/heat_equation_11.prm", "used_parameters.prm"); 23 | 24 | n_problem.run(); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /tests/tests_to_check/heat_equation_11.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL:FGMRES::Starting value 10.7363 3 | DEAL:FGMRES::Convergence step 1 value 2.38462e-15 4 | DEAL:FGMRES::Starting value 3.66921e-15 5 | DEAL:FGMRES::Convergence step 0 value 3.66921e-15 6 | DEAL:FGMRES::Starting value 3.66921e-15 7 | DEAL:FGMRES::Convergence step 0 value 3.66921e-15 8 | DEAL:PrepareOutput::Will write on file: ./solution.0.0.vtu 9 | DEAL:AddingData::Added data: u 10 | DEAL:AddingData::Added data: u_dot 11 | DEAL:WritingData::Wrote output file. 12 | DEAL:WritingData::Reset output. 13 | DEAL:FGMRES::Starting value 5.20918 14 | DEAL:FGMRES::Convergence step 1 value 1.42793e-12 15 | DEAL:FGMRES::Starting value 5.65969 16 | DEAL:FGMRES::Convergence step 1 value 1.80896e-12 17 | DEAL:FGMRES::Starting value 5.65969 18 | DEAL:FGMRES::Convergence step 1 value 1.80896e-12 19 | DEAL:PrepareOutput::Will write on file: ./solution.1.0.vtu 20 | DEAL:AddingData::Added data: u 21 | DEAL:AddingData::Added data: u_dot 22 | DEAL:WritingData::Wrote output file. 23 | DEAL:WritingData::Reset output. 24 | DEAL:FGMRES::Starting value 2.70770 25 | DEAL:FGMRES::Convergence step 1 value 3.31209e-12 26 | DEAL:FGMRES::Starting value 2.67690 27 | DEAL:FGMRES::Convergence step 1 value 3.16204e-12 28 | DEAL:FGMRES::Starting value 2.67690 29 | DEAL:FGMRES::Convergence step 1 value 3.16204e-12 30 | DEAL:PrepareOutput::Will write on file: ./solution.2.0.vtu 31 | DEAL:AddingData::Added data: u 32 | DEAL:AddingData::Added data: u_dot 33 | DEAL:WritingData::Wrote output file. 34 | DEAL:WritingData::Reset output. 35 | DEAL:FGMRES::Starting value 1.36655 36 | DEAL:FGMRES::Convergence step 1 value 6.88708e-12 37 | DEAL:FGMRES::Starting value 1.36093 38 | DEAL:FGMRES::Convergence step 1 value 6.76538e-12 39 | DEAL:FGMRES::Starting value 1.36093 40 | DEAL:FGMRES::Convergence step 1 value 6.76538e-12 41 | DEAL:PrepareOutput::Will write on file: ./solution.3.0.vtu 42 | DEAL:AddingData::Added data: u 43 | DEAL:AddingData::Added data: u_dot 44 | DEAL:WritingData::Wrote output file. 45 | DEAL:WritingData::Reset output. 46 | DEAL:FGMRES::Starting value 0.684861 47 | DEAL:FGMRES::Convergence step 16 value 2.94190e-09 48 | DEAL:FGMRES::Starting value 0.684091 49 | DEAL:FGMRES::Convergence step 16 value 2.93951e-09 50 | DEAL:FGMRES::Starting value 0.684091 51 | DEAL:FGMRES::Convergence step 16 value 2.93730e-09 52 | DEAL:PrepareOutput::Will write on file: ./solution.4.0.vtu 53 | DEAL:AddingData::Added data: u 54 | DEAL:AddingData::Added data: u_dot 55 | DEAL:WritingData::Wrote output file. 56 | DEAL:WritingData::Reset output. 57 | -------------------------------------------------------------------------------- /tests/tests_to_check/incompressible_neo_hookean_two_fields.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/neo_hookean_two_fields.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 3; 15 | const int spacedim = 3; 16 | 17 | NeoHookeanTwoFieldsInterface energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/incompressible_neo_hookean_two_fields.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/incompressible_neo_hookean_two_fields.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/incompressible_neo_hookean_two_fields.output -------------------------------------------------------------------------------- /tests/tests_to_check/linear_operator_01.cc: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------- 2 | // 3 | // Copyright (C) 2004 - 2015 by the deal.II authors 4 | // 5 | // This file is part of the deal.II library. 6 | // 7 | // The deal.II library is free software; you can use it, redistribute 8 | // it, and/or modify it under the terms of the GNU Lesser General 9 | // Public License as published by the Free Software Foundation; either 10 | // version 2.1 of the License, or (at your option) any later version. 11 | // The full text of the license can be found in the file LICENSE at 12 | // the top level of the deal.II distribution. 13 | // 14 | // --------------------------------------------------------------------- 15 | 16 | 17 | 18 | // Test whether TrilinosWrappers::SparseMatrix::vmult gives same result with 19 | // Trilinos vector and parallel distributed vector 20 | 21 | #include "tests.h" 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | using namespace dealii; 40 | 41 | void test () 42 | { 43 | const unsigned int n_procs = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); 44 | const unsigned int my_id = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); 45 | 46 | const unsigned int n_rows = 3; 47 | const unsigned int n_cols = 4; 48 | 49 | IndexSet row_partitioning (n_rows); 50 | IndexSet col_partitioning (n_cols); 51 | 52 | if (n_procs == 1) 53 | { 54 | row_partitioning.add_range(0, n_rows); 55 | col_partitioning.add_range(0, n_cols); 56 | } 57 | else if (n_procs == 2) 58 | { 59 | // row_partitioning should be { [0, 2), [2, n_rows) } 60 | // col_partitioning should be { [0, 2), [2, n_cols) } 61 | // col_relevant_set should be { [0, 3), [1, n_cols) } 62 | if (my_id == 0) 63 | { 64 | row_partitioning.add_range(0, 2); 65 | col_partitioning.add_range(0, 2); 66 | } 67 | else if (my_id == 1) 68 | { 69 | row_partitioning.add_range(2, n_rows); 70 | col_partitioning.add_range(2, n_cols); 71 | } 72 | } 73 | else 74 | Assert (false, ExcNotImplemented()); 75 | 76 | TrilinosWrappers::SparsityPattern sp (row_partitioning, 77 | col_partitioning, MPI_COMM_WORLD); 78 | { 79 | sp.add (0, 0); 80 | sp.add (0, 2); 81 | sp.add (2, 3); 82 | } 83 | 84 | sp.compress(); 85 | 86 | TrilinosWrappers::SparseMatrix A; 87 | A.clear (); 88 | A.reinit (sp); 89 | { 90 | if (my_id == 0) 91 | { 92 | A.add (0, 0, 1); 93 | A.add (0, 2, 1); 94 | A.add (2, 3, 2.0); 95 | } 96 | } 97 | 98 | A.compress(VectorOperation::add); 99 | 100 | TrilinosWrappers::MPI::Vector x, y; 101 | x.reinit (col_partitioning, MPI_COMM_WORLD); 102 | y.reinit (row_partitioning, MPI_COMM_WORLD); 103 | 104 | for (unsigned int i=0; i ylocal = x; 113 | deallog << "x : " << ylocal << std::endl; 114 | 115 | ylocal = y; 116 | deallog << "A*x: " << ylocal << std::endl; 117 | 118 | auto S = linear_operator( A ); 119 | 120 | S.vmult (y, x); 121 | 122 | ylocal = y; 123 | deallog << "S*y: " << ylocal << std::endl; 124 | } 125 | 126 | 127 | 128 | int main (int argc, char **argv) 129 | { 130 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, numbers::invalid_unsigned_int); 131 | MPILogInitAll init; 132 | 133 | test(); 134 | 135 | } 136 | -------------------------------------------------------------------------------- /tests/tests_to_check/linear_operator_01.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL:0::x : 0.00000 1.00000 2.00000 3.00000 3 | DEAL:0:: 4 | DEAL:0::A*x: 2.00000 0.00000 6.00000 5 | DEAL:0:: 6 | DEAL:0::S*y: 2.00000 0.00000 6.00000 7 | DEAL:0:: 8 | -------------------------------------------------------------------------------- /tests/tests_to_check/linear_operator_01.with_mpi=on,mpirun=2.output: -------------------------------------------------------------------------------- 1 | 2 | DEAL:0::x : 0.00000 1.00000 2.00000 3.00000 3 | DEAL:0:: 4 | DEAL:0::A*x: 2.00000 0.00000 6.00000 5 | DEAL:0:: 6 | DEAL:0::S*y: 2.00000 0.00000 6.00000 7 | DEAL:0:: 8 | 9 | DEAL:1::x : 0.00000 1.00000 2.00000 3.00000 10 | DEAL:1:: 11 | DEAL:1::A*x: 2.00000 0.00000 6.00000 12 | DEAL:1:: 13 | DEAL:1::S*y: 2.00000 0.00000 6.00000 14 | DEAL:1:: 15 | 16 | -------------------------------------------------------------------------------- /tests/tests_to_check/navier_stokes_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/navier_stokes.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | const int spacedim = 2; 16 | 17 | NavierStokes energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/navier_stokes_01.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/navier_stokes_01.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/navier_stokes_01.output -------------------------------------------------------------------------------- /tests/tests_to_check/navier_stokes_02.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/navier_stokes.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | const int spacedim = 2; 16 | 17 | NavierStokes energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/navier_stokes_02.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/navier_stokes_02.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/navier_stokes_02.output -------------------------------------------------------------------------------- /tests/tests_to_check/ode_argument_trilinos_01.with_mpi=on.mpirun=2.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/ode_argument_trilinos_01.with_mpi=on.mpirun=2.output -------------------------------------------------------------------------------- /tests/tests_to_check/old_prm/n_fields_problem_01.prm: -------------------------------------------------------------------------------- 1 | # Parameter file generated with 2 | # DEAL_II_SAK_GIT_BRANCH=dof_utilities.g 3 | # DEAL_II_SAK_GIT_SHORTREV=e6105c2.g 4 | # DEAL_II_GIT_BRANCH=master 5 | # DEAL_II_GIT_SHORTREV=c66a97f 6 | subsection Dirichlet boundary conditions 7 | set IDs and component masks = 0=u 8 | set IDs and expressions = 0=y*(1-y); 0; 0 9 | set Known component names = u,u,p 10 | set Used constants = 11 | end 12 | subsection Domain 13 | set Grid to generate = rectangle 14 | set Input grid file name = 15 | set Mesh smoothing alogrithm = none 16 | set Optional Point 1 = 0,0 17 | set Optional Point 2 = 1,1 18 | set Optional bool 1 = false 19 | set Optional double 1 = 1. 20 | set Optional double 2 = 0.5 21 | set Optional int 1 = 1 22 | set Optional vector of dim int = 1,1 23 | set Output grid file name = 24 | end 25 | subsection Error Tables 26 | set Compute error = true 27 | set Error file format = tex 28 | set Output error tables = true 29 | set Solution names = u,u,p 30 | set Solution names for latex = u,u,p 31 | set Table names = error 32 | set Write error files = false 33 | subsection Table 0 34 | set Add convergence rates = true 35 | set Extra terms = cells,dofs 36 | set Latex table caption = error 37 | set List of error norms to compute = L2,H1;L2,H1;L2,H1 38 | set Rate key = 39 | end 40 | end 41 | subsection Exact solution 42 | set Function constants = 43 | set Function expression = y*(1-y); 0; 0 44 | set Variable names = x,y,t 45 | end 46 | subsection Forcing terms 47 | set IDs and component masks = 0=u 48 | set IDs and expressions = 49 | set Known component names = u,u,p 50 | set Used constants = 51 | end 52 | subsection NFieldsProblem<2, 2, 3> 53 | set Alpha for Newton's iterations = 1 54 | set Initial global refinement = 1 55 | set Maximum number of Newton's iterations = 5 56 | set Number of cycles = 3 57 | end 58 | subsection Neumann boundary conditions 59 | set IDs and component masks = 0=ALL 60 | set IDs and expressions = 61 | set Known component names = u,u,p 62 | set Used constants = 63 | end 64 | subsection Output Parameters 65 | set Incremental run prefix = 66 | set Output partitioning = false 67 | set Problem base name = solution 68 | set Solution names = u 69 | subsection Solution output format 70 | set Output format = vtu 71 | set Subdivisions = 1 72 | subsection DX output parameters 73 | set Coordinates format = ascii 74 | set Data format = ascii 75 | set Integer format = ascii 76 | set Write neighbors = true 77 | end 78 | subsection Eps output parameters 79 | set Azimut angle = 60 80 | set Color function = default 81 | set Color shading of interior of cells = true 82 | set Draw mesh lines = true 83 | set Fill interior of cells = true 84 | set Index of vector for color = 0 85 | set Index of vector for height = 0 86 | set Line widths in eps units = 0.5 87 | set Scale to width or height = width 88 | set Scaling for z-axis = 1 89 | set Size (width or height) in eps units = 300 90 | set Turn angle = 30 91 | end 92 | subsection Gmv output parameters 93 | end 94 | subsection Gnuplot output parameters 95 | end 96 | subsection Povray output parameters 97 | set Include external file = true 98 | set Use bicubic patches = false 99 | set Use smooth triangles = false 100 | end 101 | subsection Tecplot output parameters 102 | end 103 | subsection UCD output parameters 104 | set Write preamble = true 105 | end 106 | subsection Vtk output parameters 107 | end 108 | subsection deal.II intermediate output parameters 109 | end 110 | end 111 | end 112 | subsection Stokes Interface 113 | set Block coupling = 1,1; 1,0 114 | set Blocking of the finite element = u,u,p 115 | set Finite element space = FESystem[FE_Q(2)^d-FE_Q(1)] 116 | set Preconditioner block coupling = 1,0; 0,1 117 | set eta [Pa s] = 1.0 118 | end 119 | -------------------------------------------------------------------------------- /tests/tests_to_check/old_prm/ode_argument_trilinos.prm: -------------------------------------------------------------------------------- 1 | # Parameter file generated with 2 | # DEAL_II_SAK_GIT_BRANCH=master.g 3 | # DEAL_II_SAK_GIT_SHORTREV=a7f977f.g 4 | # DEAL_II_GIT_BRANCH= 5 | # DEAL_II_GIT_SHORTREV= 6 | subsection IDA Solver Parameters 7 | set Absolute error tolerance = 1e-4 8 | set Final time = 2 9 | set Initial condition Newton max iterations = 5 10 | set Initial condition Newton parameter = 0.33 11 | set Initial condition type = none 12 | set Initial step size = 1e-4 13 | set Initial time = 0 14 | set Iterative algorithm = gmres 15 | set Min step size = 5e-5 16 | set Provide jacobian preconditioner = false 17 | set Provide jacobian product = false 18 | set Relative error tolerance = 1e-3 19 | set Seconds between each output = .25 20 | set Use local tolerances = false 21 | end 22 | subsection Solver 23 | set Number of comps = 2 24 | end 25 | -------------------------------------------------------------------------------- /tests/tests_to_check/old_prm/output.gnuplot: -------------------------------------------------------------------------------- 1 | plot 'output.gpl' using 1:2 w l title 'exp', \ 2 | 'output.gpl' using 1:(exp(-$1)) w l title 'exact' 3 | -------------------------------------------------------------------------------- /tests/tests_to_check/old_prm/stokes_unit_force_x.prm: -------------------------------------------------------------------------------- 1 | # Listing of Parameters 2 | # --------------------- 3 | subsection Cube 4 | set Grid to generate = rectangle 5 | 6 | set Input grid file name = 7 | set Mesh smoothing alogrithm = none 8 | 9 | set Optional Point 1 = 0,0 10 | 11 | set Optional Point 2 = 1,1 12 | 13 | set Optional bool 1 = false 14 | 15 | set Optional double 1 = 1. 16 | 17 | set Optional double 2 = 0.5 18 | 19 | set Optional int 1 = 1 20 | 21 | set Optional vector of dim int = 1,1 22 | 23 | set Output grid file name = 24 | end 25 | 26 | 27 | subsection Dirichlet boundary conditions 28 | 29 | set Function constants = k=1 # default: 30 | 31 | set Function expression = 0; 0; 0 32 | 33 | set Variable names = x,y,t 34 | end 35 | 36 | 37 | subsection ErrorHandler<1> 38 | set Compute error = true 39 | set Error file format = tex 40 | set Output error tables = true 41 | set Solution names = u, u, p 42 | 43 | set Solution names for latex = u, u, p 44 | 45 | set Table names = error 46 | set Write error files = false 47 | 48 | 49 | subsection Table 0 50 | set Add convergence rates = true 51 | 52 | set Extra terms = cells,dofs 53 | 54 | set Latex table caption = error 55 | 56 | set List of error norms to compute = L2, Linfty, H1; AddUp; L2 57 | 58 | set Rate key = 59 | end 60 | 61 | end 62 | 63 | 64 | subsection FE_Q 65 | set Finite element space = FESystem[FE_Q(2)^dim-FE_Q(1)] 66 | end 67 | 68 | 69 | subsection NavierStokes<2> 70 | set End time = 1e8 71 | set Generate graphical output = false 72 | set Initial adaptive refinement = 2 73 | set Initial global refinement = 2 74 | set Stokes velocity polynomial degree = 2 75 | set Time steps between graphical output = 50 76 | set Time steps between mesh refinement = 10 77 | set Use locally conservative discretization = true 78 | end 79 | 80 | 81 | subsection ParsedDataOut<2, 3> 82 | set Output partitioning = false 83 | set Problem base name = solution 84 | set Solution names = u 85 | 86 | 87 | subsection Solution output format 88 | set Output format = vtu # default: gnuplot 89 | 90 | set Subdivisions = 1 91 | 92 | 93 | subsection DX output parameters 94 | set Coordinates format = ascii 95 | 96 | set Data format = ascii 97 | 98 | set Integer format = ascii 99 | 100 | set Write neighbors = true 101 | end 102 | 103 | subsection Eps output parameters 104 | set Azimut angle = 60 105 | 106 | set Color function = default 107 | 108 | set Color shading of interior of cells = true 109 | 110 | set Draw mesh lines = true 111 | 112 | set Fill interior of cells = true 113 | 114 | set Index of vector for color = 0 115 | 116 | set Index of vector for height = 0 117 | 118 | set Line widths in eps units = 0.5 119 | 120 | set Scale to width or height = width 121 | 122 | set Scaling for z-axis = 1 123 | 124 | set Size (width or height) in eps units = 300 125 | 126 | set Turn angle = 30 127 | end 128 | 129 | subsection Gmv output parameters 130 | end 131 | 132 | subsection Gnuplot output parameters 133 | end 134 | 135 | subsection Povray output parameters 136 | set Include external file = true 137 | 138 | set Use bicubic patches = false 139 | 140 | set Use smooth triangles = false 141 | end 142 | 143 | subsection Tecplot output parameters 144 | end 145 | 146 | subsection UCD output parameters 147 | set Write preamble = true 148 | end 149 | 150 | subsection Vtk output parameters 151 | end 152 | 153 | subsection deal.II intermediate output parameters 154 | end 155 | 156 | end 157 | 158 | end 159 | 160 | subsection Exact solution 161 | set Function constants = k=1 162 | set Function expression = 0;0;(x-0.5) 163 | set Variable names = x,y,t 164 | end 165 | 166 | 167 | subsection Right-hand side force 168 | 169 | set Function constants = k=1 # default: 170 | 171 | set Function expression = 1; 0; 0 # default: 0; 0; 0 172 | 173 | set Variable names = x,y,t 174 | end 175 | 176 | 177 | -------------------------------------------------------------------------------- /tests/tests_to_check/params.prm: -------------------------------------------------------------------------------- 1 | # Listing of Parameters 2 | # --------------------- 3 | subsection Cube 4 | set Grid to generate = rectangle 5 | end 6 | 7 | subsection Dirichlet boundary conditions 8 | set Function constants = k=1 9 | set Function expression = k*pi*cos(k*pi*x)*cos(k*pi*y); k*pi*sin(k*pi*x)*sin(k*pi*y); 0 10 | end 11 | 12 | 13 | subsection ErrorHandler<1> 14 | set Compute error = true 15 | set Error file format = txt 16 | set Output error tables = true 17 | set Solution names = u, u, p 18 | set Solution names for latex = u, u, p 19 | set Table names = error 20 | set Write error files = true 21 | 22 | subsection Table 0 23 | set Add convergence rates = true 24 | set Extra terms = cells,dofs 25 | set Latex table caption = error 26 | set List of error norms to compute = L2, H1; AddUp; L2 27 | set Rate key = 28 | end 29 | 30 | end 31 | 32 | 33 | subsection FE_Q 34 | set Finite element space = FESystem[FE_Q(2)^dim-FE_Q(1)] 35 | end 36 | 37 | 38 | subsection Right-hand side force 39 | set Function constants = k=1 40 | set Function expression = 2*k^3*pi^3*cos(k*pi*x)*cos(k*pi*y); 2*k^3*pi^3*sin(k*pi*x)*sin(k*pi*y); 0 41 | end 42 | 43 | -------------------------------------------------------------------------------- /tests/tests_to_check/pidomus_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/stokes_derived_interface.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | 16 | StokesDerivedInterface energy; 17 | piDoMUS n_problem (energy); 18 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/pidomus_01.prm", "used_parameters.prm"); 19 | 20 | 21 | n_problem.run (); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /tests/tests_to_check/poiseuille.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/dynamic_stokes.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | const int spacedim = 2; 16 | 17 | DynamicStokes energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/poiseuille.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/poiseuille.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/poiseuille.output -------------------------------------------------------------------------------- /tests/tests_to_check/stokes_forcing_01.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/dynamic_stokes.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | const int spacedim = 2; 16 | 17 | DynamicStokes energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/stokes_forcing_01.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/stokes_forcing_01.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/stokes_forcing_01.output -------------------------------------------------------------------------------- /tests/tests_to_check/stokes_forcing_02.cc: -------------------------------------------------------------------------------- 1 | #include "pidomus.h" 2 | #include "interfaces/dynamic_stokes.h" 3 | #include "tests.h" 4 | 5 | using namespace dealii; 6 | int main (int argc, char *argv[]) 7 | { 8 | 9 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 10 | numbers::invalid_unsigned_int); 11 | 12 | initlog(); 13 | 14 | const int dim = 2; 15 | const int spacedim = 2; 16 | 17 | DynamicStokes energy; 18 | piDoMUS n_problem (energy); 19 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/stokes_forcing_02.prm", "used_parameters.prm"); 20 | 21 | 22 | n_problem.run (); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/tests_to_check/stokes_forcing_02.output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/pi-DoMUS/eec6ec13ce309110afe447f1b3c8ef8937030821/tests/tests_to_check/stokes_forcing_02.output -------------------------------------------------------------------------------- /tests/tests_to_check/stokes_unit_x_force.cc: -------------------------------------------------------------------------------- 1 | #include "navier_stokes.h" 2 | 3 | 4 | 5 | template 6 | void test(NavierStokes &ns) 7 | { 8 | ns.make_grid_fe(); 9 | ns.setup_dofs(); 10 | ns.assemble_navier_stokes_system(); 11 | ns.build_navier_stokes_preconditioner(); 12 | ns.solve(); 13 | ns.output_results(); 14 | } 15 | 16 | int main (int argc, char *argv[]) 17 | { 18 | using namespace dealii; 19 | 20 | Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 21 | numbers::invalid_unsigned_int); 22 | 23 | deallog.depth_console (0); 24 | 25 | const int dim = 2; 26 | NavierStokes flow_problem (NavierStokes::global_refinement); 27 | 28 | ParameterAcceptor::initialize(SOURCE_DIR "/parameters/stokes_unit_force_x.prm", "used_parameters.prm"); 29 | ParameterAcceptor::prm.log_parameters(deallog); 30 | 31 | test(flow_problem); 32 | std::cout << std::endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /tests/tests_to_check/stokes_unit_x_force.output: -------------------------------------------------------------------------------- 1 | Number of active cells: 256 (on 5 levels) 2 | Number of degrees of freedom: 2467 (2178+289) 3 | 4 | 5 | Rebuilding Stokes preconditioner... 6 | Solving Stokes system... 7 | iterations: 16 8 | 9 | cells dofs u_Linfty u_L2 u_H1 p_L2 10 | 256 2467 2.517e-09 - 8.747e-10 - 1.829e-08 - 2.742e-08 - 11 | 12 | -------------------------------------------------------------------------------- /tests/tests_to_check/utilities_07.output: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /utilities/grids/2D/rectangle_with_circular_hole.inp: -------------------------------------------------------------------------------- 1 | 82 104 0 0 0 2 | 0 01.6464466095 02.3535533905 0.00 3 | 1 01.1 01.1 0.00 4 | 2 02.0 01.0 0.00 5 | 3 03.0 0.0 0.00 6 | 4 02.0 0.0 0.00 7 | 5 01.0 02.0 0.00 8 | 6 00 03.075 0.00 9 | 7 00 02.050 0.00 10 | 8 01.0 00 0.00 11 | 9 0.0 01.025 0.00 12 | 10 0.0 0.0 0.00 13 | 11 03.0 02.0 0.00 14 | 12 01.1 02.9 0.00 15 | 13 02.0 03.0 0.00 16 | 14 02.9 02.9 0.00 17 | 15 04.0 03.0 0.00 18 | 16 06.0 02.0 0.00 19 | 17 04.0 02.0 0.00 20 | 18 06.0 01.0 0.00 21 | 19 08.0 01.0 0.00 22 | 20 10.00 0.0 0.00 23 | 21 08.0 0.0 0.00 24 | 22 02.9 01.1 0.00 25 | 23 04.0 01.0 0.00 26 | 24 06.0 0.0 0.00 27 | 25 04.0 0.0 0.00 28 | 26 10.00 02.0 0.00 29 | 27 06.0 03.0 0.00 30 | 28 08.0 03.0 0.00 31 | 29 08.0 02.0 0.00 32 | 30 10.00 03.0 0.00 33 | 31 12.0 03.0 0.00 34 | 32 14.0 02.0 0.00 35 | 33 12.0 02.0 0.00 36 | 34 14.0 01.0 0.00 37 | 35 10.0 01.0 0.00 38 | 36 12.0 01.0 0.00 39 | 37 14.0 0.0 0.00 40 | 38 12.0 0.0 0.00 41 | 39 14.0 03.0 0.00 42 | 40 03.0 04.1 0.00 43 | 41 02.0 04.1 0.00 44 | 42 01.0 04.1 0.00 45 | 43 00. 04.1 0.00 46 | 44 10.0 04.1 0.00 47 | 45 08.0 04.1 0.00 48 | 46 06.0 04.1 0.00 49 | 47 04.0 04.1 0.00 50 | 48 14.0 04.1 0.00 51 | 49 12.0 04.1 0.00 52 | 50 01.5 02.0 0.00 53 | 51 01.6464466095 01.6464466095 0.00 54 | 52 02.0 01.5 0.00 55 | 53 02.3535533905 01.6464466095 0.00 56 | 54 02.5 02.0 0.00 57 | 55 02.3535533905 02.3535533905 0.00 58 | 56 02.0 02.5 0.00 59 | 57 16.2 0 0.0 60 | 58 16.2 01. 0.0 61 | 59 16.2 02. 0.0 62 | 60 16.2 03. 0.0 63 | 61 16.2 04.1 0.0 64 | 62 18.4 0 0.0 65 | 63 18.4 01. 0.0 66 | 64 18.4 02. 0.0 67 | 65 18.4 03. 0.0 68 | 66 18.4 04.1 0.0 69 | 67 20.6 0 0.0 70 | 68 20.6 01. 0.0 71 | 69 20.6 02. 0.0 72 | 70 20.6 03. 0.0 73 | 71 20.6 04.1 0.0 74 | 72 22.8 0 0.0 75 | 73 22.8 01. 0.0 76 | 74 22.8 02. 0.0 77 | 75 22.8 03. 0.0 78 | 76 22.8 04.1 0.0 79 | 77 25. 0 0.0 80 | 78 25. 01. 0.0 81 | 79 25. 02. 0.0 82 | 80 25. 03. 0.0 83 | 81 25. 04.1 0.0 84 | 1 1 quad 10 8 1 9 85 | 2 1 quad 8 4 2 1 86 | 3 1 quad 9 1 5 7 87 | 4 1 quad 4 3 22 2 88 | 5 1 quad 3 25 23 22 89 | 6 1 quad 22 23 17 11 90 | 7 1 quad 11 17 15 14 91 | 8 1 quad 14 15 47 40 92 | 9 1 quad 13 14 40 41 93 | 10 1 quad 7 5 12 6 94 | 11 1 quad 12 13 41 42 95 | 12 1 quad 6 12 42 43 96 | 13 1 quad 25 24 18 23 97 | 14 1 quad 24 21 19 18 98 | 15 1 quad 18 19 29 16 99 | 16 1 quad 23 18 16 17 100 | 17 1 quad 21 20 35 19 101 | 18 1 quad 20 38 36 35 102 | 19 1 quad 35 36 33 26 103 | 20 1 quad 19 35 26 29 104 | 21 1 quad 29 26 30 28 105 | 22 1 quad 26 33 31 30 106 | 23 1 quad 30 31 49 44 107 | 24 1 quad 28 30 44 45 108 | 25 1 quad 17 16 27 15 109 | 26 1 quad 16 29 28 27 110 | 27 1 quad 27 28 45 46 111 | 28 1 quad 15 27 46 47 112 | 29 1 quad 38 37 34 36 113 | 30 1 quad 36 34 32 33 114 | 31 1 quad 33 32 39 31 115 | 32 1 quad 31 39 48 49 116 | 33 1 quad 1 51 50 5 117 | 34 1 quad 2 52 51 1 118 | 35 1 quad 22 53 52 2 119 | 36 1 quad 11 54 53 22 120 | 37 1 quad 14 55 54 11 121 | 38 1 quad 13 56 55 14 122 | 39 1 quad 12 0 56 13 123 | 40 1 quad 5 50 0 12 124 | 41 1 quad 57 58 34 37 125 | 42 1 quad 58 59 32 34 126 | 43 1 quad 59 60 39 32 127 | 44 1 quad 60 61 48 39 128 | 45 1 quad 62 63 58 57 129 | 46 1 quad 63 64 59 58 130 | 47 1 quad 64 65 60 59 131 | 48 1 quad 65 66 61 60 132 | 49 1 quad 67 68 63 62 133 | 50 1 quad 68 69 64 63 134 | 51 1 quad 69 70 65 64 135 | 52 1 quad 70 71 66 65 136 | 53 1 quad 72 73 68 67 137 | 54 1 quad 73 74 69 68 138 | 55 1 quad 74 75 70 69 139 | 56 1 quad 75 76 71 70 140 | 57 1 quad 77 78 73 72 141 | 58 1 quad 78 79 74 73 142 | 59 1 quad 79 80 75 74 143 | 60 1 quad 80 81 76 75 144 | 41 1 line 10 8 145 | 42 2 line 10 9 146 | 43 1 line 8 4 147 | 44 2 line 9 7 148 | 45 1 line 4 3 149 | 46 1 line 3 25 150 | 47 1 line 40 47 151 | 48 1 line 41 40 152 | 49 2 line 7 6 153 | 50 1 line 42 41 154 | 51 1 line 43 42 155 | 52 2 line 6 43 156 | 53 1 line 25 24 157 | 54 1 line 24 21 158 | 55 1 line 21 20 159 | 56 1 line 20 38 160 | 57 1 line 44 49 161 | 58 1 line 45 44 162 | 59 1 line 46 45 163 | 60 1 line 47 46 164 | 61 1 line 38 37 165 | 62 3 line 77 78 166 | 63 3 line 78 79 167 | 64 3 line 79 80 168 | 65 3 line 80 81 169 | 66 1 line 49 48 170 | 67 4 line 51 50 171 | 68 4 line 52 51 172 | 69 4 line 53 52 173 | 70 4 line 54 53 174 | 71 4 line 55 54 175 | 72 4 line 56 55 176 | 73 4 line 0 56 177 | 74 4 line 50 0 178 | 75 1 line 37 57 179 | 76 1 line 48 61 180 | 77 1 line 57 62 181 | 78 1 line 61 66 182 | 79 1 line 62 67 183 | 80 1 line 66 71 184 | 81 1 line 67 72 185 | 82 1 line 71 76 186 | 83 1 line 72 77 187 | 84 1 line 76 81 188 | -------------------------------------------------------------------------------- /utilities/grids/2D/rectangle_with_circular_hole.ucd: -------------------------------------------------------------------------------- 1 | # This file was generated by the deal.II library. 2 | # Date = 2016/4/26 3 | # Time = 12:21:17 4 | # 5 | # For a description of the UCD format see the AVS Developer's guide. 6 | # 7 | 34 48 0 0 0 8 | 1 1 0 0 9 | 2 1 1 0 10 | 3 6.12323e-17 1 0 11 | 4 -1 1 0 12 | 5 -1 1.22465e-16 0 13 | 6 -1 -1 0 14 | 7 -1.83697e-16 -1 0 15 | 8 1 -1 0 16 | 9 0.25 0 0 17 | 10 0.176777 0.176777 0 18 | 11 1.53081e-17 0.25 0 19 | 12 -0.176777 0.176777 0 20 | 13 -0.25 3.06162e-17 0 21 | 14 -0.176777 -0.176777 0 22 | 15 -4.59243e-17 -0.25 0 23 | 16 0.176777 -0.176777 0 24 | 17 -2 -1 0 25 | 18 -2 0 0 26 | 19 -2 1 0 27 | 20 2 -1 0 28 | 21 3 -1 0 29 | 22 4 -1 0 30 | 23 5 -1 0 31 | 24 6 -1 0 32 | 25 2 0 0 33 | 26 3 0 0 34 | 27 4 0 0 35 | 28 5 0 0 36 | 29 6 0 0 37 | 30 2 1 0 38 | 31 3 1 0 39 | 32 4 1 0 40 | 33 5 1 0 41 | 34 6 1 0 42 | 1 0 quad 1 2 10 9 43 | 2 0 quad 2 3 11 10 44 | 3 0 quad 3 4 12 11 45 | 4 0 quad 4 5 13 12 46 | 5 0 quad 5 6 14 13 47 | 6 0 quad 6 7 15 14 48 | 7 0 quad 7 8 16 15 49 | 8 0 quad 8 1 9 16 50 | 9 0 quad 18 17 6 5 51 | 10 0 quad 19 18 5 4 52 | 11 0 quad 20 25 1 8 53 | 12 0 quad 21 26 25 20 54 | 13 0 quad 22 27 26 21 55 | 14 0 quad 23 28 27 22 56 | 15 0 quad 24 29 28 23 57 | 16 0 quad 25 30 2 1 58 | 17 0 quad 26 31 30 25 59 | 18 0 quad 27 32 31 26 60 | 19 0 quad 28 33 32 27 61 | 20 0 quad 29 34 33 28 62 | 21 1 line 2 3 63 | 22 1 line 3 4 64 | 23 1 line 6 7 65 | 24 1 line 7 8 66 | 25 4 line 9 10 67 | 26 4 line 10 11 68 | 27 4 line 11 12 69 | 28 4 line 12 13 70 | 29 4 line 13 14 71 | 30 4 line 14 15 72 | 31 4 line 15 16 73 | 32 4 line 16 9 74 | 33 1 line 17 6 75 | 34 2 line 18 17 76 | 35 1 line 19 4 77 | 36 2 line 19 18 78 | 37 1 line 20 8 79 | 38 1 line 21 20 80 | 39 1 line 22 21 81 | 40 1 line 23 22 82 | 41 1 line 24 23 83 | 42 3 line 24 29 84 | 43 3 line 29 34 85 | 44 1 line 30 2 86 | 45 1 line 31 30 87 | 46 1 line 32 31 88 | 47 1 line 33 32 89 | 48 1 line 34 33 90 | --------------------------------------------------------------------------------