Commit 0c17cd94 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

mini example added to main AMDiS dir

parent b91cc94a
project("example")
cmake_minimum_required(VERSION 2.8)
find_package(AMDIS REQUIRED)
if(AMDIS_FOUND)
message(STATUS "AMDiS was found.")
include(${AMDIS_USE_FILE})
SET(BASIS_LIBS ${AMDIS_LIBRARIES})
endif(AMDIS_FOUND)
add_executable("example" example.cc)
target_link_libraries("example" ${BASIS_LIBS})
#include "AMDiS.h"
using AMDiS::Msg;
int main(int argc, char* argv[])
{
FUNCNAME("main");
AMDiS::init(argc, argv);
MSG("Hello World!\n");
AMDiS::finalize();
}
dimension of world: 2 % dow = 1, 2, or 3
% include other init-files (remove % at the beginning of the line)
% #include <filename>
% #include "filename"
parameter1: value1
% using variable:
parameter2: $parameter1
parameter3: ${parameter1}
parameter4_${parameter1}: value2 % => parameter4_value1 = value2
% overwriting values
parameter1: value3
% value format
parameter1: 1.0 % double
parameter2: 1 % int
parameter3: Hello World! % std::string
parameter4: [1,2,3] % std::vector<int>
parameter5: [1,2,3; 4,5,6; 7,8,9] % std::vector<std::vector<int> >
parameter6: 1/2 % arithmetic expression => 0.5
parameter7: 2*${parameter6}+sin(0.5) % complex arithm. expression
parameter8: m_pi + m_e % some predefined constants: pi, e
parameter9: [2*m_pi, sin((${parameter7})*m_e)/2]
% substitution and evaluation
parameter1: 1/2 + 1/2
parameter2: Hello ${parameter1} World! % => "Hello 1/2 + 1/2 World!"
parameter3: Hello $(${parameter1}) World! % => "Hello 1 World!"
parameter4: Hello $(1/2 + 1/2) World! % => "Hello 1 World!"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment