Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions 2D_DDD_simulation.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{75A81D91-0A37-4267-B130-851C16A59F5E}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>2D_DDD_simulation</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>%VCPKG_ROOT%\packages\suitesparse_x64-windows\include\suitesparse;include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>%VCPKG_ROOT%\packages\suitesparse_x64-windows\include\suitesparse;include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="src\fields\AnalyticField.cpp" />
<ClCompile Include="src\fields\Field.cpp" />
<ClCompile Include="src\fields\PeriodicShearStressELTE.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\precision_handler.cpp" />
<ClCompile Include="src\project_parser.cpp" />
<ClCompile Include="src\simulation.cpp" />
<ClCompile Include="src\simulation_data.cpp" />
<ClCompile Include="src\stressprotocols\fixed_rate_protocol.cpp" />
<ClCompile Include="src\stressprotocols\stress_protocol.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\constants.h" />
<ClInclude Include="include\dislocation.h" />
<ClInclude Include="include\fields\AnalyticField.h" />
<ClInclude Include="include\fields\Field.h" />
<ClInclude Include="include\fields\PeriodicShearStressELTE.h" />
<ClInclude Include="include\point_defect.h" />
<ClInclude Include="include\precision_handler.h" />
<ClInclude Include="include\project_parser.h" />
<ClInclude Include="include\simulation.h" />
<ClInclude Include="include\simulation_data.h" />
<ClInclude Include="include\stressprotocols\fixed_rate_protocol.h" />
<ClInclude Include="include\stressprotocols\stress_protocol.h" />
<ClInclude Include="include\utility.h" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
90 changes: 90 additions & 0 deletions 2D_DDD_simulation.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="src\fields\AnalyticField.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\fields\Field.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\stressprotocols\fixed_rate_protocol.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\precision_handler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\project_parser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\simulation.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\simulation_data.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\stressprotocols\stress_protocol.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\fields\PeriodicShearStressELTE.cpp">
<Filter>Resource Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\fields\AnalyticField.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\constants.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\dislocation.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\fields\Field.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\stressprotocols\fixed_rate_protocol.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\fields\PeriodicShearStressELTE.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\point_defect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\precision_handler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\project_parser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\simulation.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\simulation_data.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\stressprotocols\stress_protocol.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\utility.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{6013aefb-16fa-4271-98ac-dde3f86dde21}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{64edc90b-102e-42e6-a58f-608780a2886c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{6834fa22-3c32-484d-8c46-ddd1aaf96a40}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # is required


# Find required packages

find_package(PythonLibs ${PY_VERSION})
if(PYTHON_FOUND)
include_directories(${PYTHON_INCLUDE_DIR})
Expand All @@ -94,7 +95,6 @@ endif()
find_package(FFTW REQUIRED DOUBLE_LIB)
include_directories(FFTW_INCLUDE_DIRS)


FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS program_options)
if(Boost_FOUND)
# with SYSTEM the compiler knows that they aren't our headers thus
Expand All @@ -106,12 +106,18 @@ endif()
set(Boost_FOUND FALSE)

if (BUILD_PYTHON_BINDINGS)
FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} COMPONENTS system python3)
if(Boost_FOUND)
# with SYSTEM the compiler knows that they aren't our headers thus
# warnings & co. will be omitted
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
set(BOOST_PYTHON_LIBRARIES ${Boost_LIBRARIES})
FIND_PACKAGE(PythonLibs ${PY_VERSION} REQUIRED)
if(PYTHONLIBS_FOUND)
include_directories(${PYTHON_INCLUDE_DIR})
FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} COMPONENTS system python3)
if(Boost_FOUND)
# with SYSTEM the compiler knows that they aren't our headers thus
# warnings & co. will be omitted
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
set(BOOST_PYTHON_LIBRARIES ${Boost_LIBRARIES})
else()
set(BUILD_PYTHON_BINDINGS FALSE)
endif()
else()
set(BUILD_PYTHON_BINDINGS FALSE)
endif()
Expand Down
61 changes: 51 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,37 @@
Simple Discrete Dislocation Dynamics Simulation Toolkit

## Short description
This toolkit makes it possible to easily simulate 2D edge dislocation systems where the slip planes are parallel and periodic boundary conditions are applied. The integrator is based on an implicit numerical scheme which makes it possible to keep the
O(N<sup>2</sup>) complexity which arise from the pair interactions while no dislocation annihilation is required and the runtime is greatly decreased.
This toolkit contains tools to simulate 2D single slip edge dislocation systems under periodic boundary conditions. The integrator is based on an implicit numerical scheme which makes it possible to keep the
O(*N*<sup>2</sup>) complexity which arise from the pair interactions while no dislocation annihilation is required and the runtime is greatly decreased.

SDDDST is highly modular, it can be easily modified and extended based on the use case where it is needed.

The detailed publication of the numerical scheme and the implementation with the achived results will be soon available.

### Tools
The toolkit contains the following tools
1. The **simulation program** *2D_DDD_simulation* that evols the dislocation configuration under the prescribed external stress.
2. [**Dislocation system generator** *init_config_gen*](https://github.com/danieltuzes/sdddst/init_config_gen) to create the initial configuration.
3. **Evaulation programs** to do perform analysis on the simulations obatined.

The rest of this file belongs to the simulation program 2D_DDD_simulation.

## Build & run
### Dependencies
In order to be able to build the simulator, you will need the following dependencies on your computer:
This project uses several external libraries, such as **umfpack** and **boost** and furthermore, to keep the code simple, some additional include libraries must be set up for your compiler. A convenient Linux-gcc-cmake built procedure (scenario A) is provided along with a Windows-VS-vcpkg built procedure (scenario B).

### Dependencies: scenario A
This is the Linux-gcc-cmake case. To be able to build the simulator, you will need the following dependencies on your computer:

* g++ or clang
* cmake
* cmake (at least version 3.8)
* make
* boost
* pyhton3 with python3-dev
* this is only needed if python interface is required in `CMakeLists.txt`
* this can be found at line 23: `option(BUILD_PYTHON_BINDINGS "Build python interface package" OFF)`
* a system-wide installation is required by default, otherwise, cmake will not find the libs
* using a local (user) version of python is also possible: define paths for cmake with the switch `-DPYTHON_LIBRARY=~/.local/lib/libpython` and `-DPYTHON_INCLUDE_DIR=~/.local/include/python3.7m` if you installed python3-dev into your `$HOME/.local` directory
* umfpack from suitesparse
* gsl
* boost (the program options, and python libraries, if python is required)
* FFTW

The build is fairly simple from the root directory of the source:
Expand All @@ -35,14 +49,41 @@ The resulting binary which can be used to run the simulations:
```bash
build/src/sdddst
```

You can safely **delete** the files corresponding to scenario B:
* 2D_DDD_simulation.vcxproj
* 2D_DDD_simulation.vcxproj.filters
* 2D_DDD_simulation.vcxproj.user
* SDDST.sln

### Dependencies: scenario B
This is the Windows-VS-vcpkg case. The project can be compiled for x64 compatible machines only [due to umfpacks's openblas dependency](https://github.com/microsoft/vcpkg/issues/2095), which is available only for x64. This case comes with no python interface yet. Follow these instructions to be able build this project.
1. Install [vcpkg](https://github.com/microsoft/vcpkg)
1. Open a PowerShell (abbreviated as PS) and first create the directory where you would like to place it. Let's say, `C:\local`, so in PS, execute `mkdir C:\local`. Move there by executing `cd C:\local`.
2. Download the vcpkg package with git or by downloading it with a browser from [its website](https://github.com/Microsoft/vcpkg).
3. Extract the files with their parent folder vcpkg-master from the compressed file vcpkg-master.zip. Move it to `C:\local`. Navigate your PS there by `cd vcpkg-master`.
3. Install the program by executing `.\bootstrap-vcpkg.bat`. The installar may ask for admin privileges.
4. To use the installed packages automatically, execute `.\vcpkg integrate install`.
2. Install the required dependencies with *vcpkg* by executing

1. `.\vcpkg install boost-program-options:x64-windows` for boost program options, and
2. `.\vcpkg install suitesparse:x64-windows`, this installs the umfpack.

These steps may take at least around 10 minutes.
3. Use the solution file or set up a new one for the project. Due to an [issue](https://github.com/microsoft/vcpkg/issues/3417), your compiler probably need be informed about umpack's directory.
1. With the provided solution the project files, it has been already added by pointing to `%VCPKG_ROOT%`. All you need to do is to add a system variable called VCPKG_ROOT with value pointing to the root directory of vcpkg. In our previous example, it was `C:\local\vcpkg-master`.
2. If you do not want to or cannot create the system variable, or want to start your solution and project files from zero, you can manually add it to your project settings. Open project 2D_DDD_simulation in the solution SDDST, then open your project properties under Project, \<Projectname\> properties. Go to VC++ Directories and in the Include Directories add `C:\local\vcpkg-master\packages\suitesparse_x64-windows\include\suitesparse`.

You can safely **delete** building files and folders for scenario A:
* cmake/
* CMakeLists.txt
* sdddstCMakeConfig.h.in
### Configuration files
For the available parameters, check out the help!

```bash
./sdddst --help
```

### Configuration files
To be able to run a simulation, data has to be provided in plain text format. The slip planes of the dislocations are parallel with the x axis and the simulation area is between [-0.5, 0.5] in both directions. Based on that an example configuration file which contains dislocation data:

```
Expand Down Expand Up @@ -75,7 +116,7 @@ If a log file is requested, a file will be continously updated during the simula
* value of the external stress
* computation time between the last two successful steps
* accumulated strain
* average v<sup>2</sup>
* average *v*<sup>2</sup>
* energy of the system

### Cutoff multiplier
Expand Down
31 changes: 31 additions & 0 deletions SDDST.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2D_DDD_simulation", "2D_DDD_simulation.vcxproj", "{75A81D91-0A37-4267-B130-851C16A59F5E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "init_config_gen", "init_config_gen\init_config_gen.vcxproj", "{4234E9E2-9233-443B-A8DC-B66EDD59BBFD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{75A81D91-0A37-4267-B130-851C16A59F5E}.Debug|x64.ActiveCfg = Debug|x64
{75A81D91-0A37-4267-B130-851C16A59F5E}.Debug|x64.Build.0 = Debug|x64
{75A81D91-0A37-4267-B130-851C16A59F5E}.Release|x64.ActiveCfg = Release|x64
{75A81D91-0A37-4267-B130-851C16A59F5E}.Release|x64.Build.0 = Release|x64
{4234E9E2-9233-443B-A8DC-B66EDD59BBFD}.Debug|x64.ActiveCfg = Debug|x64
{4234E9E2-9233-443B-A8DC-B66EDD59BBFD}.Debug|x64.Build.0 = Debug|x64
{4234E9E2-9233-443B-A8DC-B66EDD59BBFD}.Release|x64.ActiveCfg = Release|x64
{4234E9E2-9233-443B-A8DC-B66EDD59BBFD}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1160B3E2-E24B-4F5E-9924-2AA7FD6AB9C0}
EndGlobalSection
EndGlobal
3 changes: 2 additions & 1 deletion include/Fields/AnalyticField.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#include "Fields/Field.h"
#include "constants.h"

#include <cmath>
#define _USE_MATH_DEFINES
#include <math.h>

namespace sdddstCore {

Expand Down
2 changes: 1 addition & 1 deletion include/Fields/PeriodicShearStressELTE.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <ctime>
#include <cmath>

#include <gsl/gsl_sf_bessel.h>
//#include <gsl/gsl_sf_bessel.h>

#include "Fields/Field.h"

Expand Down
Loading